diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index aea2d1a63669..81ae2b670853 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -19,6 +19,7 @@ specifiers: '@rush-temp/arm-authorization': file:./projects/arm-authorization.tgz '@rush-temp/arm-avs': file:./projects/arm-avs.tgz '@rush-temp/arm-azurestack': file:./projects/arm-azurestack.tgz + '@rush-temp/arm-azurestackhci': file:./projects/arm-azurestackhci.tgz '@rush-temp/arm-batch': file:./projects/arm-batch.tgz '@rush-temp/arm-billing': file:./projects/arm-billing.tgz '@rush-temp/arm-botservice': file:./projects/arm-botservice.tgz @@ -205,6 +206,7 @@ dependencies: '@rush-temp/arm-authorization': file:projects/arm-authorization.tgz '@rush-temp/arm-avs': file:projects/arm-avs.tgz '@rush-temp/arm-azurestack': file:projects/arm-azurestack.tgz + '@rush-temp/arm-azurestackhci': file:projects/arm-azurestackhci.tgz '@rush-temp/arm-batch': file:projects/arm-batch.tgz '@rush-temp/arm-billing': file:projects/arm-billing.tgz '@rush-temp/arm-botservice': file:projects/arm-botservice.tgz @@ -6574,6 +6576,7 @@ packages: /source-map-resolve/0.5.3: resolution: {integrity: sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==} + deprecated: See https://github.com/lydell/source-map-resolve#deprecated dependencies: atob: 2.1.2 decode-uri-component: 0.2.0 @@ -6591,6 +6594,7 @@ packages: /source-map-url/0.4.1: resolution: {integrity: sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==} + deprecated: See https://github.com/lydell/source-map-url#deprecated dev: false /source-map/0.5.7: @@ -8188,6 +8192,27 @@ packages: uglify-js: 3.14.5 dev: false + file:projects/arm-azurestackhci.tgz: + resolution: {integrity: sha512-fS7YNoGtj+meNXuUKFvQds/Ug+ZLwwjH742j9eUfULcEgcTzKZv747pSGTQzPT+V9xT+psO6E4d/zHdLfdsQEw==, tarball: file:projects/arm-azurestackhci.tgz} + name: '@rush-temp/arm-azurestackhci' + version: 0.0.0 + dependencies: + '@microsoft/api-extractor': 7.19.2 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + tslib: 2.3.1 + typescript: 4.2.4 + uglify-js: 3.14.5 + dev: false + file:projects/arm-batch.tgz: resolution: {integrity: sha512-3Icocw0QnB8/JYmiR/jIr/2A2XhYvFbte2ah1d8s7Mx4Bb23RCnZjTREPQinlGgdpuNSUL0va2ixFwyXTRCiBA==, tarball: file:projects/arm-batch.tgz} name: '@rush-temp/arm-batch' diff --git a/rush.json b/rush.json index 77f97540c795..d974a5f3e38e 100644 --- a/rush.json +++ b/rush.json @@ -1240,6 +1240,11 @@ "packageName": "@azure/arm-appconfiguration", "projectFolder": "sdk/appconfiguration/arm-appconfiguration", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-azurestackhci", + "projectFolder": "sdk/azurestackhci/arm-azurestackhci", + "versionPolicyName": "management" } ] } \ No newline at end of file diff --git a/sdk/azurestackhci/arm-azurestackhci/CHANGELOG.md b/sdk/azurestackhci/arm-azurestackhci/CHANGELOG.md new file mode 100644 index 000000000000..d1366c46189e --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 2.0.0 (2022-01-11) + +The package of @azure/arm-azurestackhci is using our next generation design principles since version 2.0.0, which contains breaking changes. + +To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). + +To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/azurestackhci/arm-azurestackhci/LICENSE b/sdk/azurestackhci/arm-azurestackhci/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 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. \ No newline at end of file diff --git a/sdk/azurestackhci/arm-azurestackhci/README.md b/sdk/azurestackhci/arm-azurestackhci/README.md index 13116bde073e..521f29bb0537 100644 --- a/sdk/azurestackhci/arm-azurestackhci/README.md +++ b/sdk/azurestackhci/arm-azurestackhci/README.md @@ -1,109 +1,98 @@ -## Azure AzureStackHCIClient SDK for JavaScript +# AzureStackHCI client library 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 AzureStackHCI client. + +Azure Stack HCI management service + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/azurestackhci/arm-azurestackhci) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-azurestackhci) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-azurestackhci) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started ### 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 -You must have an [Azure subscription](https://azure.microsoft.com/free/). +- An [Azure subscription][azure_sub]. -### How to install +### Install the `@azure/arm-azurestackhci` package -To use this SDK in your project, you will need to install two packages. -- `@azure/arm-azurestackhci` that contains the client. -- `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory. +Install the AzureStackHCI client library for JavaScript with `npm`: -Install both packages using the below command: ```bash -npm install --save @azure/arm-azurestackhci @azure/identity +npm install @azure/arm-azurestackhci ``` -> **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. +### Create and authenticate a `AzureStackHCIClient` -### How to use +To create a client object to access the AzureStackHCI API, you will need the `endpoint` of your AzureStackHCI resource and a `credential`. The AzureStackHCI client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your AzureStackHCI resource in the [Azure Portal][azure_portal]. -- If you are writing a client side browser application, - - Follow the instructions in the section on Authenticating client side browser applications in [Azure Identity examples](https://aka.ms/azsdk/js/identity/examples) to register your application in the Microsoft identity platform and set the right permissions. - - Copy the client ID and tenant ID from the Overview section of your app registration in Azure portal and use it in the browser sample below. -- If you are writing a server side application, - - [Select a credential from `@azure/identity` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples) - - Complete the set up steps required by the credential if any. - - Use the credential you picked in the place of `DefaultAzureCredential` in the Node.js sample below. +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). -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. +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` -#### nodejs - Authentication, client creation, and list operations as an example written in JavaScript. +You will also need to **register a new AAD application and grant access to AzureStackHCI** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. -##### Sample code +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). ```javascript -const { DefaultAzureCredential } = require("@azure/identity"); const { AzureStackHCIClient } = require("@azure/arm-azurestackhci"); -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -// Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples -// 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) => { - console.log("The result is:"); - console.log(result); -}).catch((err) => { - console.log("An error occurred:"); - console.error(err); -}); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new AzureStackHCIClient(new DefaultAzureCredential(), subscriptionId); ``` -#### browser - Authentication, client creation, and list operations 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. - - Note down the client Id from the previous step and use it in the browser sample below. - -##### Sample code - -- index.html - -```html - - - - @azure/arm-azurestackhci sample - - - - - - - + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### AzureStackHCIClient + +`AzureStackHCIClient` is the primary interface for developers using the AzureStackHCI client library. Explore the methods on this client object to understand the different features of the AzureStackHCI service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); ``` +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + ## Related projects -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fazurestackhci%2Farm-azurestackhci%2FREADME.png) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/azurestackhci/arm-azurestackhci/README.png) +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/azurestackhci/arm-azurestackhci/_meta.json b/sdk/azurestackhci/arm-azurestackhci/_meta.json new file mode 100644 index 000000000000..9a5c3eea21e7 --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "e6a2296d02ec6c4b2c32479198bfbcb9b16ea247", + "readme": "specification/azurestackhci/resource-manager/readme.md", + "autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/azurestackhci/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20211217.1", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "use": "@autorest/typescript@6.0.0-alpha.16.20211217.1" +} \ No newline at end of file diff --git a/sdk/azurestackhci/arm-azurestackhci/api-extractor.json b/sdk/azurestackhci/arm-azurestackhci/api-extractor.json new file mode 100644 index 000000000000..0cabc18600c7 --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/api-extractor.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { "enabled": true }, + "apiReport": { "enabled": true, "reportFolder": "./review" }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-azurestackhci.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/azurestackhci/arm-azurestackhci/package.json b/sdk/azurestackhci/arm-azurestackhci/package.json index 2ac277230b0d..37feef47168a 100644 --- a/sdk/azurestackhci/arm-azurestackhci/package.json +++ b/sdk/azurestackhci/arm-azurestackhci/package.json @@ -1,58 +1,91 @@ { "name": "@azure/arm-azurestackhci", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "AzureStackHCIClient Library with typescript type definitions for node.js and browser.", - "version": "1.1.0", + "description": "A generated SDK for AzureStackHCIClient.", + "version": "2.0.0", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^2.1.0", - "@azure/ms-rest-js": "^2.2.0", - "@azure/core-auth": "^1.1.4", - "tslib": "^1.10.0" + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], "license": "MIT", - "main": "./dist/arm-azurestackhci.js", - "module": "./esm/azureStackHCIClient.js", - "types": "./esm/azureStackHCIClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-azurestackhci.d.ts", "devDependencies": { - "typescript": "^3.6.0", - "rollup": "^1.18.0", - "rollup-plugin-node-resolve": "^5.2.0", + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", - "uglify-js": "^3.6.0" + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/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" - }, + "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", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", "src/**/*.ts", "README.md", + "LICENSE", "rollup.config.js", - "tsconfig.json" + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" ], "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" + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "api-extractor run --local", + "lint": "echo skipped", + "audit": "echo skipped", + "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:browser": "echo skipped", + "docs": "echo skipped" }, "sideEffects": false, "autoPublish": true diff --git a/sdk/azurestackhci/arm-azurestackhci/recordings/node/my_test/recording_sample_test.js b/sdk/azurestackhci/arm-azurestackhci/recordings/node/my_test/recording_sample_test.js new file mode 100644 index 000000000000..0f6ecb857acf --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/recordings/node/my_test/recording_sample_test.js @@ -0,0 +1,5 @@ +let nock = require('nock'); + +module.exports.hash = "7a6be38bb8cb644d64b4094802301751"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/azurestackhci/arm-azurestackhci/review/arm-azurestackhci.api.md b/sdk/azurestackhci/arm-azurestackhci/review/arm-azurestackhci.api.md new file mode 100644 index 000000000000..7d5cc35f4fd2 --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/review/arm-azurestackhci.api.md @@ -0,0 +1,650 @@ +## API Report File for "@azure/arm-azurestackhci" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export type ActionType = string; + +// @public +export type ArcSetting = ProxyResource & { + readonly provisioningState?: ProvisioningState; + readonly arcInstanceResourceGroup?: string; + readonly aggregateState?: ArcSettingAggregateState; + readonly perNodeDetails?: PerNodeState[]; + createdBy?: string; + createdByType?: CreatedByType; + createdAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; + lastModifiedAt?: Date; +}; + +// @public +export type ArcSettingAggregateState = string; + +// @public +export interface ArcSettingList { + readonly nextLink?: string; + readonly value?: ArcSetting[]; +} + +// @public +export interface ArcSettings { + beginDelete(resourceGroupName: string, clusterName: string, arcSettingName: string, options?: ArcSettingsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, clusterName: string, arcSettingName: string, options?: ArcSettingsDeleteOptionalParams): Promise; + create(resourceGroupName: string, clusterName: string, arcSettingName: string, arcSetting: ArcSetting, options?: ArcSettingsCreateOptionalParams): Promise; + get(resourceGroupName: string, clusterName: string, arcSettingName: string, options?: ArcSettingsGetOptionalParams): Promise; + listByCluster(resourceGroupName: string, clusterName: string, options?: ArcSettingsListByClusterOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ArcSettingsCreateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ArcSettingsCreateResponse = ArcSetting; + +// @public +export interface ArcSettingsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ArcSettingsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ArcSettingsGetResponse = ArcSetting; + +// @public +export interface ArcSettingsListByClusterNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ArcSettingsListByClusterNextResponse = ArcSettingList; + +// @public +export interface ArcSettingsListByClusterOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ArcSettingsListByClusterResponse = ArcSettingList; + +// @public (undocumented) +export class AzureStackHCIClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: AzureStackHCIClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + arcSettings: ArcSettings; + // (undocumented) + clusters: Clusters; + // (undocumented) + extensions: Extensions; + // (undocumented) + operations: Operations; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface AzureStackHCIClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export type Cluster = TrackedResource & { + readonly provisioningState?: ProvisioningState; + readonly status?: Status; + readonly cloudId?: string; + cloudManagementEndpoint?: string; + aadClientId?: string; + aadTenantId?: string; + desiredProperties?: ClusterDesiredProperties; + readonly reportedProperties?: ClusterReportedProperties; + readonly trialDaysRemaining?: number; + readonly billingModel?: string; + readonly registrationTimestamp?: Date; + readonly lastSyncTimestamp?: Date; + readonly lastBillingTimestamp?: Date; + createdBy?: string; + createdByType?: CreatedByType; + createdAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; + lastModifiedAt?: Date; +}; + +// @public +export interface ClusterDesiredProperties { + diagnosticLevel?: DiagnosticLevel; + windowsServerSubscription?: WindowsServerSubscription; +} + +// @public +export interface ClusterList { + readonly nextLink?: string; + value?: Cluster[]; +} + +// @public +export interface ClusterNode { + readonly coreCount?: number; + readonly id?: number; + readonly manufacturer?: string; + readonly memoryInGiB?: number; + readonly model?: string; + readonly name?: string; + readonly osName?: string; + readonly osVersion?: string; + readonly serialNumber?: string; + readonly windowsServerSubscription?: WindowsServerSubscription; +} + +// @public +export interface ClusterPatch { + aadClientId?: string; + aadTenantId?: string; + cloudManagementEndpoint?: string; + desiredProperties?: ClusterDesiredProperties; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface ClusterReportedProperties { + readonly clusterId?: string; + readonly clusterName?: string; + readonly clusterVersion?: string; + diagnosticLevel?: DiagnosticLevel; + readonly imdsAttestation?: ImdsAttestation; + readonly lastUpdated?: Date; + readonly nodes?: ClusterNode[]; +} + +// @public +export interface Clusters { + create(resourceGroupName: string, clusterName: string, cluster: Cluster, options?: ClustersCreateOptionalParams): Promise; + delete(resourceGroupName: string, clusterName: string, options?: ClustersDeleteOptionalParams): Promise; + get(resourceGroupName: string, clusterName: string, options?: ClustersGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: ClustersListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: ClustersListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, clusterName: string, cluster: ClusterPatch, options?: ClustersUpdateOptionalParams): Promise; +} + +// @public +export interface ClustersCreateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ClustersCreateResponse = Cluster; + +// @public +export interface ClustersDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ClustersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ClustersGetResponse = Cluster; + +// @public +export interface ClustersListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ClustersListByResourceGroupNextResponse = ClusterList; + +// @public +export interface ClustersListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ClustersListByResourceGroupResponse = ClusterList; + +// @public +export interface ClustersListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ClustersListBySubscriptionNextResponse = ClusterList; + +// @public +export interface ClustersListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ClustersListBySubscriptionResponse = ClusterList; + +// @public +export interface ClustersUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ClustersUpdateResponse = Cluster; + +// @public +export type CreatedByType = string; + +// @public +export type DiagnosticLevel = string; + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export type Extension = ProxyResource & { + readonly provisioningState?: ProvisioningState; + readonly aggregateState?: ExtensionAggregateState; + readonly perNodeExtensionDetails?: PerNodeExtensionState[]; + forceUpdateTag?: string; + publisher?: string; + typePropertiesExtensionParametersType?: string; + typeHandlerVersion?: string; + autoUpgradeMinorVersion?: boolean; + settings?: Record; + protectedSettings?: Record; + createdBy?: string; + createdByType?: CreatedByType; + createdAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; + lastModifiedAt?: Date; +}; + +// @public +export type ExtensionAggregateState = string; + +// @public +export interface ExtensionList { + readonly nextLink?: string; + readonly value?: Extension[]; +} + +// @public +export interface Extensions { + beginCreate(resourceGroupName: string, clusterName: string, arcSettingName: string, extensionName: string, extension: Extension, options?: ExtensionsCreateOptionalParams): Promise, ExtensionsCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, clusterName: string, arcSettingName: string, extensionName: string, extension: Extension, options?: ExtensionsCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, clusterName: string, arcSettingName: string, extensionName: string, options?: ExtensionsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, clusterName: string, arcSettingName: string, extensionName: string, options?: ExtensionsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, clusterName: string, arcSettingName: string, extensionName: string, extension: Extension, options?: ExtensionsUpdateOptionalParams): Promise, ExtensionsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, clusterName: string, arcSettingName: string, extensionName: string, extension: Extension, options?: ExtensionsUpdateOptionalParams): Promise; + get(resourceGroupName: string, clusterName: string, arcSettingName: string, extensionName: string, options?: ExtensionsGetOptionalParams): Promise; + listByArcSetting(resourceGroupName: string, clusterName: string, arcSettingName: string, options?: ExtensionsListByArcSettingOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ExtensionsCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ExtensionsCreateResponse = Extension; + +// @public +export interface ExtensionsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ExtensionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExtensionsGetResponse = Extension; + +// @public +export interface ExtensionsListByArcSettingNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExtensionsListByArcSettingNextResponse = ExtensionList; + +// @public +export interface ExtensionsListByArcSettingOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExtensionsListByArcSettingResponse = ExtensionList; + +// @public +export interface ExtensionsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ExtensionsUpdateResponse = Extension; + +// @public +export type ImdsAttestation = string; + +// @public +export enum KnownActionType { + // (undocumented) + Internal = "Internal" +} + +// @public +export enum KnownArcSettingAggregateState { + // (undocumented) + Canceled = "Canceled", + // (undocumented) + Connected = "Connected", + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleted = "Deleted", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Disconnected = "Disconnected", + // (undocumented) + Error = "Error", + // (undocumented) + Failed = "Failed", + // (undocumented) + InProgress = "InProgress", + // (undocumented) + Moving = "Moving", + // (undocumented) + NotSpecified = "NotSpecified", + // (undocumented) + PartiallyConnected = "PartiallyConnected", + // (undocumented) + PartiallySucceeded = "PartiallySucceeded", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Updating = "Updating" +} + +// @public +export enum KnownCreatedByType { + // (undocumented) + Application = "Application", + // (undocumented) + Key = "Key", + // (undocumented) + ManagedIdentity = "ManagedIdentity", + // (undocumented) + User = "User" +} + +// @public +export enum KnownDiagnosticLevel { + // (undocumented) + Basic = "Basic", + // (undocumented) + Enhanced = "Enhanced", + // (undocumented) + Off = "Off" +} + +// @public +export enum KnownExtensionAggregateState { + // (undocumented) + Canceled = "Canceled", + // (undocumented) + Connected = "Connected", + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleted = "Deleted", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Disconnected = "Disconnected", + // (undocumented) + Error = "Error", + // (undocumented) + Failed = "Failed", + // (undocumented) + InProgress = "InProgress", + // (undocumented) + Moving = "Moving", + // (undocumented) + NotSpecified = "NotSpecified", + // (undocumented) + PartiallyConnected = "PartiallyConnected", + // (undocumented) + PartiallySucceeded = "PartiallySucceeded", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Updating = "Updating" +} + +// @public +export enum KnownImdsAttestation { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled" +} + +// @public +export enum KnownNodeArcState { + // (undocumented) + Canceled = "Canceled", + // (undocumented) + Connected = "Connected", + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleted = "Deleted", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Disconnected = "Disconnected", + // (undocumented) + Error = "Error", + // (undocumented) + Failed = "Failed", + // (undocumented) + Moving = "Moving", + // (undocumented) + NotSpecified = "NotSpecified", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Updating = "Updating" +} + +// @public +export enum KnownNodeExtensionState { + // (undocumented) + Canceled = "Canceled", + // (undocumented) + Connected = "Connected", + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleted = "Deleted", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Disconnected = "Disconnected", + // (undocumented) + Error = "Error", + // (undocumented) + Failed = "Failed", + // (undocumented) + Moving = "Moving", + // (undocumented) + NotSpecified = "NotSpecified", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Updating = "Updating" +} + +// @public +export enum KnownOrigin { + // (undocumented) + System = "system", + // (undocumented) + User = "user", + // (undocumented) + UserSystem = "user,system" +} + +// @public +export enum KnownProvisioningState { + // (undocumented) + Accepted = "Accepted", + // (undocumented) + Canceled = "Canceled", + // (undocumented) + Failed = "Failed", + // (undocumented) + Provisioning = "Provisioning", + // (undocumented) + Succeeded = "Succeeded" +} + +// @public +export enum KnownStatus { + // (undocumented) + ConnectedRecently = "ConnectedRecently", + // (undocumented) + Disconnected = "Disconnected", + // (undocumented) + Error = "Error", + // (undocumented) + NotConnectedRecently = "NotConnectedRecently", + // (undocumented) + NotYetRegistered = "NotYetRegistered" +} + +// @public +export enum KnownWindowsServerSubscription { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled" +} + +// @public +export type NodeArcState = string; + +// @public +export type NodeExtensionState = string; + +// @public +export interface Operation { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): Promise; +} + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export type Origin = string; + +// @public +export interface PerNodeExtensionState { + readonly extension?: string; + readonly name?: string; + readonly state?: NodeExtensionState; +} + +// @public +export interface PerNodeState { + readonly arcInstance?: string; + readonly name?: string; + readonly state?: NodeArcState; +} + +// @public +export type ProvisioningState = string; + +// @public +export type ProxyResource = Resource & {}; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export type Status = string; + +// @public +export type TrackedResource = Resource & { + tags?: { + [propertyName: string]: string; + }; + location: string; +}; + +// @public +export type WindowsServerSubscription = string; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/azurestackhci/arm-azurestackhci/rollup.config.js b/sdk/azurestackhci/arm-azurestackhci/rollup.config.js index 06178ceba9e5..9be1955eb7f1 100644 --- a/sdk/azurestackhci/arm-azurestackhci/rollup.config.js +++ b/sdk/azurestackhci/arm-azurestackhci/rollup.config.js @@ -1,37 +1,188 @@ -import rollup from "rollup"; -import nodeResolve from "rollup-plugin-node-resolve"; +/* + * 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 nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + +// #region Warning Handler /** - * @type {rollup.RollupFileOptions} + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. */ -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" + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] }, - 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() - ] + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false }; -export default config; +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve(), cjs()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClient.ts b/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClient.ts index d4f586397e73..3c3aa649cb01 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClient.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClient.ts @@ -1,50 +1,91 @@ /* - * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { AzureStackHCIClientContext } from "./azureStackHCIClientContext"; +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + ArcSettingsImpl, + ClustersImpl, + ExtensionsImpl, + OperationsImpl +} from "./operations"; +import { + ArcSettings, + Clusters, + Extensions, + Operations +} from "./operationsInterfaces"; +import { AzureStackHCIClientOptionalParams } from "./models"; - -class AzureStackHCIClient extends AzureStackHCIClientContext { - // Operation groups - operations: operations.Operations; - clusters: operations.Clusters; +export class AzureStackHCIClient extends coreClient.ServiceClient { + $host: string; + subscriptionId: string; + apiVersion: string; /** * Initializes a new instance of the AzureStackHCIClient class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. + * @param credentials Subscription credentials which uniquely identify client subscription. * @param subscriptionId The ID of the target subscription. - * @param [options] The parameter options + * @param options The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.AzureStackHCIClientOptions) { - super(credentials, subscriptionId, options); - this.operations = new operations.Operations(this); - this.clusters = new operations.Clusters(this); - } -} + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: AzureStackHCIClientOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: AzureStackHCIClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; -// Operation Specifications + const packageDetails = `azsdk-js-arm-azurestackhci/2.0.0`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; -export { - AzureStackHCIClient, - AzureStackHCIClientContext, - Models as AzureStackHCIModels, - Mappers as AzureStackHCIMappers -}; -export * from "./operations"; + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2021-09-01"; + this.arcSettings = new ArcSettingsImpl(this); + this.clusters = new ClustersImpl(this); + this.extensions = new ExtensionsImpl(this); + this.operations = new OperationsImpl(this); + } + + arcSettings: ArcSettings; + clusters: Clusters; + extensions: Extensions; + operations: Operations; +} diff --git a/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClientContext.ts b/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClientContext.ts deleted file mode 100644 index 6a541775ad3f..000000000000 --- a/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClientContext.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 { TokenCredential } from "@azure/core-auth"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-azurestackhci"; -const packageVersion = "1.1.0"; - -export class AzureStackHCIClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials | TokenCredential; - apiVersion?: string; - subscriptionId: string; - - /** - * Initializes a new instance of the AzureStackHCIClient class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. - * @param subscriptionId The ID of the target subscription. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, 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-03-01-preview'; - 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/index.ts b/sdk/azurestackhci/arm-azurestackhci/src/index.ts new file mode 100644 index 000000000000..f633cd0df6d6 --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/src/index.ts @@ -0,0 +1,12 @@ +/* + * 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 "./models"; +export { AzureStackHCIClient } from "./azureStackHCIClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/azurestackhci/arm-azurestackhci/src/lroImpl.ts b/sdk/azurestackhci/arm-azurestackhci/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/src/lroImpl.ts @@ -0,0 +1,34 @@ +/* + * 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 { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export class LroImpl implements LongRunningOperation { + constructor( + private sendOperationFn: (args: any, spec: any) => Promise>, + private args: Record, + private spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record, + public requestPath: string = spec.path!, + public requestMethod: string = spec.httpMethod + ) {} + public async sendInitialRequest(): Promise> { + return this.sendOperationFn(this.args, this.spec); + } + public async sendPollRequest(path: string): Promise> { + const { requestBody, ...restSpec } = this.spec; + return this.sendOperationFn(this.args, { + ...restSpec, + path, + httpMethod: "GET" + }); + } +} diff --git a/sdk/azurestackhci/arm-azurestackhci/src/models/clustersMappers.ts b/sdk/azurestackhci/arm-azurestackhci/src/models/clustersMappers.ts deleted file mode 100644 index 5eff99898d82..000000000000 --- a/sdk/azurestackhci/arm-azurestackhci/src/models/clustersMappers.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 index a72c11439ebe..1ce8f1596647 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/models/index.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/models/index.ts @@ -1,546 +1,955 @@ /* - * 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. */ -import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export { BaseResource, CloudError }; +/** List of ArcSetting proxy resources for the HCI cluster. */ +export interface ArcSettingList { + /** + * List of ArcSetting proxy resources. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: ArcSetting[]; + /** + * 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; +} -/** - * Cluster node details. - */ -export interface ClusterNode { +/** Status of Arc agent for a particular node in HCI Cluster. */ +export interface PerNodeState { /** - * Name of the cluster node. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * 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; /** - * Id of the node in the cluster. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * 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 id?: number; + readonly arcInstance?: string; /** - * Manufacturer of the cluster node hardware. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * State of Arc agent in this node. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly manufacturer?: string; + readonly state?: NodeArcState; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { /** - * Model name of the cluster node hardware. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * 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 model?: string; + readonly id?: string; /** - * Operating system running on the cluster node. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly osName?: string; + readonly name?: 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.** + * 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 osVersion?: string; + readonly type?: string; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { /** - * Immutable id of the cluster node. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly serialNumber?: string; + readonly code?: string; /** - * Number of physical cores on the cluster node. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly coreCount?: number; + readonly message?: string; /** - * Total available memory on the cluster node (in GiB). - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly memoryInGiB?: number; + 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[]; } -/** - * Properties reported by cluster agent. - */ +/** 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?: Record; +} + +/** List of clusters. */ +export interface ClusterList { + /** List of clusters. */ + value?: Cluster[]; + /** + * 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; +} + +/** Desired properties of the cluster. */ +export interface ClusterDesiredProperties { + /** Desired state of Windows Server Subscription. */ + windowsServerSubscription?: WindowsServerSubscription; + /** Desired level of diagnostic data emitted by the cluster. */ + diagnosticLevel?: DiagnosticLevel; +} + +/** 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.** + * 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.** + * 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.** + * 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.** + * 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.** + * 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.** + * IMDS attestation status of the cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly imdsAttestation?: ImdsAttestation; + /** Level of diagnostic data emitted by the cluster. */ + diagnosticLevel?: DiagnosticLevel; +} + +/** Cluster node details. */ +export interface ClusterNode { /** - * The name of the resource - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Name of the cluster node. + * 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.** + * Id of the node in the cluster. + * 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 { + readonly id?: number; /** - * Resource tags. + * State of Windows Server Subscription. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: { [propertyName: string]: string }; + readonly windowsServerSubscription?: WindowsServerSubscription; /** - * The geo-location where the resource lives + * Manufacturer of the cluster node hardware. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - location: string; -} - -/** - * Cluster details. - */ -export interface Cluster extends TrackedResource { + readonly manufacturer?: string; /** - * 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.** + * Model name of the cluster node hardware. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: ProvisioningState; + readonly model?: string; /** - * 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.** + * Operating system running on the cluster node. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly status?: Status; + readonly osName?: string; /** - * Unique, immutable resource id. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * 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 cloudId?: string; + readonly osVersion?: string; /** - * App id of cluster AAD identity. + * Immutable id of the cluster node. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - aadClientId: string; + readonly serialNumber?: string; /** - * Tenant id of cluster AAD identity. + * Number of physical cores on the cluster node. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - aadTenantId: string; + readonly coreCount?: number; /** - * Properties reported by cluster agent. + * Total available memory on the cluster node (in GiB). + * NOTE: This property will not be serialized. It can only be populated by the server. */ - reportedProperties?: ClusterReportedProperties; + readonly memoryInGiB?: number; +} + +/** Cluster details to update. */ +export interface ClusterPatch { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** Endpoint configured for management from the Azure portal */ + cloudManagementEndpoint?: string; + /** App id of cluster AAD identity. */ + aadClientId?: string; + /** Tenant id of cluster AAD identity. */ + aadTenantId?: string; + /** Desired properties of the cluster. */ + desiredProperties?: ClusterDesiredProperties; +} + +/** List of Extensions in HCI cluster. */ +export interface ExtensionList { /** - * Number of days remaining in the trial period. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * List of Extensions in HCI cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly trialDaysRemaining?: number; + readonly value?: Extension[]; /** - * Type of billing applied to the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Link to the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingModel?: string; + readonly nextLink?: string; +} + +/** Status of Arc Extension for a particular node in HCI Cluster. */ +export interface PerNodeExtensionState { /** - * First cluster sync timestamp. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Name of the node in HCI Cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly registrationTimestamp?: Date; + readonly name?: string; /** - * Most recent cluster sync timestamp. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * 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. */ - readonly lastSyncTimestamp?: Date; + readonly extension?: string; /** - * Most recent billing meter timestamp. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * State of Arc Extension in this node. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly lastBillingTimestamp?: Date; + readonly state?: NodeExtensionState; } -/** - * Cluster details to update. - */ -export interface ClusterUpdate { +/** 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 OperationListResult { /** - * Resource tags. + * List of operations supported by the resource provider + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: { [propertyName: string]: string }; + readonly value?: Operation[]; + /** + * 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. + */ + readonly nextLink?: string; } -/** - * Operation display payload - */ -export interface OperationDisplay { +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { /** - * Resource provider of the operation + * 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. */ - provider?: string; + readonly name?: string; /** - * Resource of the operation + * 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. */ - resource?: string; + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; /** - * Localized friendly name for the operation + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" + * NOTE: This property will not be serialized. It can only be populated by the server. */ - operation?: string; + readonly origin?: Origin; /** - * Localized friendly description for the operation + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - description?: string; + readonly actionType?: ActionType; } -/** - * Operation detail payload - */ -export interface OperationDetail { +/** Localized display information for this particular operation. */ +export interface OperationDisplay { /** - * Name of the operation + * 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. */ - name?: string; + readonly provider?: string; /** - * Indicates whether the operation is a data action + * 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. */ - isDataAction?: boolean; + readonly resource?: string; /** - * Display of the operation + * 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. */ - display?: OperationDisplay; + readonly operation?: string; /** - * Origin of the operation + * 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. */ - origin?: string; - /** - * Properties of the operation - */ - properties?: any; + readonly description?: string; } -/** - * Available operations of the service - */ -export interface AvailableOperations { +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export type ProxyResource = Resource & {}; + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export type TrackedResource = Resource & { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +}; + +/** ArcSetting details. */ +export type ArcSetting = ProxyResource & { /** - * Collection of available operation details + * Provisioning state of the ArcSetting proxy resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - value?: OperationDetail[]; + readonly provisioningState?: ProvisioningState; /** - * URL client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. + * 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. */ - 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 { -} + readonly arcInstanceResourceGroup?: string; + /** + * Aggregate state of Arc agent across the nodes in this HCI cluster. + * 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 identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + 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. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +}; -/** - * The resource model definition for a Azure Resource Manager resource with an etag. - */ -export interface AzureEntityResource extends Resource { +/** Details of a particular extension in HCI Cluster. */ +export type Extension = ProxyResource & { /** - * Resource Etag. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Provisioning state of the Extension proxy resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly etag?: string; -} + readonly provisioningState?: ProvisioningState; + /** + * Aggregate state of Arc Extensions across the nodes in this HCI cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + 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[]; + /** 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". */ + typePropertiesExtensionParametersType?: 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?: Record; + /** Protected settings (may contain secrets). */ + protectedSettings?: Record; + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + 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. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +}; -/** - * The resource management error additional info. - */ -export interface ErrorAdditionalInfo { +/** Cluster details. */ +export type Cluster = TrackedResource & { /** - * The additional info type. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; + readonly provisioningState?: ProvisioningState; /** - * The additional info. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Status of the cluster agent. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly info?: any; -} - -/** - * The error object. - */ -export interface ErrorResponseError { + readonly status?: Status; /** - * The error code. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Unique, immutable resource id. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly code?: string; + readonly cloudId?: string; + /** Endpoint configured for management from the Azure portal. */ + cloudManagementEndpoint?: string; + /** App id of cluster AAD identity. */ + aadClientId?: string; + /** Tenant id of cluster AAD identity. */ + aadTenantId?: string; + /** Desired properties of the cluster. */ + desiredProperties?: ClusterDesiredProperties; /** - * The error message. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Properties reported by cluster agent. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly message?: string; + readonly reportedProperties?: ClusterReportedProperties; /** - * The error target. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Number of days remaining in the trial period. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly target?: string; + readonly trialDaysRemaining?: number; /** - * The error details. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Type of billing applied to the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly details?: ErrorResponse[]; + readonly billingModel?: string; /** - * The error additional info. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * First cluster sync timestamp. + * 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 { + readonly registrationTimestamp?: Date; /** - * The error object. + * Most recent cluster sync timestamp. + * 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 lastSyncTimestamp?: Date; /** - * Resource tags. + * Most recent billing meter timestamp. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: { [propertyName: string]: string }; + readonly lastBillingTimestamp?: Date; + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + 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. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +}; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + User = "User", + Application = "Application", + ManagedIdentity = "ManagedIdentity", + Key = "Key" } /** - * An interface representing AzureStackHCIClientOptions. + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** */ -export interface AzureStackHCIClientOptions extends AzureServiceClientOptions { - baseUri?: string; +export type CreatedByType = string; + +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + Succeeded = "Succeeded", + Failed = "Failed", + Canceled = "Canceled", + Accepted = "Accepted", + Provisioning = "Provisioning" } /** - * @interface - * List of clusters. - * @extends Array + * Defines values for ProvisioningState. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Accepted** \ + * **Provisioning** */ -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; +export type ProvisioningState = string; + +/** Known values of {@link ArcSettingAggregateState} that the service accepts. */ +export enum KnownArcSettingAggregateState { + NotSpecified = "NotSpecified", + Error = "Error", + Succeeded = "Succeeded", + Canceled = "Canceled", + Failed = "Failed", + Connected = "Connected", + Disconnected = "Disconnected", + Deleted = "Deleted", + Creating = "Creating", + Updating = "Updating", + Deleting = "Deleting", + Moving = "Moving", + PartiallySucceeded = "PartiallySucceeded", + PartiallyConnected = "PartiallyConnected", + InProgress = "InProgress" } /** - * Defines values for ProvisioningState. - * Possible values include: 'Succeeded', 'Failed', 'Canceled', 'Accepted', 'Provisioning' - * @readonly - * @enum {string} + * Defines values for ArcSettingAggregateState. \ + * {@link KnownArcSettingAggregateState} can be used interchangeably with ArcSettingAggregateState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NotSpecified** \ + * **Error** \ + * **Succeeded** \ + * **Canceled** \ + * **Failed** \ + * **Connected** \ + * **Disconnected** \ + * **Deleted** \ + * **Creating** \ + * **Updating** \ + * **Deleting** \ + * **Moving** \ + * **PartiallySucceeded** \ + * **PartiallyConnected** \ + * **InProgress** */ -export type ProvisioningState = 'Succeeded' | 'Failed' | 'Canceled' | 'Accepted' | 'Provisioning'; +export type ArcSettingAggregateState = string; + +/** Known values of {@link NodeArcState} that the service accepts. */ +export enum KnownNodeArcState { + NotSpecified = "NotSpecified", + Error = "Error", + Succeeded = "Succeeded", + Canceled = "Canceled", + Failed = "Failed", + Connected = "Connected", + Disconnected = "Disconnected", + Deleted = "Deleted", + Creating = "Creating", + Updating = "Updating", + Deleting = "Deleting", + Moving = "Moving" +} /** - * Defines values for Status. - * Possible values include: 'NotYetRegistered', 'ConnectedRecently', 'NotConnectedRecently', - * 'Disconnected', 'Error' - * @readonly - * @enum {string} + * Defines values for NodeArcState. \ + * {@link KnownNodeArcState} can be used interchangeably with NodeArcState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NotSpecified** \ + * **Error** \ + * **Succeeded** \ + * **Canceled** \ + * **Failed** \ + * **Connected** \ + * **Disconnected** \ + * **Deleted** \ + * **Creating** \ + * **Updating** \ + * **Deleting** \ + * **Moving** */ -export type Status = 'NotYetRegistered' | 'ConnectedRecently' | 'NotConnectedRecently' | 'Disconnected' | 'Error'; +export type NodeArcState = string; + +/** Known values of {@link Status} that the service accepts. */ +export enum KnownStatus { + NotYetRegistered = "NotYetRegistered", + ConnectedRecently = "ConnectedRecently", + NotConnectedRecently = "NotConnectedRecently", + Disconnected = "Disconnected", + Error = "Error" +} /** - * Contains response data for the list operation. + * Defines values for Status. \ + * {@link KnownStatus} can be used interchangeably with Status, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NotYetRegistered** \ + * **ConnectedRecently** \ + * **NotConnectedRecently** \ + * **Disconnected** \ + * **Error** */ -export type OperationsListResponse = AvailableOperations & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type Status = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AvailableOperations; - }; -}; +/** Known values of {@link WindowsServerSubscription} that the service accepts. */ +export enum KnownWindowsServerSubscription { + Disabled = "Disabled", + Enabled = "Enabled" +} /** - * Contains response data for the list operation. + * Defines values for WindowsServerSubscription. \ + * {@link KnownWindowsServerSubscription} can be used interchangeably with WindowsServerSubscription, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Disabled** \ + * **Enabled** */ -export type ClustersListResponse = ClusterList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type WindowsServerSubscription = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ClusterList; - }; -}; +/** Known values of {@link DiagnosticLevel} that the service accepts. */ +export enum KnownDiagnosticLevel { + Off = "Off", + Basic = "Basic", + Enhanced = "Enhanced" +} /** - * Contains response data for the listByResourceGroup operation. + * Defines values for DiagnosticLevel. \ + * {@link KnownDiagnosticLevel} can be used interchangeably with DiagnosticLevel, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Off** \ + * **Basic** \ + * **Enhanced** */ -export type ClustersListByResourceGroupResponse = ClusterList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type DiagnosticLevel = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ClusterList; - }; -}; +/** Known values of {@link ImdsAttestation} that the service accepts. */ +export enum KnownImdsAttestation { + Disabled = "Disabled", + Enabled = "Enabled" +} /** - * Contains response data for the get operation. + * Defines values for ImdsAttestation. \ + * {@link KnownImdsAttestation} can be used interchangeably with ImdsAttestation, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Disabled** \ + * **Enabled** */ -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; - }; -}; +export type ImdsAttestation = string; + +/** Known values of {@link ExtensionAggregateState} that the service accepts. */ +export enum KnownExtensionAggregateState { + NotSpecified = "NotSpecified", + Error = "Error", + Succeeded = "Succeeded", + Canceled = "Canceled", + Failed = "Failed", + Connected = "Connected", + Disconnected = "Disconnected", + Deleted = "Deleted", + Creating = "Creating", + Updating = "Updating", + Deleting = "Deleting", + Moving = "Moving", + PartiallySucceeded = "PartiallySucceeded", + PartiallyConnected = "PartiallyConnected", + InProgress = "InProgress" +} /** - * Contains response data for the create operation. + * Defines values for ExtensionAggregateState. \ + * {@link KnownExtensionAggregateState} can be used interchangeably with ExtensionAggregateState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NotSpecified** \ + * **Error** \ + * **Succeeded** \ + * **Canceled** \ + * **Failed** \ + * **Connected** \ + * **Disconnected** \ + * **Deleted** \ + * **Creating** \ + * **Updating** \ + * **Deleting** \ + * **Moving** \ + * **PartiallySucceeded** \ + * **PartiallyConnected** \ + * **InProgress** */ -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; - }; -}; +export type ExtensionAggregateState = string; + +/** Known values of {@link NodeExtensionState} that the service accepts. */ +export enum KnownNodeExtensionState { + NotSpecified = "NotSpecified", + Error = "Error", + Succeeded = "Succeeded", + Canceled = "Canceled", + Failed = "Failed", + Connected = "Connected", + Disconnected = "Disconnected", + Deleted = "Deleted", + Creating = "Creating", + Updating = "Updating", + Deleting = "Deleting", + Moving = "Moving" +} /** - * Contains response data for the update operation. + * Defines values for NodeExtensionState. \ + * {@link KnownNodeExtensionState} can be used interchangeably with NodeExtensionState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NotSpecified** \ + * **Error** \ + * **Succeeded** \ + * **Canceled** \ + * **Failed** \ + * **Connected** \ + * **Disconnected** \ + * **Deleted** \ + * **Creating** \ + * **Updating** \ + * **Deleting** \ + * **Moving** */ -export type ClustersUpdateResponse = Cluster & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type NodeExtensionState = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Cluster; - }; -}; +/** Known values of {@link Origin} that the service accepts. */ +export enum KnownOrigin { + User = "user", + System = "system", + UserSystem = "user,system" +} /** - * Contains response data for the listNext operation. + * Defines values for Origin. \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user** \ + * **system** \ + * **user,system** */ -export type ClustersListNextResponse = ClusterList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type Origin = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ClusterList; - }; -}; +/** Known values of {@link ActionType} that the service accepts. */ +export enum KnownActionType { + Internal = "Internal" +} /** - * Contains response data for the listByResourceGroupNext operation. + * Defines values for ActionType. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal** */ -export type ClustersListByResourceGroupNextResponse = ClusterList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type ActionType = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ClusterList; - }; -}; +/** Optional parameters. */ +export interface ArcSettingsListByClusterOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByCluster operation. */ +export type ArcSettingsListByClusterResponse = ArcSettingList; + +/** Optional parameters. */ +export interface ArcSettingsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ArcSettingsGetResponse = ArcSetting; + +/** Optional parameters. */ +export interface ArcSettingsCreateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the create operation. */ +export type ArcSettingsCreateResponse = ArcSetting; + +/** Optional parameters. */ +export interface ArcSettingsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface ArcSettingsListByClusterNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByClusterNext operation. */ +export type ArcSettingsListByClusterNextResponse = ArcSettingList; + +/** Optional parameters. */ +export interface ClustersListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type ClustersListBySubscriptionResponse = ClusterList; + +/** Optional parameters. */ +export interface ClustersListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type ClustersListByResourceGroupResponse = ClusterList; + +/** Optional parameters. */ +export interface ClustersGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ClustersGetResponse = Cluster; + +/** Optional parameters. */ +export interface ClustersCreateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the create operation. */ +export type ClustersCreateResponse = Cluster; + +/** Optional parameters. */ +export interface ClustersUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type ClustersUpdateResponse = Cluster; + +/** Optional parameters. */ +export interface ClustersDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface ClustersListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type ClustersListBySubscriptionNextResponse = ClusterList; + +/** Optional parameters. */ +export interface ClustersListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type ClustersListByResourceGroupNextResponse = ClusterList; + +/** Optional parameters. */ +export interface ExtensionsListByArcSettingOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByArcSetting operation. */ +export type ExtensionsListByArcSettingResponse = ExtensionList; + +/** Optional parameters. */ +export interface ExtensionsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ExtensionsGetResponse = Extension; + +/** Optional parameters. */ +export interface ExtensionsCreateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the create operation. */ +export type ExtensionsCreateResponse = Extension; + +/** Optional parameters. */ +export interface ExtensionsUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type ExtensionsUpdateResponse = Extension; + +/** Optional parameters. */ +export interface ExtensionsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface ExtensionsListByArcSettingNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByArcSettingNext operation. */ +export type ExtensionsListByArcSettingNextResponse = ExtensionList; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface AzureStackHCIClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/azurestackhci/arm-azurestackhci/src/models/mappers.ts b/sdk/azurestackhci/arm-azurestackhci/src/models/mappers.ts index 79dcf481ddc1..e16e5ca36686 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/models/mappers.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/models/mappers.ts @@ -1,193 +1,218 @@ /* - * 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. */ -import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export const CloudError = CloudErrorMapper; -export const BaseResource = BaseResourceMapper; - -export const ClusterNode: msRest.CompositeMapper = { - serializedName: "ClusterNode", +export const ArcSettingList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ClusterNode", + className: "ArcSettingList", modelProperties: { - name: { + value: { + serializedName: "value", readOnly: true, - serializedName: "name", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ArcSetting" + } + } } }, - id: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "id", type: { - name: "Number" + name: "String" } - }, - manufacturer: { + } + } + } +}; + +export const PerNodeState: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PerNodeState", + modelProperties: { + name: { + serializedName: "name", readOnly: true, - serializedName: "manufacturer", type: { name: "String" } }, - model: { + arcInstance: { + serializedName: "arcInstance", readOnly: true, - serializedName: "model", type: { name: "String" } }, - osName: { + state: { + serializedName: "state", readOnly: true, - serializedName: "osName", type: { name: "String" } - }, - osVersion: { + } + } + } +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", readOnly: true, - serializedName: "osVersion", type: { name: "String" } }, - serialNumber: { + name: { + serializedName: "name", readOnly: true, - serializedName: "serialNumber", type: { name: "String" } }, - coreCount: { + type: { + serializedName: "type", readOnly: true, - serializedName: "coreCount", type: { - name: "Number" + name: "String" } - }, - memoryInGiB: { - readOnly: true, - serializedName: "memoryInGiB", + } + } + } +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", type: { - name: "Number" + name: "Composite", + className: "ErrorDetail" } } } } }; -export const ClusterReportedProperties: msRest.CompositeMapper = { - serializedName: "ClusterReportedProperties", +export const ErrorDetail: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ClusterReportedProperties", + className: "ErrorDetail", modelProperties: { - clusterName: { + code: { + serializedName: "code", readOnly: true, - serializedName: "clusterName", type: { name: "String" } }, - clusterId: { + message: { + serializedName: "message", readOnly: true, - serializedName: "clusterId", type: { name: "String" } }, - clusterVersion: { + target: { + serializedName: "target", readOnly: true, - serializedName: "clusterVersion", type: { name: "String" } }, - nodes: { + details: { + serializedName: "details", readOnly: true, - serializedName: "nodes", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ClusterNode" + className: "ErrorDetail" } } } }, - lastUpdated: { + additionalInfo: { + serializedName: "additionalInfo", readOnly: true, - serializedName: "lastUpdated", type: { - name: "DateTime" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } } } } } }; -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "ErrorAdditionalInfo", modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - name: { + type: { + serializedName: "type", readOnly: true, - serializedName: "name", type: { name: "String" } }, - type: { + info: { + serializedName: "info", readOnly: true, - serializedName: "type", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "any" } } } } } } }; -export const TrackedResource: msRest.CompositeMapper = { - serializedName: "TrackedResource", +export const ClusterList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TrackedResource", + className: "ClusterList", modelProperties: { - ...Resource.type.modelProperties, - tags: { - serializedName: "tags", + value: { + serializedName: "value", type: { - name: "Dictionary", - value: { + name: "Sequence", + element: { type: { - name: "String" + name: "Composite", + className: "Cluster" } } } }, - location: { - required: true, - serializedName: "location", + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { name: "String" } @@ -196,210 +221,231 @@ export const TrackedResource: msRest.CompositeMapper = { } }; -export const Cluster: msRest.CompositeMapper = { - serializedName: "Cluster", +export const ClusterDesiredProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Cluster", + className: "ClusterDesiredProperties", modelProperties: { - ...TrackedResource.type.modelProperties, - provisioningState: { - readOnly: true, - serializedName: "properties.provisioningState", + windowsServerSubscription: { + serializedName: "windowsServerSubscription", type: { name: "String" } }, - status: { - readOnly: true, - serializedName: "properties.status", + diagnosticLevel: { + serializedName: "diagnosticLevel", type: { name: "String" } - }, - cloudId: { + } + } + } +}; + +export const ClusterReportedProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClusterReportedProperties", + modelProperties: { + clusterName: { + serializedName: "clusterName", 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: { + clusterId: { + serializedName: "clusterId", readOnly: true, - serializedName: "properties.trialDaysRemaining", type: { - name: "Number" + name: "String" } }, - billingModel: { + clusterVersion: { + serializedName: "clusterVersion", readOnly: true, - serializedName: "properties.billingModel", type: { name: "String" } }, - registrationTimestamp: { + nodes: { + serializedName: "nodes", readOnly: true, - serializedName: "properties.registrationTimestamp", type: { - name: "DateTime" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ClusterNode" + } + } } }, - lastSyncTimestamp: { + lastUpdated: { + serializedName: "lastUpdated", readOnly: true, - serializedName: "properties.lastSyncTimestamp", type: { name: "DateTime" } }, - lastBillingTimestamp: { + imdsAttestation: { + serializedName: "imdsAttestation", readOnly: true, - serializedName: "properties.lastBillingTimestamp", type: { - name: "DateTime" + name: "String" } - } - } - } -}; - -export const ClusterUpdate: msRest.CompositeMapper = { - serializedName: "ClusterUpdate", - type: { - name: "Composite", - className: "ClusterUpdate", - modelProperties: { - tags: { - serializedName: "tags", + }, + diagnosticLevel: { + serializedName: "diagnosticLevel", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "String" } } } } }; -export const OperationDisplay: msRest.CompositeMapper = { - serializedName: "OperationDisplay", +export const ClusterNode: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationDisplay", + className: "ClusterNode", modelProperties: { - provider: { - serializedName: "provider", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - resource: { - serializedName: "resource", + id: { + serializedName: "id", + readOnly: true, type: { - name: "String" + name: "Number" } }, - operation: { - serializedName: "operation", + windowsServerSubscription: { + serializedName: "windowsServerSubscription", + readOnly: true, type: { name: "String" } }, - description: { - serializedName: "description", + manufacturer: { + serializedName: "manufacturer", + readOnly: true, type: { name: "String" } - } + }, + model: { + serializedName: "model", + readOnly: true, + type: { + name: "String" + } + }, + osName: { + serializedName: "osName", + readOnly: true, + type: { + name: "String" + } + }, + osVersion: { + serializedName: "osVersion", + readOnly: true, + type: { + name: "String" + } + }, + serialNumber: { + serializedName: "serialNumber", + readOnly: true, + type: { + name: "String" + } + }, + coreCount: { + serializedName: "coreCount", + readOnly: true, + type: { + name: "Number" + } + }, + memoryInGiB: { + serializedName: "memoryInGiB", + readOnly: true, + type: { + name: "Number" + } + } } } }; -export const OperationDetail: msRest.CompositeMapper = { - serializedName: "OperationDetail", +export const ClusterPatch: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationDetail", + className: "ClusterPatch", modelProperties: { - name: { - serializedName: "name", + tags: { + serializedName: "tags", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } }, - isDataAction: { - serializedName: "isDataAction", + cloudManagementEndpoint: { + serializedName: "properties.cloudManagementEndpoint", type: { - name: "Boolean" + name: "String" } }, - display: { - serializedName: "display", + aadClientId: { + serializedName: "properties.aadClientId", type: { - name: "Composite", - className: "OperationDisplay" + name: "String" } }, - origin: { - serializedName: "origin", + aadTenantId: { + serializedName: "properties.aadTenantId", type: { name: "String" } }, - properties: { - serializedName: "properties", + desiredProperties: { + serializedName: "properties.desiredProperties", type: { - name: "Object" + name: "Composite", + className: "ClusterDesiredProperties" } } } } }; -export const AvailableOperations: msRest.CompositeMapper = { - serializedName: "AvailableOperations", +export const ExtensionList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AvailableOperations", + className: "ExtensionList", modelProperties: { value: { serializedName: "value", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "OperationDetail" + className: "Extension" } } } }, nextLink: { serializedName: "nextLink", + readOnly: true, type: { name: "String" } @@ -408,27 +454,57 @@ export const AvailableOperations: msRest.CompositeMapper = { } }; -export const ProxyResource: msRest.CompositeMapper = { - serializedName: "ProxyResource", +export const PerNodeExtensionState: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ProxyResource", + className: "PerNodeExtensionState", modelProperties: { - ...Resource.type.modelProperties + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + extension: { + serializedName: "extension", + readOnly: true, + type: { + name: "String" + } + }, + state: { + serializedName: "state", + readOnly: true, + type: { + name: "String" + } + } } } }; -export const AzureEntityResource: msRest.CompositeMapper = { - serializedName: "AzureEntityResource", +export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureEntityResource", + className: "OperationListResult", modelProperties: { - ...Resource.type.modelProperties, - etag: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "etag", type: { name: "String" } @@ -437,128 +513,448 @@ export const AzureEntityResource: msRest.CompositeMapper = { } }; -export const ErrorAdditionalInfo: msRest.CompositeMapper = { - serializedName: "ErrorAdditionalInfo", +export const Operation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorAdditionalInfo", + className: "Operation", modelProperties: { - type: { + name: { + serializedName: "name", readOnly: true, - serializedName: "type", type: { name: "String" } }, - info: { + isDataAction: { + serializedName: "isDataAction", readOnly: true, - serializedName: "info", type: { - name: "Object" + name: "Boolean" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + readOnly: true, + type: { + name: "String" + } + }, + actionType: { + serializedName: "actionType", + readOnly: true, + type: { + name: "String" } } } } }; -export const ErrorResponseError: msRest.CompositeMapper = { - serializedName: "ErrorResponse_error", +export const OperationDisplay: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorResponseError", + className: "OperationDisplay", modelProperties: { - code: { + provider: { + serializedName: "provider", readOnly: true, - serializedName: "code", type: { name: "String" } }, - message: { + resource: { + serializedName: "resource", readOnly: true, - serializedName: "message", type: { name: "String" } }, - target: { + operation: { + serializedName: "operation", readOnly: true, - serializedName: "target", type: { name: "String" } }, - details: { + description: { + serializedName: "description", readOnly: true, - serializedName: "details", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorResponse" - } - } + name: "String" + } + } + } + } +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } } }, - additionalInfo: { + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ArcSetting: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ArcSetting", + modelProperties: { + ...ProxyResource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + arcInstanceResourceGroup: { + serializedName: "properties.arcInstanceResourceGroup", + readOnly: true, + type: { + name: "String" + } + }, + aggregateState: { + serializedName: "properties.aggregateState", + readOnly: true, + type: { + name: "String" + } + }, + perNodeDetails: { + serializedName: "properties.perNodeDetails", readOnly: true, - serializedName: "additionalInfo", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ErrorAdditionalInfo" + className: "PerNodeState" } } } + }, + 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" + } } } } }; -export const ErrorResponse: msRest.CompositeMapper = { - serializedName: "ErrorResponse", +export const Extension: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorResponse", + className: "Extension", modelProperties: { - error: { - serializedName: "error", + ...ProxyResource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, type: { - name: "Composite", - className: "ErrorResponseError" + name: "String" + } + }, + aggregateState: { + serializedName: "properties.aggregateState", + readOnly: true, + type: { + name: "String" + } + }, + perNodeExtensionDetails: { + serializedName: "properties.perNodeExtensionDetails", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PerNodeExtensionState" + } + } + } + }, + forceUpdateTag: { + serializedName: "properties.extensionParameters.forceUpdateTag", + type: { + name: "String" + } + }, + publisher: { + serializedName: "properties.extensionParameters.publisher", + type: { + name: "String" + } + }, + typePropertiesExtensionParametersType: { + 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: "Dictionary", + value: { type: { name: "any" } } + } + }, + protectedSettings: { + serializedName: "properties.extensionParameters.protectedSettings", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + }, + 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" } } } } }; -export const ClusterList: msRest.CompositeMapper = { - serializedName: "ClusterList", +export const Cluster: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ClusterList", + className: "Cluster", modelProperties: { - value: { - serializedName: "", + ...TrackedResource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Cluster" - } - } + name: "String" } }, - nextLink: { + status: { + serializedName: "properties.status", readOnly: true, - serializedName: "nextLink", type: { name: "String" } + }, + cloudId: { + serializedName: "properties.cloudId", + readOnly: true, + type: { + name: "String" + } + }, + cloudManagementEndpoint: { + serializedName: "properties.cloudManagementEndpoint", + type: { + name: "String" + } + }, + aadClientId: { + serializedName: "properties.aadClientId", + type: { + name: "String" + } + }, + aadTenantId: { + serializedName: "properties.aadTenantId", + type: { + name: "String" + } + }, + desiredProperties: { + serializedName: "properties.desiredProperties", + type: { + name: "Composite", + className: "ClusterDesiredProperties" + } + }, + reportedProperties: { + serializedName: "properties.reportedProperties", + type: { + name: "Composite", + className: "ClusterReportedProperties" + } + }, + trialDaysRemaining: { + serializedName: "properties.trialDaysRemaining", + readOnly: true, + type: { + name: "Number" + } + }, + billingModel: { + serializedName: "properties.billingModel", + readOnly: true, + type: { + name: "String" + } + }, + registrationTimestamp: { + serializedName: "properties.registrationTimestamp", + readOnly: true, + type: { + name: "DateTime" + } + }, + lastSyncTimestamp: { + serializedName: "properties.lastSyncTimestamp", + readOnly: true, + type: { + name: "DateTime" + } + }, + lastBillingTimestamp: { + serializedName: "properties.lastBillingTimestamp", + readOnly: true, + type: { + name: "DateTime" + } + }, + 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" + } } } } diff --git a/sdk/azurestackhci/arm-azurestackhci/src/models/operationsMappers.ts b/sdk/azurestackhci/arm-azurestackhci/src/models/operationsMappers.ts deleted file mode 100644 index ee870560220e..000000000000 --- a/sdk/azurestackhci/arm-azurestackhci/src/models/operationsMappers.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * 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 index 2d791ec70bf2..4af20c93c4de 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/models/parameters.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/models/parameters.ts @@ -1,84 +1,161 @@ /* - * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + ArcSetting as ArcSettingMapper, + Cluster as ClusterMapper, + ClusterPatch as ClusterPatchMapper, + Extension as ExtensionMapper +} from "../models/mappers"; -export const acceptLanguage: msRest.OperationParameter = { - parameterPath: "acceptLanguage", +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { - serializedName: "accept-language", - defaultValue: 'en-US', + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", type: { name: "String" } } }; -export const apiVersion: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const $host: OperationURLParameter = { + parameterPath: "$host", mapper: { + serializedName: "$host", required: true, - serializedName: "api-version", + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { constraints: { MinLength: 1 }, + serializedName: "subscriptionId", + required: true, type: { name: "String" } } }; -export const clusterName: msRest.OperationURLParameter = { - parameterPath: "clusterName", + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", mapper: { + constraints: { + MaxLength: 90, + MinLength: 1 + }, + serializedName: "resourceGroupName", required: true, - serializedName: "clusterName", type: { name: "String" } } }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", + +export const clusterName: OperationURLParameter = { + parameterPath: "clusterName", mapper: { + serializedName: "clusterName", required: true, - serializedName: "nextLink", type: { name: "String" } - }, - skipEncoding: true + } }; -export const resourceGroupName: msRest.OperationURLParameter = { - parameterPath: "resourceGroupName", + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2021-09-01", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const arcSettingName: OperationURLParameter = { + parameterPath: "arcSettingName", mapper: { + serializedName: "arcSettingName", required: true, - serializedName: "resourceGroupName", - constraints: { - MaxLength: 90, - MinLength: 1, - Pattern: /^[-\w\._\(\)]+$/ - }, type: { name: "String" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const arcSetting: OperationParameter = { + parameterPath: "arcSetting", + mapper: ArcSettingMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const cluster: OperationParameter = { + parameterPath: "cluster", + mapper: ClusterMapper +}; + +export const cluster1: OperationParameter = { + parameterPath: "cluster", + mapper: ClusterPatchMapper +}; + +export const extensionName: OperationURLParameter = { + parameterPath: "extensionName", mapper: { + serializedName: "extensionName", required: true, - serializedName: "subscriptionId", - constraints: { - MinLength: 1 - }, type: { name: "String" } } }; + +export const extension: OperationParameter = { + parameterPath: "extension", + mapper: ExtensionMapper +}; 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..90c049668791 --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/src/operations/arcSettings.ts @@ -0,0 +1,394 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { ArcSettings } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureStackHCIClient } from "../azureStackHCIClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + ArcSetting, + ArcSettingsListByClusterNextOptionalParams, + ArcSettingsListByClusterOptionalParams, + ArcSettingsListByClusterResponse, + ArcSettingsGetOptionalParams, + ArcSettingsGetResponse, + ArcSettingsCreateOptionalParams, + ArcSettingsCreateResponse, + ArcSettingsDeleteOptionalParams, + ArcSettingsListByClusterNextResponse +} from "../models"; + +/// +/** Class containing ArcSettings operations. */ +export class ArcSettingsImpl implements ArcSettings { + private readonly client: AzureStackHCIClient; + + /** + * Initialize a new instance of the class ArcSettings class. + * @param client Reference to the service client + */ + constructor(client: AzureStackHCIClient) { + 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 options parameters. + */ + public listByCluster( + resourceGroupName: string, + clusterName: string, + options?: ArcSettingsListByClusterOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByClusterPagingAll( + resourceGroupName, + clusterName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByClusterPagingPage( + resourceGroupName, + clusterName, + options + ); + } + }; + } + + private async *listByClusterPagingPage( + resourceGroupName: string, + clusterName: string, + options?: ArcSettingsListByClusterOptionalParams + ): AsyncIterableIterator { + let result = await this._listByCluster( + resourceGroupName, + clusterName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByClusterNext( + resourceGroupName, + clusterName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByClusterPagingAll( + resourceGroupName: string, + clusterName: string, + options?: ArcSettingsListByClusterOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByClusterPagingPage( + resourceGroupName, + clusterName, + options + )) { + yield* page; + } + } + + /** + * 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 options parameters. + */ + private _listByCluster( + resourceGroupName: string, + clusterName: string, + options?: ArcSettingsListByClusterOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, options }, + listByClusterOperationSpec + ); + } + + /** + * 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 options parameters. + */ + get( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + options?: ArcSettingsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, arcSettingName, options }, + getOperationSpec + ); + } + + /** + * 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 options parameters. + */ + create( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + arcSetting: ArcSetting, + options?: ArcSettingsCreateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, arcSettingName, arcSetting, options }, + createOperationSpec + ); + } + + /** + * 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 options parameters. + */ + async beginDelete( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + options?: ArcSettingsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, clusterName, arcSettingName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * 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 options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + options?: ArcSettingsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + clusterName, + arcSettingName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListByClusterNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param nextLink The nextLink from the previous successful call to the ListByCluster method. + * @param options The options parameters. + */ + private _listByClusterNext( + resourceGroupName: string, + clusterName: string, + nextLink: string, + options?: ArcSettingsListByClusterNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, nextLink, options }, + listByClusterNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByClusterOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ArcSettingList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ArcSetting + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.arcSettingName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ArcSetting + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.arcSetting, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.arcSettingName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.arcSettingName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByClusterNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ArcSettingList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/azurestackhci/arm-azurestackhci/src/operations/clusters.ts b/sdk/azurestackhci/arm-azurestackhci/src/operations/clusters.ts index 154cb11025a8..382b1bffb34a 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/operations/clusters.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/operations/clusters.ts @@ -1,113 +1,188 @@ /* - * 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. + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Clusters } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AzureStackHCIClientContext } from "../azureStackHCIClientContext"; +import { AzureStackHCIClient } from "../azureStackHCIClient"; +import { + Cluster, + ClustersListBySubscriptionNextOptionalParams, + ClustersListBySubscriptionOptionalParams, + ClustersListByResourceGroupNextOptionalParams, + ClustersListByResourceGroupOptionalParams, + ClustersListBySubscriptionResponse, + ClustersListByResourceGroupResponse, + ClustersGetOptionalParams, + ClustersGetResponse, + ClustersCreateOptionalParams, + ClustersCreateResponse, + ClusterPatch, + ClustersUpdateOptionalParams, + ClustersUpdateResponse, + ClustersDeleteOptionalParams, + ClustersListBySubscriptionNextResponse, + ClustersListByResourceGroupNextResponse +} from "../models"; -/** Class representing a Clusters. */ -export class Clusters { - private readonly client: AzureStackHCIClientContext; +/// +/** Class containing Clusters operations. */ +export class ClustersImpl implements Clusters { + private readonly client: AzureStackHCIClient; /** - * Create a Clusters. - * @param {AzureStackHCIClientContext} client Reference to the service client. + * Initialize a new instance of the class Clusters class. + * @param client Reference to the service client */ - constructor(client: AzureStackHCIClientContext) { + constructor(client: AzureStackHCIClient) { this.client = client; } /** * List all HCI clusters in a subscription. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - 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 + public listBySubscription( + options?: ClustersListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); }, - listOperationSpec, - callback) as Promise; + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: ClustersListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listBySubscriptionPagingAll( + options?: ClustersListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } } /** * 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 + * @param options The options parameters. */ - 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( - { + public listByResourceGroup( + resourceGroupName: string, + options?: ClustersListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: ClustersListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( resourceGroupName, + continuationToken, options - }, - listByResourceGroupOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: ClustersListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } } /** - * 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 + * List all HCI clusters in a subscription. + * @param options The options parameters. */ - get(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase): Promise; + private _listBySubscription( + options?: ClustersListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + /** + * List all HCI clusters in a resource group. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, clusterName: string, callback: msRest.ServiceCallback): void; + private _listByResourceGroup( + resourceGroupName: string, + options?: ClustersListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + /** + * 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 - * @param callback The callback + * @param options The options parameters. */ - 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 { + get( + resourceGroupName: string, + clusterName: string, + options?: ClustersGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - clusterName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, clusterName, options }, + getOperationSpec + ); } /** @@ -115,172 +190,95 @@ export class Clusters { * @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 + * @param options The options parameters. */ - 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 { + create( + resourceGroupName: string, + clusterName: string, + cluster: Cluster, + options?: ClustersCreateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - clusterName, - cluster, - options - }, - createOperationSpec, - callback) as Promise; + { resourceGroupName, clusterName, cluster, options }, + createOperationSpec + ); } /** * 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 + * @param cluster Details of the HCI cluster. + * @param options The options parameters. */ - 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: ClusterPatch, + options?: ClustersUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - clusterName, - options - }, - updateOperationSpec, - callback) as Promise; + { resourceGroupName, clusterName, cluster, options }, + updateOperationSpec + ); } /** * 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 + * @param options The options parameters. */ - 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 { + delete( + resourceGroupName: string, + clusterName: string, + options?: ClustersDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - clusterName, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, clusterName, options }, + deleteOperationSpec + ); } /** - * 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 - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listBySubscriptionNext( + nextLink: string, + options?: ClustersListBySubscriptionNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); } /** - * 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 + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. */ - listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: ClustersListByResourceGroupNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByResourceGroupNextOperationSpec, - callback) as Promise; + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/clusters", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/clusters", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ClusterList @@ -289,22 +287,15 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters", 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 @@ -313,23 +304,19 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.clusterName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Cluster @@ -338,30 +325,20 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const createOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.clusterName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "cluster", - mapper: { - ...Mappers.Cluster, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.Cluster @@ -370,35 +347,22 @@ const createOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", + requestBody: Parameters.cluster, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.clusterName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: { - tags: [ - "options", - "tags" - ] - }, - mapper: { - ...Mappers.ClusterUpdate, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.Cluster @@ -407,23 +371,22 @@ const updateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", + requestBody: Parameters.cluster1, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.clusterName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, @@ -431,19 +394,19 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ClusterList @@ -452,19 +415,18 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ClusterList @@ -473,5 +435,13 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; 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..cec0ec77d279 --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/src/operations/extensions.ts @@ -0,0 +1,672 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Extensions } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureStackHCIClient } from "../azureStackHCIClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Extension, + ExtensionsListByArcSettingNextOptionalParams, + ExtensionsListByArcSettingOptionalParams, + ExtensionsListByArcSettingResponse, + ExtensionsGetOptionalParams, + ExtensionsGetResponse, + ExtensionsCreateOptionalParams, + ExtensionsCreateResponse, + ExtensionsUpdateOptionalParams, + ExtensionsUpdateResponse, + ExtensionsDeleteOptionalParams, + ExtensionsListByArcSettingNextResponse +} from "../models"; + +/// +/** Class containing Extensions operations. */ +export class ExtensionsImpl implements Extensions { + private readonly client: AzureStackHCIClient; + + /** + * Initialize a new instance of the class Extensions class. + * @param client Reference to the service client + */ + constructor(client: AzureStackHCIClient) { + 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 options parameters. + */ + public listByArcSetting( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + options?: ExtensionsListByArcSettingOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByArcSettingPagingAll( + resourceGroupName, + clusterName, + arcSettingName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByArcSettingPagingPage( + resourceGroupName, + clusterName, + arcSettingName, + options + ); + } + }; + } + + private async *listByArcSettingPagingPage( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + options?: ExtensionsListByArcSettingOptionalParams + ): AsyncIterableIterator { + let result = await this._listByArcSetting( + resourceGroupName, + clusterName, + arcSettingName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByArcSettingNext( + resourceGroupName, + clusterName, + arcSettingName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByArcSettingPagingAll( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + options?: ExtensionsListByArcSettingOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByArcSettingPagingPage( + resourceGroupName, + clusterName, + arcSettingName, + options + )) { + yield* page; + } + } + + /** + * 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 options parameters. + */ + private _listByArcSetting( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + options?: ExtensionsListByArcSettingOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, arcSettingName, options }, + listByArcSettingOperationSpec + ); + } + + /** + * 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 options parameters. + */ + get( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + extensionName: string, + options?: ExtensionsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterName, + arcSettingName, + extensionName, + options + }, + getOperationSpec + ); + } + + /** + * 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 options parameters. + */ + async beginCreate( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + extensionName: string, + extension: Extension, + options?: ExtensionsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ExtensionsCreateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + clusterName, + arcSettingName, + extensionName, + extension, + options + }, + createOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * 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 options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + extensionName: string, + extension: Extension, + options?: ExtensionsCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + clusterName, + arcSettingName, + extensionName, + extension, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options parameters. + */ + async beginUpdate( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + extensionName: string, + extension: Extension, + options?: ExtensionsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ExtensionsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + clusterName, + arcSettingName, + extensionName, + extension, + options + }, + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "original-uri" + }); + } + + /** + * 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 options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + extensionName: string, + extension: Extension, + options?: ExtensionsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + clusterName, + arcSettingName, + extensionName, + extension, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options parameters. + */ + async beginDelete( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + extensionName: string, + options?: ExtensionsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + clusterName, + arcSettingName, + extensionName, + options + }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * 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 options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + extensionName: string, + options?: ExtensionsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + clusterName, + arcSettingName, + extensionName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListByArcSettingNext + * @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 nextLink The nextLink from the previous successful call to the ListByArcSetting method. + * @param options The options parameters. + */ + private _listByArcSettingNext( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + nextLink: string, + options?: ExtensionsListByArcSettingNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, arcSettingName, nextLink, options }, + listByArcSettingNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByArcSettingOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ExtensionList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.arcSettingName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Extension + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.arcSettingName, + Parameters.extensionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Extension + }, + 201: { + bodyMapper: Mappers.Extension + }, + 202: { + bodyMapper: Mappers.Extension + }, + 204: { + bodyMapper: Mappers.Extension + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.extension, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.arcSettingName, + Parameters.extensionName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Extension + }, + 201: { + bodyMapper: Mappers.Extension + }, + 202: { + bodyMapper: Mappers.Extension + }, + 204: { + bodyMapper: Mappers.Extension + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.extension, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.arcSettingName, + Parameters.extensionName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.arcSettingName, + Parameters.extensionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByArcSettingNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ExtensionList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.arcSettingName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/azurestackhci/arm-azurestackhci/src/operations/index.ts b/sdk/azurestackhci/arm-azurestackhci/src/operations/index.ts index a0c122fdd7b8..2d20c6edaf47 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/operations/index.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/operations/index.ts @@ -1,12 +1,12 @@ /* - * 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. + * 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..8a7c9440c8e4 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/operations/operations.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/operations/operations.ts @@ -1,74 +1,59 @@ /* - * 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. + * 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 { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AzureStackHCIClientContext } from "../azureStackHCIClientContext"; +import { AzureStackHCIClient } from "../azureStackHCIClient"; +import { + OperationsListOptionalParams, + OperationsListResponse +} from "../models"; -/** Class representing a Operations. */ -export class Operations { - private readonly client: AzureStackHCIClientContext; +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: AzureStackHCIClient; /** - * Create a Operations. - * @param {AzureStackHCIClientContext} client Reference to the service client. + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client */ - constructor(client: AzureStackHCIClientContext) { + constructor(client: AzureStackHCIClient) { this.client = client; } /** * List all available Microsoft.AzureStackHCI provider operations - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - 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; + list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.AzureStackHCI/operations", httpMethod: "GET", - path: "providers/Microsoft.AzureStackHCI/operations", - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { - bodyMapper: Mappers.AvailableOperations + bodyMapper: Mappers.OperationListResult }, default: { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/azurestackhci/arm-azurestackhci/src/operationsInterfaces/arcSettings.ts b/sdk/azurestackhci/arm-azurestackhci/src/operationsInterfaces/arcSettings.ts new file mode 100644 index 000000000000..b8541458da21 --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/src/operationsInterfaces/arcSettings.ts @@ -0,0 +1,89 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + ArcSetting, + ArcSettingsListByClusterOptionalParams, + ArcSettingsGetOptionalParams, + ArcSettingsGetResponse, + ArcSettingsCreateOptionalParams, + ArcSettingsCreateResponse, + ArcSettingsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a ArcSettings. */ +export interface ArcSettings { + /** + * 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 options parameters. + */ + listByCluster( + resourceGroupName: string, + clusterName: string, + options?: ArcSettingsListByClusterOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options parameters. + */ + get( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + options?: ArcSettingsGetOptionalParams + ): 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 options parameters. + */ + create( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + arcSetting: ArcSetting, + options?: ArcSettingsCreateOptionalParams + ): 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 options parameters. + */ + beginDelete( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + options?: ArcSettingsDeleteOptionalParams + ): Promise, void>>; + /** + * 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 options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + options?: ArcSettingsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/azurestackhci/arm-azurestackhci/src/operationsInterfaces/clusters.ts b/sdk/azurestackhci/arm-azurestackhci/src/operationsInterfaces/clusters.ts new file mode 100644 index 000000000000..44fdb94966e9 --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/src/operationsInterfaces/clusters.ts @@ -0,0 +1,91 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + Cluster, + ClustersListBySubscriptionOptionalParams, + ClustersListByResourceGroupOptionalParams, + ClustersGetOptionalParams, + ClustersGetResponse, + ClustersCreateOptionalParams, + ClustersCreateResponse, + ClusterPatch, + ClustersUpdateOptionalParams, + ClustersUpdateResponse, + ClustersDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a Clusters. */ +export interface Clusters { + /** + * List all HCI clusters in a subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: ClustersListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * List all HCI clusters in a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: ClustersListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options parameters. + */ + get( + resourceGroupName: string, + clusterName: string, + options?: ClustersGetOptionalParams + ): 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 options parameters. + */ + create( + resourceGroupName: string, + clusterName: string, + cluster: Cluster, + options?: ClustersCreateOptionalParams + ): 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 cluster Details of the HCI cluster. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + clusterName: string, + cluster: ClusterPatch, + options?: ClustersUpdateOptionalParams + ): 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 options parameters. + */ + delete( + resourceGroupName: string, + clusterName: string, + options?: ClustersDeleteOptionalParams + ): Promise; +} diff --git a/sdk/azurestackhci/arm-azurestackhci/src/operationsInterfaces/extensions.ts b/sdk/azurestackhci/arm-azurestackhci/src/operationsInterfaces/extensions.ts new file mode 100644 index 000000000000..22c2192cc9af --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/src/operationsInterfaces/extensions.ts @@ -0,0 +1,162 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + Extension, + ExtensionsListByArcSettingOptionalParams, + ExtensionsGetOptionalParams, + ExtensionsGetResponse, + ExtensionsCreateOptionalParams, + ExtensionsCreateResponse, + ExtensionsUpdateOptionalParams, + ExtensionsUpdateResponse, + ExtensionsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a Extensions. */ +export interface Extensions { + /** + * 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 options parameters. + */ + listByArcSetting( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + options?: ExtensionsListByArcSettingOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options parameters. + */ + get( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + extensionName: string, + options?: ExtensionsGetOptionalParams + ): 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 options parameters. + */ + beginCreate( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + extensionName: string, + extension: Extension, + options?: ExtensionsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ExtensionsCreateResponse + > + >; + /** + * 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 options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + extensionName: string, + extension: Extension, + options?: ExtensionsCreateOptionalParams + ): 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 options parameters. + */ + beginUpdate( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + extensionName: string, + extension: Extension, + options?: ExtensionsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ExtensionsUpdateResponse + > + >; + /** + * 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 options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + extensionName: string, + extension: Extension, + options?: ExtensionsUpdateOptionalParams + ): 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 options parameters. + */ + beginDelete( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + extensionName: string, + options?: ExtensionsDeleteOptionalParams + ): Promise, void>>; + /** + * 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 options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + extensionName: string, + options?: ExtensionsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/azurestackhci/arm-azurestackhci/src/operationsInterfaces/index.ts b/sdk/azurestackhci/arm-azurestackhci/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..2d20c6edaf47 --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/src/operationsInterfaces/index.ts @@ -0,0 +1,12 @@ +/* + * 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 "./arcSettings"; +export * from "./clusters"; +export * from "./extensions"; +export * from "./operations"; diff --git a/sdk/azurestackhci/arm-azurestackhci/src/operationsInterfaces/operations.ts b/sdk/azurestackhci/arm-azurestackhci/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..706ea219c720 --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/src/operationsInterfaces/operations.ts @@ -0,0 +1,21 @@ +/* + * 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 { + OperationsListOptionalParams, + OperationsListResponse +} from "../models"; + +/** Interface representing a Operations. */ +export interface Operations { + /** + * List all available Microsoft.AzureStackHCI provider operations + * @param options The options parameters. + */ + list(options?: OperationsListOptionalParams): Promise; +} diff --git a/sdk/azurestackhci/arm-azurestackhci/test/sampleTest.ts b/sdk/azurestackhci/arm-azurestackhci/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/azurestackhci/arm-azurestackhci/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * 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 { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/azurestackhci/arm-azurestackhci/tsconfig.json b/sdk/azurestackhci/arm-azurestackhci/tsconfig.json index 422b584abd5e..6e3251194117 100644 --- a/sdk/azurestackhci/arm-azurestackhci/tsconfig.json +++ b/sdk/azurestackhci/arm-azurestackhci/tsconfig.json @@ -3,7 +3,7 @@ "module": "es6", "moduleResolution": "node", "strict": true, - "target": "es5", + "target": "es6", "sourceMap": true, "declarationMap": true, "esModuleInterop": true, @@ -11,9 +11,9 @@ "forceConsistentCasingInFileNames": true, "lib": ["es6", "dom"], "declaration": true, - "outDir": "./esm", + "outDir": "./dist-esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./src/**/*.ts", "./test/**/*.ts"], "exclude": ["node_modules"] } diff --git a/sdk/azurestackhci/ci.yml b/sdk/azurestackhci/ci.yml new file mode 100644 index 000000000000..a292f51b614a --- /dev/null +++ b/sdk/azurestackhci/ci.yml @@ -0,0 +1,29 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. +trigger: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/azurestackhci/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/azurestackhci/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: azurestackhci + Artifacts: + - name: azure-arm-azurestackhci + safeName: azurearmazurestackhci + \ No newline at end of file