azure-arm-insights
Version:
Microsoft Azure Insights Management Client Library for node
116 lines (110 loc) • 3.83 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 ScaleRule class.
* @constructor
* A rule that provide the triggers and parameters for the scaling action.
*
* @member {object} metricTrigger the trigger that results in a scaling action.
*
* @member {string} [metricTrigger.metricName] the name of the metric that
* defines what the rule monitors.
*
* @member {string} [metricTrigger.metricResourceUri] the resource identifier
* of the resource the rule monitors.
*
* @member {moment.duration} [metricTrigger.timeGrain] the granularity of
* metrics the rule monitors. Must be one of the predefined values returned
* from metric definitions for the metric. Must be between 12 hours and 1
* minute.
*
* @member {string} [metricTrigger.statistic] the metric statistic type. How
* the metrics from multiple instances are combined. Possible values include:
* 'Average', 'Min', 'Max', 'Sum'
*
* @member {moment.duration} [metricTrigger.timeWindow] the range of time in
* which instance data is collected. This value must be greater than the delay
* in metric collection, which can vary from resource-to-resource. Must be
* between 12 hours and 5 minutes.
*
* @member {string} [metricTrigger.timeAggregation] time aggregation type. How
* the data that is collected should be combined over time. The default value
* is Average. Possible values include: 'Average', 'Minimum', 'Maximum',
* 'Total', 'Count'
*
* @member {string} [metricTrigger.operator] the operator that is used to
* compare the metric data and the threshold. Possible values include:
* 'Equals', 'NotEquals', 'GreaterThan', 'GreaterThanOrEqual', 'LessThan',
* 'LessThanOrEqual'
*
* @member {number} [metricTrigger.threshold] the threshold of the metric that
* triggers the scale action.
*
* @member {object} scaleAction the parameters for the scaling action.
*
* @member {string} [scaleAction.direction] the scale direction. Whether the
* scaling action increases or decreases the number of instances. Possible
* values include: 'None', 'Increase', 'Decrease'
*
* @member {string} [scaleAction.type] the type of action that should occur
* when the scale rule fires. Possible values include: 'ChangeCount',
* 'PercentChangeCount', 'ExactCount'
*
* @member {string} [scaleAction.value] the number of instances that are
* involved in the scaling action. This value must be 1 or greater. The default
* value is 1.
*
* @member {moment.duration} [scaleAction.cooldown] the amount of time to wait
* since the last scaling action before this action occurs. It must be between
* 1 week and 1 minute in ISO 8601 format.
*
*/
class ScaleRule {
constructor() {
}
/**
* Defines the metadata of ScaleRule
*
* @returns {object} metadata of ScaleRule
*
*/
mapper() {
return {
required: false,
serializedName: 'ScaleRule',
type: {
name: 'Composite',
className: 'ScaleRule',
modelProperties: {
metricTrigger: {
required: true,
serializedName: 'metricTrigger',
type: {
name: 'Composite',
className: 'MetricTrigger'
}
},
scaleAction: {
required: true,
serializedName: 'scaleAction',
type: {
name: 'Composite',
className: 'ScaleAction'
}
}
}
}
};
}
}
module.exports = ScaleRule;