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
26 changes: 1 addition & 25 deletions lib/services/monitorManagement/lib/models/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@
'use strict';

/**
* An alert action.
*
* Class representing a Action.
*/
class Action {
/**
* Create a Action.
* @member {string} [actionGroupId] the id of the action group to use.
* @member {object} [webhookProperties]
* @member {string} odatatype Polymorphic Discriminator
*/
constructor() {
Expand All @@ -43,27 +40,6 @@ class Action {
uberParent: 'Action',
className: 'Action',
modelProperties: {
actionGroupId: {
required: false,
serializedName: 'actionGroupId',
type: {
name: 'String'
}
},
webhookProperties: {
required: false,
serializedName: 'webhookProperties',
type: {
name: 'Dictionary',
value: {
required: false,
serializedName: 'StringElementType',
type: {
name: 'String'
}
}
}
},
odatatype: {
required: true,
serializedName: 'odata\\.type',
Expand Down
34 changes: 7 additions & 27 deletions lib/services/monitorManagement/lib/models/alertingAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ class AlertingAction extends models['Action'] {
* Create a AlertingAction.
* @member {string} severity Severity of the alert. Possible values include:
* '0', '1', '2', '3', '4'
* @member {object} aznsAction azns notification group reference.
* @member {array} [aznsAction.actionGroup] Azure Group reference.
* @member {string} [aznsAction.emailSubject] Custom subject for Azns email
* @member {string} [aznsAction.customWebhookPayload] Custom webhook payload
* to be send to azns action group
* @member {object} aznsAction Azure action group reference.
* @member {array} [aznsAction.actionGroup] Azure Action Group reference.
* @member {string} [aznsAction.emailSubject] Custom subject override for all
* email ids in Azure action group
* @member {string} [aznsAction.customWebhookPayload] Custom payload to be
* sent for all webook URI in Azure action group
* @member {number} [throttlingInMin] time (in minutes) for which Alerts
* should be throttled
* should be throttled or suppressed.
* @member {object} trigger The trigger condition that results in the alert
* rule being.
* @member {string} [trigger.thresholdOperator] Evaluation operation for rule
Expand Down Expand Up @@ -95,27 +96,6 @@ class AlertingAction extends models['Action'] {
uberParent: 'Action',
className: 'AlertingAction',
modelProperties: {
actionGroupId: {
required: false,
serializedName: 'actionGroupId',
type: {
name: 'String'
}
},
webhookProperties: {
required: false,
serializedName: 'webhookProperties',
type: {
name: 'Dictionary',
value: {
required: false,
serializedName: 'StringElementType',
type: {
name: 'String'
}
}
}
},
odatatype: {
required: true,
serializedName: 'odata\\.type',
Expand Down
11 changes: 6 additions & 5 deletions lib/services/monitorManagement/lib/models/azNsActionGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@
'use strict';

/**
* azns notification group
* Azure action group
*
*/
class AzNsActionGroup {
/**
* Create a AzNsActionGroup.
* @member {array} [actionGroup] Azure Group reference.
* @member {string} [emailSubject] Custom subject for Azns email
* @member {string} [customWebhookPayload] Custom webhook payload to be send
* to azns action group
* @member {array} [actionGroup] Azure Action Group reference.
* @member {string} [emailSubject] Custom subject override for all email ids
* in Azure action group
* @member {string} [customWebhookPayload] Custom payload to be sent for all
* webook URI in Azure action group
*/
constructor() {
}
Expand Down
52 changes: 30 additions & 22 deletions lib/services/monitorManagement/lib/models/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1994,18 +1994,16 @@ export interface CalculateBaselineResponse {

/**
* @class
* Initializes a new instance of the Action class.
* Initializes a new instance of the MetricAlertAction class.
* @constructor
* An alert action.
*
* @member {string} [actionGroupId] the id of the action group to use.
* @member {object} [webhookProperties]
* @member {string} odatatype Polymorphic Discriminator
*/
export interface Action {
export interface MetricAlertAction {
actionGroupId?: string;
webhookProperties?: { [propertyName: string]: string };
odatatype: string;
}

/**
Expand Down Expand Up @@ -2061,7 +2059,7 @@ export interface MetricAlertResource extends Resource {
windowSize: moment.Duration;
criteria: MetricAlertCriteria;
autoMitigate?: boolean;
actions?: Action[];
actions?: MetricAlertAction[];
readonly lastUpdatedTime?: Date;
}

Expand Down Expand Up @@ -2103,7 +2101,7 @@ export interface MetricAlertResourcePatch {
windowSize: moment.Duration;
criteria: MetricAlertCriteria;
autoMitigate?: boolean;
actions?: Action[];
actions?: MetricAlertAction[];
readonly lastUpdatedTime?: Date;
}

Expand Down Expand Up @@ -2216,7 +2214,7 @@ export interface MetricAlertSingleResourceMultipleMetricCriteria extends MetricA
*
* @member {string} query Log search query.
* @member {array} [authorizedResources] List of Resource referred into query
* @member {string} datasourceId The resource uri over which log search query
* @member {string} dataSourceId The resource uri over which log search query
* is to be run.
* @member {string} [queryType] Set value to ResultCount if query should be
* returning search result count. Set it to Number if its a metric query.
Expand All @@ -2225,7 +2223,7 @@ export interface MetricAlertSingleResourceMultipleMetricCriteria extends MetricA
export interface Source {
query: string;
authorizedResources?: string[];
datasourceId: string;
dataSourceId: string;
queryType?: string;
}

Expand All @@ -2245,6 +2243,16 @@ export interface Schedule {
timeWindowInMinutes: number;
}

/**
* @class
* Initializes a new instance of the Action class.
* @constructor
* @member {string} odatatype Polymorphic Discriminator
*/
export interface Action {
odatatype: string;
}

/**
* @class
* Initializes a new instance of the LogSearchRuleResource class.
Expand All @@ -2264,7 +2272,7 @@ export interface Schedule {
* @member {string} [source.query] Log search query.
* @member {array} [source.authorizedResources] List of Resource referred into
* query
* @member {string} [source.datasourceId] The resource uri over which log
* @member {string} [source.dataSourceId] The resource uri over which log
* search query is to be run.
* @member {string} [source.queryType] Set value to ResultCount if query should
* be returning search result count. Set it to Number if its a metric query.
Expand All @@ -2276,8 +2284,6 @@ export interface Schedule {
* needs to be fetched for query (should be greater than or equal to
* frequencyInMinutes).
* @member {object} action Action needs to be taken on rule execution.
* @member {string} [action.actionGroupId] the id of the action group to use.
* @member {object} [action.webhookProperties]
* @member {string} [action.odatatype] Polymorphic Discriminator
*/
export interface LogSearchRuleResource extends Resource {
Expand Down Expand Up @@ -2345,12 +2351,13 @@ export interface TriggerCondition {
* @class
* Initializes a new instance of the AzNsActionGroup class.
* @constructor
* azns notification group
* Azure action group
*
* @member {array} [actionGroup] Azure Group reference.
* @member {string} [emailSubject] Custom subject for Azns email
* @member {string} [customWebhookPayload] Custom webhook payload to be send to
* azns action group
* @member {array} [actionGroup] Azure Action Group reference.
* @member {string} [emailSubject] Custom subject override for all email ids in
* Azure action group
* @member {string} [customWebhookPayload] Custom payload to be sent for all
* webook URI in Azure action group
*/
export interface AzNsActionGroup {
actionGroup?: string[];
Expand All @@ -2366,13 +2373,14 @@ export interface AzNsActionGroup {
*
* @member {string} severity Severity of the alert. Possible values include:
* '0', '1', '2', '3', '4'
* @member {object} aznsAction azns notification group reference.
* @member {array} [aznsAction.actionGroup] Azure Group reference.
* @member {string} [aznsAction.emailSubject] Custom subject for Azns email
* @member {string} [aznsAction.customWebhookPayload] Custom webhook payload to
* be send to azns action group
* @member {object} aznsAction Azure action group reference.
* @member {array} [aznsAction.actionGroup] Azure Action Group reference.
* @member {string} [aznsAction.emailSubject] Custom subject override for all
* email ids in Azure action group
* @member {string} [aznsAction.customWebhookPayload] Custom payload to be sent
* for all webook URI in Azure action group
* @member {number} [throttlingInMin] time (in minutes) for which Alerts should
* be throttled
* be throttled or suppressed.
* @member {object} trigger The trigger condition that results in the alert
* rule being.
* @member {string} [trigger.thresholdOperator] Evaluation operation for rule -
Expand Down
5 changes: 3 additions & 2 deletions lib/services/monitorManagement/lib/models/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ exports.Baseline = require('./baseline');
exports.BaselineResponse = require('./baselineResponse');
exports.TimeSeriesInformation = require('./timeSeriesInformation');
exports.CalculateBaselineResponse = require('./calculateBaselineResponse');
exports.Action = require('./action');
exports.MetricAlertAction = require('./metricAlertAction');
exports.MetricAlertCriteria = require('./metricAlertCriteria');
exports.MetricAlertResource = require('./metricAlertResource');
exports.MetricAlertResourcePatch = require('./metricAlertResourcePatch');
Expand All @@ -107,6 +107,7 @@ exports.MetricCriteria = require('./metricCriteria');
exports.MetricAlertSingleResourceMultipleMetricCriteria = require('./metricAlertSingleResourceMultipleMetricCriteria');
exports.Source = require('./source');
exports.Schedule = require('./schedule');
exports.Action = require('./action');
exports.LogSearchRuleResource = require('./logSearchRuleResource');
exports.TriggerCondition = require('./triggerCondition');
exports.AzNsActionGroup = require('./azNsActionGroup');
Expand All @@ -133,8 +134,8 @@ exports.discriminators = {
'RuleAction' : exports.RuleAction,
'RuleAction.Microsoft.Azure.Management.Insights.Models.RuleEmailAction' : exports.RuleEmailAction,
'RuleAction.Microsoft.Azure.Management.Insights.Models.RuleWebhookAction' : exports.RuleWebhookAction,
'Action' : exports.Action,
'MetricAlertCriteria' : exports.MetricAlertCriteria,
'MetricAlertCriteria.Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' : exports.MetricAlertSingleResourceMultipleMetricCriteria,
'Action' : exports.Action,
'Action.Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction' : exports.AlertingAction
};
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class LogSearchRuleResource extends models['Resource'] {
* @member {string} [source.query] Log search query.
* @member {array} [source.authorizedResources] List of Resource referred
* into query
* @member {string} [source.datasourceId] The resource uri over which log
* @member {string} [source.dataSourceId] The resource uri over which log
* search query is to be run.
* @member {string} [source.queryType] Set value to ResultCount if query
* should be returning search result count. Set it to Number if its a metric
Expand All @@ -45,8 +45,6 @@ class LogSearchRuleResource extends models['Resource'] {
* needs to be fetched for query (should be greater than or equal to
* frequencyInMinutes).
* @member {object} action Action needs to be taken on rule execution.
* @member {string} [action.actionGroupId] the id of the action group to use.
* @member {object} [action.webhookProperties]
* @member {string} [action.odatatype] Polymorphic Discriminator
*/
constructor() {
Expand Down
67 changes: 67 additions & 0 deletions lib/services/monitorManagement/lib/models/metricAlertAction.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* 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';

/**
* An alert action.
*
*/
class MetricAlertAction {
/**
* Create a MetricAlertAction.
* @member {string} [actionGroupId] the id of the action group to use.
* @member {object} [webhookProperties]
*/
constructor() {
}

/**
* Defines the metadata of MetricAlertAction
*
* @returns {object} metadata of MetricAlertAction
*
*/
mapper() {
return {
required: false,
serializedName: 'MetricAlertAction',
type: {
name: 'Composite',
className: 'MetricAlertAction',
modelProperties: {
actionGroupId: {
required: false,
serializedName: 'actionGroupId',
type: {
name: 'String'
}
},
webhookProperties: {
required: false,
serializedName: 'webhookProperties',
type: {
name: 'Dictionary',
value: {
required: false,
serializedName: 'StringElementType',
type: {
name: 'String'
}
}
}
}
}
}
};
}
}

module.exports = MetricAlertAction;
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,10 @@ class MetricAlertResource extends models['Resource'] {
name: 'Sequence',
element: {
required: false,
serializedName: 'ActionElementType',
serializedName: 'MetricAlertActionElementType',
type: {
name: 'Composite',
polymorphicDiscriminator: {
serializedName: 'odata.type',
clientName: 'odatatype'
},
uberParent: 'Action',
className: 'Action'
className: 'MetricAlertAction'
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,10 @@ class MetricAlertResourcePatch {
name: 'Sequence',
element: {
required: false,
serializedName: 'ActionElementType',
serializedName: 'MetricAlertActionElementType',
type: {
name: 'Composite',
polymorphicDiscriminator: {
serializedName: 'odata.type',
clientName: 'odatatype'
},
uberParent: 'Action',
className: 'Action'
className: 'MetricAlertAction'
}
}
}
Expand Down
Loading