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

[AutoPR] monitor/resource-manager #2602

Merged
15 commits merged into from
Jul 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
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
42 changes: 21 additions & 21 deletions lib/services/monitorManagement/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
The MIT License (MIT)

Copyright (c) 2018 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
The MIT License (MIT)
Copyright (c) 2018 Microsoft
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
77 changes: 41 additions & 36 deletions lib/services/monitorManagement/README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,41 @@
# Microsoft Azure SDK for Node.js - MonitorManagementClient
This project provides a Node.js package for accessing Azure. Right now it supports:
- **Node.js version 6.x.x or higher**

## Features


## How to Install

```bash
npm install azure-arm-monitor
```

## How to use

### Authentication, client creation and listByResourceGroup autoscaleSettings as an example.

```javascript
const msRestAzure = require("ms-rest-azure");
const MonitorManagementClient = require("azure-arm-monitor");
msRestAzure.interactiveLogin().then((creds) => {
const subscriptionId = "<Subscription_Id>";
const client = new MonitorManagementClient(creds, subscriptionId);
const resourceGroupName = "testresourceGroupName";
return client.autoscaleSettings.listByResourceGroup(resourceGroupName).then((result) => {
console.log("The result is:");
console.log(result);
});
}).catch((err) => {
console.log('An error ocurred:');
console.dir(err, {depth: null, colors: true});
});

## Related projects

- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node)
---
uid: azure-arm-monitor
summary: *content

---
# Microsoft Azure SDK for Node.js - MonitorManagementClient
This project provides a Node.js package for accessing Azure. Right now it supports:
- **Node.js version 6.x.x or higher**

## Features


## How to Install

```bash
npm install azure-arm-monitor
```

## How to use

### Authentication, client creation and listByResourceGroup autoscaleSettings as an example.

```javascript
const msRestAzure = require("ms-rest-azure");
const MonitorManagementClient = require("azure-arm-monitor");
msRestAzure.interactiveLogin().then((creds) => {
const subscriptionId = "<Subscription_Id>";
const client = new MonitorManagementClient(creds, subscriptionId);
const resourceGroupName = "testresourceGroupName";
return client.autoscaleSettings.listByResourceGroup(resourceGroupName).then((result) => {
console.log("The result is:");
console.log(result);
});
}).catch((err) => {
console.log('An error occurred:');
console.dir(err, {depth: null, colors: true});
});

## Related projects

- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node)
31 changes: 11 additions & 20 deletions lib/services/monitorManagement/lib/models/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@
'use strict';

/**
* An alert action.
* Action descriptor.
*
*/
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,28 +34,20 @@ class Action {
serializedName: 'Action',
type: {
name: 'Composite',
polymorphicDiscriminator: {
serializedName: 'odata.type',
clientName: 'odatatype'
},
uberParent: 'Action',
className: 'Action',
modelProperties: {
actionGroupId: {
required: false,
serializedName: 'actionGroupId',
odatatype: {
required: true,
serializedName: 'odata\\.type',
isPolymorphicDiscriminator: true,
type: {
name: 'String'
}
},
webhookProperties: {
required: false,
serializedName: 'webhookProperties',
type: {
name: 'Dictionary',
value: {
required: false,
serializedName: 'StringElementType',
type: {
name: 'String'
}
}
}
}
}
}
Expand Down
53 changes: 52 additions & 1 deletion lib/services/monitorManagement/lib/models/actionGroupResource.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ class ActionGroupResource extends models['Resource'] {
* that are part of this action group.
* @member {array} [automationRunbookReceivers] The list of AutomationRunbook
* receivers that are part of this action group.
* @member {array} [voiceReceivers] The list of voice receivers that are part
* of this action group.
* @member {array} [logicAppReceivers] The list of logic app receivers that
* are part of this action group.
* @member {array} [azureFunctionReceivers] The list of azure function
* receivers that are part of this action group.
*/
constructor() {
super();
Expand Down Expand Up @@ -105,7 +111,7 @@ class ActionGroupResource extends models['Resource'] {
required: true,
serializedName: 'properties.groupShortName',
constraints: {
MaxLength: 15
MaxLength: 12
},
type: {
name: 'String'
Expand Down Expand Up @@ -208,6 +214,51 @@ class ActionGroupResource extends models['Resource'] {
}
}
}
},
voiceReceivers: {
required: false,
serializedName: 'properties.voiceReceivers',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'VoiceReceiverElementType',
type: {
name: 'Composite',
className: 'VoiceReceiver'
}
}
}
},
logicAppReceivers: {
required: false,
serializedName: 'properties.logicAppReceivers',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'LogicAppReceiverElementType',
type: {
name: 'Composite',
className: 'LogicAppReceiver'
}
}
}
},
azureFunctionReceivers: {
required: false,
serializedName: 'properties.azureFunctionReceivers',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'AzureFunctionReceiverElementType',
type: {
name: 'Composite',
className: 'AzureFunctionReceiver'
}
}
}
}
}
}
Expand Down
120 changes: 120 additions & 0 deletions lib/services/monitorManagement/lib/models/alertingAction.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
/*
* 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 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 or suppressed.
* @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.thresholdOperator] Evaluation
* operation for Metric -'GreaterThan' or 'LessThan' or 'Equal'. Possible
* values include: 'GreaterThan', 'LessThan', 'Equal'
* @member {number} [trigger.metricTrigger.threshold] The threshold of the
* metric trigger.
* @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: {
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;
5 changes: 0 additions & 5 deletions lib/services/monitorManagement/lib/models/autoscaleProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@ class AutoscaleProfile {
* format.
* @member {object} [recurrence] the repeating times at which this profile
* begins. This element is not used if the FixedDate element is used.
* @member {string} [recurrence.frequency] the recurrence frequency. How
* often the schedule profile should take effect. This value must be Week,
* meaning each week will have the same set of profiles. Possible values
* include: 'None', 'Second', 'Minute', 'Hour', 'Day', 'Week', 'Month',
* 'Year'
* @member {object} [recurrence.schedule] the scheduling constraints for when
* the profile begins.
* @member {string} [recurrence.schedule.timeZone] the timezone for the hours
Expand Down
Loading