diff --git a/sdk/azurestackhci/arm-azurestackhci/README.md b/sdk/azurestackhci/arm-azurestackhci/README.md index 54ed8d33c65a..fac5b4edcb48 100644 --- a/sdk/azurestackhci/arm-azurestackhci/README.md +++ b/sdk/azurestackhci/arm-azurestackhci/README.md @@ -15,7 +15,7 @@ npm install @azure/arm-azurestackhci ### How to use -#### nodejs - Authentication, client creation and list operations as an example written in TypeScript. +#### nodejs - client creation and list operations as an example written in TypeScript. ##### Install @azure/ms-rest-nodeauth @@ -26,11 +26,10 @@ npm install @azure/ms-rest-nodeauth@"^3.0.0" ##### Sample code +While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package ```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"; -import { AzureStackHCIClient, AzureStackHCIModels, AzureStackHCIMappers } from "@azure/arm-azurestackhci"; +const msRestNodeAuth = require("@azure/ms-rest-nodeauth"); +const { AzureStackHCIClient } = require("@azure/arm-azurestackhci"); const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; msRestNodeAuth.interactiveLogin().then((creds) => { diff --git a/sdk/azurestackhci/arm-azurestackhci/rollup.config.js b/sdk/azurestackhci/arm-azurestackhci/rollup.config.js index 06178ceba9e5..1cc256bfcd8d 100644 --- a/sdk/azurestackhci/arm-azurestackhci/rollup.config.js +++ b/sdk/azurestackhci/arm-azurestackhci/rollup.config.js @@ -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. diff --git a/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClient.ts b/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClient.ts index 1d411dcbd664..ceb5a7ab46ea 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClient.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClient.ts @@ -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 diff --git a/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClientContext.ts b/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClientContext.ts index b820335844ca..b79e06541b16 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClientContext.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClientContext.ts @@ -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 @@ -44,7 +43,7 @@ export class AzureStackHCIClientContext extends msRestAzure.AzureServiceClient { super(credentials, options); - this.apiVersion = '2020-03-01-preview'; + this.apiVersion = '2020-10-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; diff --git a/sdk/azurestackhci/arm-azurestackhci/src/models/clustersMappers.ts b/sdk/azurestackhci/arm-azurestackhci/src/models/clustersMappers.ts index 5eff99898d82..df6d40ff7553 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/models/clustersMappers.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/models/clustersMappers.ts @@ -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. @@ -15,8 +15,8 @@ export { ClusterReportedProperties, ClusterUpdate, ErrorAdditionalInfo, + ErrorDetail, ErrorResponse, - ErrorResponseError, ProxyResource, Resource, TrackedResource diff --git a/sdk/azurestackhci/arm-azurestackhci/src/models/index.ts b/sdk/azurestackhci/arm-azurestackhci/src/models/index.ts index a72c11439ebe..f7b9b6a06cee 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/models/index.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/models/index.ts @@ -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. @@ -94,11 +94,11 @@ export interface ClusterReportedProperties { } /** - * An interface representing Resource. + * Common fields that are returned in the response for all Azure Resource Manager resources */ export interface Resource extends BaseResource { /** - * Fully qualified resource Id for the resource. Ex - + * Fully qualified resource ID for the resource. Ex - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} * **NOTE: This property will not be serialized. It can only be populated by the server.** */ @@ -109,15 +109,15 @@ export interface Resource extends BaseResource { */ readonly name?: string; /** - * The type of the resource. Ex- Microsoft.Compute/virtualMachines or - * Microsoft.Storage/storageAccounts. + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + * "Microsoft.Storage/storageAccounts" * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly type?: string; } /** - * The resource model definition for a ARM tracked top level resource + * The resource model definition for an Azure Resource Manager tracked top level resource */ export interface TrackedResource extends Resource { /** @@ -264,14 +264,14 @@ export interface AvailableOperations { } /** - * The resource model definition for a ARM proxy resource. It will have everything other than - * required location and tags + * The resource model definition for an Azure Resource Manager proxy resource. It will have + * everything other than required location and tags */ export interface ProxyResource extends Resource { } /** - * The resource model definition for a Azure Resource Manager resource with an etag. + * The resource model definition for an Azure Resource Manager resource with an etag. */ export interface AzureEntityResource extends Resource { /** @@ -298,9 +298,9 @@ export interface ErrorAdditionalInfo { } /** - * The error object. + * The error detail. */ -export interface ErrorResponseError { +export interface ErrorDetail { /** * The error code. * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -320,7 +320,7 @@ export interface ErrorResponseError { * The error details. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly details?: ErrorResponse[]; + readonly details?: ErrorDetail[]; /** * The error additional info. * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -329,13 +329,15 @@ export interface ErrorResponseError { } /** - * The resource management error response. + * Common error response for all Azure Resource Manager APIs to return error details for failed + * operations. (This also follows the OData error response format.). + * @summary Error response */ export interface ErrorResponse { /** * The error object. */ - error?: ErrorResponseError; + error?: ErrorDetail; } /** @@ -406,9 +408,9 @@ export type OperationsListResponse = AvailableOperations & { }; /** - * Contains response data for the list operation. + * Contains response data for the listBySubscription operation. */ -export type ClustersListResponse = ClusterList & { +export type ClustersListBySubscriptionResponse = ClusterList & { /** * The underlying HTTP response. */ @@ -506,9 +508,9 @@ export type ClustersUpdateResponse = Cluster & { }; /** - * Contains response data for the listNext operation. + * Contains response data for the listBySubscriptionNext operation. */ -export type ClustersListNextResponse = ClusterList & { +export type ClustersListBySubscriptionNextResponse = ClusterList & { /** * The underlying HTTP response. */ diff --git a/sdk/azurestackhci/arm-azurestackhci/src/models/mappers.ts b/sdk/azurestackhci/arm-azurestackhci/src/models/mappers.ts index 79dcf481ddc1..2c67801ccb2d 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/models/mappers.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/models/mappers.ts @@ -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. @@ -461,11 +461,11 @@ export const ErrorAdditionalInfo: msRest.CompositeMapper = { } }; -export const ErrorResponseError: msRest.CompositeMapper = { - serializedName: "ErrorResponse_error", +export const ErrorDetail: msRest.CompositeMapper = { + serializedName: "ErrorDetail", type: { name: "Composite", - className: "ErrorResponseError", + className: "ErrorDetail", modelProperties: { code: { readOnly: true, @@ -496,7 +496,7 @@ export const ErrorResponseError: msRest.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorResponse" + className: "ErrorDetail" } } } @@ -528,7 +528,7 @@ export const ErrorResponse: msRest.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorResponseError" + className: "ErrorDetail" } } } diff --git a/sdk/azurestackhci/arm-azurestackhci/src/models/operationsMappers.ts b/sdk/azurestackhci/arm-azurestackhci/src/models/operationsMappers.ts index ee870560220e..78fc7c1d897a 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/models/operationsMappers.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/models/operationsMappers.ts @@ -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. @@ -9,8 +9,8 @@ export { AvailableOperations, ErrorAdditionalInfo, + ErrorDetail, ErrorResponse, - ErrorResponseError, OperationDetail, OperationDisplay } from "../models/mappers"; diff --git a/sdk/azurestackhci/arm-azurestackhci/src/models/parameters.ts b/sdk/azurestackhci/arm-azurestackhci/src/models/parameters.ts index 2d791ec70bf2..18411882dc94 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/models/parameters.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/models/parameters.ts @@ -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 diff --git a/sdk/azurestackhci/arm-azurestackhci/src/operations/clusters.ts b/sdk/azurestackhci/arm-azurestackhci/src/operations/clusters.ts index 154cb11025a8..5bb260748499 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/operations/clusters.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/operations/clusters.ts @@ -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 @@ -29,25 +28,25 @@ export class Clusters { /** * List all HCI clusters in a subscription. * @param [options] The optional parameters - * @returns Promise + * @returns Promise */ - list(options?: msRest.RequestOptionsBase): Promise; + listBySubscription(options?: msRest.RequestOptionsBase): Promise; /** * @param callback The callback */ - list(callback: msRest.ServiceCallback): void; + listBySubscription(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 { + listBySubscription(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBySubscription(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { options }, - listOperationSpec, - callback) as Promise; + listBySubscriptionOperationSpec, + callback) as Promise; } /** @@ -214,28 +213,28 @@ export class Clusters { * List all HCI clusters in a subscription. * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters - * @returns Promise + * @returns Promise */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listBySubscriptionNext(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; + listBySubscriptionNext(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 { + listBySubscriptionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, options }, - listNextOperationSpec, - callback) as Promise; + listBySubscriptionNextOperationSpec, + callback) as Promise; } /** @@ -269,7 +268,7 @@ export class Clusters { // Operation Specifications const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const listBySubscriptionOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/clusters", urlParameters: [ @@ -434,13 +433,16 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { serializer }; -const listNextOperationSpec: msRest.OperationSpec = { +const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", path: "{nextLink}", urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], @@ -462,6 +464,9 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/azurestackhci/arm-azurestackhci/src/operations/index.ts b/sdk/azurestackhci/arm-azurestackhci/src/operations/index.ts index a0c122fdd7b8..f26d281d136e 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/operations/index.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/operations/index.ts @@ -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 diff --git a/sdk/azurestackhci/arm-azurestackhci/src/operations/operations.ts b/sdk/azurestackhci/arm-azurestackhci/src/operations/operations.ts index 5ed4e1a70696..ec1c2a225cd3 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/operations/operations.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/operations/operations.ts @@ -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