diff --git a/sdk/advisor/arm-advisor/LICENSE.txt b/sdk/advisor/arm-advisor/LICENSE.txt index a70e8cf66038..ea8fb1516028 100644 --- a/sdk/advisor/arm-advisor/LICENSE.txt +++ b/sdk/advisor/arm-advisor/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +Copyright (c) 2020 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 diff --git a/sdk/advisor/arm-advisor/README.md b/sdk/advisor/arm-advisor/README.md index 2794174bda52..6e851c5fd17e 100644 --- a/sdk/advisor/arm-advisor/README.md +++ b/sdk/advisor/arm-advisor/README.md @@ -9,23 +9,24 @@ This package contains an isomorphic SDK for AdvisorManagementClient. ### How to Install -``` +```bash npm install @azure/arm-advisor ``` ### How to use -#### nodejs - Authentication, client creation and listBySubscription configurations as an example written in TypeScript. +#### nodejs - Authentication, client creation and get recommendationMetadata as an example written in TypeScript. ##### Install @azure/ms-rest-nodeauth -``` -npm install @azure/ms-rest-nodeauth +- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. +```bash +npm install @azure/ms-rest-nodeauth@"^3.0.0" ``` ##### Sample code -```ts +```typescript import * as msRest from "@azure/ms-rest-js"; import * as msRestAzure from "@azure/ms-rest-azure-js"; import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; @@ -34,7 +35,8 @@ const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; msRestNodeAuth.interactiveLogin().then((creds) => { const client = new AdvisorManagementClient(creds, subscriptionId); - client.configurations.listBySubscription().then((result) => { + const name = "testname"; + client.recommendationMetadata.get(name).then((result) => { console.log("The result is:"); console.log(result); }); @@ -43,11 +45,11 @@ msRestNodeAuth.interactiveLogin().then((creds) => { }); ``` -#### browser - Authentication, client creation and listBySubscription configurations as an example written in JavaScript. +#### browser - Authentication, client creation and get recommendationMetadata as an example written in JavaScript. ##### Install @azure/ms-rest-browserauth -``` +```bash npm install @azure/ms-rest-browserauth ``` @@ -77,7 +79,8 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to authManager.login(); } const client = new Azure.ArmAdvisor.AdvisorManagementClient(res.creds, subscriptionId); - client.configurations.listBySubscription().then((result) => { + const name = "testname"; + client.recommendationMetadata.get(name).then((result) => { console.log("The result is:"); console.log(result); }).catch((err) => { @@ -95,5 +98,4 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fadvisor%2Farm-advisor%2FREADME.png) +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/advisor/arm-advisor/README.png) diff --git a/sdk/advisor/arm-advisor/package.json b/sdk/advisor/arm-advisor/package.json index ac17810a1a1a..1fdcf0cf4e9a 100644 --- a/sdk/advisor/arm-advisor/package.json +++ b/sdk/advisor/arm-advisor/package.json @@ -4,9 +4,9 @@ "description": "AdvisorManagementClient Library with typescript type definitions for node.js and browser.", "version": "1.2.0", "dependencies": { - "@azure/ms-rest-azure-js": "^1.1.0", - "@azure/ms-rest-js": "^1.1.0", - "tslib": "^1.9.3" + "@azure/ms-rest-azure-js": "^2.0.1", + "@azure/ms-rest-js": "^2.0.4", + "tslib": "^1.10.0" }, "keywords": [ "node", @@ -20,18 +20,19 @@ "module": "./esm/advisorManagementClient.js", "types": "./esm/advisorManagementClient.d.ts", "devDependencies": { - "typescript": "^3.1.1", - "rollup": "^0.66.2", - "rollup-plugin-node-resolve": "^3.4.0", - "uglify-js": "^3.4.9" + "typescript": "^3.5.3", + "rollup": "^1.18.0", + "rollup-plugin-node-resolve": "^5.2.0", + "rollup-plugin-sourcemaps": "^0.4.2", + "uglify-js": "^3.6.0" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/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" + "url": "https://github.com/Azure/azure-sdk-for-js.git" }, "bugs": { - "url": "https://github.com/azure/azure-sdk-for-js/issues" + "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", @@ -43,6 +44,7 @@ "esm/**/*.d.ts", "esm/**/*.d.ts.map", "src/**/*.ts", + "README.md", "rollup.config.js", "tsconfig.json" ], @@ -52,5 +54,5 @@ "prepack": "npm install && npm run build" }, "sideEffects": false, - "authPublish": true + "autoPublish": true } diff --git a/sdk/advisor/arm-advisor/rollup.config.js b/sdk/advisor/arm-advisor/rollup.config.js index 19c4680fc09c..6d406ff2ce84 100644 --- a/sdk/advisor/arm-advisor/rollup.config.js +++ b/sdk/advisor/arm-advisor/rollup.config.js @@ -1,10 +1,16 @@ +import rollup from "rollup"; import nodeResolve from "rollup-plugin-node-resolve"; +import sourcemaps from "rollup-plugin-sourcemaps"; + /** - * @type {import('rollup').RollupFileOptions} + * @type {rollup.RollupFileOptions} */ const config = { - input: './esm/advisorManagementClient.js', - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], + input: "./esm/advisorManagementClient.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], output: { file: "./dist/arm-advisor.js", format: "umd", @@ -16,16 +22,16 @@ const config = { }, banner: `/* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */` }, plugins: [ - nodeResolve({ module: true }) + nodeResolve({ mainFields: ['module', 'main'] }), + sourcemaps() ] }; + export default config; diff --git a/sdk/advisor/arm-advisor/src/advisorManagementClient.ts b/sdk/advisor/arm-advisor/src/advisorManagementClient.ts index 643eaf226574..a1de4884947a 100644 --- a/sdk/advisor/arm-advisor/src/advisorManagementClient.ts +++ b/sdk/advisor/arm-advisor/src/advisorManagementClient.ts @@ -17,6 +17,7 @@ import { AdvisorManagementClientContext } from "./advisorManagementClientContext class AdvisorManagementClient extends AdvisorManagementClientContext { // Operation groups + recommendationMetadata: operations.RecommendationMetadata; configurations: operations.Configurations; recommendations: operations.Recommendations; operations: operations.Operations; @@ -30,6 +31,7 @@ class AdvisorManagementClient extends AdvisorManagementClientContext { */ constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.AdvisorManagementClientOptions) { super(credentials, subscriptionId, options); + this.recommendationMetadata = new operations.RecommendationMetadata(this); this.configurations = new operations.Configurations(this); this.recommendations = new operations.Recommendations(this); this.operations = new operations.Operations(this); diff --git a/sdk/advisor/arm-advisor/src/advisorManagementClientContext.ts b/sdk/advisor/arm-advisor/src/advisorManagementClientContext.ts index 82f5adb2547f..01ec48ff989e 100644 --- a/sdk/advisor/arm-advisor/src/advisorManagementClientContext.ts +++ b/sdk/advisor/arm-advisor/src/advisorManagementClientContext.ts @@ -13,7 +13,7 @@ import * as msRest from "@azure/ms-rest-js"; import * as msRestAzure from "@azure/ms-rest-azure-js"; const packageName = "@azure/arm-advisor"; -const packageVersion = "0.1.0"; +const packageVersion = "1.2.0"; export class AdvisorManagementClientContext extends msRestAzure.AzureServiceClient { credentials: msRest.ServiceClientCredentials; @@ -44,7 +44,7 @@ export class AdvisorManagementClientContext extends msRestAzure.AzureServiceClie super(credentials, options); - this.apiVersion = '2017-04-19'; + this.apiVersion = '2020-01-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; diff --git a/sdk/advisor/arm-advisor/src/models/configurationsMappers.ts b/sdk/advisor/arm-advisor/src/models/configurationsMappers.ts index 7e0bc956ab06..e2c5cdf5de9f 100644 --- a/sdk/advisor/arm-advisor/src/models/configurationsMappers.ts +++ b/sdk/advisor/arm-advisor/src/models/configurationsMappers.ts @@ -1,18 +1,20 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { - ConfigurationListResult, + ArmErrorResponse, + ARMErrorResponseBody, + BaseResource, ConfigData, - ConfigDataProperties, - CloudError, - ARMErrorResponseBody + ConfigurationListResult, + DigestConfig, + Resource, + ResourceRecommendationBase, + ShortDescription, + SuppressionContract } from "../models/mappers"; - diff --git a/sdk/advisor/arm-advisor/src/models/index.ts b/sdk/advisor/arm-advisor/src/models/index.ts index 21d9a82bd89e..d6046feb0601 100644 --- a/sdk/advisor/arm-advisor/src/models/index.ts +++ b/sdk/advisor/arm-advisor/src/models/index.ts @@ -1,11 +1,9 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; @@ -13,392 +11,413 @@ import * as msRest from "@azure/ms-rest-js"; export { BaseResource, CloudError }; - /** - * @interface - * An interface representing ConfigDataProperties. - * The list of property name/value pairs. - * + * The metadata supported value detail. */ -export interface ConfigDataProperties { +export interface MetadataSupportedValueDetail { /** - * @member {boolean} [exclude] Exclude the resource from Advisor evaluations. - * Valid values: False (default) or True. + * The id. */ - exclude?: boolean; - /** - * @member {string} [lowCpuThreshold] Minimum percentage threshold for - * Advisor low CPU utilization evaluation. Valid only for subscriptions. - * Valid values: 5 (default), 10, 15 or 20. - */ - lowCpuThreshold?: string; + id?: string; /** - * @property Describes unknown properties. The value of an unknown property - * can be of "any" type. + * The display name. */ - [property: string]: any; + displayName?: string; } /** - * @interface - * An interface representing ConfigData. - * The Advisor configuration data structure. - * + * The metadata entity contract. */ -export interface ConfigData { +export interface MetadataEntity { /** - * @member {string} [id] The resource Id of the configuration resource. + * The resource Id of the metadata entity. */ id?: string; /** - * @member {string} [type] The type of the configuration resource. + * The type of the metadata entity. */ type?: string; /** - * @member {string} [name] The name of the configuration resource. + * The name of the metadata entity. */ name?: string; /** - * @member {ConfigDataProperties} [properties] The list of property - * name/value pairs. + * The display name. */ - properties?: ConfigDataProperties; -} - -/** - * @interface - * An interface representing ARMErrorResponseBody. - * ARM error response body. - * - */ -export interface ARMErrorResponseBody { + displayName?: string; /** - * @member {string} [message] Gets or sets the string that describes the - * error in detail and provides debugging information. + * The list of keys on which this entity depends on. */ - message?: string; + dependsOn?: string[]; /** - * @member {string} [code] Gets or sets the string that can be used to - * programmatically identify the error. + * The list of scenarios applicable to this metadata entity. */ - code?: string; + applicableScenarios?: Scenario[]; + /** + * The list of supported values. + */ + supportedValues?: MetadataSupportedValueDetail[]; } /** - * @interface - * An interface representing ShortDescription. - * A summary of the recommendation. - * + * Advisor Digest configuration entity */ -export interface ShortDescription { +export interface DigestConfig { /** - * @member {string} [problem] The issue or opportunity identified by the - * recommendation. + * Name of digest configuration. Value is case-insensitive and must be unique within a + * subscription. */ - problem?: string; + name?: string; /** - * @member {string} [solution] The remediation action suggested by the - * recommendation. + * Action group resource id used by digest. */ - solution?: string; + actionGroupResourceId?: string; + /** + * Frequency that digest will be triggered, in days. Value must be between 7 and 30 days + * inclusive. + */ + frequency?: number; + /** + * Categories to send digest for. If categories are not provided, then digest will be sent for + * all categories. + */ + categories?: Category[]; + /** + * Language for digest content body. Value must be ISO 639-1 code for one of Azure portal + * supported languages. Otherwise, it will be converted into one. Default value is English (en). + */ + language?: string; + /** + * State of digest configuration. Possible values include: 'Active', 'Disabled' + */ + state?: DigestConfigState; } /** - * @interface - * An interface representing Resource. * An Azure resource. - * - * @extends BaseResource */ export interface Resource extends BaseResource { /** - * @member {string} [id] The resource ID. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The resource ID. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly id?: string; /** - * @member {string} [name] The name of the resource. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The name of the resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly name?: string; /** - * @member {string} [type] The type of the resource. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The type of the resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly type?: string; } /** - * @interface - * An interface representing ResourceRecommendationBase. + * The Advisor configuration data structure. + */ +export interface ConfigData extends Resource { + /** + * Exclude the resource from Advisor evaluations. Valid values: False (default) or True. + */ + exclude?: boolean; + /** + * Minimum percentage threshold for Advisor low CPU utilization evaluation. Valid only for + * subscriptions. Valid values: 5 (default), 10, 15 or 20. Possible values include: '5', '10', + * '15', '20' + */ + lowCpuThreshold?: CpuThreshold; + /** + * Advisor digest configuration. Valid only for subscriptions + */ + digests?: DigestConfig[]; +} + +/** + * ARM error response body. + */ +export interface ARMErrorResponseBody { + /** + * Gets or sets the string that describes the error in detail and provides debugging information. + */ + message?: string; + /** + * Gets or sets the string that can be used to programmatically identify the error. + */ + code?: string; +} + +/** + * An interface representing ArmErrorResponse. + */ +export interface ArmErrorResponse { + error?: ARMErrorResponseBody; +} + +/** + * A summary of the recommendation. + */ +export interface ShortDescription { + /** + * The issue or opportunity identified by the recommendation. + */ + problem?: string; + /** + * The remediation action suggested by the recommendation. + */ + solution?: string; +} + +/** * Advisor Recommendation. - * - * @extends Resource */ export interface ResourceRecommendationBase extends Resource { /** - * @member {Category} [category] The category of the recommendation. Possible - * values include: 'HighAvailability', 'Security', 'Performance', 'Cost' + * The category of the recommendation. Possible values include: 'HighAvailability', 'Security', + * 'Performance', 'Cost', 'OperationalExcellence' */ category?: Category; /** - * @member {Impact} [impact] The business impact of the recommendation. - * Possible values include: 'High', 'Medium', 'Low' + * The business impact of the recommendation. Possible values include: 'High', 'Medium', 'Low' */ impact?: Impact; /** - * @member {string} [impactedField] The resource type identified by Advisor. + * The resource type identified by Advisor. */ impactedField?: string; /** - * @member {string} [impactedValue] The resource identified by Advisor. + * The resource identified by Advisor. */ impactedValue?: string; /** - * @member {Date} [lastUpdated] The most recent time that Advisor checked the - * validity of the recommendation. + * The most recent time that Advisor checked the validity of the recommendation. */ lastUpdated?: Date; /** - * @member {{ [propertyName: string]: any }} [metadata] The recommendation - * metadata. + * The recommendation metadata. */ metadata?: { [propertyName: string]: any }; /** - * @member {string} [recommendationTypeId] The recommendation-type GUID. + * The recommendation-type GUID. */ recommendationTypeId?: string; /** - * @member {Risk} [risk] The potential risk of not implementing the - * recommendation. Possible values include: 'Error', 'Warning', 'None' + * The potential risk of not implementing the recommendation. Possible values include: 'Error', + * 'Warning', 'None' */ risk?: Risk; /** - * @member {ShortDescription} [shortDescription] A summary of the - * recommendation. + * A summary of the recommendation. */ shortDescription?: ShortDescription; /** - * @member {string[]} [suppressionIds] The list of snoozed and dismissed - * rules for the recommendation. + * The list of snoozed and dismissed rules for the recommendation. */ suppressionIds?: string[]; /** - * @member {{ [propertyName: string]: string }} [extendedProperties] Extended - * properties + * Extended properties */ extendedProperties?: { [propertyName: string]: string }; } /** - * @interface - * An interface representing OperationDisplayInfo. * The operation supported by Advisor. - * */ export interface OperationDisplayInfo { /** - * @member {string} [description] The description of the operation. + * The description of the operation. */ description?: string; /** - * @member {string} [operation] The action that users can perform, based on - * their permission level. + * The action that users can perform, based on their permission level. */ operation?: string; /** - * @member {string} [provider] Service provider: Microsoft Advisor. + * Service provider: Microsoft Advisor. */ provider?: string; /** - * @member {string} [resource] Resource on which the operation is performed. + * Resource on which the operation is performed. */ resource?: string; } /** - * @interface - * An interface representing OperationEntity. * The operation supported by Advisor. - * */ export interface OperationEntity { /** - * @member {string} [name] Operation name: {provider}/{resource}/{operation}. + * Operation name: {provider}/{resource}/{operation}. */ name?: string; /** - * @member {OperationDisplayInfo} [display] The operation supported by - * Advisor. + * The operation supported by Advisor. */ display?: OperationDisplayInfo; } /** - * @interface - * An interface representing SuppressionContract. - * The details of the snoozed or dismissed rule; for example, the duration, - * name, and GUID associated with the rule. - * - * @extends Resource + * The details of the snoozed or dismissed rule; for example, the duration, name, and GUID + * associated with the rule. */ export interface SuppressionContract extends Resource { /** - * @member {string} [suppressionId] The GUID of the suppression. + * The GUID of the suppression. */ suppressionId?: string; /** - * @member {string} [ttl] The duration for which the suppression is valid. + * The duration for which the suppression is valid. */ ttl?: string; } /** - * @interface - * An interface representing RecommendationsListOptionalParams. * Optional Parameters. - * - * @extends RequestOptionsBase */ export interface RecommendationsListOptionalParams extends msRest.RequestOptionsBase { /** - * @member {string} [filter] The filter to apply to the recommendations. + * The filter to apply to the recommendations. */ filter?: string; /** - * @member {number} [top] The number of recommendations per page if a paged - * version of this API is being used. + * The number of recommendations per page if a paged version of this API is being used. */ top?: number; /** - * @member {string} [skipToken] The page-continuation token to use with a - * paged version of this API. + * The page-continuation token to use with a paged version of this API. */ skipToken?: string; } /** - * @interface - * An interface representing SuppressionsListOptionalParams. * Optional Parameters. - * - * @extends RequestOptionsBase */ export interface SuppressionsListOptionalParams extends msRest.RequestOptionsBase { /** - * @member {number} [top] The number of suppressions per page if a paged - * version of this API is being used. + * The number of suppressions per page if a paged version of this API is being used. */ top?: number; /** - * @member {string} [skipToken] The page-continuation token to use with a - * paged version of this API. + * The page-continuation token to use with a paged version of this API. */ skipToken?: string; } /** - * @interface * An interface representing AdvisorManagementClientOptions. - * @extends AzureServiceClientOptions */ export interface AdvisorManagementClientOptions extends AzureServiceClientOptions { - /** - * @member {string} [baseUri] - */ baseUri?: string; } /** - * @interface - * An interface representing RecommendationsGenerateHeaders. * Defines headers for Generate operation. - * */ export interface RecommendationsGenerateHeaders { /** - * @member {string} [location] The URL where the status of the asynchronous - * operation can be checked. + * The URL where the status of the asynchronous operation can be checked. */ location: string; /** - * @member {string} [retryAfter] The amount of delay to use while the status - * of the operation is checked. The value is expressed in seconds. + * The amount of delay to use while the status of the operation is checked. The value is + * expressed in seconds. */ retryAfter: string; } +/** + * @interface + * The list of metadata entities + * @extends Array + */ +export interface MetadataEntityListResult extends Array { + /** + * The link used to get the next page of metadata. + */ + nextLink?: string; +} /** * @interface - * An interface representing the ConfigurationListResult. * The list of Advisor configurations. - * * @extends Array */ export interface ConfigurationListResult extends Array { /** - * @member {string} [nextLink] The link used to get the next page of - * configurations. + * The link used to get the next page of configurations. */ nextLink?: string; } /** * @interface - * An interface representing the ResourceRecommendationBaseListResult. * The list of Advisor recommendations. - * * @extends Array */ export interface ResourceRecommendationBaseListResult extends Array { /** - * @member {string} [nextLink] The link used to get the next page of - * recommendations. + * The link used to get the next page of recommendations. */ nextLink?: string; } /** * @interface - * An interface representing the OperationEntityListResult. * The list of Advisor operations. - * * @extends Array */ export interface OperationEntityListResult extends Array { /** - * @member {string} [nextLink] The link used to get the next page of - * operations. + * The link used to get the next page of operations. */ nextLink?: string; } /** * @interface - * An interface representing the SuppressionContractListResult. * The list of Advisor suppressions. - * * @extends Array */ export interface SuppressionContractListResult extends Array { /** - * @member {string} [nextLink] The link used to get the next page of - * suppressions. + * The link used to get the next page of suppressions. */ nextLink?: string; } +/** + * Defines values for Scenario. + * Possible values include: 'Alerts' + * @readonly + * @enum {string} + */ +export type Scenario = 'Alerts'; + +/** + * Defines values for CpuThreshold. + * Possible values include: '5', '10', '15', '20' + * @readonly + * @enum {string} + */ +export type CpuThreshold = '5' | '10' | '15' | '20'; + /** * Defines values for Category. - * Possible values include: 'HighAvailability', 'Security', 'Performance', 'Cost' + * Possible values include: 'HighAvailability', 'Security', 'Performance', 'Cost', + * 'OperationalExcellence' + * @readonly + * @enum {string} + */ +export type Category = 'HighAvailability' | 'Security' | 'Performance' | 'Cost' | 'OperationalExcellence'; + +/** + * Defines values for DigestConfigState. + * Possible values include: 'Active', 'Disabled' * @readonly * @enum {string} */ -export type Category = 'HighAvailability' | 'Security' | 'Performance' | 'Cost'; +export type DigestConfigState = 'Active' | 'Disabled'; /** * Defines values for Impact. @@ -416,6 +435,71 @@ export type Impact = 'High' | 'Medium' | 'Low'; */ export type Risk = 'Error' | 'Warning' | 'None'; +/** + * Contains response data for the get operation. + */ +export type RecommendationMetadataGetResponse = { + /** + * The parsed response body. + */ + body: any; + + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: any; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type RecommendationMetadataListResponse = MetadataEntityListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MetadataEntityListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type RecommendationMetadataListNextResponse = MetadataEntityListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MetadataEntityListResult; + }; +}; + /** * Contains response data for the listBySubscription operation. */ @@ -428,6 +512,7 @@ export type ConfigurationsListBySubscriptionResponse = ConfigurationListResult & * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -438,7 +523,7 @@ export type ConfigurationsListBySubscriptionResponse = ConfigurationListResult & /** * Contains response data for the createInSubscription operation. */ -export type ConfigurationsCreateInSubscriptionResponse = ARMErrorResponseBody & { +export type ConfigurationsCreateInSubscriptionResponse = ConfigData & { /** * The underlying HTTP response. */ @@ -447,10 +532,11 @@ export type ConfigurationsCreateInSubscriptionResponse = ARMErrorResponseBody & * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ - parsedBody: ARMErrorResponseBody; + parsedBody: ConfigData; }; }; @@ -466,6 +552,7 @@ export type ConfigurationsListByResourceGroupResponse = ConfigurationListResult * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -476,7 +563,7 @@ export type ConfigurationsListByResourceGroupResponse = ConfigurationListResult /** * Contains response data for the createInResourceGroup operation. */ -export type ConfigurationsCreateInResourceGroupResponse = ARMErrorResponseBody & { +export type ConfigurationsCreateInResourceGroupResponse = ConfigData & { /** * The underlying HTTP response. */ @@ -485,10 +572,11 @@ export type ConfigurationsCreateInResourceGroupResponse = ARMErrorResponseBody & * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ - parsedBody: ARMErrorResponseBody; + parsedBody: ConfigData; }; }; @@ -504,6 +592,7 @@ export type ConfigurationsListBySubscriptionNextResponse = ConfigurationListResu * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -538,6 +627,7 @@ export type RecommendationsListResponse = ResourceRecommendationBaseListResult & * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -557,6 +647,7 @@ export type RecommendationsGetResponse = ResourceRecommendationBase & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -576,6 +667,7 @@ export type RecommendationsListNextResponse = ResourceRecommendationBaseListResu * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -595,6 +687,7 @@ export type OperationsListResponse = OperationEntityListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -614,6 +707,7 @@ export type OperationsListNextResponse = OperationEntityListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -633,6 +727,7 @@ export type SuppressionsGetResponse = SuppressionContract & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -652,6 +747,7 @@ export type SuppressionsCreateResponse = SuppressionContract & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -671,6 +767,7 @@ export type SuppressionsListResponse = SuppressionContractListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -690,6 +787,7 @@ export type SuppressionsListNextResponse = SuppressionContractListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ diff --git a/sdk/advisor/arm-advisor/src/models/mappers.ts b/sdk/advisor/arm-advisor/src/models/mappers.ts index ffd0fb954f60..3b400dfca404 100644 --- a/sdk/advisor/arm-advisor/src/models/mappers.ts +++ b/sdk/advisor/arm-advisor/src/models/mappers.ts @@ -1,11 +1,9 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; @@ -14,38 +12,33 @@ import * as msRest from "@azure/ms-rest-js"; export const CloudError = CloudErrorMapper; export const BaseResource = BaseResourceMapper; -export const ConfigDataProperties: msRest.CompositeMapper = { - serializedName: "ConfigData_properties", +export const MetadataSupportedValueDetail: msRest.CompositeMapper = { + serializedName: "MetadataSupportedValueDetail", type: { name: "Composite", - className: "ConfigDataProperties", + className: "MetadataSupportedValueDetail", modelProperties: { - exclude: { - serializedName: "exclude", + id: { + serializedName: "id", type: { - name: "Boolean" + name: "String" } }, - lowCpuThreshold: { - serializedName: "low_cpu_threshold", + displayName: { + serializedName: "displayName", type: { name: "String" } } - }, - additionalProperties: { - type: { - name: "Object" - } } } }; -export const ConfigData: msRest.CompositeMapper = { - serializedName: "ConfigData", +export const MetadataEntity: msRest.CompositeMapper = { + serializedName: "MetadataEntity", type: { name: "Composite", - className: "ConfigData", + className: "MetadataEntity", modelProperties: { id: { serializedName: "id", @@ -65,14 +58,42 @@ export const ConfigData: msRest.CompositeMapper = { name: "String" } }, - properties: { - serializedName: "properties", + displayName: { + serializedName: "properties.displayName", type: { - name: "Composite", - className: "ConfigDataProperties", - additionalProperties: { + name: "String" + } + }, + dependsOn: { + serializedName: "properties.dependsOn", + type: { + name: "Sequence", + element: { type: { - name: "Object" + name: "String" + } + } + } + }, + applicableScenarios: { + serializedName: "properties.applicableScenarios", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + supportedValues: { + serializedName: "properties.supportedValues", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetadataSupportedValueDetail" } } } @@ -81,42 +102,49 @@ export const ConfigData: msRest.CompositeMapper = { } }; -export const ARMErrorResponseBody: msRest.CompositeMapper = { - serializedName: "ARMErrorResponseBody", +export const DigestConfig: msRest.CompositeMapper = { + serializedName: "DigestConfig", type: { name: "Composite", - className: "ARMErrorResponseBody", + className: "DigestConfig", modelProperties: { - message: { - serializedName: "message", + name: { + serializedName: "name", type: { name: "String" } }, - code: { - serializedName: "code", + actionGroupResourceId: { + serializedName: "actionGroupResourceId", type: { name: "String" } - } - } - } -}; - -export const ShortDescription: msRest.CompositeMapper = { - serializedName: "ShortDescription", - type: { - name: "Composite", - className: "ShortDescription", - modelProperties: { - problem: { - serializedName: "problem", + }, + frequency: { + serializedName: "frequency", + type: { + name: "Number" + } + }, + categories: { + serializedName: "categories", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + language: { + serializedName: "language", type: { name: "String" } }, - solution: { - serializedName: "solution", + state: { + serializedName: "state", type: { name: "String" } @@ -156,6 +184,102 @@ export const Resource: msRest.CompositeMapper = { } }; +export const ConfigData: msRest.CompositeMapper = { + serializedName: "ConfigData", + type: { + name: "Composite", + className: "ConfigData", + modelProperties: { + ...Resource.type.modelProperties, + exclude: { + serializedName: "properties.exclude", + type: { + name: "Boolean" + } + }, + lowCpuThreshold: { + serializedName: "properties.lowCpuThreshold", + type: { + name: "String" + } + }, + digests: { + serializedName: "properties.digests", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DigestConfig" + } + } + } + } + } + } +}; + +export const ARMErrorResponseBody: msRest.CompositeMapper = { + serializedName: "ARMErrorResponseBody", + type: { + name: "Composite", + className: "ARMErrorResponseBody", + modelProperties: { + message: { + serializedName: "message", + type: { + name: "String" + } + }, + code: { + serializedName: "code", + type: { + name: "String" + } + } + } + } +}; + +export const ArmErrorResponse: msRest.CompositeMapper = { + serializedName: "ArmErrorResponse", + type: { + name: "Composite", + className: "ArmErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ARMErrorResponseBody" + } + } + } + } +}; + +export const ShortDescription: msRest.CompositeMapper = { + serializedName: "ShortDescription", + type: { + name: "Composite", + className: "ShortDescription", + modelProperties: { + problem: { + serializedName: "problem", + type: { + name: "String" + } + }, + solution: { + serializedName: "solution", + type: { + name: "String" + } + } + } + } +}; + export const ResourceRecommendationBase: msRest.CompositeMapper = { serializedName: "ResourceRecommendationBase", type: { @@ -351,6 +475,34 @@ export const RecommendationsGenerateHeaders: msRest.CompositeMapper = { } }; +export const MetadataEntityListResult: msRest.CompositeMapper = { + serializedName: "MetadataEntityListResult", + type: { + name: "Composite", + className: "MetadataEntityListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetadataEntity" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + export const ConfigurationListResult: msRest.CompositeMapper = { serializedName: "ConfigurationListResult", type: { diff --git a/sdk/advisor/arm-advisor/src/models/operationsMappers.ts b/sdk/advisor/arm-advisor/src/models/operationsMappers.ts index aba5d8bf047b..c83dbeabcc21 100644 --- a/sdk/advisor/arm-advisor/src/models/operationsMappers.ts +++ b/sdk/advisor/arm-advisor/src/models/operationsMappers.ts @@ -1,17 +1,14 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { - OperationEntityListResult, - OperationEntity, + CloudError, OperationDisplayInfo, - CloudError + OperationEntity, + OperationEntityListResult } from "../models/mappers"; - diff --git a/sdk/advisor/arm-advisor/src/models/parameters.ts b/sdk/advisor/arm-advisor/src/models/parameters.ts index 4c86c5e6de44..0a32fd06e64c 100644 --- a/sdk/advisor/arm-advisor/src/models/parameters.ts +++ b/sdk/advisor/arm-advisor/src/models/parameters.ts @@ -30,6 +30,18 @@ export const apiVersion: msRest.OperationQueryParameter = { } } }; +export const configurationName: msRest.OperationURLParameter = { + parameterPath: "configurationName", + mapper: { + required: true, + isConstant: true, + serializedName: "configurationName", + defaultValue: 'default', + type: { + name: "String" + } + } +}; export const filter: msRest.OperationQueryParameter = { parameterPath: [ "options", diff --git a/sdk/advisor/arm-advisor/src/models/recommendationMetadataMappers.ts b/sdk/advisor/arm-advisor/src/models/recommendationMetadataMappers.ts new file mode 100644 index 000000000000..fca081125f33 --- /dev/null +++ b/sdk/advisor/arm-advisor/src/models/recommendationMetadataMappers.ts @@ -0,0 +1,15 @@ +/* + * 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. + */ + +export { + ARMErrorResponseBody, + CloudError, + MetadataEntity, + MetadataEntityListResult, + MetadataSupportedValueDetail +} from "../models/mappers"; diff --git a/sdk/advisor/arm-advisor/src/models/recommendationsMappers.ts b/sdk/advisor/arm-advisor/src/models/recommendationsMappers.ts index f7c5c9df26b7..72b442cbec33 100644 --- a/sdk/advisor/arm-advisor/src/models/recommendationsMappers.ts +++ b/sdk/advisor/arm-advisor/src/models/recommendationsMappers.ts @@ -1,21 +1,20 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { - RecommendationsGenerateHeaders, + BaseResource, CloudError, - ResourceRecommendationBaseListResult, - ResourceRecommendationBase, + ConfigData, + DigestConfig, + RecommendationsGenerateHeaders, Resource, - BaseResource, + ResourceRecommendationBase, + ResourceRecommendationBaseListResult, ShortDescription, SuppressionContract } from "../models/mappers"; - diff --git a/sdk/advisor/arm-advisor/src/models/suppressionsMappers.ts b/sdk/advisor/arm-advisor/src/models/suppressionsMappers.ts index dd0d5a4133d7..d9ee58600432 100644 --- a/sdk/advisor/arm-advisor/src/models/suppressionsMappers.ts +++ b/sdk/advisor/arm-advisor/src/models/suppressionsMappers.ts @@ -1,20 +1,19 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { - SuppressionContract, - Resource, BaseResource, CloudError, - SuppressionContractListResult, + ConfigData, + DigestConfig, + Resource, ResourceRecommendationBase, - ShortDescription + ShortDescription, + SuppressionContract, + SuppressionContractListResult } from "../models/mappers"; - diff --git a/sdk/advisor/arm-advisor/src/operations/configurations.ts b/sdk/advisor/arm-advisor/src/operations/configurations.ts index 91d1ae84a445..9ea34dae1bff 100644 --- a/sdk/advisor/arm-advisor/src/operations/configurations.ts +++ b/sdk/advisor/arm-advisor/src/operations/configurations.ts @@ -65,14 +65,14 @@ export class Configurations { * @param configContract The Azure Advisor configuration data structure. * @param callback The callback */ - createInSubscription(configContract: Models.ConfigData, callback: msRest.ServiceCallback): void; + createInSubscription(configContract: Models.ConfigData, callback: msRest.ServiceCallback): void; /** * @param configContract The Azure Advisor configuration data structure. * @param options The optional parameters * @param callback The callback */ - createInSubscription(configContract: Models.ConfigData, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createInSubscription(configContract: Models.ConfigData, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createInSubscription(configContract: Models.ConfigData, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createInSubscription(configContract: Models.ConfigData, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { configContract, @@ -123,15 +123,15 @@ export class Configurations { * @param resourceGroup The name of the Azure resource group. * @param callback The callback */ - createInResourceGroup(configContract: Models.ConfigData, resourceGroup: string, callback: msRest.ServiceCallback): void; + createInResourceGroup(configContract: Models.ConfigData, resourceGroup: string, callback: msRest.ServiceCallback): void; /** * @param configContract The Azure Advisor configuration data structure. * @param resourceGroup The name of the Azure resource group. * @param options The optional parameters * @param callback The callback */ - createInResourceGroup(configContract: Models.ConfigData, resourceGroup: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createInResourceGroup(configContract: Models.ConfigData, resourceGroup: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createInResourceGroup(configContract: Models.ConfigData, resourceGroup: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createInResourceGroup(configContract: Models.ConfigData, resourceGroup: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { configContract, @@ -192,7 +192,7 @@ const listBySubscriptionOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ConfigurationListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ArmErrorResponse } }, serializer @@ -200,9 +200,10 @@ const listBySubscriptionOperationSpec: msRest.OperationSpec = { const createInSubscriptionOperationSpec: msRest.OperationSpec = { httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Advisor/configurations", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Advisor/configurations/{configurationName}", urlParameters: [ - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.configurationName ], queryParameters: [ Parameters.apiVersion @@ -218,12 +219,11 @@ const createInSubscriptionOperationSpec: msRest.OperationSpec = { } }, responses: { - 204: {}, - 400: { - bodyMapper: Mappers.ARMErrorResponseBody + 200: { + bodyMapper: Mappers.ConfigData }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ArmErrorResponse } }, serializer @@ -247,7 +247,7 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ConfigurationListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ArmErrorResponse } }, serializer @@ -255,9 +255,10 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { const createInResourceGroupOperationSpec: msRest.OperationSpec = { httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Advisor/configurations", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Advisor/configurations/{configurationName}", urlParameters: [ Parameters.subscriptionId, + Parameters.configurationName, Parameters.resourceGroup ], queryParameters: [ @@ -274,12 +275,11 @@ const createInResourceGroupOperationSpec: msRest.OperationSpec = { } }, responses: { - 204: {}, - 400: { - bodyMapper: Mappers.ARMErrorResponseBody + 200: { + bodyMapper: Mappers.ConfigData }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ArmErrorResponse } }, serializer @@ -300,7 +300,7 @@ const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ConfigurationListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ArmErrorResponse } }, serializer diff --git a/sdk/advisor/arm-advisor/src/operations/index.ts b/sdk/advisor/arm-advisor/src/operations/index.ts index 0b5134141fb7..1b2399089695 100644 --- a/sdk/advisor/arm-advisor/src/operations/index.ts +++ b/sdk/advisor/arm-advisor/src/operations/index.ts @@ -8,6 +8,7 @@ * regenerated. */ +export * from "./recommendationMetadata"; export * from "./configurations"; export * from "./recommendations"; export * from "./operations"; diff --git a/sdk/advisor/arm-advisor/src/operations/recommendationMetadata.ts b/sdk/advisor/arm-advisor/src/operations/recommendationMetadata.ts new file mode 100644 index 000000000000..487abe86bdca --- /dev/null +++ b/sdk/advisor/arm-advisor/src/operations/recommendationMetadata.ts @@ -0,0 +1,177 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/recommendationMetadataMappers"; +import * as Parameters from "../models/parameters"; +import { AdvisorManagementClientContext } from "../advisorManagementClientContext"; + +/** Class representing a RecommendationMetadata. */ +export class RecommendationMetadata { + private readonly client: AdvisorManagementClientContext; + + /** + * Create a RecommendationMetadata. + * @param {AdvisorManagementClientContext} client Reference to the service client. + */ + constructor(client: AdvisorManagementClientContext) { + this.client = client; + } + + /** + * @summary Gets the metadata entity. + * @param name Name of metadata entity. + * @param [options] The optional parameters + * @returns Promise + */ + get(name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param name Name of metadata entity. + * @param callback The callback + */ + get(name: string, callback: msRest.ServiceCallback): void; + /** + * @param name Name of metadata entity. + * @param options The optional parameters + * @param callback The callback + */ + get(name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + name, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * @summary Gets the list of metadata entities. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * @summary Gets the list of metadata entities. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Advisor/metadata/{name}", + urlParameters: [ + Parameters.name + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.MetadataEntity + }, + 404: { + bodyMapper: Mappers.ARMErrorResponseBody + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Advisor/metadata", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.MetadataEntityListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.MetadataEntityListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/advisor/arm-advisor/tsconfig.json b/sdk/advisor/arm-advisor/tsconfig.json index 87bbf5b5fa49..422b584abd5e 100644 --- a/sdk/advisor/arm-advisor/tsconfig.json +++ b/sdk/advisor/arm-advisor/tsconfig.json @@ -9,7 +9,7 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6"], + "lib": ["es6", "dom"], "declaration": true, "outDir": "./esm", "importHelpers": true