Skip to content
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
2 changes: 1 addition & 1 deletion sdk/advisor/arm-advisor/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2020 Microsoft
Copyright (c) 2021 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
Expand Down
8 changes: 3 additions & 5 deletions sdk/advisor/arm-advisor/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## Azure AdvisorManagementClient SDK for JavaScript

This package contains an isomorphic SDK (runs both in Node.js and in browsers) for AdvisorManagementClient.
This package contains an isomorphic SDK (runs both in node.js and in browsers) for AdvisorManagementClient.

### Currently supported environments

- [LTS versions of Node.js](https://nodejs.org/about/releases/)
- Latest versions of Safari, Chrome, Edge, and Firefox.
- Latest versions of Safari, Chrome, Edge and Firefox.

### Prerequisites

Expand All @@ -21,7 +21,6 @@ Install both packages using the below command:
```bash
npm install --save @azure/arm-advisor @azure/identity
```

> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features.
If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options.

Expand All @@ -37,7 +36,6 @@ If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/

In the below samples, we pass the credential and the Azure subscription id to instantiate the client.
Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started.

#### nodejs - Authentication, client creation, and get recommendationMetadata as an example written in JavaScript.

##### Sample code
Expand Down Expand Up @@ -86,7 +84,7 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t
const credential = new InteractiveBrowserCredential(
{
clientId: "<client id for your Azure AD app>",
tenantId: "<optional tenant for your organization>"
tenant: "<optional tenant for your organization>"
});
const client = new Azure.ArmAdvisor.AdvisorManagementClient(creds, subscriptionId);
const name = "testname";
Expand Down
2 changes: 1 addition & 1 deletion sdk/advisor/arm-advisor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"rollup-plugin-sourcemaps": "^0.4.2",
"uglify-js": "^3.6.0"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/advisor/arm-advisor",
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/advisor/arm-advisor",
"repository": {
"type": "git",
"url": "https://github.com/Azure/azure-sdk-for-js.git"
Expand Down
4 changes: 2 additions & 2 deletions sdk/advisor/arm-advisor/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const config = {
"@azure/ms-rest-azure-js": "msRestAzure"
},
banner: `/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
5 changes: 2 additions & 3 deletions sdk/advisor/arm-advisor/src/advisorManagementClient.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
Expand Down
13 changes: 6 additions & 7 deletions sdk/advisor/arm-advisor/src/advisorManagementClientContext.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
Expand All @@ -10,8 +9,8 @@

import * as Models from "./models";
import * as msRest from "@azure/ms-rest-js";
import { TokenCredential } from "@azure/core-auth";
import * as msRestAzure from "@azure/ms-rest-azure-js";
import { TokenCredential } from "@azure/core-auth";

const packageName = "@azure/arm-advisor";
const packageVersion = "2.1.0";
Expand Down Expand Up @@ -43,7 +42,7 @@ export class AdvisorManagementClientContext extends msRestAzure.AzureServiceClie
if (!options) {
options = {};
}
if(!options.userAgent) {
if (!options.userAgent) {
const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
}
Expand All @@ -58,10 +57,10 @@ export class AdvisorManagementClientContext extends msRestAzure.AzureServiceClie
this.credentials = credentials;
this.subscriptionId = subscriptionId;

if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
this.acceptLanguage = options.acceptLanguage;
}
if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout;
}
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/advisor/arm-advisor/src/models/configurationsMappers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
98 changes: 88 additions & 10 deletions sdk/advisor/arm-advisor/src/models/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down Expand Up @@ -181,6 +181,18 @@ export interface ResourceMetadata {
* Source from which recommendation is generated
*/
source?: string;
/**
* The action to view resource.
*/
action?: { [propertyName: string]: any };
/**
* The singular user friendly name of resource type. eg: virtual machine
*/
singular?: string;
/**
* The plural user friendly name of resource type. eg: virtual machines
*/
plural?: string;
}

/**
Expand Down Expand Up @@ -237,6 +249,34 @@ export interface ResourceRecommendationBase extends Resource {
* Metadata of resource that was assessed
*/
resourceMetadata?: ResourceMetadata;
/**
* The detailed description of recommendation.
*/
description?: string;
/**
* The label of recommendation.
*/
label?: string;
/**
* The link to learn more about recommendation and generation logic.
*/
learnMoreLink?: string;
/**
* The potential benefit of implementing recommendation.
*/
potentialBenefits?: string;
/**
* The list of recommended actions to implement recommendation.
*/
actions?: { [propertyName: string]: any }[];
/**
* The automated way to apply recommendation.
*/
remediation?: { [propertyName: string]: any };
/**
* The recommendation metadata properties exposed to customer to provide additional information.
*/
exposedMetadataProperties?: { [propertyName: string]: any };
}

/**
Expand Down Expand Up @@ -288,14 +328,43 @@ export interface SuppressionContract extends Resource {
* The duration for which the suppression is valid.
*/
ttl?: string;
/**
* Gets or sets the expiration time stamp.
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly expirationTimeStamp?: Date;
}

/**
* Optional Parameters.
*/
export interface RecommendationsListOptionalParams extends msRest.RequestOptionsBase {
/**
* The filter to apply to the recommendations.
* The filter to apply to the recommendations.<br>Filter can be applied to properties
* ['ResourceId', 'ResourceGroup', 'RecommendationTypeGuid', '[Category](#category)'] with
* operators ['eq', 'and', 'or'].<br>Example:<br>- $filter=Category eq 'Cost' and ResourceGroup
* eq 'MyResourceGroup'
*/
filter?: string;
/**
* The number of recommendations per page if a paged version of this API is being used.
*/
top?: number;
/**
* The page-continuation token to use with a paged version of this API.
*/
skipToken?: string;
}

/**
* Optional Parameters.
*/
export interface RecommendationsListNextOptionalParams extends msRest.RequestOptionsBase {
/**
* The filter to apply to the recommendations.<br>Filter can be applied to properties
* ['ResourceId', 'ResourceGroup', 'RecommendationTypeGuid', '[Category](#category)'] with
* operators ['eq', 'and', 'or'].<br>Example:<br>- $filter=Category eq 'Cost' and ResourceGroup
* eq 'MyResourceGroup'
*/
filter?: string;
/**
Expand All @@ -322,6 +391,20 @@ export interface SuppressionsListOptionalParams extends msRest.RequestOptionsBas
skipToken?: string;
}

/**
* Optional Parameters.
*/
export interface SuppressionsListNextOptionalParams extends msRest.RequestOptionsBase {
/**
* The number of suppressions per page if a paged version of this API is being used.
*/
top?: number;
/**
* The page-continuation token to use with a paged version of this API.
*/
skipToken?: string;
}

/**
* An interface representing AdvisorManagementClientOptions.
*/
Expand Down Expand Up @@ -456,12 +539,7 @@ export type Risk = 'Error' | 'Warning' | 'None';
/**
* Contains response data for the get operation.
*/
export type RecommendationMetadataGetResponse = {
/**
* The parsed response body.
*/
body: any;

export type RecommendationMetadataGetResponse = MetadataEntity & {
/**
* The underlying HTTP response.
*/
Expand All @@ -474,7 +552,7 @@ export type RecommendationMetadataGetResponse = {
/**
* The response body as parsed JSON or XML
*/
parsedBody: any;
parsedBody: MetadataEntity;
};
};

Expand Down
Loading