azure-arm-insights
Version:
Microsoft Azure Insights Management Client Library for node
118 lines (112 loc) • 3.54 kB
JavaScript
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
;
const models = require('./index');
/**
* @class
* Initializes a new instance of the ThresholdRuleCondition class.
* @constructor
* A rule condition based on a metric crossing a threshold.
*
* @member {object} [dataSource] the resource from which the rule collects its
* data. For this type dataSource will always be of type RuleMetricDataSource.
*
* @member {string} [dataSource.odatatype] Polymorphic Discriminator
*
* @member {string} operator the operator used to compare the data and the
* threshold. Possible values include: 'GreaterThan', 'GreaterThanOrEqual',
* 'LessThan', 'LessThanOrEqual'
*
* @member {number} threshold the threshold value that activates the alert.
*
* @member {moment.duration} [windowSize] the period of time (in ISO 8601
* duration format) that is used to monitor alert activity based on the
* threshold. If specified then it must be between 5 minutes and 1 day.
*
* @member {string} [timeAggregation] the time aggregation operator. How the
* data that are collected should be combined over time. The default value is
* the PrimaryAggregationType of the Metric. Possible values include:
* 'Average', 'Minimum', 'Maximum', 'Total', 'Last'
*
*/
class ThresholdRuleCondition extends models['RuleCondition'] {
constructor() {
super();
}
/**
* Defines the metadata of ThresholdRuleCondition
*
* @returns {object} metadata of ThresholdRuleCondition
*
*/
mapper() {
return {
required: false,
serializedName: 'Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition',
type: {
name: 'Composite',
className: 'ThresholdRuleCondition',
modelProperties: {
odatatype: {
required: true,
serializedName: 'odata\\.type',
type: {
name: 'String'
}
},
dataSource: {
required: false,
serializedName: 'dataSource',
type: {
name: 'Composite',
polymorphicDiscriminator: {
serializedName: 'odata.type',
clientName: 'odatatype'
},
uberParent: 'RuleDataSource',
className: 'RuleDataSource'
}
},
operator: {
required: true,
serializedName: 'operator',
type: {
name: 'Enum',
allowedValues: [ 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual' ]
}
},
threshold: {
required: true,
serializedName: 'threshold',
type: {
name: 'Number'
}
},
windowSize: {
required: false,
serializedName: 'windowSize',
type: {
name: 'TimeSpan'
}
},
timeAggregation: {
required: false,
serializedName: 'timeAggregation',
type: {
name: 'Enum',
allowedValues: [ 'Average', 'Minimum', 'Maximum', 'Total', 'Last' ]
}
}
}
}
};
}
}
module.exports = ThresholdRuleCondition;