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

Commit

Permalink
[AutoPR monitor/resource-manager] Added GA API version for Scheduled …
Browse files Browse the repository at this point in the history
…Query Rule (#2721)

* Generated from 2e4c790d16eb6be9299db7a75798bca1697fd5e9

Added GA API version for Scheduled Query Rule

Added GA API version for Scheduled Query Rule

* Generated from d183bad923d3a0a4092d21203f850db6cde9f4e9

Resolving Comments

Resolving Comments

* Generated from df40ac3bbf17ea0180dd4adff2af3094065feca0

Made SKU as top level proprty and including generic error response format

Couple of changes -
1. Made SKU as top level proprty as mentioned here - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/resource-api-reference.md#put-resource
 2. including generic error response format

* Generated from 7578160670750a68d05f77ec8163b25bb72f391e

Minor Changes to align implementation

1. Removed SKU - Billing Model is still under discussion, hence need not to be exposed to customers.
2.  Enabled field ichanged to align with camel case.
3.  'throttleTillDate' in properties.action changed to 'throttlingInMin' to denote correct meaning  and it’s data type changed to number instead of date.
4. 'status' to be removed in properties.action from examples.
5.  'severity' made a required field in properties.action.
6. Removed Examples from original spec json

* Generated from fb180fb311d73934d0f5150f72638cc3de155ea0

Added Default Response payload in all APIs

Changes -
1. Added Default Response payload in all APIs
2. Made azNs description more clear

* Generated from fb180fb311d73934d0f5150f72638cc3de155ea0

Added Default Response payload in all APIs

Changes -
1. Added Default Response payload in all APIs
2. Made azNs description more clear
  • Loading branch information
AutorestCI authored Apr 24, 2018
1 parent 5e87a39 commit d864459
Show file tree
Hide file tree
Showing 21 changed files with 2,863 additions and 2 deletions.
14 changes: 14 additions & 0 deletions lib/services/monitorManagement/lib/models/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ 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 @@ -35,6 +36,11 @@ class Action {
serializedName: 'Action',
type: {
name: 'Composite',
polymorphicDiscriminator: {
serializedName: 'odata.type',
clientName: 'odatatype'
},
uberParent: 'Action',
className: 'Action',
modelProperties: {
actionGroupId: {
Expand All @@ -57,6 +63,14 @@ class Action {
}
}
}
},
odatatype: {
required: true,
serializedName: 'odata\\.type',
isPolymorphicDiscriminator: true,
type: {
name: 'String'
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class ActionGroupResource extends models['Resource'] {
required: true,
serializedName: 'properties.groupShortName',
constraints: {
MaxLength: 12
MaxLength: 15
},
type: {
name: 'String'
Expand Down
163 changes: 163 additions & 0 deletions lib/services/monitorManagement/lib/models/alertingAction.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
/*
* 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');

/**
* Specifiy action need to be taken when rule type is Alert
*
* @extends models['Action']
*/
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 {number} [throttlingInMin] time (in minutes) for which Alerts
* should be throttled
* @member {object} trigger The trigger condition that results in the alert
* rule being.
* @member {string} [trigger.thresholdOperator] Evaluation operation for rule
* - 'GreaterThan' or 'LessThan. Possible values include: 'GreaterThan',
* 'LessThan', 'Equal'
* @member {number} [trigger.threshold] Result or count threshold based on
* which rule should be triggered.
* @member {object} [trigger.metricTrigger] Trigger condition for metric
* query rule
* @member {string} [trigger.metricTrigger.metricName] the name of the metric
* that defines what the rule monitors.
* @member {string} [trigger.metricTrigger.metricResourceUri] the resource
* identifier of the resource the rule monitors.
* @member {moment.duration} [trigger.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} [trigger.metricTrigger.statistic] the metric statistic
* type. How the metrics from multiple instances are combined. Possible
* values include: 'Average', 'Min', 'Max', 'Sum'
* @member {moment.duration} [trigger.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} [trigger.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} [trigger.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} [trigger.metricTrigger.threshold] the threshold of the
* metric that triggers the scale action.
* @member {string} [trigger.metricTrigger.thresholdOperator] Evaluation
* operation for Metric -'GreaterThan' or 'LessThan' or 'Equal'. Possible
* values include: 'GreaterThan', 'LessThan', 'Equal'
* @member {string} [trigger.metricTrigger.metricTriggerType] Metric Trigger
* Type - 'Consecutive' or 'Total'. Possible values include: 'Consecutive',
* 'Total'
* @member {string} [trigger.metricTrigger.metricColumn] Evaluation of metric
* on a particular column
*/
constructor() {
super();
}

/**
* Defines the metadata of AlertingAction
*
* @returns {object} metadata of AlertingAction
*
*/
mapper() {
return {
required: false,
serializedName: 'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction',
type: {
name: 'Composite',
polymorphicDiscriminator: {
serializedName: 'odata.type',
clientName: 'odatatype'
},
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',
isPolymorphicDiscriminator: true,
type: {
name: 'String'
}
},
severity: {
required: true,
serializedName: 'severity',
type: {
name: 'String'
}
},
aznsAction: {
required: true,
serializedName: 'aznsAction',
type: {
name: 'Composite',
className: 'AzNsActionGroup'
}
},
throttlingInMin: {
required: false,
serializedName: 'throttlingInMin',
type: {
name: 'Number'
}
},
trigger: {
required: true,
serializedName: 'trigger',
type: {
name: 'Composite',
className: 'TriggerCondition'
}
}
}
}
};
}
}

module.exports = AlertingAction;
76 changes: 76 additions & 0 deletions lib/services/monitorManagement/lib/models/azNsActionGroup.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';

/**
* azns notification 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
*/
constructor() {
}

/**
* Defines the metadata of AzNsActionGroup
*
* @returns {object} metadata of AzNsActionGroup
*
*/
mapper() {
return {
required: false,
serializedName: 'AzNsActionGroup',
type: {
name: 'Composite',
className: 'AzNsActionGroup',
modelProperties: {
actionGroup: {
required: false,
serializedName: 'actionGroup',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'StringElementType',
type: {
name: 'String'
}
}
}
},
emailSubject: {
required: false,
serializedName: 'emailSubject',
type: {
name: 'String'
}
},
customWebhookPayload: {
required: false,
serializedName: 'customWebhookPayload',
type: {
name: 'String'
}
}
}
}
};
}
}

module.exports = AzNsActionGroup;
Loading

0 comments on commit d864459

Please sign in to comment.