UNPKG

azure-arm-insights

Version:

Microsoft Azure Insights Management Client Library for node

134 lines (129 loc) 3.94 kB
/* * 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. */ 'use strict'; /** * @class * Initializes a new instance of the MetricTrigger class. * @constructor * The trigger that results in a scaling action. * * @member {string} metricName the name of the metric that defines what the * rule monitors. * * @member {string} metricResourceUri the resource identifier of the resource * the rule monitors. * * @member {moment.duration} 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} statistic the metric statistic type. How the metrics from * multiple instances are combined. Possible values include: 'Average', 'Min', * 'Max', 'Sum' * * @member {moment.duration} 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} 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} 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} threshold the threshold of the metric that triggers the * scale action. * */ class MetricTrigger { constructor() { } /** * Defines the metadata of MetricTrigger * * @returns {object} metadata of MetricTrigger * */ mapper() { return { required: false, serializedName: 'MetricTrigger', type: { name: 'Composite', className: 'MetricTrigger', modelProperties: { metricName: { required: true, serializedName: 'metricName', type: { name: 'String' } }, metricResourceUri: { required: true, serializedName: 'metricResourceUri', type: { name: 'String' } }, timeGrain: { required: true, serializedName: 'timeGrain', type: { name: 'TimeSpan' } }, statistic: { required: true, serializedName: 'statistic', type: { name: 'Enum', allowedValues: [ 'Average', 'Min', 'Max', 'Sum' ] } }, timeWindow: { required: true, serializedName: 'timeWindow', type: { name: 'TimeSpan' } }, timeAggregation: { required: true, serializedName: 'timeAggregation', type: { name: 'Enum', allowedValues: [ 'Average', 'Minimum', 'Maximum', 'Total', 'Count' ] } }, operator: { required: true, serializedName: 'operator', type: { name: 'Enum', allowedValues: [ 'Equals', 'NotEquals', 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual' ] } }, threshold: { required: true, serializedName: 'threshold', type: { name: 'Number' } } } } }; } } module.exports = MetricTrigger;