From 6b9670713fdef33ec1d52f574d2a0557c2b65b5a Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Mon, 5 Oct 2020 19:28:52 +0000 Subject: [PATCH] Generated from c80a4d2c529a04e64d7340010447f466ab4fa09e --- .../arm-azurestackhci/LICENSE.txt | 21 + sdk/azurestackhci/arm-azurestackhci/README.md | 99 +++ .../arm-azurestackhci/package.json | 58 ++ .../arm-azurestackhci/rollup.config.js | 37 ++ .../src/azureStackHCIClient.ts | 44 ++ .../src/azureStackHCIClientContext.ts | 62 ++ .../src/models/clustersMappers.ts | 23 + .../arm-azurestackhci/src/models/index.ts | 546 +++++++++++++++++ .../arm-azurestackhci/src/models/mappers.ts | 565 ++++++++++++++++++ .../src/models/operationsMappers.ts | 16 + .../src/models/parameters.ts | 84 +++ .../src/operations/clusters.ts | 477 +++++++++++++++ .../arm-azurestackhci/src/operations/index.ts | 12 + .../src/operations/operations.ts | 74 +++ .../arm-azurestackhci/tsconfig.json | 19 + 15 files changed, 2137 insertions(+) create mode 100644 sdk/azurestackhci/arm-azurestackhci/LICENSE.txt create mode 100644 sdk/azurestackhci/arm-azurestackhci/README.md create mode 100644 sdk/azurestackhci/arm-azurestackhci/package.json create mode 100644 sdk/azurestackhci/arm-azurestackhci/rollup.config.js create mode 100644 sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClient.ts create mode 100644 sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClientContext.ts create mode 100644 sdk/azurestackhci/arm-azurestackhci/src/models/clustersMappers.ts create mode 100644 sdk/azurestackhci/arm-azurestackhci/src/models/index.ts create mode 100644 sdk/azurestackhci/arm-azurestackhci/src/models/mappers.ts create mode 100644 sdk/azurestackhci/arm-azurestackhci/src/models/operationsMappers.ts create mode 100644 sdk/azurestackhci/arm-azurestackhci/src/models/parameters.ts create mode 100644 sdk/azurestackhci/arm-azurestackhci/src/operations/clusters.ts create mode 100644 sdk/azurestackhci/arm-azurestackhci/src/operations/index.ts create mode 100644 sdk/azurestackhci/arm-azurestackhci/src/operations/operations.ts create mode 100644 sdk/azurestackhci/arm-azurestackhci/tsconfig.json diff --git a/sdk/azurestackhci/arm-azurestackhci/LICENSE.txt b/sdk/azurestackhci/arm-azurestackhci/LICENSE.txt new file mode 100644 index 000000000000..ea8fb1516028 --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2020 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/sdk/azurestackhci/arm-azurestackhci/README.md b/sdk/azurestackhci/arm-azurestackhci/README.md new file mode 100644 index 000000000000..54ed8d33c65a --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/README.md @@ -0,0 +1,99 @@ +## Azure AzureStackHCIClient SDK for JavaScript + +This package contains an isomorphic SDK for AzureStackHCIClient. + +### Currently supported environments + +- Node.js version 6.x.x or higher +- Browser JavaScript + +### How to Install + +```bash +npm install @azure/arm-azurestackhci +``` + +### How to use + +#### nodejs - Authentication, client creation and list operations as an example written in TypeScript. + +##### Install @azure/ms-rest-nodeauth + +- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. +```bash +npm install @azure/ms-rest-nodeauth@"^3.0.0" +``` + +##### Sample code + +```typescript +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; +import { AzureStackHCIClient, AzureStackHCIModels, AzureStackHCIMappers } from "@azure/arm-azurestackhci"; +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new AzureStackHCIClient(creds, subscriptionId); + client.operations.list().then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.error(err); +}); +``` + +#### browser - Authentication, client creation and list operations as an example written in JavaScript. + +##### Install @azure/ms-rest-browserauth + +```bash +npm install @azure/ms-rest-browserauth +``` + +##### Sample code + +See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. + +- index.html +```html + + + + @azure/arm-azurestackhci sample + + + + + + + + +``` + +## Related projects + +- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/azurestackhci/arm-azurestackhci/README.png) diff --git a/sdk/azurestackhci/arm-azurestackhci/package.json b/sdk/azurestackhci/arm-azurestackhci/package.json new file mode 100644 index 000000000000..95df5ac728c2 --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/package.json @@ -0,0 +1,58 @@ +{ + "name": "@azure/arm-azurestackhci", + "author": "Microsoft Corporation", + "description": "AzureStackHCIClient Library with typescript type definitions for node.js and browser.", + "version": "1.0.0", + "dependencies": { + "@azure/ms-rest-azure-js": "^2.0.1", + "@azure/ms-rest-js": "^2.0.4", + "tslib": "^1.10.0" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/arm-azurestackhci.js", + "module": "./esm/azureStackHCIClient.js", + "types": "./esm/azureStackHCIClient.d.ts", + "devDependencies": { + "typescript": "^3.5.3", + "rollup": "^1.18.0", + "rollup-plugin-node-resolve": "^5.2.0", + "rollup-plugin-sourcemaps": "^0.4.2", + "uglify-js": "^3.6.0" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/azurestackhci/arm-azurestackhci", + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.d.ts.map", + "esm/**/*.js", + "esm/**/*.js.map", + "esm/**/*.d.ts", + "esm/**/*.d.ts.map", + "src/**/*.ts", + "README.md", + "rollup.config.js", + "tsconfig.json" + ], + "scripts": { + "build": "tsc && rollup -c rollup.config.js && npm run minify", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-azurestackhci.js.map'\" -o ./dist/arm-azurestackhci.min.js ./dist/arm-azurestackhci.js", + "prepack": "npm install && npm run build" + }, + "sideEffects": false, + "autoPublish": true +} diff --git a/sdk/azurestackhci/arm-azurestackhci/rollup.config.js b/sdk/azurestackhci/arm-azurestackhci/rollup.config.js new file mode 100644 index 000000000000..06178ceba9e5 --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/rollup.config.js @@ -0,0 +1,37 @@ +import rollup from "rollup"; +import nodeResolve from "rollup-plugin-node-resolve"; +import sourcemaps from "rollup-plugin-sourcemaps"; + +/** + * @type {rollup.RollupFileOptions} + */ +const config = { + input: "./esm/azureStackHCIClient.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], + output: { + file: "./dist/arm-azurestackhci.js", + format: "umd", + name: "Azure.ArmAzurestackhci", + sourcemap: true, + globals: { + "@azure/ms-rest-js": "msRest", + "@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. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */` + }, + plugins: [ + nodeResolve({ mainFields: ['module', 'main'] }), + sourcemaps() + ] +}; + +export default config; diff --git a/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClient.ts b/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClient.ts new file mode 100644 index 000000000000..1d411dcbd664 --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClient.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "./models"; +import * as Mappers from "./models/mappers"; +import * as operations from "./operations"; +import { AzureStackHCIClientContext } from "./azureStackHCIClientContext"; + + +class AzureStackHCIClient extends AzureStackHCIClientContext { + // Operation groups + operations: operations.Operations; + clusters: operations.Clusters; + + /** + * Initializes a new instance of the AzureStackHCIClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The ID of the target subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.AzureStackHCIClientOptions) { + super(credentials, subscriptionId, options); + this.operations = new operations.Operations(this); + this.clusters = new operations.Clusters(this); + } +} + +// Operation Specifications + +export { + AzureStackHCIClient, + AzureStackHCIClientContext, + Models as AzureStackHCIModels, + Mappers as AzureStackHCIMappers +}; +export * from "./operations"; diff --git a/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClientContext.ts b/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClientContext.ts new file mode 100644 index 000000000000..54500e56f2f7 --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClientContext.ts @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as Models from "./models"; +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; + +const packageName = "@azure/arm-azurestackhci"; +const packageVersion = "1.0.0"; + +export class AzureStackHCIClientContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials; + apiVersion?: string; + subscriptionId: string; + + /** + * Initializes a new instance of the AzureStackHCIClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The ID of the target subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.AzureStackHCIClientOptions) { + if (credentials == undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId == undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) { + options = {}; + } + if(!options.userAgent) { + const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + + super(credentials, options); + + this.apiVersion = '2020-10-01'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; + this.requestContentType = "application/json; charset=utf-8"; + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + } +} diff --git a/sdk/azurestackhci/arm-azurestackhci/src/models/clustersMappers.ts b/sdk/azurestackhci/arm-azurestackhci/src/models/clustersMappers.ts new file mode 100644 index 000000000000..5eff99898d82 --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/src/models/clustersMappers.ts @@ -0,0 +1,23 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + AzureEntityResource, + BaseResource, + Cluster, + ClusterList, + ClusterNode, + ClusterReportedProperties, + ClusterUpdate, + ErrorAdditionalInfo, + ErrorResponse, + ErrorResponseError, + 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 new file mode 100644 index 000000000000..4b08ededa377 --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/src/models/index.ts @@ -0,0 +1,546 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export { BaseResource, CloudError }; + +/** + * Cluster node details. + */ +export interface ClusterNode { + /** + * Name of the cluster node. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * Id of the node in the cluster. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: number; + /** + * Manufacturer of the cluster node hardware. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly manufacturer?: string; + /** + * Model name of the cluster node hardware. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly model?: string; + /** + * Operating system running on the cluster node. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly osName?: string; + /** + * Version of the operating system running on the cluster node. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly osVersion?: string; + /** + * Immutable id of the cluster node. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly serialNumber?: string; + /** + * Number of physical cores on the cluster node. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly coreCount?: number; + /** + * Total available memory on the cluster node (in GiB). + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly memoryInGiB?: number; +} + +/** + * Properties reported by cluster agent. + */ +export interface ClusterReportedProperties { + /** + * Name of the on-prem cluster connected to this resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly clusterName?: string; + /** + * Unique id generated by the on-prem cluster. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly clusterId?: string; + /** + * Version of the cluster software. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly clusterVersion?: string; + /** + * List of nodes reported by the cluster. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nodes?: ClusterNode[]; + /** + * Last time the cluster reported the data. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly lastUpdated?: Date; +} + +/** + * An interface representing 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. Ex- Microsoft.Compute/virtualMachines or + * Microsoft.Storage/storageAccounts. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; +} + +/** + * The resource model definition for a ARM tracked top level resource + */ +export interface TrackedResource extends Resource { + /** + * Resource tags. + */ + tags?: { [propertyName: string]: string }; + /** + * The geo-location where the resource lives + */ + location: string; +} + +/** + * Cluster details. + */ +export interface Cluster extends TrackedResource { + /** + * Provisioning state. 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; + /** + * Status of the cluster agent. Possible values include: 'NotYetRegistered', 'ConnectedRecently', + * 'NotConnectedRecently', 'Disconnected', 'Error' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly status?: Status; + /** + * Unique, immutable resource id. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly cloudId?: string; + /** + * App id of cluster AAD identity. + */ + aadClientId: string; + /** + * Tenant id of cluster AAD identity. + */ + aadTenantId: string; + /** + * Properties reported by cluster agent. + */ + 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.** + */ + readonly trialDaysRemaining?: number; + /** + * Type of billing applied to the resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly billingModel?: string; + /** + * First cluster sync timestamp. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly registrationTimestamp?: Date; + /** + * Most recent cluster sync timestamp. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly lastSyncTimestamp?: Date; + /** + * Most recent billing meter timestamp. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly lastBillingTimestamp?: Date; +} + +/** + * Cluster details to update. + */ +export interface ClusterUpdate { + /** + * Resource tags. + */ + tags?: { [propertyName: string]: string }; +} + +/** + * Operation display payload + */ +export interface OperationDisplay { + /** + * Resource provider of the operation + */ + provider?: string; + /** + * Resource of the operation + */ + resource?: string; + /** + * Localized friendly name for the operation + */ + operation?: string; + /** + * Localized friendly description for the operation + */ + description?: string; +} + +/** + * Operation detail payload + */ +export interface OperationDetail { + /** + * Name of the operation + */ + name?: string; + /** + * Indicates whether the operation is a data action + */ + isDataAction?: boolean; + /** + * Display of the operation + */ + display?: OperationDisplay; + /** + * Origin of the operation + */ + origin?: string; + /** + * Properties of the operation + */ + properties?: any; +} + +/** + * Available operations of the service + */ +export interface AvailableOperations { + /** + * Collection of available operation details + */ + value?: OperationDetail[]; + /** + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + 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 { + /** + * 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 object. + */ +export interface ErrorResponseError { + /** + * 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?: ErrorResponse[]; + /** + * The error additional info. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** + * The resource management error response. + */ +export interface ErrorResponse { + /** + * The error object. + */ + error?: ErrorResponseError; +} + +/** + * Optional Parameters. + */ +export interface ClustersUpdateOptionalParams extends msRest.RequestOptionsBase { + /** + * Resource tags. + */ + tags?: { [propertyName: string]: string }; +} + +/** + * An interface representing AzureStackHCIClientOptions. + */ +export interface AzureStackHCIClientOptions extends AzureServiceClientOptions { + baseUri?: string; +} + +/** + * @interface + * List of clusters. + * @extends Array + */ +export interface ClusterList 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 ProvisioningState. + * Possible values include: 'Succeeded', 'Failed', 'Canceled', 'Accepted', 'Provisioning' + * @readonly + * @enum {string} + */ +export type ProvisioningState = 'Succeeded' | 'Failed' | 'Canceled' | 'Accepted' | 'Provisioning'; + +/** + * Defines values for Status. + * Possible values include: 'NotYetRegistered', 'ConnectedRecently', 'NotConnectedRecently', + * 'Disconnected', 'Error' + * @readonly + * @enum {string} + */ +export type Status = 'NotYetRegistered' | 'ConnectedRecently' | 'NotConnectedRecently' | 'Disconnected' | 'Error'; + +/** + * Contains response data for the list operation. + */ +export type OperationsListResponse = AvailableOperations & { + /** + * 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: AvailableOperations; + }; +}; + +/** + * Contains response data for the listBySubscription operation. + */ +export type ClustersListBySubscriptionResponse = ClusterList & { + /** + * 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: ClusterList; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type ClustersListByResourceGroupResponse = ClusterList & { + /** + * 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: ClusterList; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type ClustersGetResponse = Cluster & { + /** + * 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: Cluster; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type ClustersCreateResponse = Cluster & { + /** + * 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: Cluster; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type ClustersUpdateResponse = Cluster & { + /** + * 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: Cluster; + }; +}; + +/** + * Contains response data for the listBySubscriptionNext operation. + */ +export type ClustersListBySubscriptionNextResponse = ClusterList & { + /** + * 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: ClusterList; + }; +}; + +/** + * Contains response data for the listByResourceGroupNext operation. + */ +export type ClustersListByResourceGroupNextResponse = ClusterList & { + /** + * 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: ClusterList; + }; +}; diff --git a/sdk/azurestackhci/arm-azurestackhci/src/models/mappers.ts b/sdk/azurestackhci/arm-azurestackhci/src/models/mappers.ts new file mode 100644 index 000000000000..79dcf481ddc1 --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/src/models/mappers.ts @@ -0,0 +1,565 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export const CloudError = CloudErrorMapper; +export const BaseResource = BaseResourceMapper; + +export const ClusterNode: msRest.CompositeMapper = { + serializedName: "ClusterNode", + type: { + name: "Composite", + className: "ClusterNode", + modelProperties: { + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + id: { + readOnly: true, + serializedName: "id", + type: { + name: "Number" + } + }, + manufacturer: { + readOnly: true, + serializedName: "manufacturer", + type: { + name: "String" + } + }, + model: { + readOnly: true, + serializedName: "model", + type: { + name: "String" + } + }, + osName: { + readOnly: true, + serializedName: "osName", + type: { + name: "String" + } + }, + osVersion: { + readOnly: true, + serializedName: "osVersion", + type: { + name: "String" + } + }, + serialNumber: { + readOnly: true, + serializedName: "serialNumber", + type: { + name: "String" + } + }, + coreCount: { + readOnly: true, + serializedName: "coreCount", + type: { + name: "Number" + } + }, + memoryInGiB: { + readOnly: true, + serializedName: "memoryInGiB", + type: { + name: "Number" + } + } + } + } +}; + +export const ClusterReportedProperties: msRest.CompositeMapper = { + serializedName: "ClusterReportedProperties", + type: { + name: "Composite", + className: "ClusterReportedProperties", + modelProperties: { + clusterName: { + readOnly: true, + serializedName: "clusterName", + type: { + name: "String" + } + }, + clusterId: { + readOnly: true, + serializedName: "clusterId", + type: { + name: "String" + } + }, + clusterVersion: { + readOnly: true, + serializedName: "clusterVersion", + type: { + name: "String" + } + }, + nodes: { + readOnly: true, + serializedName: "nodes", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ClusterNode" + } + } + } + }, + lastUpdated: { + readOnly: true, + serializedName: "lastUpdated", + type: { + name: "DateTime" + } + } + } + } +}; + +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 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 Cluster: msRest.CompositeMapper = { + serializedName: "Cluster", + type: { + name: "Composite", + className: "Cluster", + modelProperties: { + ...TrackedResource.type.modelProperties, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + status: { + readOnly: true, + serializedName: "properties.status", + type: { + name: "String" + } + }, + cloudId: { + readOnly: true, + serializedName: "properties.cloudId", + type: { + name: "String" + } + }, + aadClientId: { + required: true, + serializedName: "properties.aadClientId", + type: { + name: "String" + } + }, + aadTenantId: { + required: true, + serializedName: "properties.aadTenantId", + type: { + name: "String" + } + }, + reportedProperties: { + serializedName: "properties.reportedProperties", + type: { + name: "Composite", + className: "ClusterReportedProperties" + } + }, + trialDaysRemaining: { + readOnly: true, + serializedName: "properties.trialDaysRemaining", + type: { + name: "Number" + } + }, + billingModel: { + readOnly: true, + serializedName: "properties.billingModel", + type: { + name: "String" + } + }, + registrationTimestamp: { + readOnly: true, + serializedName: "properties.registrationTimestamp", + type: { + name: "DateTime" + } + }, + lastSyncTimestamp: { + readOnly: true, + serializedName: "properties.lastSyncTimestamp", + type: { + name: "DateTime" + } + }, + lastBillingTimestamp: { + readOnly: true, + serializedName: "properties.lastBillingTimestamp", + type: { + name: "DateTime" + } + } + } + } +}; + +export const ClusterUpdate: msRest.CompositeMapper = { + serializedName: "ClusterUpdate", + type: { + name: "Composite", + className: "ClusterUpdate", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const OperationDisplay: msRest.CompositeMapper = { + serializedName: "OperationDisplay", + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const OperationDetail: msRest.CompositeMapper = { + serializedName: "OperationDetail", + type: { + name: "Composite", + className: "OperationDetail", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + type: { + name: "Boolean" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Object" + } + } + } + } +}; + +export const AvailableOperations: msRest.CompositeMapper = { + serializedName: "AvailableOperations", + type: { + name: "Composite", + className: "AvailableOperations", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OperationDetail" + } + } + } + }, + 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", + 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 ErrorResponseError: msRest.CompositeMapper = { + serializedName: "ErrorResponse_error", + type: { + name: "Composite", + className: "ErrorResponseError", + 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: "ErrorResponse" + } + } + } + }, + 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: "ErrorResponseError" + } + } + } + } +}; + +export const ClusterList: msRest.CompositeMapper = { + serializedName: "ClusterList", + type: { + name: "Composite", + className: "ClusterList", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Cluster" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/azurestackhci/arm-azurestackhci/src/models/operationsMappers.ts b/sdk/azurestackhci/arm-azurestackhci/src/models/operationsMappers.ts new file mode 100644 index 000000000000..ee870560220e --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/src/models/operationsMappers.ts @@ -0,0 +1,16 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + AvailableOperations, + ErrorAdditionalInfo, + ErrorResponse, + ErrorResponseError, + OperationDetail, + OperationDisplay +} from "../models/mappers"; diff --git a/sdk/azurestackhci/arm-azurestackhci/src/models/parameters.ts b/sdk/azurestackhci/arm-azurestackhci/src/models/parameters.ts new file mode 100644 index 000000000000..2d791ec70bf2 --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/src/models/parameters.ts @@ -0,0 +1,84 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; + +export const acceptLanguage: msRest.OperationParameter = { + parameterPath: "acceptLanguage", + mapper: { + serializedName: "accept-language", + defaultValue: 'en-US', + type: { + name: "String" + } + } +}; +export const apiVersion: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + serializedName: "api-version", + constraints: { + MinLength: 1 + }, + type: { + name: "String" + } + } +}; +export const clusterName: msRest.OperationURLParameter = { + parameterPath: "clusterName", + mapper: { + required: true, + serializedName: "clusterName", + type: { + name: "String" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const resourceGroupName: msRest.OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + required: true, + serializedName: "resourceGroupName", + constraints: { + MaxLength: 90, + MinLength: 1, + Pattern: /^[-\w\._\(\)]+$/ + }, + type: { + name: "String" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + constraints: { + MinLength: 1 + }, + type: { + name: "String" + } + } +}; diff --git a/sdk/azurestackhci/arm-azurestackhci/src/operations/clusters.ts b/sdk/azurestackhci/arm-azurestackhci/src/operations/clusters.ts new file mode 100644 index 000000000000..ac2f6a1aa271 --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/src/operations/clusters.ts @@ -0,0 +1,477 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/clustersMappers"; +import * as Parameters from "../models/parameters"; +import { AzureStackHCIClientContext } from "../azureStackHCIClientContext"; + +/** Class representing a Clusters. */ +export class Clusters { + private readonly client: AzureStackHCIClientContext; + + /** + * Create a Clusters. + * @param {AzureStackHCIClientContext} client Reference to the service client. + */ + constructor(client: AzureStackHCIClientContext) { + this.client = client; + } + + /** + * List all HCI clusters in a subscription. + * @param [options] The optional parameters + * @returns Promise + */ + listBySubscription(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + listBySubscription(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listBySubscription(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBySubscription(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listBySubscriptionOperationSpec, + callback) as Promise; + } + + /** + * List all HCI clusters in a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + listByResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Get 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 + */ + get(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 + */ + get(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 + */ + get(resourceGroupName: string, clusterName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Create 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 + */ + create(resourceGroupName: string, clusterName: string, cluster: Models.Cluster, 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 + */ + create(resourceGroupName: string, clusterName: string, cluster: Models.Cluster, 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 + */ + create(resourceGroupName: string, clusterName: string, cluster: Models.Cluster, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + create(resourceGroupName: string, clusterName: string, cluster: Models.Cluster, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterName, + cluster, + options + }, + createOperationSpec, + callback) as Promise; + } + + /** + * 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 [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, clusterName: string, options?: Models.ClustersUpdateOptionalParams): 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 + */ + update(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 + */ + 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 { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterName, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Delete an 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 + */ + deleteMethod(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 + */ + deleteMethod(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 + */ + deleteMethod(resourceGroupName: string, clusterName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * 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 + */ + listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + 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 + */ + 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 + }, + listBySubscriptionNextOperationSpec, + callback) as Promise; + } + + /** + * List all HCI clusters in a resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByResourceGroupNext(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 + */ + listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByResourceGroupNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listBySubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/clusters", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ClusterList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ClusterList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Cluster + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const createOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "cluster", + mapper: { + ...Mappers.Cluster, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Cluster + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + tags: [ + "options", + "tags" + ] + }, + mapper: { + ...Mappers.ClusterUpdate, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Cluster + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ClusterList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ClusterList + }, + 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 new file mode 100644 index 000000000000..a0c122fdd7b8 --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/src/operations/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export * from "./operations"; +export * from "./clusters"; diff --git a/sdk/azurestackhci/arm-azurestackhci/src/operations/operations.ts b/sdk/azurestackhci/arm-azurestackhci/src/operations/operations.ts new file mode 100644 index 000000000000..5ed4e1a70696 --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/src/operations/operations.ts @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/operationsMappers"; +import * as Parameters from "../models/parameters"; +import { AzureStackHCIClientContext } from "../azureStackHCIClientContext"; + +/** Class representing a Operations. */ +export class Operations { + private readonly client: AzureStackHCIClientContext; + + /** + * Create a Operations. + * @param {AzureStackHCIClientContext} client Reference to the service client. + */ + constructor(client: AzureStackHCIClientContext) { + this.client = client; + } + + /** + * List all available Microsoft.AzureStackHCI provider operations + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.AzureStackHCI/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.AvailableOperations + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/azurestackhci/arm-azurestackhci/tsconfig.json b/sdk/azurestackhci/arm-azurestackhci/tsconfig.json new file mode 100644 index 000000000000..422b584abd5e --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es5", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": ["es6", "dom"], + "declaration": true, + "outDir": "./esm", + "importHelpers": true + }, + "include": ["./src/**/*.ts"], + "exclude": ["node_modules"] +}