Skip to content
This repository was archived by the owner on May 5, 2023. It is now read-only.
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
68 changes: 68 additions & 0 deletions lib/services/monitorManagement/lib/models/criteria.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* 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';

/**
* Specifies the criteria for converting log to metric.
*
*/
class Criteria {
/**
* Create a Criteria.
* @member {string} metricName Name of the metric
* @member {array} [dimensions] List of Dimensions for creating metric
*/
constructor() {
}

/**
* Defines the metadata of Criteria
*
* @returns {object} metadata of Criteria
*
*/
mapper() {
return {
required: false,
serializedName: 'Criteria',
type: {
name: 'Composite',
className: 'Criteria',
modelProperties: {
metricName: {
required: true,
serializedName: 'metricName',
type: {
name: 'String'
}
},
dimensions: {
required: false,
serializedName: 'dimensions',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'DimensionElementType',
type: {
name: 'Composite',
className: 'Dimension'
}
}
}
}
}
}
};
}
}

module.exports = Criteria;
76 changes: 76 additions & 0 deletions lib/services/monitorManagement/lib/models/dimension.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* 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';

/**
* Specifies the criteria for converting log to metric.
*
*/
class Dimension {
/**
* Create a Dimension.
* @member {string} name Name of the dimension
* @member {array} values List of dimension values
*/
constructor() {
}

/**
* Defines the metadata of Dimension
*
* @returns {object} metadata of Dimension
*
*/
mapper() {
return {
required: false,
serializedName: 'Dimension',
type: {
name: 'Composite',
className: 'Dimension',
modelProperties: {
name: {
required: true,
serializedName: 'name',
type: {
name: 'String'
}
},
operator: {
required: true,
isConstant: true,
serializedName: 'operator',
defaultValue: 'Include',
type: {
name: 'String'
}
},
values: {
required: true,
serializedName: 'values',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'StringElementType',
type: {
name: 'String'
}
}
}
}
}
}
};
}
}

module.exports = Dimension;
107 changes: 100 additions & 7 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,21 +2238,36 @@ 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.
* @constructor
* Specifies the log search query.
*
* @member {string} query Log search query.
* @member {string} [query] Log search query. Required for action type -
* AlertingAction
* @member {array} [authorizedResources] List of Resource referred into query
* @member {string} dataSourceId The resource uri over which log search query
* is to be run.
* @member {string} [queryType] Set value to 'ResultCount'. Possible values
* include: 'ResultCount'
*/
export interface Source {
query: string;
query?: string;
authorizedResources?: string[];
dataSourceId: string;
queryType?: string;
Expand Down Expand Up @@ -2268,14 +2317,16 @@ export interface Action {
* scheduledquery rule. Possible values include: 'Succeeded', 'Deploying',
* 'Canceled', 'Failed'
* @member {object} source Data Source against which rule will Query Data
* @member {string} [source.query] Log search query.
* @member {string} [source.query] Log search query. Required for action type -
* AlertingAction
* @member {array} [source.authorizedResources] List of Resource referred into
* query
* @member {string} [source.dataSourceId] The resource uri over which log
* search query is to be run.
* @member {string} [source.queryType] Set value to 'ResultCount'. Possible
* values include: 'ResultCount'
* @member {object} schedule Schedule (Frequnecy, Time Window) for rule.
* @member {object} [schedule] Schedule (Frequnecy, Time Window) for rule.
* Required for action type - AlertingAction
* @member {number} [schedule.frequencyInMinutes] frequency (in minutes) at
* which rule condition should be evaluated.
* @member {number} [schedule.timeWindowInMinutes] Time window for which data
Expand All @@ -2290,7 +2341,7 @@ export interface LogSearchRuleResource extends Resource {
readonly lastUpdatedTime?: Date;
readonly provisioningState?: string;
source: Source;
schedule: Schedule;
schedule?: Schedule;
action: Action;
}

Expand Down Expand Up @@ -2420,6 +2471,48 @@ export interface AlertingAction extends Action {
trigger: TriggerCondition;
}

/**
* @class
* Initializes a new instance of the Dimension class.
* @constructor
* Specifies the criteria for converting log to metric.
*
* @member {string} name Name of the dimension
* @member {array} values List of dimension values
*/
export interface Dimension {
name: string;
values: string[];
}

/**
* @class
* Initializes a new instance of the Criteria class.
* @constructor
* Specifies the criteria for converting log to metric.
*
* @member {string} metricName Name of the metric
* @member {array} [dimensions] List of Dimensions for creating metric
*/
export interface Criteria {
metricName: string;
dimensions?: Dimension[];
}

/**
* @class
* Initializes a new instance of the LogToMetricAction class.
* @constructor
* Specifiy action need to be taken when rule type is converting log to metric
*
* @member {object} criteria Severity of the alert
* @member {string} [criteria.metricName] Name of the metric
* @member {array} [criteria.dimensions] List of Dimensions for creating metric
*/
export interface LogToMetricAction extends Action {
criteria: Criteria;
}

/**
* @class
* Initializes a new instance of the MetricNamespaceName class.
Expand Down
11 changes: 10 additions & 1 deletion 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 All @@ -114,6 +116,9 @@ exports.LogMetricTrigger = require('./logMetricTrigger');
exports.TriggerCondition = require('./triggerCondition');
exports.AzNsActionGroup = require('./azNsActionGroup');
exports.AlertingAction = require('./alertingAction');
exports.Dimension = require('./dimension');
exports.Criteria = require('./criteria');
exports.LogToMetricAction = require('./logToMetricAction');
exports.MetricNamespaceName = require('./metricNamespaceName');
exports.MetricNamespace = require('./metricNamespace');
exports.AutoscaleSettingResourceCollection = require('./autoscaleSettingResourceCollection');
Expand All @@ -140,7 +145,11 @@ 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.AlertingAction' : exports.AlertingAction,
'Action.Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction' : exports.LogToMetricAction
};
Loading