Skip to content
This repository was archived by the owner on May 5, 2023. It is now read-only.
Closed
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
42 changes: 21 additions & 21 deletions lib/services/advisorManagement/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
The MIT License (MIT)

Copyright (c) 2017 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.
87 changes: 41 additions & 46 deletions lib/services/advisorManagement/README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,41 @@
---
uid: azure-arm-advisor
summary: *content
---

# Microsoft Azure SDK for Node.js - AdvisorManagement

This project provides a Node.js package for accessing Azure. Right now it supports:
- **Node.js version: 6.x.x or higher**
- **API version: 2017-04-19**

## Features


## How to Install

```bash
npm install azure-arm-advisor
```

## How to Use

### Authentication, client creation and listing recommendations as an example

```javascript
const msRestAzure = require('ms-rest-azure');
const advisorManagement = require("azure-arm-advisor");

// Interactive Login
// It provides a url and code that needs to be copied and pasted in a browser and authenticated over there. If successful,
// the user will get a DeviceTokenCredentials object.
msRestAzure.interactiveLogin().then((credentials) => {
let client = new advisorManagement(credentials, 'your-subscription-id');
client.recommendations.list().then((recommendations) => {
console.log('List of recommendations:');
console.dir(recommendations, {depth: null, colors: true});
});
}).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-advisor
summary: *content

---
# Microsoft Azure SDK for Node.js - AdvisorManagementClient
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-advisor
```

## How to use

### Authentication, client creation and getGenerateRecommendationsStatus recommendations as an example.

