From 1de7d1de4a02b143115ab70f98ee4106f39c2925 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 24 Jun 2021 08:02:46 +0000 Subject: [PATCH] CodeGen from PR 14967 in Azure/azure-rest-api-specs Merge b3f8852ee77a23db4d7c5031aff046a340a42b5e into 18aa5fc0a4aeb8d98b47d06c45ef5f551f9b7a81 --- .../arm-azurestackhci/LICENSE.txt | 2 +- sdk/azurestackhci/arm-azurestackhci/README.md | 21 +- .../arm-azurestackhci/package.json | 2 +- .../arm-azurestackhci/rollup.config.js | 4 +- .../src/azureStackHCIClient.ts | 13 +- .../src/azureStackHCIClientContext.ts | 15 +- .../src/models/arcSettingsMappers.ts | 26 + .../src/models/clustersMappers.ts | 12 +- .../src/models/extensionsMappers.ts | 26 + .../arm-azurestackhci/src/models/index.ts | 786 +++++++++++++++--- .../arm-azurestackhci/src/models/mappers.ts | 698 ++++++++++++---- .../src/models/operationsMappers.ts | 12 +- .../src/models/parameters.ts | 28 +- .../src/operations/arcSettings.ts | 341 ++++++++ .../src/operations/clusters.ts | 64 +- .../src/operations/extensions.ts | 435 ++++++++++ .../arm-azurestackhci/src/operations/index.ts | 9 +- .../src/operations/operations.ts | 13 +- 18 files changed, 2143 insertions(+), 364 deletions(-) create mode 100644 sdk/azurestackhci/arm-azurestackhci/src/models/arcSettingsMappers.ts create mode 100644 sdk/azurestackhci/arm-azurestackhci/src/models/extensionsMappers.ts create mode 100644 sdk/azurestackhci/arm-azurestackhci/src/operations/arcSettings.ts create mode 100644 sdk/azurestackhci/arm-azurestackhci/src/operations/extensions.ts diff --git a/sdk/azurestackhci/arm-azurestackhci/LICENSE.txt b/sdk/azurestackhci/arm-azurestackhci/LICENSE.txt index ea8fb1516028..2d3163745319 100644 --- a/sdk/azurestackhci/arm-azurestackhci/LICENSE.txt +++ b/sdk/azurestackhci/arm-azurestackhci/LICENSE.txt @@ -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 diff --git a/sdk/azurestackhci/arm-azurestackhci/README.md b/sdk/azurestackhci/arm-azurestackhci/README.md index 13116bde073e..cc28a602de6b 100644 --- a/sdk/azurestackhci/arm-azurestackhci/README.md +++ b/sdk/azurestackhci/arm-azurestackhci/README.md @@ -1,11 +1,11 @@ ## Azure AzureStackHCIClient SDK for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for AzureStackHCIClient. +This package contains an isomorphic SDK (runs both in node.js and in browsers) for AzureStackHCIClient. ### 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 @@ -21,7 +21,6 @@ Install both packages using the below command: ```bash npm install --save @azure/arm-azurestackhci @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. @@ -37,8 +36,7 @@ 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 list operations as an example written in JavaScript. +#### nodejs - Authentication, client creation, and listByCluster arcSettings as an example written in JavaScript. ##### Sample code @@ -51,8 +49,9 @@ const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; // Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead. const creds = new DefaultAzureCredential(); const client = new AzureStackHCIClient(creds, subscriptionId); - -client.operations.list().then((result) => { +const resourceGroupName = "testresourceGroupName"; +const clusterName = "testclusterName"; +client.arcSettings.listByCluster(resourceGroupName, clusterName).then((result) => { console.log("The result is:"); console.log(result); }).catch((err) => { @@ -61,7 +60,7 @@ client.operations.list().then((result) => { }); ``` -#### browser - Authentication, client creation, and list operations as an example written in JavaScript. +#### browser - Authentication, client creation, and listByCluster arcSettings as an example written in JavaScript. In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser. - See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser. @@ -86,10 +85,12 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t const credential = new InteractiveBrowserCredential( { clientId: "", - tenantId: "" + tenant: "" }); const client = new Azure.ArmAzurestackhci.AzureStackHCIClient(creds, subscriptionId); - client.operations.list().then((result) => { + const resourceGroupName = "testresourceGroupName"; + const clusterName = "testclusterName"; + client.arcSettings.listByCluster(resourceGroupName, clusterName).then((result) => { console.log("The result is:"); console.log(result); }).catch((err) => { diff --git a/sdk/azurestackhci/arm-azurestackhci/package.json b/sdk/azurestackhci/arm-azurestackhci/package.json index 2ac277230b0d..1406e3a30a9a 100644 --- a/sdk/azurestackhci/arm-azurestackhci/package.json +++ b/sdk/azurestackhci/arm-azurestackhci/package.json @@ -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/azurestackhci/arm-azurestackhci", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/azurestackhci/arm-azurestackhci", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" 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 d4f586397e73..276ff7113ca5 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 @@ -18,8 +17,10 @@ import { AzureStackHCIClientContext } from "./azureStackHCIClientContext"; class AzureStackHCIClient extends AzureStackHCIClientContext { // Operation groups - operations: operations.Operations; + arcSettings: operations.ArcSettings; clusters: operations.Clusters; + extensions: operations.Extensions; + operations: operations.Operations; /** * Initializes a new instance of the AzureStackHCIClient class. @@ -34,8 +35,10 @@ class AzureStackHCIClient extends AzureStackHCIClientContext { */ constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.AzureStackHCIClientOptions) { super(credentials, subscriptionId, options); - this.operations = new operations.Operations(this); + this.arcSettings = new operations.ArcSettings(this); this.clusters = new operations.Clusters(this); + this.extensions = new operations.Extensions(this); + this.operations = new operations.Operations(this); } } diff --git a/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClientContext.ts b/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClientContext.ts index 6a541775ad3f..dc6f52d8e5df 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 @@ -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-azurestackhci"; const packageVersion = "1.1.0"; @@ -43,14 +42,14 @@ export class AzureStackHCIClientContext extends msRestAzure.AzureServiceClient { if (!options) { options = {}; } - if(!options.userAgent) { + if (!options.userAgent) { const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; } super(credentials, options); - this.apiVersion = '2020-03-01-preview'; + this.apiVersion = '2021-01-01-preview'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; @@ -58,10 +57,10 @@ export class AzureStackHCIClientContext extends msRestAzure.AzureServiceClient { 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; } } diff --git a/sdk/azurestackhci/arm-azurestackhci/src/models/arcSettingsMappers.ts b/sdk/azurestackhci/arm-azurestackhci/src/models/arcSettingsMappers.ts new file mode 100644 index 000000000000..ab82d6e4d195 --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/src/models/arcSettingsMappers.ts @@ -0,0 +1,26 @@ +/* + * 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. + */ + +export { + ArcSetting, + ArcSettingList, + AzureEntityResource, + BaseResource, + Cluster, + ClusterNode, + ClusterReportedProperties, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + Extension, + PerNodeExtensionState, + PerNodeState, + ProxyResource, + Resource, + TrackedResource +} from "../models/mappers"; diff --git a/sdk/azurestackhci/arm-azurestackhci/src/models/clustersMappers.ts b/sdk/azurestackhci/arm-azurestackhci/src/models/clustersMappers.ts index 5eff99898d82..fb2560b80429 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/models/clustersMappers.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/models/clustersMappers.ts @@ -1,22 +1,26 @@ /* - * 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. */ export { + ArcSetting, AzureEntityResource, BaseResource, Cluster, ClusterList, ClusterNode, + ClusterPatch, ClusterReportedProperties, - ClusterUpdate, ErrorAdditionalInfo, + ErrorDetail, ErrorResponse, - ErrorResponseError, + Extension, + PerNodeExtensionState, + PerNodeState, ProxyResource, Resource, TrackedResource diff --git a/sdk/azurestackhci/arm-azurestackhci/src/models/extensionsMappers.ts b/sdk/azurestackhci/arm-azurestackhci/src/models/extensionsMappers.ts new file mode 100644 index 000000000000..e0bb16ba6468 --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/src/models/extensionsMappers.ts @@ -0,0 +1,26 @@ +/* + * 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. + */ + +export { + ArcSetting, + AzureEntityResource, + BaseResource, + Cluster, + ClusterNode, + ClusterReportedProperties, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + Extension, + ExtensionList, + PerNodeExtensionState, + PerNodeState, + ProxyResource, + Resource, + TrackedResource +} from "../models/mappers"; diff --git a/sdk/azurestackhci/arm-azurestackhci/src/models/index.ts b/sdk/azurestackhci/arm-azurestackhci/src/models/index.ts index a72c11439ebe..cb2006b7927a 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. @@ -11,6 +11,204 @@ import * as msRest from "@azure/ms-rest-js"; export { BaseResource, CloudError }; +/** + * Status of Arc agent for a particular node in HCI Cluster. + */ +export interface PerNodeState { + /** + * Name of the Node in HCI Cluster + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * Fully qualified resource ID for the Arc agent of this node. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly arcInstance?: string; + /** + * State of Arc agent in this node. Possible values include: 'NotSpecified', 'Error', + * 'Succeeded', 'Canceled', 'Failed', 'Connected', 'Disconnected', 'Deleted', 'Creating', + * 'Updating', 'Deleting', 'Moving' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly state?: NodeArcState; +} + +/** + * Common fields that are returned in the response for all Azure Resource Manager resources + * @summary Resource + */ +export interface Resource extends BaseResource { + /** + * 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.** + */ + readonly id?: string; + /** + * The name of the resource + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * 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 Azure Resource Manager proxy resource. It will not have tags + * and a location + * @summary Proxy Resource + */ +export interface ProxyResource extends Resource { +} + +/** + * ArcSetting details. + */ +export interface ArcSetting extends ProxyResource { + /** + * The identity that created the resource. + */ + createdBy?: string; + /** + * The type of identity that created the resource. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' + */ + createdByType?: CreatedByType; + /** + * The timestamp of resource creation (UTC). + */ + createdAt?: Date; + /** + * The identity that last modified the resource. + */ + lastModifiedBy?: string; + /** + * The type of identity that last modified the resource. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' + */ + lastModifiedByType?: CreatedByType; + /** + * The timestamp of resource last modification (UTC) + */ + lastModifiedAt?: Date; + /** + * Provisioning state of the ArcSetting proxy resource. Possible values include: 'Succeeded', + * 'Failed', 'Canceled', 'Accepted', 'Provisioning' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provisioningState?: ProvisioningState; + /** + * The resource group that hosts the Arc agents, ie. Hybrid Compute Machine resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly arcInstanceResourceGroup?: string; + /** + * Aggregate state of Arc agent across the nodes in this HCI cluster. Possible values include: + * 'NotSpecified', 'Error', 'Succeeded', 'Canceled', 'Failed', 'Connected', 'Disconnected', + * 'Deleted', 'Creating', 'Updating', 'Deleting', 'Moving', 'PartiallySucceeded', + * 'PartiallyConnected', 'InProgress' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly aggregateState?: ArcSettingAggregateState; + /** + * State of Arc agent in each of the nodes. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly perNodeDetails?: PerNodeState[]; +} + +/** + * The resource model definition for an Azure Resource Manager tracked top level resource which has + * 'tags' and a 'location' + * @summary Tracked Resource + */ +export interface TrackedResource extends Resource { + /** + * Resource tags. + */ + tags?: { [propertyName: string]: string }; + /** + * The geo-location where the resource lives + */ + location: string; +} + +/** + * The resource model definition for an Azure Resource Manager resource with an etag. + * @summary Entity Resource + */ +export interface AzureEntityResource extends Resource { + /** + * Resource Etag. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly etag?: string; +} + +/** + * The resource management error additional info. + */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * The additional info. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly info?: any; +} + +/** + * The error detail. + */ +export interface ErrorDetail { + /** + * The error code. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly code?: string; + /** + * The error message. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly message?: string; + /** + * The error target. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly target?: string; + /** + * The error details. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** + * 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?: ErrorDetail; +} + /** * Cluster node details. */ @@ -94,46 +292,35 @@ export interface ClusterReportedProperties { } /** - * An interface representing Resource. + * Cluster details. */ -export interface Resource extends BaseResource { +export interface Cluster extends TrackedResource { /** - * 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.** + * The identity that created the resource. */ - readonly id?: string; + createdBy?: string; /** - * The name of the resource - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The type of identity that created the resource. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' */ - readonly name?: string; + createdByType?: CreatedByType; /** - * The type of the resource. Ex- Microsoft.Compute/virtualMachines or - * Microsoft.Storage/storageAccounts. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The timestamp of resource creation (UTC). */ - readonly type?: string; -} - -/** - * The resource model definition for a ARM tracked top level resource - */ -export interface TrackedResource extends Resource { + createdAt?: Date; /** - * Resource tags. + * The identity that last modified the resource. */ - tags?: { [propertyName: string]: string }; + lastModifiedBy?: string; /** - * The geo-location where the resource lives + * The type of identity that last modified the resource. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' */ - location: string; -} - -/** - * Cluster details. - */ -export interface Cluster extends TrackedResource { + lastModifiedByType?: CreatedByType; + /** + * The timestamp of resource last modification (UTC) + */ + lastModifiedAt?: Date; /** * Provisioning state. Possible values include: 'Succeeded', 'Failed', 'Canceled', 'Accepted', * 'Provisioning' @@ -151,6 +338,10 @@ export interface Cluster extends TrackedResource { * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly cloudId?: string; + /** + * Endpoint configured for management from the Azure portal + */ + cloudManagementEndpoint?: string; /** * App id of cluster AAD identity. */ @@ -161,8 +352,9 @@ export interface Cluster extends TrackedResource { aadTenantId: string; /** * Properties reported by cluster agent. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - reportedProperties?: ClusterReportedProperties; + readonly reportedProperties?: ClusterReportedProperties; /** * Number of days remaining in the trial period. * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -193,159 +385,203 @@ export interface Cluster extends TrackedResource { /** * Cluster details to update. */ -export interface ClusterUpdate { +export interface ClusterPatch { /** * Resource tags. */ tags?: { [propertyName: string]: string }; + /** + * Endpoint configured for management from the Azure portal + */ + cloudManagementEndpoint?: string; } /** - * Operation display payload + * Status of Arc Extension for a particular node in HCI Cluster. */ -export interface OperationDisplay { - /** - * Resource provider of the operation - */ - provider?: string; +export interface PerNodeExtensionState { /** - * Resource of the operation + * Name of the node in HCI Cluster. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - resource?: string; + readonly name?: string; /** - * Localized friendly name for the operation + * Fully qualified resource ID for the particular Arc Extension on this node. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - operation?: string; + readonly extension?: string; /** - * Localized friendly description for the operation + * State of Arc Extension in this node. Possible values include: 'NotSpecified', 'Error', + * 'Succeeded', 'Canceled', 'Failed', 'Connected', 'Disconnected', 'Deleted', 'Creating', + * 'Updating', 'Deleting', 'Moving' + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - description?: string; + readonly state?: NodeExtensionState; } /** - * Operation detail payload + * Details of a particular extension in HCI Cluster. */ -export interface OperationDetail { +export interface Extension extends ProxyResource { /** - * Name of the operation + * The identity that created the resource. */ - name?: string; + createdBy?: string; /** - * Indicates whether the operation is a data action + * The type of identity that created the resource. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' */ - isDataAction?: boolean; + createdByType?: CreatedByType; /** - * Display of the operation + * The timestamp of resource creation (UTC). */ - display?: OperationDisplay; + createdAt?: Date; /** - * Origin of the operation + * The identity that last modified the resource. */ - origin?: string; + lastModifiedBy?: string; /** - * Properties of the operation + * The type of identity that last modified the resource. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' */ - properties?: any; -} - -/** - * Available operations of the service - */ -export interface AvailableOperations { + lastModifiedByType?: CreatedByType; /** - * Collection of available operation details + * The timestamp of resource last modification (UTC) */ - value?: OperationDetail[]; + lastModifiedAt?: Date; /** - * URL client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. + * Provisioning state of the Extension proxy resource. Possible values include: 'Succeeded', + * 'Failed', 'Canceled', 'Accepted', 'Provisioning' + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - nextLink?: string; -} - -/** - * The resource model definition for a ARM 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. - */ -export interface AzureEntityResource extends Resource { + readonly provisioningState?: ProvisioningState; /** - * Resource Etag. + * How the extension handler should be forced to update even if the extension configuration has + * not changed. + */ + forceUpdateTag?: string; + /** + * The name of the extension handler publisher. + */ + publisher?: string; + /** + * Specifies the type of the extension; an example is "CustomScriptExtension". + */ + extensionType?: string; + /** + * Specifies the version of the script handler. + */ + typeHandlerVersion?: string; + /** + * Indicates whether the extension should use a newer minor version if one is available at + * deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + */ + autoUpgradeMinorVersion?: boolean; + /** + * Json formatted public settings for the extension. + */ + settings?: any; + /** + * Protected settings (may contain secrets). + */ + protectedSettings?: any; + /** + * Aggregate state of Arc Extensions across the nodes in this HCI cluster. Possible values + * include: 'NotSpecified', 'Error', 'Succeeded', 'Canceled', 'Failed', 'Connected', + * 'Disconnected', 'Deleted', 'Creating', 'Updating', 'Deleting', 'Moving', 'PartiallySucceeded', + * 'PartiallyConnected', 'InProgress' * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly etag?: string; + readonly aggregateState?: ExtensionAggregateState; + /** + * State of Arc Extension in each of the nodes. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly perNodeExtensionDetails?: PerNodeExtensionState[]; } /** - * The resource management error additional info. + * Localized display information for this particular operation. */ -export interface ErrorAdditionalInfo { +export interface OperationDisplay { /** - * The additional info type. + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly type?: string; + readonly provider?: string; /** - * The additional info. + * The localized friendly name of the resource type related to this operation. E.g. "Virtual + * Machines" or "Job Schedule Collections". * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly info?: any; + readonly resource?: string; + /** + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create + * or Update Virtual Machine", "Restart Virtual Machine". + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly operation?: string; + /** + * The short, localized friendly description of the operation; suitable for tool tips and + * detailed views. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly description?: string; } /** - * The error object. + * Details of a REST API operation, returned from the Resource Provider Operations API + * @summary REST API Operation */ -export interface ErrorResponseError { +export interface Operation { /** - * The error code. + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly code?: string; + readonly name?: string; /** - * The error message. + * Whether the operation applies to data-plane. This is "true" for data-plane operations and + * "false" for ARM/control-plane operations. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly message?: string; + readonly isDataAction?: boolean; /** - * The error target. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Localized display information for this particular operation. */ - readonly target?: string; + display?: OperationDisplay; /** - * The error details. + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit + * logs UX. Default value is "user,system". Possible values include: 'user', 'system', + * 'user,system' * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly details?: ErrorResponse[]; + readonly origin?: Origin; /** - * The error additional info. + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * Possible values include: 'Internal' * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly actionType?: ActionType; } /** - * The resource management error response. + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link + * to get the next set of results. */ -export interface ErrorResponse { +export interface OperationListResult { /** - * The error object. + * List of operations supported by the resource provider + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - error?: ErrorResponseError; -} - -/** - * Optional Parameters. - */ -export interface ClustersUpdateOptionalParams extends msRest.RequestOptionsBase { + readonly value?: Operation[]; /** - * Resource tags. + * URL to get the next set of operation list results (if there are any). + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - tags?: { [propertyName: string]: string }; + readonly nextLink?: string; } /** @@ -355,6 +591,19 @@ export interface AzureStackHCIClientOptions extends AzureServiceClientOptions { baseUri?: string; } +/** + * @interface + * List of ArcSetting proxy resources for the HCI cluster. + * @extends Array + */ +export interface ArcSettingList extends Array { + /** + * Link to the next set of results. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + /** * @interface * List of clusters. @@ -368,6 +617,27 @@ export interface ClusterList extends Array { readonly nextLink?: string; } +/** + * @interface + * List of Extensions in HCI cluster. + * @extends Array + */ +export interface ExtensionList extends Array { + /** + * Link to the next set of results. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * Defines values for CreatedByType. + * Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + * @readonly + * @enum {string} + */ +export type CreatedByType = 'User' | 'Application' | 'ManagedIdentity' | 'Key'; + /** * Defines values for ProvisioningState. * Possible values include: 'Succeeded', 'Failed', 'Canceled', 'Accepted', 'Provisioning' @@ -376,6 +646,25 @@ export interface ClusterList extends Array { */ export type ProvisioningState = 'Succeeded' | 'Failed' | 'Canceled' | 'Accepted' | 'Provisioning'; +/** + * Defines values for ArcSettingAggregateState. + * Possible values include: 'NotSpecified', 'Error', 'Succeeded', 'Canceled', 'Failed', + * 'Connected', 'Disconnected', 'Deleted', 'Creating', 'Updating', 'Deleting', 'Moving', + * 'PartiallySucceeded', 'PartiallyConnected', 'InProgress' + * @readonly + * @enum {string} + */ +export type ArcSettingAggregateState = 'NotSpecified' | 'Error' | 'Succeeded' | 'Canceled' | 'Failed' | 'Connected' | 'Disconnected' | 'Deleted' | 'Creating' | 'Updating' | 'Deleting' | 'Moving' | 'PartiallySucceeded' | 'PartiallyConnected' | 'InProgress'; + +/** + * Defines values for NodeArcState. + * Possible values include: 'NotSpecified', 'Error', 'Succeeded', 'Canceled', 'Failed', + * 'Connected', 'Disconnected', 'Deleted', 'Creating', 'Updating', 'Deleting', 'Moving' + * @readonly + * @enum {string} + */ +export type NodeArcState = 'NotSpecified' | 'Error' | 'Succeeded' | 'Canceled' | 'Failed' | 'Connected' | 'Disconnected' | 'Deleted' | 'Creating' | 'Updating' | 'Deleting' | 'Moving'; + /** * Defines values for Status. * Possible values include: 'NotYetRegistered', 'ConnectedRecently', 'NotConnectedRecently', @@ -386,9 +675,44 @@ export type ProvisioningState = 'Succeeded' | 'Failed' | 'Canceled' | 'Accepted' export type Status = 'NotYetRegistered' | 'ConnectedRecently' | 'NotConnectedRecently' | 'Disconnected' | 'Error'; /** - * Contains response data for the list operation. + * Defines values for ExtensionAggregateState. + * Possible values include: 'NotSpecified', 'Error', 'Succeeded', 'Canceled', 'Failed', + * 'Connected', 'Disconnected', 'Deleted', 'Creating', 'Updating', 'Deleting', 'Moving', + * 'PartiallySucceeded', 'PartiallyConnected', 'InProgress' + * @readonly + * @enum {string} */ -export type OperationsListResponse = AvailableOperations & { +export type ExtensionAggregateState = 'NotSpecified' | 'Error' | 'Succeeded' | 'Canceled' | 'Failed' | 'Connected' | 'Disconnected' | 'Deleted' | 'Creating' | 'Updating' | 'Deleting' | 'Moving' | 'PartiallySucceeded' | 'PartiallyConnected' | 'InProgress'; + +/** + * Defines values for NodeExtensionState. + * Possible values include: 'NotSpecified', 'Error', 'Succeeded', 'Canceled', 'Failed', + * 'Connected', 'Disconnected', 'Deleted', 'Creating', 'Updating', 'Deleting', 'Moving' + * @readonly + * @enum {string} + */ +export type NodeExtensionState = 'NotSpecified' | 'Error' | 'Succeeded' | 'Canceled' | 'Failed' | 'Connected' | 'Disconnected' | 'Deleted' | 'Creating' | 'Updating' | 'Deleting' | 'Moving'; + +/** + * Defines values for Origin. + * Possible values include: 'user', 'system', 'user,system' + * @readonly + * @enum {string} + */ +export type Origin = 'user' | 'system' | 'user,system'; + +/** + * Defines values for ActionType. + * Possible values include: 'Internal' + * @readonly + * @enum {string} + */ +export type ActionType = 'Internal'; + +/** + * Contains response data for the listByCluster operation. + */ +export type ArcSettingsListByClusterResponse = ArcSettingList & { /** * The underlying HTTP response. */ @@ -401,14 +725,74 @@ export type OperationsListResponse = AvailableOperations & { /** * The response body as parsed JSON or XML */ - parsedBody: AvailableOperations; + parsedBody: ArcSettingList; }; }; /** - * Contains response data for the list operation. + * Contains response data for the get operation. + */ +export type ArcSettingsGetResponse = ArcSetting & { + /** + * 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: ArcSetting; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type ArcSettingsCreateResponse = ArcSetting & { + /** + * 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: ArcSetting; + }; +}; + +/** + * Contains response data for the listByClusterNext operation. */ -export type ClustersListResponse = ClusterList & { +export type ArcSettingsListByClusterNextResponse = ArcSettingList & { + /** + * 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: ArcSettingList; + }; +}; + +/** + * Contains response data for the listBySubscription operation. + */ +export type ClustersListBySubscriptionResponse = ClusterList & { /** * The underlying HTTP response. */ @@ -506,9 +890,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. */ @@ -544,3 +928,163 @@ export type ClustersListByResourceGroupNextResponse = ClusterList & { parsedBody: ClusterList; }; }; + +/** + * Contains response data for the listByArcSetting operation. + */ +export type ExtensionsListByArcSettingResponse = ExtensionList & { + /** + * 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: ExtensionList; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type ExtensionsGetResponse = Extension & { + /** + * 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: Extension; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type ExtensionsCreateResponse = Extension & { + /** + * 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: Extension; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type ExtensionsUpdateResponse = Extension & { + /** + * 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: Extension; + }; +}; + +/** + * Contains response data for the beginCreate operation. + */ +export type ExtensionsBeginCreateResponse = Extension & { + /** + * 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: Extension; + }; +}; + +/** + * Contains response data for the beginUpdate operation. + */ +export type ExtensionsBeginUpdateResponse = Extension & { + /** + * 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: Extension; + }; +}; + +/** + * Contains response data for the listByArcSettingNext operation. + */ +export type ExtensionsListByArcSettingNextResponse = ExtensionList & { + /** + * 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: ExtensionList; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type OperationsListResponse = OperationListResult & { + /** + * 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: OperationListResult; + }; +}; diff --git a/sdk/azurestackhci/arm-azurestackhci/src/models/mappers.ts b/sdk/azurestackhci/arm-azurestackhci/src/models/mappers.ts index 79dcf481ddc1..1052aaef1f97 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. @@ -12,6 +12,305 @@ import * as msRest from "@azure/ms-rest-js"; export const CloudError = CloudErrorMapper; export const BaseResource = BaseResourceMapper; +export const PerNodeState: msRest.CompositeMapper = { + serializedName: "PerNodeState", + type: { + name: "Composite", + className: "PerNodeState", + modelProperties: { + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + arcInstance: { + readOnly: true, + serializedName: "arcInstance", + type: { + name: "String" + } + }, + state: { + readOnly: true, + serializedName: "state", + type: { + name: "String" + } + } + } + } +}; + +export const Resource: msRest.CompositeMapper = { + serializedName: "Resource", + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const ProxyResource: msRest.CompositeMapper = { + serializedName: "ProxyResource", + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + +export const ArcSetting: msRest.CompositeMapper = { + serializedName: "ArcSetting", + type: { + name: "Composite", + className: "ArcSetting", + modelProperties: { + ...ProxyResource.type.modelProperties, + createdBy: { + serializedName: "systemData.createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "systemData.createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "systemData.createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "systemData.lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "systemData.lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "systemData.lastModifiedAt", + type: { + name: "DateTime" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + arcInstanceResourceGroup: { + readOnly: true, + serializedName: "properties.arcInstanceResourceGroup", + type: { + name: "String" + } + }, + aggregateState: { + readOnly: true, + serializedName: "properties.aggregateState", + type: { + name: "String" + } + }, + perNodeDetails: { + readOnly: true, + serializedName: "properties.perNodeDetails", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PerNodeState" + } + } + } + } + } + } +}; + +export const TrackedResource: msRest.CompositeMapper = { + serializedName: "TrackedResource", + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + location: { + required: true, + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const AzureEntityResource: msRest.CompositeMapper = { + serializedName: "AzureEntityResource", + type: { + name: "Composite", + className: "AzureEntityResource", + modelProperties: { + ...Resource.type.modelProperties, + etag: { + readOnly: true, + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const ErrorAdditionalInfo: msRest.CompositeMapper = { + serializedName: "ErrorAdditionalInfo", + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + info: { + readOnly: true, + serializedName: "info", + type: { + name: "Object" + } + } + } + } +}; + +export const ErrorDetail: msRest.CompositeMapper = { + serializedName: "ErrorDetail", + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + readOnly: true, + serializedName: "code", + type: { + name: "String" + } + }, + message: { + readOnly: true, + serializedName: "message", + type: { + name: "String" + } + }, + target: { + readOnly: true, + serializedName: "target", + type: { + name: "String" + } + }, + details: { + readOnly: true, + serializedName: "details", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + }, + additionalInfo: { + readOnly: true, + serializedName: "additionalInfo", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const ErrorResponse: msRest.CompositeMapper = { + serializedName: "ErrorResponse", + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + export const ClusterNode: msRest.CompositeMapper = { serializedName: "ClusterNode", type: { @@ -136,73 +435,49 @@ export const ClusterReportedProperties: msRest.CompositeMapper = { } }; -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const Cluster: msRest.CompositeMapper = { + serializedName: "Cluster", type: { name: "Composite", - className: "Resource", + className: "Cluster", modelProperties: { - id: { - readOnly: true, - serializedName: "id", + ...TrackedResource.type.modelProperties, + createdBy: { + serializedName: "systemData.createdBy", type: { name: "String" } }, - name: { - readOnly: true, - serializedName: "name", + createdByType: { + serializedName: "systemData.createdByType", type: { name: "String" } }, - type: { - readOnly: true, - serializedName: "type", + createdAt: { + serializedName: "systemData.createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "systemData.lastModifiedBy", type: { name: "String" } - } - } - } -}; - -export const TrackedResource: msRest.CompositeMapper = { - serializedName: "TrackedResource", - type: { - name: "Composite", - className: "TrackedResource", - modelProperties: { - ...Resource.type.modelProperties, - tags: { - serializedName: "tags", + }, + lastModifiedByType: { + serializedName: "systemData.lastModifiedByType", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "String" } }, - location: { - required: true, - serializedName: "location", + lastModifiedAt: { + serializedName: "systemData.lastModifiedAt", type: { - name: "String" + name: "DateTime" } - } - } - } -}; - -export const Cluster: msRest.CompositeMapper = { - serializedName: "Cluster", - type: { - name: "Composite", - className: "Cluster", - modelProperties: { - ...TrackedResource.type.modelProperties, + }, provisioningState: { readOnly: true, serializedName: "properties.provisioningState", @@ -224,6 +499,12 @@ export const Cluster: msRest.CompositeMapper = { name: "String" } }, + cloudManagementEndpoint: { + serializedName: "properties.cloudManagementEndpoint", + type: { + name: "String" + } + }, aadClientId: { required: true, serializedName: "properties.aadClientId", @@ -239,6 +520,7 @@ export const Cluster: msRest.CompositeMapper = { } }, reportedProperties: { + readOnly: true, serializedName: "properties.reportedProperties", type: { name: "Composite", @@ -284,11 +566,11 @@ export const Cluster: msRest.CompositeMapper = { } }; -export const ClusterUpdate: msRest.CompositeMapper = { - serializedName: "ClusterUpdate", +export const ClusterPatch: msRest.CompositeMapper = { + serializedName: "ClusterPatch", type: { name: "Composite", - className: "ClusterUpdate", + className: "ClusterPatch", modelProperties: { tags: { serializedName: "tags", @@ -300,36 +582,193 @@ export const ClusterUpdate: msRest.CompositeMapper = { } } } + }, + cloudManagementEndpoint: { + serializedName: "properties.cloudManagementEndpoint", + type: { + name: "String" + } + } + } + } +}; + +export const PerNodeExtensionState: msRest.CompositeMapper = { + serializedName: "PerNodeExtensionState", + type: { + name: "Composite", + className: "PerNodeExtensionState", + modelProperties: { + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + extension: { + readOnly: true, + serializedName: "extension", + type: { + name: "String" + } + }, + state: { + readOnly: true, + serializedName: "state", + type: { + name: "String" + } + } + } + } +}; + +export const Extension: msRest.CompositeMapper = { + serializedName: "Extension", + type: { + name: "Composite", + className: "Extension", + modelProperties: { + ...ProxyResource.type.modelProperties, + createdBy: { + serializedName: "systemData.createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "systemData.createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "systemData.createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "systemData.lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "systemData.lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "systemData.lastModifiedAt", + type: { + name: "DateTime" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + forceUpdateTag: { + serializedName: "properties.extensionParameters.forceUpdateTag", + type: { + name: "String" + } + }, + publisher: { + serializedName: "properties.extensionParameters.publisher", + type: { + name: "String" + } + }, + extensionType: { + serializedName: "properties.extensionParameters.type", + type: { + name: "String" + } + }, + typeHandlerVersion: { + serializedName: "properties.extensionParameters.typeHandlerVersion", + type: { + name: "String" + } + }, + autoUpgradeMinorVersion: { + serializedName: "properties.extensionParameters.autoUpgradeMinorVersion", + type: { + name: "Boolean" + } + }, + settings: { + serializedName: "properties.extensionParameters.settings", + type: { + name: "Object" + } + }, + protectedSettings: { + serializedName: "properties.extensionParameters.protectedSettings", + type: { + name: "Object" + } + }, + aggregateState: { + readOnly: true, + serializedName: "properties.aggregateState", + type: { + name: "String" + } + }, + perNodeExtensionDetails: { + readOnly: true, + serializedName: "properties.perNodeExtensionDetails", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PerNodeExtensionState" + } + } + } } } } }; export const OperationDisplay: msRest.CompositeMapper = { - serializedName: "OperationDisplay", + serializedName: "Operation_display", type: { name: "Composite", className: "OperationDisplay", modelProperties: { provider: { + readOnly: true, serializedName: "provider", type: { name: "String" } }, resource: { + readOnly: true, serializedName: "resource", type: { name: "String" } }, operation: { + readOnly: true, serializedName: "operation", type: { name: "String" } }, description: { + readOnly: true, serializedName: "description", type: { name: "String" @@ -339,19 +778,21 @@ export const OperationDisplay: msRest.CompositeMapper = { } }; -export const OperationDetail: msRest.CompositeMapper = { - serializedName: "OperationDetail", +export const Operation: msRest.CompositeMapper = { + serializedName: "Operation", type: { name: "Composite", - className: "OperationDetail", + className: "Operation", modelProperties: { name: { + readOnly: true, serializedName: "name", type: { name: "String" } }, isDataAction: { + readOnly: true, serializedName: "isDataAction", type: { name: "Boolean" @@ -365,70 +806,45 @@ export const OperationDetail: msRest.CompositeMapper = { } }, origin: { + readOnly: true, serializedName: "origin", type: { name: "String" } }, - properties: { - serializedName: "properties", + actionType: { + readOnly: true, + serializedName: "actionType", type: { - name: "Object" + name: "String" } } } } }; -export const AvailableOperations: msRest.CompositeMapper = { - serializedName: "AvailableOperations", +export const OperationListResult: msRest.CompositeMapper = { + serializedName: "OperationListResult", type: { name: "Composite", - className: "AvailableOperations", + className: "OperationListResult", modelProperties: { value: { + readOnly: true, serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "OperationDetail" + className: "Operation" } } } }, nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } -}; - -export const ProxyResource: msRest.CompositeMapper = { - serializedName: "ProxyResource", - type: { - name: "Composite", - className: "ProxyResource", - modelProperties: { - ...Resource.type.modelProperties - } - } -}; - -export const AzureEntityResource: msRest.CompositeMapper = { - serializedName: "AzureEntityResource", - type: { - name: "Composite", - className: "AzureEntityResource", - modelProperties: { - ...Resource.type.modelProperties, - etag: { readOnly: true, - serializedName: "etag", + serializedName: "nextLink", type: { name: "String" } @@ -437,118 +853,80 @@ export const AzureEntityResource: msRest.CompositeMapper = { } }; -export const ErrorAdditionalInfo: msRest.CompositeMapper = { - serializedName: "ErrorAdditionalInfo", +export const ArcSettingList: msRest.CompositeMapper = { + serializedName: "ArcSettingList", type: { name: "Composite", - className: "ErrorAdditionalInfo", + className: "ArcSettingList", modelProperties: { - type: { + value: { readOnly: true, - serializedName: "type", + serializedName: "", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ArcSetting" + } + } } }, - info: { + nextLink: { readOnly: true, - serializedName: "info", + serializedName: "nextLink", type: { - name: "Object" + name: "String" } } } } }; -export const ErrorResponseError: msRest.CompositeMapper = { - serializedName: "ErrorResponse_error", +export const ClusterList: msRest.CompositeMapper = { + serializedName: "ClusterList", type: { name: "Composite", - className: "ErrorResponseError", + className: "ClusterList", modelProperties: { - code: { - readOnly: true, - serializedName: "code", - type: { - name: "String" - } - }, - message: { - readOnly: true, - serializedName: "message", - type: { - name: "String" - } - }, - target: { - readOnly: true, - serializedName: "target", - type: { - name: "String" - } - }, - details: { - readOnly: true, - serializedName: "details", + value: { + serializedName: "", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ErrorResponse" + className: "Cluster" } } } }, - additionalInfo: { + nextLink: { readOnly: true, - serializedName: "additionalInfo", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } -}; - -export const ErrorResponse: msRest.CompositeMapper = { - serializedName: "ErrorResponse", - type: { - name: "Composite", - className: "ErrorResponse", - modelProperties: { - error: { - serializedName: "error", + serializedName: "nextLink", type: { - name: "Composite", - className: "ErrorResponseError" + name: "String" } } } } }; -export const ClusterList: msRest.CompositeMapper = { - serializedName: "ClusterList", +export const ExtensionList: msRest.CompositeMapper = { + serializedName: "ExtensionList", type: { name: "Composite", - className: "ClusterList", + className: "ExtensionList", modelProperties: { value: { + readOnly: true, serializedName: "", type: { name: "Sequence", element: { type: { name: "Composite", - className: "Cluster" + className: "Extension" } } } diff --git a/sdk/azurestackhci/arm-azurestackhci/src/models/operationsMappers.ts b/sdk/azurestackhci/arm-azurestackhci/src/models/operationsMappers.ts index ee870560220e..fddc3077d64b 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/models/operationsMappers.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/models/operationsMappers.ts @@ -1,16 +1,16 @@ /* - * 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. */ export { - AvailableOperations, ErrorAdditionalInfo, + ErrorDetail, ErrorResponse, - ErrorResponseError, - OperationDetail, - OperationDisplay + Operation, + OperationDisplay, + OperationListResult } 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..e1ba7f4a4192 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 @@ -33,6 +32,16 @@ export const apiVersion: msRest.OperationQueryParameter = { } } }; +export const arcSettingName: msRest.OperationURLParameter = { + parameterPath: "arcSettingName", + mapper: { + required: true, + serializedName: "arcSettingName", + type: { + name: "String" + } + } +}; export const clusterName: msRest.OperationURLParameter = { parameterPath: "clusterName", mapper: { @@ -43,6 +52,16 @@ export const clusterName: msRest.OperationURLParameter = { } } }; +export const extensionName: msRest.OperationURLParameter = { + parameterPath: "extensionName", + mapper: { + required: true, + serializedName: "extensionName", + type: { + name: "String" + } + } +}; export const nextPageLink: msRest.OperationURLParameter = { parameterPath: "nextPageLink", mapper: { @@ -61,8 +80,7 @@ export const resourceGroupName: msRest.OperationURLParameter = { serializedName: "resourceGroupName", constraints: { MaxLength: 90, - MinLength: 1, - Pattern: /^[-\w\._\(\)]+$/ + MinLength: 1 }, type: { name: "String" diff --git a/sdk/azurestackhci/arm-azurestackhci/src/operations/arcSettings.ts b/sdk/azurestackhci/arm-azurestackhci/src/operations/arcSettings.ts new file mode 100644 index 000000000000..acec8b7551ce --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/src/operations/arcSettings.ts @@ -0,0 +1,341 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/arcSettingsMappers"; +import * as Parameters from "../models/parameters"; +import { AzureStackHCIClientContext } from "../azureStackHCIClientContext"; + +/** Class representing a ArcSettings. */ +export class ArcSettings { + private readonly client: AzureStackHCIClientContext; + + /** + * Create a ArcSettings. + * @param {AzureStackHCIClientContext} client Reference to the service client. + */ + constructor(client: AzureStackHCIClientContext) { + this.client = client; + } + + /** + * Get ArcSetting resources of HCI Cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param [options] The optional parameters + * @returns Promise + */ + listByCluster(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param callback The callback + */ + listByCluster(resourceGroupName: string, clusterName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param options The optional parameters + * @param callback The callback + */ + listByCluster(resourceGroupName: string, clusterName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByCluster(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterName, + options + }, + listByClusterOperationSpec, + callback) as Promise; + } + + /** + * Get ArcSetting resource details of HCI Cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting + * information. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, clusterName: string, arcSettingName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting + * information. + * @param callback The callback + */ + get(resourceGroupName: string, clusterName: string, arcSettingName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting + * information. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, clusterName: string, arcSettingName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, clusterName: string, arcSettingName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterName, + arcSettingName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Create ArcSetting for HCI cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting + * information. + * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. + * @param [options] The optional parameters + * @returns Promise + */ + create(resourceGroupName: string, clusterName: string, arcSettingName: string, arcSetting: Models.ArcSetting, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting + * information. + * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. + * @param callback The callback + */ + create(resourceGroupName: string, clusterName: string, arcSettingName: string, arcSetting: Models.ArcSetting, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting + * information. + * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. + * @param options The optional parameters + * @param callback The callback + */ + create(resourceGroupName: string, clusterName: string, arcSettingName: string, arcSetting: Models.ArcSetting, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + create(resourceGroupName: string, clusterName: string, arcSettingName: string, arcSetting: Models.ArcSetting, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterName, + arcSettingName, + arcSetting, + options + }, + createOperationSpec, + callback) as Promise; + } + + /** + * Delete ArcSetting resource details of HCI Cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting + * information. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, clusterName: string, arcSettingName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,clusterName,arcSettingName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Delete ArcSetting resource details of HCI Cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting + * information. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, clusterName: string, arcSettingName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + clusterName, + arcSettingName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * Get ArcSetting resources of HCI Cluster. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByClusterNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByClusterNext(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 + */ + listByClusterNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByClusterNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByClusterNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listByClusterOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ArcSettingList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.arcSettingName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ArcSetting + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const createOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.arcSettingName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "arcSetting", + mapper: { + ...Mappers.ArcSetting, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ArcSetting + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.arcSettingName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByClusterNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ArcSettingList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/azurestackhci/arm-azurestackhci/src/operations/clusters.ts b/sdk/azurestackhci/arm-azurestackhci/src/operations/clusters.ts index 154cb11025a8..3fedb4dde2cc 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; } /** @@ -150,28 +149,32 @@ export class Clusters { * Update an HCI cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. + * @param cluster Details of the HCI cluster. * @param [options] The optional parameters * @returns Promise */ - update(resourceGroupName: string, clusterName: string, options?: Models.ClustersUpdateOptionalParams): Promise; + update(resourceGroupName: string, clusterName: string, cluster: Models.ClusterPatch, options?: msRest.RequestOptionsBase): Promise; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. + * @param cluster Details of the HCI cluster. * @param callback The callback */ - update(resourceGroupName: string, clusterName: string, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, clusterName: string, cluster: Models.ClusterPatch, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. + * @param cluster Details of the HCI cluster. * @param options The optional parameters * @param callback The callback */ - update(resourceGroupName: string, clusterName: string, options: Models.ClustersUpdateOptionalParams, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, clusterName: string, options?: Models.ClustersUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update(resourceGroupName: string, clusterName: string, cluster: Models.ClusterPatch, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, clusterName: string, cluster: Models.ClusterPatch, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, clusterName, + cluster, options }, updateOperationSpec, @@ -214,28 +217,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 +272,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: [ @@ -388,14 +391,9 @@ const updateOperationSpec: msRest.OperationSpec = { Parameters.acceptLanguage ], requestBody: { - parameterPath: { - tags: [ - "options", - "tags" - ] - }, + parameterPath: "cluster", mapper: { - ...Mappers.ClusterUpdate, + ...Mappers.ClusterPatch, required: true } }, @@ -434,13 +432,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 +463,9 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/azurestackhci/arm-azurestackhci/src/operations/extensions.ts b/sdk/azurestackhci/arm-azurestackhci/src/operations/extensions.ts new file mode 100644 index 000000000000..96e664ad8845 --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/src/operations/extensions.ts @@ -0,0 +1,435 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/extensionsMappers"; +import * as Parameters from "../models/parameters"; +import { AzureStackHCIClientContext } from "../azureStackHCIClientContext"; + +/** Class representing a Extensions. */ +export class Extensions { + private readonly client: AzureStackHCIClientContext; + + /** + * Create a Extensions. + * @param {AzureStackHCIClientContext} client Reference to the service client. + */ + constructor(client: AzureStackHCIClientContext) { + this.client = client; + } + + /** + * List all Extensions under ArcSetting resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting + * information. + * @param [options] The optional parameters + * @returns Promise + */ + listByArcSetting(resourceGroupName: string, clusterName: string, arcSettingName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting + * information. + * @param callback The callback + */ + listByArcSetting(resourceGroupName: string, clusterName: string, arcSettingName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting + * information. + * @param options The optional parameters + * @param callback The callback + */ + listByArcSetting(resourceGroupName: string, clusterName: string, arcSettingName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByArcSetting(resourceGroupName: string, clusterName: string, arcSettingName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterName, + arcSettingName, + options + }, + listByArcSettingOperationSpec, + callback) as Promise; + } + + /** + * Get particular Arc Extension of HCI Cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting + * information. + * @param extensionName The name of the machine extension. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, clusterName: string, arcSettingName: string, extensionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting + * information. + * @param extensionName The name of the machine extension. + * @param callback The callback + */ + get(resourceGroupName: string, clusterName: string, arcSettingName: string, extensionName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting + * information. + * @param extensionName The name of the machine extension. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, clusterName: string, arcSettingName: string, extensionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, clusterName: string, arcSettingName: string, extensionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterName, + arcSettingName, + extensionName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Create Extension for HCI cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting + * information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param [options] The optional parameters + * @returns Promise + */ + create(resourceGroupName: string, clusterName: string, arcSettingName: string, extensionName: string, extension: Models.Extension, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreate(resourceGroupName,clusterName,arcSettingName,extensionName,extension,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Update Extension for HCI cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting + * information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, clusterName: string, arcSettingName: string, extensionName: string, extension: Models.Extension, options?: msRest.RequestOptionsBase): Promise { + return this.beginUpdate(resourceGroupName,clusterName,arcSettingName,extensionName,extension,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Delete particular Arc Extension of HCI Cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting + * information. + * @param extensionName The name of the machine extension. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, clusterName: string, arcSettingName: string, extensionName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,clusterName,arcSettingName,extensionName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Create Extension for HCI cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting + * information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreate(resourceGroupName: string, clusterName: string, arcSettingName: string, extensionName: string, extension: Models.Extension, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + clusterName, + arcSettingName, + extensionName, + extension, + options + }, + beginCreateOperationSpec, + options); + } + + /** + * Update Extension for HCI cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting + * information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param [options] The optional parameters + * @returns Promise + */ + beginUpdate(resourceGroupName: string, clusterName: string, arcSettingName: string, extensionName: string, extension: Models.Extension, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + clusterName, + arcSettingName, + extensionName, + extension, + options + }, + beginUpdateOperationSpec, + options); + } + + /** + * Delete particular Arc Extension of HCI Cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting + * information. + * @param extensionName The name of the machine extension. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, clusterName: string, arcSettingName: string, extensionName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + clusterName, + arcSettingName, + extensionName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * List all Extensions under ArcSetting resource. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByArcSettingNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByArcSettingNext(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 + */ + listByArcSettingNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByArcSettingNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByArcSettingNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listByArcSettingOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.arcSettingName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ExtensionList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.arcSettingName, + Parameters.extensionName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Extension + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginCreateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.arcSettingName, + Parameters.extensionName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "extension", + mapper: { + ...Mappers.Extension, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Extension + }, + 201: { + bodyMapper: Mappers.Extension + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.arcSettingName, + Parameters.extensionName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "extension", + mapper: { + ...Mappers.Extension, + required: true + } + }, + responses: { + 201: { + bodyMapper: Mappers.Extension + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.arcSettingName, + Parameters.extensionName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByArcSettingNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ExtensionList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/azurestackhci/arm-azurestackhci/src/operations/index.ts b/sdk/azurestackhci/arm-azurestackhci/src/operations/index.ts index a0c122fdd7b8..fbd2509168ba 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/operations/index.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/operations/index.ts @@ -1,12 +1,13 @@ /* - * 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. */ -export * from "./operations"; +export * from "./arcSettings"; export * from "./clusters"; +export * from "./extensions"; +export * from "./operations"; diff --git a/sdk/azurestackhci/arm-azurestackhci/src/operations/operations.ts b/sdk/azurestackhci/arm-azurestackhci/src/operations/operations.ts index 5ed4e1a70696..f3170c23c4b2 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 @@ -35,13 +34,13 @@ export class Operations { /** * @param callback The callback */ - list(callback: msRest.ServiceCallback): void; + 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 { + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { options @@ -64,7 +63,7 @@ const listOperationSpec: msRest.OperationSpec = { ], responses: { 200: { - bodyMapper: Mappers.AvailableOperations + bodyMapper: Mappers.OperationListResult }, default: { bodyMapper: Mappers.ErrorResponse