Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

[AutoPR] monitor/resource-manager #3762

Merged
merged 4 commits into from
Oct 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 50 additions & 2 deletions lib/services/monitorManagement/lib/models/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2033,6 +2033,12 @@ export interface MetricAlertCriteria {
* @member {moment.duration} windowSize the period of time (in ISO 8601
* duration format) that is used to monitor alert activity based on the
* threshold.
* @member {string} [targetResourceType] the resource type of the target
* resource(s) on which the alert is created/updated. Mandatory for
* MultipleResourceMultipleMetricCriteria.
* @member {string} [targetResourceRegion] the region of the target resource(s)
* on which the alert is created/updated. Mandatory for
* MultipleResourceMultipleMetricCriteria.
* @member {object} criteria defines the specific alert criteria information.
* @member {string} [criteria.odatatype] Polymorphic Discriminator
* @member {boolean} [autoMitigate] the flag that indicates whether the alert
Expand All @@ -2049,6 +2055,8 @@ export interface MetricAlertResource extends Resource {
scopes?: string[];
evaluationFrequency: moment.Duration;
windowSize: moment.Duration;
targetResourceType?: string;
targetResourceRegion?: string;
criteria: MetricAlertCriteria;
autoMitigate?: boolean;
actions?: MetricAlertAction[];
Expand All @@ -2074,6 +2082,12 @@ export interface MetricAlertResource extends Resource {
* @member {moment.duration} windowSize the period of time (in ISO 8601
* duration format) that is used to monitor alert activity based on the
* threshold.
* @member {string} [targetResourceType] the resource type of the target
* resource(s) on which the alert is created/updated. Mandatory for
* MultipleResourceMultipleMetricCriteria.
* @member {string} [targetResourceRegion] the region of the target resource(s)
* on which the alert is created/updated. Mandatory for
* MultipleResourceMultipleMetricCriteria.
* @member {object} criteria defines the specific alert criteria information.
* @member {string} [criteria.odatatype] Polymorphic Discriminator
* @member {boolean} [autoMitigate] the flag that indicates whether the alert
Expand All @@ -2091,6 +2105,8 @@ export interface MetricAlertResourcePatch {
scopes?: string[];
evaluationFrequency: moment.Duration;
windowSize: moment.Duration;
targetResourceType?: string;
targetResourceRegion?: string;
criteria: MetricAlertCriteria;
autoMitigate?: boolean;
actions?: MetricAlertAction[];
Expand Down Expand Up @@ -2156,7 +2172,8 @@ export interface MetricAlertStatusCollection {
* Specifies a metric dimension.
*
* @member {string} name Name of the dimension.
* @member {string} operator the dimension operator.
* @member {string} operator the dimension operator. Only 'Include' and
* 'Exclude' are supported
* @member {array} values list of dimension values.
*/
export interface MetricDimension {
Expand All @@ -2165,6 +2182,23 @@ export interface MetricDimension {
values: string[];
}

/**
* @class
* Initializes a new instance of the MultiMetricCriteria class.
* @constructor
* The types of conditions for a multi resource alert
*
* @member {string} criterionType Polymorphic Discriminator
*/
export interface MultiMetricCriteria {
criterionType: string;
/**
* @property Describes unknown properties. The value of an unknown property
* can be of "any" type.
*/
[property: string]: any;
}

/**
* @class
* Initializes a new instance of the MetricCriteria class.
Expand All @@ -2180,7 +2214,7 @@ export interface MetricDimension {
* alert.
* @member {array} [dimensions] List of dimension conditions.
*/
export interface MetricCriteria {
export interface MetricCriteria extends MultiMetricCriteria {
name: string;
metricName: string;
metricNamespace?: string;
Expand All @@ -2204,6 +2238,20 @@ export interface MetricAlertSingleResourceMultipleMetricCriteria extends MetricA
allOf?: MetricCriteria[];
}

/**
* @class
* Initializes a new instance of the MetricAlertMultipleResourceMultipleMetricCriteria class.
* @constructor
* Speficies the metric alert criteria for multiple resource that has multiple
* metric criteria.
*
* @member {array} [allOf] the list of multiple metric criteria for this 'all
* of' operation.
*/
export interface MetricAlertMultipleResourceMultipleMetricCriteria extends MetricAlertCriteria {
allOf?: MultiMetricCriteria[];
}

/**
* @class
* Initializes a new instance of the Source class.
Expand Down
5 changes: 5 additions & 0 deletions lib/services/monitorManagement/lib/models/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,10 @@ exports.MetricAlertStatusProperties = require('./metricAlertStatusProperties');
exports.MetricAlertStatus = require('./metricAlertStatus');
exports.MetricAlertStatusCollection = require('./metricAlertStatusCollection');
exports.MetricDimension = require('./metricDimension');
exports.MultiMetricCriteria = require('./multiMetricCriteria');
exports.MetricCriteria = require('./metricCriteria');
exports.MetricAlertSingleResourceMultipleMetricCriteria = require('./metricAlertSingleResourceMultipleMetricCriteria');
exports.MetricAlertMultipleResourceMultipleMetricCriteria = require('./metricAlertMultipleResourceMultipleMetricCriteria');
exports.Source = require('./source');
exports.Schedule = require('./schedule');
exports.Action = require('./action');
Expand Down Expand Up @@ -143,7 +145,10 @@ exports.discriminators = {
'RuleAction.Microsoft.Azure.Management.Insights.Models.RuleEmailAction' : exports.RuleEmailAction,
'RuleAction.Microsoft.Azure.Management.Insights.Models.RuleWebhookAction' : exports.RuleWebhookAction,
'MetricAlertCriteria' : exports.MetricAlertCriteria,
'MultiMetricCriteria.StaticThresholdCriterion' : exports.MetricCriteria,
'MetricAlertCriteria.Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' : exports.MetricAlertSingleResourceMultipleMetricCriteria,
'MultiMetricCriteria' : exports.MultiMetricCriteria,
'MetricAlertCriteria.Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' : exports.MetricAlertMultipleResourceMultipleMetricCriteria,
'Action' : exports.Action,
'Action.Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction' : exports.AlertingAction,
'Action.Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction' : exports.LogToMetricAction
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/*
* 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';

const models = require('./index');

/**
* Speficies the metric alert criteria for multiple resource that has multiple
* metric criteria.
*
* @extends models['MetricAlertCriteria']
*/
class MetricAlertMultipleResourceMultipleMetricCriteria extends models['MetricAlertCriteria'] {
/**
* Create a MetricAlertMultipleResourceMultipleMetricCriteria.
* @member {array} [allOf] the list of multiple metric criteria for this 'all
* of' operation.
*/
constructor() {
super();
}

/**
* Defines the metadata of MetricAlertMultipleResourceMultipleMetricCriteria
*
* @returns {object} metadata of MetricAlertMultipleResourceMultipleMetricCriteria
*
*/
mapper() {
return {
required: false,
serializedName: 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria',
type: {
name: 'Composite',
polymorphicDiscriminator: {
serializedName: 'odata.type',
clientName: 'odatatype'
},
uberParent: 'MetricAlertCriteria',
className: 'MetricAlertMultipleResourceMultipleMetricCriteria',
modelProperties: {
odatatype: {
required: true,
serializedName: 'odata\\.type',
isPolymorphicDiscriminator: true,
type: {
name: 'String'
}
},
allOf: {
required: false,
serializedName: 'allOf',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'MultiMetricCriteriaElementType',
type: {
name: 'Composite',
additionalProperties: {
type: {
name: 'Dictionary',
value: {
required: false,
serializedName: 'ObjectElementType',
type: {
name: 'Object'
}
}
}
},
polymorphicDiscriminator: {
serializedName: 'criterionType',
clientName: 'criterionType'
},
uberParent: 'MultiMetricCriteria',
className: 'MultiMetricCriteria'
}
}
}
}
}
}
};
}
}

module.exports = MetricAlertMultipleResourceMultipleMetricCriteria;
20 changes: 20 additions & 0 deletions lib/services/monitorManagement/lib/models/metricAlertResource.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ class MetricAlertResource extends models['Resource'] {
* @member {moment.duration} windowSize the period of time (in ISO 8601
* duration format) that is used to monitor alert activity based on the
* threshold.
* @member {string} [targetResourceType] the resource type of the target
* resource(s) on which the alert is created/updated. Mandatory for
* MultipleResourceMultipleMetricCriteria.
* @member {string} [targetResourceRegion] the region of the target
* resource(s) on which the alert is created/updated. Mandatory for
* MultipleResourceMultipleMetricCriteria.
* @member {object} criteria defines the specific alert criteria information.
* @member {string} [criteria.odatatype] Polymorphic Discriminator
* @member {boolean} [autoMitigate] the flag that indicates whether the alert
Expand Down Expand Up @@ -153,6 +159,20 @@ class MetricAlertResource extends models['Resource'] {
name: 'TimeSpan'
}
},
targetResourceType: {
required: false,
serializedName: 'properties.targetResourceType',
type: {
name: 'String'
}
},
targetResourceRegion: {
required: false,
serializedName: 'properties.targetResourceRegion',
type: {
name: 'String'
}
},
criteria: {
required: true,
serializedName: 'properties.criteria',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ class MetricAlertResourcePatch {
* @member {moment.duration} windowSize the period of time (in ISO 8601
* duration format) that is used to monitor alert activity based on the
* threshold.
* @member {string} [targetResourceType] the resource type of the target
* resource(s) on which the alert is created/updated. Mandatory for
* MultipleResourceMultipleMetricCriteria.
* @member {string} [targetResourceRegion] the region of the target
* resource(s) on which the alert is created/updated. Mandatory for
* MultipleResourceMultipleMetricCriteria.
* @member {object} criteria defines the specific alert criteria information.
* @member {string} [criteria.odatatype] Polymorphic Discriminator
* @member {boolean} [autoMitigate] the flag that indicates whether the alert
Expand Down Expand Up @@ -119,6 +125,20 @@ class MetricAlertResourcePatch {
name: 'TimeSpan'
}
},
targetResourceType: {
required: false,
serializedName: 'properties.targetResourceType',
type: {
name: 'String'
}
},
targetResourceRegion: {
required: false,
serializedName: 'properties.targetResourceRegion',
type: {
name: 'String'
}
},
criteria: {
required: true,
serializedName: 'properties.criteria',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ class MetricAlertSingleResourceMultipleMetricCriteria extends models['MetricAler
serializedName: 'MetricCriteriaElementType',
type: {
name: 'Composite',
polymorphicDiscriminator: {
serializedName: 'criterionType',
clientName: 'criterionType'
},
uberParent: 'MultiMetricCriteria',
className: 'MetricCriteria'
}
}
Expand Down
21 changes: 19 additions & 2 deletions lib/services/monitorManagement/lib/models/metricCriteria.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@

'use strict';

const models = require('./index');

/**
* Criterion to filter metrics.
*
* @extends models['MultiMetricCriteria']
*/
class MetricCriteria {
class MetricCriteria extends models['MultiMetricCriteria'] {
/**
* Create a MetricCriteria.
* @member {string} name Name of the criteria.
Expand All @@ -27,6 +30,7 @@ class MetricCriteria {
* @member {array} [dimensions] List of dimension conditions.
*/
constructor() {
super();
}

/**
Expand All @@ -38,11 +42,24 @@ class MetricCriteria {
mapper() {
return {
required: false,
serializedName: 'MetricCriteria',
serializedName: 'StaticThresholdCriterion',
type: {
name: 'Composite',
polymorphicDiscriminator: {
serializedName: 'criterionType',
clientName: 'criterionType'
},
uberParent: 'MultiMetricCriteria',
className: 'MetricCriteria',
modelProperties: {
criterionType: {
required: true,
serializedName: 'criterionType',
isPolymorphicDiscriminator: true,
type: {
name: 'String'
}
},
name: {
required: true,
serializedName: 'name',
Expand Down
3 changes: 2 additions & 1 deletion lib/services/monitorManagement/lib/models/metricDimension.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class MetricDimension {
/**
* Create a MetricDimension.
* @member {string} name Name of the dimension.
* @member {string} operator the dimension operator.
* @member {string} operator the dimension operator. Only 'Include' and
* 'Exclude' are supported
* @member {array} values list of dimension values.
*/
constructor() {
Expand Down
Loading