```javascript
const msRestAzure = require("ms-rest-azure");
const AdvisorManagementClient = require("azure-arm-advisor");
msRestAzure.interactiveLogin().then((creds) => {
const subscriptionId = "<Subscription_Id>";
const client = new AdvisorManagementClient(creds, subscriptionId);
const operationId = ec7b1657-199d-4d8a-bbb2-89a11a42e02a;
return client.recommendations.getGenerateRecommendationsStatus(operationId).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)
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@

import { ServiceClientCredentials } from 'ms-rest';
import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure';
import * as models from "./models";
import * as operations from "./operations";

declare class AdvisorManagementClient extends AzureServiceClient {
export default class AdvisorManagementClient extends AzureServiceClient {
/**
* Initializes a new instance of the AdvisorManagementClient class.
* @constructor
Expand Down Expand Up @@ -60,4 +61,4 @@ declare class AdvisorManagementClient extends AzureServiceClient {
suppressions: operations.Suppressions;
}

export = AdvisorManagementClient;
export { AdvisorManagementClient, models as AdvisorManagementModels };
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class AdvisorManagementClient extends ServiceClient {

super(credentials, options);

this.apiVersion = '2017-04-19';
this.apiVersion = '2018-01-02-preview';
this.acceptLanguage = 'en-US';
this.longRunningOperationRetryTimeout = 30;
this.generateClientRequestId = true;
Expand Down Expand Up @@ -82,3 +82,6 @@ class AdvisorManagementClient extends ServiceClient {
}

module.exports = AdvisorManagementClient;
module.exports['default'] = AdvisorManagementClient;
module.exports.AdvisorManagementClient = AdvisorManagementClient;
module.exports.AdvisorManagementModels = models;
60 changes: 30 additions & 30 deletions lib/services/advisorManagement/lib/models/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,15 @@ export interface ShortDescription {
solution?: string;
}

/**
* @class
* Initializes a new instance of the Resource class.
* @constructor
* An Azure resource.
*
* @member {string} [id] The resource ID.
* @member {string} [name] The name of the resource.
* @member {string} [type] The type of the resource.
*/
export interface Resource extends BaseResource {
readonly id?: string;
readonly name?: string;
readonly type?: string;
}

/**
* @class
* Initializes a new instance of the ResourceRecommendationBase class.
* @constructor
* Advisor Recommendation.
*
* @member {string} [id] The fully qualified recommendation ID, for example
* /subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.ClassicCompute/virtualMachines/vm1/providers/Microsoft.Advisor/recommendations/recommendationGUID.
* @member {string} [name] The name of recommendation.
* @member {string} [category] The category of the recommendation. Possible
* values include: 'HighAvailability', 'Security', 'Performance', 'Cost'
* @member {string} [impact] The business impact of the recommendation.
Expand All @@ -73,8 +60,12 @@ export interface Resource extends BaseResource {
* suggested by the recommendation.
* @member {array} [suppressionIds] The list of snoozed and dismissed rules for
* the recommendation.
* @member {string} [type] The recommendation type:
* Microsoft.Advisor/recommendations.
*/
export interface ResourceRecommendationBase extends Resource {
export interface ResourceRecommendationBase {
id?: string;
name?: string;
category?: string;
impact?: string;
impactedField?: string;
Expand All @@ -85,6 +76,28 @@ export interface ResourceRecommendationBase extends Resource {
risk?: string;
shortDescription?: ShortDescription;
suppressionIds?: string[];
type?: string;
}

/**
* @class
* Initializes a new instance of the Resource class.
* @constructor
* An Azure resource.
*
* @member {string} [id] The resource ID.
* @member {string} [name] The name of the resource.
* @member {string} [type] The type of the resource.
* @member {string} [location] The location of the resource. This cannot be
* changed after the resource is created.
* @member {object} [tags] The tags of the resource.
*/
export interface Resource extends BaseResource {
readonly id?: string;
readonly name?: string;
readonly type?: string;
location?: string;
tags?: { [propertyName: string]: string };
}

/**
Expand Down Expand Up @@ -167,16 +180,3 @@ export interface ResourceRecommendationBaseListResult extends Array<ResourceReco
export interface OperationEntityListResult extends Array<OperationEntity> {
nextLink?: string;
}

/**
* @class
* Initializes a new instance of the SuppressionContractListResult class.
* @constructor
* The list of Advisor suppressions.
*
* @member {string} [nextLink] The link used to get the next page of
* suppressions.
*/
export interface SuppressionContractListResult extends Array<SuppressionContract> {
nextLink?: string;
}
3 changes: 1 addition & 2 deletions lib/services/advisorManagement/lib/models/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ var msRestAzure = require('ms-rest-azure');
exports.BaseResource = msRestAzure.BaseResource;
exports.CloudError = msRestAzure.CloudError;
exports.ShortDescription = require('./shortDescription');
exports.Resource = require('./resource');
exports.ResourceRecommendationBase = require('./resourceRecommendationBase');
exports.Resource = require('./resource');
exports.OperationDisplayInfo = require('./operationDisplayInfo');
exports.OperationEntity = require('./operationEntity');
exports.SuppressionContract = require('./suppressionContract');
exports.ResourceRecommendationBaseListResult = require('./resourceRecommendationBaseListResult');
exports.OperationEntityListResult = require('./operationEntityListResult');
exports.SuppressionContractListResult = require('./suppressionContractListResult');
24 changes: 24 additions & 0 deletions lib/services/advisorManagement/lib/models/resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ class Resource extends models['BaseResource'] {
* @member {string} [id] The resource ID.
* @member {string} [name] The name of the resource.
* @member {string} [type] The type of the resource.
* @member {string} [location] The location of the resource. This cannot be
* changed after the resource is created.
* @member {object} [tags] The tags of the resource.
*/
constructor() {
super();
Expand Down Expand Up @@ -65,6 +68,27 @@ class Resource extends models['BaseResource'] {
type: {
name: 'String'
}
},
location: {
required: false,
serializedName: 'location',
type: {
name: 'String'
}
},
tags: {
required: false,
serializedName: 'tags',
type: {
name: 'Dictionary',
value: {
required: false,
serializedName: 'StringElementType',
type: {
name: 'String'
}
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ const models = require('./index');
/**
* Advisor Recommendation.
*
* @extends models['Resource']
*/
class ResourceRecommendationBase extends models['Resource'] {
class ResourceRecommendationBase {
/**
* Create a ResourceRecommendationBase.
* @member {string} [id] The fully qualified recommendation ID, for example
* /subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.ClassicCompute/virtualMachines/vm1/providers/Microsoft.Advisor/recommendations/recommendationGUID.
* @member {string} [name] The name of recommendation.
* @member {string} [category] The category of the recommendation. Possible
* values include: 'HighAvailability', 'Security', 'Performance', 'Cost'
* @member {string} [impact] The business impact of the recommendation.
Expand All @@ -39,9 +41,10 @@ class ResourceRecommendationBase extends models['Resource'] {
* suggested by the recommendation.
* @member {array} [suppressionIds] The list of snoozed and dismissed rules
* for the recommendation.
* @member {string} [type] The recommendation type:
* Microsoft.Advisor/recommendations.
*/
constructor() {
super();
}

/**
Expand All @@ -60,28 +63,18 @@ class ResourceRecommendationBase extends models['Resource'] {
modelProperties: {
id: {
required: false,
readOnly: true,
serializedName: 'id',
type: {
name: 'String'
}
},
name: {
required: false,
readOnly: true,
serializedName: 'name',
type: {
name: 'String'
}
},
type: {
required: false,
readOnly: true,
serializedName: 'type',
type: {
name: 'String'
}
},
category: {
required: false,
serializedName: 'properties.category',
Expand Down Expand Up @@ -155,7 +148,7 @@ class ResourceRecommendationBase extends models['Resource'] {
},
suppressionIds: {
required: false,
serializedName: 'properties.suppressionIds',
serializedName: 'suppressionIds',
type: {
name: 'Sequence',
element: {
Expand All @@ -166,6 +159,13 @@ class ResourceRecommendationBase extends models['Resource'] {
}
}
}
},
type: {
required: false,
serializedName: 'type',
type: {
name: 'String'
}
}
}
}
Expand Down
Loading