diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 3c65773d62a2..57d9c102ebaa 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -47,6 +47,7 @@ specifiers: '@rush-temp/arm-compute-profile-2020-09-01-hybrid': file:./projects/arm-compute-profile-2020-09-01-hybrid.tgz '@rush-temp/arm-confidentialledger': file:./projects/arm-confidentialledger.tgz '@rush-temp/arm-confluent': file:./projects/arm-confluent.tgz + '@rush-temp/arm-connectedvmware': file:./projects/arm-connectedvmware.tgz '@rush-temp/arm-consumption': file:./projects/arm-consumption.tgz '@rush-temp/arm-containerinstance': file:./projects/arm-containerinstance.tgz '@rush-temp/arm-containerregistry': file:./projects/arm-containerregistry.tgz @@ -349,6 +350,7 @@ dependencies: '@rush-temp/arm-compute-profile-2020-09-01-hybrid': file:projects/arm-compute-profile-2020-09-01-hybrid.tgz '@rush-temp/arm-confidentialledger': file:projects/arm-confidentialledger.tgz '@rush-temp/arm-confluent': file:projects/arm-confluent.tgz + '@rush-temp/arm-connectedvmware': file:projects/arm-connectedvmware.tgz '@rush-temp/arm-consumption': file:projects/arm-consumption.tgz '@rush-temp/arm-containerinstance': file:projects/arm-containerinstance.tgz '@rush-temp/arm-containerregistry': file:projects/arm-containerregistry.tgz @@ -11011,6 +11013,33 @@ packages: - supports-color dev: false + file:projects/arm-connectedvmware.tgz: + resolution: {integrity: sha512-12LgkTdZkmzbUPLD2tgNyijsnNZG7HtQfwNdReKatvR6gfPAWLGeNdENOIS7DTE2iuQKf3Tur/ftjFKBNwStqA==, tarball: file:projects/arm-connectedvmware.tgz} + name: '@rush-temp/arm-connectedvmware' + version: 0.0.0 + dependencies: + '@azure/identity': 2.1.0 + '@microsoft/api-extractor': 7.18.11 + '@rollup/plugin-commonjs': 21.1.0_rollup@2.77.2 + '@rollup/plugin-json': 4.1.0_rollup@2.77.2 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.77.2 + '@rollup/plugin-node-resolve': 13.3.0_rollup@2.77.2 + '@types/chai': 4.3.1 + chai: 4.3.6 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 2.77.2 + rollup-plugin-sourcemaps: 0.6.3_rollup@2.77.2 + tslib: 2.4.0 + typescript: 4.6.4 + uglify-js: 3.16.3 + transitivePeerDependencies: + - '@types/node' + - supports-color + dev: false + file:projects/arm-consumption.tgz: resolution: {integrity: sha512-NQFxrW/D3odjtPrxLs6gwb+AyosrVpjGVmISx1HvJpfEs12cYKRWGNNYGnKdiv4vjyKW8RWrBEg4SP8duHVDGQ==, tarball: file:projects/arm-consumption.tgz} name: '@rush-temp/arm-consumption' diff --git a/eng/ignore-links.txt b/eng/ignore-links.txt index 636c58bbbbcb..3bba6e2f2a2e 100644 --- a/eng/ignore-links.txt +++ b/eng/ignore-links.txt @@ -18,3 +18,4 @@ https://docs.microsoft.com/javascript/api/@azure/arm-fluidrelay?view=azure-node- https://docs.microsoft.com/javascript/api/@azure/arm-automanage https://docs.microsoft.com/javascript/api/@azure/arm-automanage?view=azure-node-preview https://docs.microsoft.com/javascript/api/@azure/arm-devcenter?view=azure-node-preview +https://docs.microsoft.com/javascript/api/@azure/arm-connectedvmware?view=azure-node-preview diff --git a/rush.json b/rush.json index 4a158dfbe248..22642df3ef0b 100644 --- a/rush.json +++ b/rush.json @@ -1820,6 +1820,11 @@ "packageName": "@azure/communication-rooms", "projectFolder": "sdk/communication/communication-rooms", "versionPolicyName": "client" + }, + { + "packageName": "@azure/arm-connectedvmware", + "projectFolder": "sdk/connectedvmware/arm-connectedvmware", + "versionPolicyName": "management" } ] -} +} \ No newline at end of file diff --git a/sdk/connectedvmware/arm-connectedvmware/CHANGELOG.md b/sdk/connectedvmware/arm-connectedvmware/CHANGELOG.md new file mode 100644 index 000000000000..46e005e8c35f --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-08-15) + +The package of @azure/arm-connectedvmware is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/connectedvmware/arm-connectedvmware/LICENSE b/sdk/connectedvmware/arm-connectedvmware/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/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/connectedvmware/arm-connectedvmware/README.md b/sdk/connectedvmware/arm-connectedvmware/README.md new file mode 100644 index 000000000000..aba40450f3cf --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/README.md @@ -0,0 +1,109 @@ +# Azure Arc VMware Management client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Arc VMware Management client. + +Self service experience for VMware. + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/connectedvmware/arm-connectedvmware) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-connectedvmware) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-connectedvmware?view=azure-node-preview) | +[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. + +See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-connectedvmware` package + +Install the Azure Arc VMware Management client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-connectedvmware +``` + +### Create and authenticate a `AzureArcVMwareManagementServiceAPI` + +To create a client object to access the Azure Arc VMware Management API, you will need the `endpoint` of your Azure Arc VMware Management resource and a `credential`. The Azure Arc VMware Management client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure Arc VMware Management resource in the [Azure Portal][azure_portal]. + +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). + +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 +``` + +You will also need to **register a new AAD application and grant access to Azure Arc VMware Management** 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`. + +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 { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); +// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. + +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new AzureArcVMwareManagementServiceAPI(new DefaultAzureCredential(), subscriptionId); + +// For client-side applications running in the browser, use this code instead: +// const credential = new InteractiveBrowserCredential({ +// tenantId: "", +// clientId: "" +// }); +// const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); +``` + + +### 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 + +### AzureArcVMwareManagementServiceAPI + +`AzureArcVMwareManagementServiceAPI` is the primary interface for developers using the Azure Arc VMware Management client library. Explore the methods on this client object to understand the different features of the Azure Arc VMware Management 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) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fconnectedvmware%2Farm-connectedvmware%2FREADME.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/connectedvmware/arm-connectedvmware/_meta.json b/sdk/connectedvmware/arm-connectedvmware/_meta.json new file mode 100644 index 000000000000..a228036c11cd --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/_meta.json @@ -0,0 +1,8 @@ +{ + "commit": "05bce5fc8e93c97fc3a70072e7510acc41255f6c", + "readme": "specification/connectedvmware/resource-manager/readme.md", + "autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\connectedvmware\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.1.20220727.1 --generate-sample=true", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.4.1", + "use": "@autorest/typescript@6.0.0-rc.1.20220727.1" +} diff --git a/sdk/connectedvmware/arm-connectedvmware/api-extractor.json b/sdk/connectedvmware/arm-connectedvmware/api-extractor.json new file mode 100644 index 000000000000..38ad920836c3 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/api-extractor.json @@ -0,0 +1,31 @@ +{ + "$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-connectedvmware.d.ts" + }, + "messages": { + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, + "extractorMessageReporting": { + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } + } + } +} \ No newline at end of file diff --git a/sdk/connectedvmware/arm-connectedvmware/package.json b/sdk/connectedvmware/arm-connectedvmware/package.json new file mode 100644 index 000000000000..7b9283417886 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/package.json @@ -0,0 +1,121 @@ +{ + "name": "@azure/arm-connectedvmware", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for AzureArcVMwareManagementServiceAPI.", + "version": "1.0.0-beta.1", + "engines": { + "node": ">=12.0.0" + }, + "dependencies": { + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.5.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.8.0", + "tslib": "^2.2.0" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-connectedvmware.d.ts", + "devDependencies": { + "@microsoft/api-extractor": "7.18.11", + "@rollup/plugin-commonjs": "^21.0.1", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-multi-entry": "^4.1.0", + "@rollup/plugin-node-resolve": "^13.1.3", + "mkdirp": "^1.0.4", + "rollup": "^2.66.1", + "rollup-plugin-sourcemaps": "^0.6.3", + "typescript": "~4.6.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^2.0.0", + "@azure-tools/test-credential": "^1.0.0", + "mocha": "^7.1.1", + "@types/chai": "^4.2.8", + "chai": "^4.2.0", + "cross-env": "^7.0.2", + "@azure/dev-tool": "^1.0.0" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/connectedvmware/arm-connectedvmware", + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.d.ts.map", + "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", + "review/*", + "CHANGELOG.md", + "types/*" + ], + "scripts": { + "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": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped" + }, + "sideEffects": false, + "//metadata": { + "constantPaths": [ + { + "path": "src/azureArcVMwareManagementServiceAPI.ts", + "prefix": "packageDetails" + } + ] + }, + "autoPublish": true, + "//sampleConfiguration": { + "productName": "", + "productSlugs": [ + "azure" + ], + "disableDocsMs": true, + "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-connectedvmware?view=azure-node-preview" + } +} \ No newline at end of file diff --git a/sdk/connectedvmware/arm-connectedvmware/recordings/node/my_test/recording_sample_test.json b/sdk/connectedvmware/arm-connectedvmware/recordings/node/my_test/recording_sample_test.json new file mode 100644 index 000000000000..f721723386d8 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/recordings/node/my_test/recording_sample_test.json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/connectedvmware/arm-connectedvmware/review/arm-connectedvmware.api.md b/sdk/connectedvmware/arm-connectedvmware/review/arm-connectedvmware.api.md new file mode 100644 index 000000000000..851d0d603425 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/review/arm-connectedvmware.api.md @@ -0,0 +1,1996 @@ +## API Report File for "@azure/arm-connectedvmware" + +> 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 interface AvailablePatchCountByClassification { + readonly critical?: number; + readonly definition?: number; + readonly featurePack?: number; + readonly other?: number; + readonly security?: number; + readonly servicePack?: number; + readonly tools?: number; + readonly updateRollup?: number; + readonly updates?: number; +} + +// @public (undocumented) +export class AzureArcVMwareManagementServiceAPI extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: AzureArcVMwareManagementServiceAPIOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + clusters: Clusters; + // (undocumented) + datastores: Datastores; + // (undocumented) + guestAgents: GuestAgents; + // (undocumented) + hosts: Hosts; + // (undocumented) + hybridIdentityMetadataOperations: HybridIdentityMetadataOperations; + // (undocumented) + inventoryItems: InventoryItems; + // (undocumented) + machineExtensions: MachineExtensions; + // (undocumented) + operations: Operations; + // (undocumented) + resourcePools: ResourcePools; + // (undocumented) + subscriptionId: string; + // (undocumented) + vCenters: VCenters; + // (undocumented) + virtualMachines: VirtualMachines; + // (undocumented) + virtualMachineTemplates: VirtualMachineTemplates; + // (undocumented) + virtualNetworks: VirtualNetworks; +} + +// @public +export interface AzureArcVMwareManagementServiceAPIOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface Cluster { + readonly customResourceName?: string; + readonly datastoreIds?: string[]; + extendedLocation?: ExtendedLocation; + readonly id?: string; + inventoryItemId?: string; + kind?: string; + location: string; + readonly moName?: string; + moRefId?: string; + readonly name?: string; + readonly networkIds?: string[]; + readonly provisioningState?: string; + readonly statuses?: ResourceStatus[]; + readonly systemData?: SystemData; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; + readonly uuid?: string; + vCenterId?: string; +} + +// @public +export interface ClusterInventoryItem extends InventoryItemProperties { + inventoryType: "Cluster"; +} + +// @public +export interface Clusters { + beginCreate(resourceGroupName: string, clusterName: string, options?: ClustersCreateOptionalParams): Promise, ClustersCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, clusterName: string, options?: ClustersCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, clusterName: string, options?: ClustersDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, clusterName: string, options?: ClustersDeleteOptionalParams): Promise; + get(resourceGroupName: string, clusterName: string, options?: ClustersGetOptionalParams): Promise; + list(options?: ClustersListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: ClustersListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, clusterName: string, options?: ClustersUpdateOptionalParams): Promise; +} + +// @public +export interface ClustersCreateOptionalParams extends coreClient.OperationOptions { + body?: Cluster; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ClustersCreateResponse = Cluster; + +// @public +export interface ClustersDeleteOptionalParams extends coreClient.OperationOptions { + force?: boolean; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ClustersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ClustersGetResponse = Cluster; + +// @public +export interface ClustersList { + nextLink?: string; + value: Cluster[]; +} + +// @public +export interface ClustersListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ClustersListByResourceGroupNextResponse = ClustersList; + +// @public +export interface ClustersListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ClustersListByResourceGroupResponse = ClustersList; + +// @public +export interface ClustersListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ClustersListNextResponse = ClustersList; + +// @public +export interface ClustersListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ClustersListResponse = ClustersList; + +// @public +export interface ClustersUpdateOptionalParams extends coreClient.OperationOptions { + body?: ResourcePatch; +} + +// @public +export type ClustersUpdateResponse = Cluster; + +// @public +export interface Condition { + readonly message?: string; + readonly reason?: string; + readonly severity?: string; + readonly status?: string; +} + +// @public +export type CreatedByType = string; + +// @public +export interface Datastore { + readonly customResourceName?: string; + extendedLocation?: ExtendedLocation; + readonly id?: string; + inventoryItemId?: string; + kind?: string; + location: string; + readonly moName?: string; + moRefId?: string; + readonly name?: string; + readonly provisioningState?: ProvisioningState; + readonly statuses?: ResourceStatus[]; + readonly systemData?: SystemData; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; + readonly uuid?: string; + vCenterId?: string; +} + +// @public +export interface DatastoreInventoryItem extends InventoryItemProperties { + capacityGB?: number; + freeSpaceGB?: number; + inventoryType: "Datastore"; +} + +// @public +export interface Datastores { + beginCreate(resourceGroupName: string, datastoreName: string, options?: DatastoresCreateOptionalParams): Promise, DatastoresCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, datastoreName: string, options?: DatastoresCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, datastoreName: string, options?: DatastoresDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, datastoreName: string, options?: DatastoresDeleteOptionalParams): Promise; + get(resourceGroupName: string, datastoreName: string, options?: DatastoresGetOptionalParams): Promise; + list(options?: DatastoresListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: DatastoresListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, datastoreName: string, options?: DatastoresUpdateOptionalParams): Promise; +} + +// @public +export interface DatastoresCreateOptionalParams extends coreClient.OperationOptions { + body?: Datastore; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DatastoresCreateResponse = Datastore; + +// @public +export interface DatastoresDeleteOptionalParams extends coreClient.OperationOptions { + force?: boolean; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DatastoresGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DatastoresGetResponse = Datastore; + +// @public +export interface DatastoresList { + nextLink?: string; + value: Datastore[]; +} + +// @public +export interface DatastoresListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DatastoresListByResourceGroupNextResponse = DatastoresList; + +// @public +export interface DatastoresListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DatastoresListByResourceGroupResponse = DatastoresList; + +// @public +export interface DatastoresListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DatastoresListNextResponse = DatastoresList; + +// @public +export interface DatastoresListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DatastoresListResponse = DatastoresList; + +// @public +export interface DatastoresUpdateOptionalParams extends coreClient.OperationOptions { + body?: ResourcePatch; +} + +// @public +export type DatastoresUpdateResponse = Datastore; + +// @public +export type DiskMode = string; + +// @public +export type DiskType = string; + +// @public +export interface ErrorDefinition { + readonly code?: string; + readonly details?: ErrorDefinition[]; + readonly message?: string; +} + +// @public +export interface ErrorDetail { + code: string; + details?: ErrorDetail[]; + message: string; + target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDefinition; +} + +// @public +export interface ExtendedLocation { + name?: string; + type?: string; +} + +// @public +export type FirmwareType = string; + +// @public +export interface GuestAgent extends ProxyResource { + credentials?: GuestCredential; + readonly customResourceName?: string; + httpProxyConfig?: HttpProxyConfiguration; + provisioningAction?: ProvisioningAction; + readonly provisioningState?: string; + readonly status?: string; + readonly statuses?: ResourceStatus[]; + readonly systemData?: SystemData; + readonly uuid?: string; +} + +// @public +export interface GuestAgentList { + nextLink?: string; + value: GuestAgent[]; +} + +// @public +export interface GuestAgentProfile { + readonly agentVersion?: string; + readonly errorDetails?: ErrorDetail[]; + readonly lastStatusChange?: Date; + readonly status?: StatusTypes; + readonly vmUuid?: string; +} + +// @public +export interface GuestAgents { + beginCreate(resourceGroupName: string, virtualMachineName: string, name: string, options?: GuestAgentsCreateOptionalParams): Promise, GuestAgentsCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, virtualMachineName: string, name: string, options?: GuestAgentsCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, virtualMachineName: string, name: string, options?: GuestAgentsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, virtualMachineName: string, name: string, options?: GuestAgentsDeleteOptionalParams): Promise; + get(resourceGroupName: string, virtualMachineName: string, name: string, options?: GuestAgentsGetOptionalParams): Promise; + listByVm(resourceGroupName: string, virtualMachineName: string, options?: GuestAgentsListByVmOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface GuestAgentsCreateOptionalParams extends coreClient.OperationOptions { + body?: GuestAgent; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type GuestAgentsCreateResponse = GuestAgent; + +// @public +export interface GuestAgentsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface GuestAgentsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type GuestAgentsGetResponse = GuestAgent; + +// @public +export interface GuestAgentsListByVmNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type GuestAgentsListByVmNextResponse = GuestAgentList; + +// @public +export interface GuestAgentsListByVmOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type GuestAgentsListByVmResponse = GuestAgentList; + +// @public +export interface GuestCredential { + password?: string; + username?: string; +} + +// @public +export interface HardwareProfile { + readonly cpuHotAddEnabled?: boolean; + readonly cpuHotRemoveEnabled?: boolean; + readonly memoryHotAddEnabled?: boolean; + memorySizeMB?: number; + numCoresPerSocket?: number; + numCPUs?: number; +} + +// @public +export interface Host { + readonly customResourceName?: string; + extendedLocation?: ExtendedLocation; + readonly id?: string; + inventoryItemId?: string; + kind?: string; + location: string; + readonly moName?: string; + moRefId?: string; + readonly name?: string; + readonly provisioningState?: string; + readonly statuses?: ResourceStatus[]; + readonly systemData?: SystemData; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; + readonly uuid?: string; + vCenterId?: string; +} + +// @public +export interface HostInventoryItem extends InventoryItemProperties { + inventoryType: "Host"; + parent?: InventoryItemDetails; +} + +// @public +export interface Hosts { + beginCreate(resourceGroupName: string, hostName: string, options?: HostsCreateOptionalParams): Promise, HostsCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, hostName: string, options?: HostsCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, hostName: string, options?: HostsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, hostName: string, options?: HostsDeleteOptionalParams): Promise; + get(resourceGroupName: string, hostName: string, options?: HostsGetOptionalParams): Promise; + list(options?: HostsListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: HostsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, hostName: string, options?: HostsUpdateOptionalParams): Promise; +} + +// @public +export interface HostsCreateOptionalParams extends coreClient.OperationOptions { + body?: Host; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type HostsCreateResponse = Host; + +// @public +export interface HostsDeleteOptionalParams extends coreClient.OperationOptions { + force?: boolean; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface HostsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HostsGetResponse = Host; + +// @public +export interface HostsList { + nextLink?: string; + value: Host[]; +} + +// @public +export interface HostsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HostsListByResourceGroupNextResponse = HostsList; + +// @public +export interface HostsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HostsListByResourceGroupResponse = HostsList; + +// @public +export interface HostsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HostsListNextResponse = HostsList; + +// @public +export interface HostsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HostsListResponse = HostsList; + +// @public +export interface HostsUpdateOptionalParams extends coreClient.OperationOptions { + body?: ResourcePatch; +} + +// @public +export type HostsUpdateResponse = Host; + +// @public +export interface HttpProxyConfiguration { + httpsProxy?: string; +} + +// @public +export interface HybridIdentityMetadata extends ProxyResource { + readonly identity?: Identity; + readonly provisioningState?: string; + publicKey?: string; + readonly systemData?: SystemData; + vmId?: string; +} + +// @public +export interface HybridIdentityMetadataCreateOptionalParams extends coreClient.OperationOptions { + body?: HybridIdentityMetadata; +} + +// @public +export type HybridIdentityMetadataCreateResponse = HybridIdentityMetadata; + +// @public +export interface HybridIdentityMetadataDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface HybridIdentityMetadataGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HybridIdentityMetadataGetResponse = HybridIdentityMetadata; + +// @public +export interface HybridIdentityMetadataList { + nextLink?: string; + value: HybridIdentityMetadata[]; +} + +// @public +export interface HybridIdentityMetadataListByVmNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HybridIdentityMetadataListByVmNextResponse = HybridIdentityMetadataList; + +// @public +export interface HybridIdentityMetadataListByVmOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HybridIdentityMetadataListByVmResponse = HybridIdentityMetadataList; + +// @public +export interface HybridIdentityMetadataOperations { + create(resourceGroupName: string, virtualMachineName: string, metadataName: string, options?: HybridIdentityMetadataCreateOptionalParams): Promise; + delete(resourceGroupName: string, virtualMachineName: string, metadataName: string, options?: HybridIdentityMetadataDeleteOptionalParams): Promise; + get(resourceGroupName: string, virtualMachineName: string, metadataName: string, options?: HybridIdentityMetadataGetOptionalParams): Promise; + listByVm(resourceGroupName: string, virtualMachineName: string, options?: HybridIdentityMetadataListByVmOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface Identity { + readonly principalId?: string; + readonly tenantId?: string; + type: IdentityType; +} + +// @public +export type IdentityType = string; + +// @public +export interface InventoryItem extends ProxyResource { + inventoryType: InventoryType; + kind?: string; + managedResourceId?: string; + moName?: string; + moRefId?: string; + readonly provisioningState?: string; + readonly systemData?: SystemData; +} + +// @public +export interface InventoryItemDetails { + inventoryItemId?: string; + moName?: string; +} + +// @public +export interface InventoryItemProperties { + inventoryType: "ResourcePool" | "VirtualMachine" | "VirtualMachineTemplate" | "VirtualNetwork" | "Cluster" | "Datastore" | "Host"; + managedResourceId?: string; + moName?: string; + moRefId?: string; + readonly provisioningState?: string; +} + +// @public (undocumented) +export type InventoryItemPropertiesUnion = InventoryItemProperties | ResourcePoolInventoryItem | VirtualMachineInventoryItem | VirtualMachineTemplateInventoryItem | VirtualNetworkInventoryItem | ClusterInventoryItem | DatastoreInventoryItem | HostInventoryItem; + +// @public +export interface InventoryItems { + create(resourceGroupName: string, vcenterName: string, inventoryItemName: string, options?: InventoryItemsCreateOptionalParams): Promise; + delete(resourceGroupName: string, vcenterName: string, inventoryItemName: string, options?: InventoryItemsDeleteOptionalParams): Promise; + get(resourceGroupName: string, vcenterName: string, inventoryItemName: string, options?: InventoryItemsGetOptionalParams): Promise; + listByVCenter(resourceGroupName: string, vcenterName: string, options?: InventoryItemsListByVCenterOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface InventoryItemsCreateOptionalParams extends coreClient.OperationOptions { + body?: InventoryItem; +} + +// @public +export type InventoryItemsCreateResponse = InventoryItem; + +// @public +export interface InventoryItemsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface InventoryItemsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type InventoryItemsGetResponse = InventoryItem; + +// @public +export interface InventoryItemsList { + nextLink?: string; + value: InventoryItem[]; +} + +// @public +export interface InventoryItemsListByVCenterNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type InventoryItemsListByVCenterNextResponse = InventoryItemsList; + +// @public +export interface InventoryItemsListByVCenterOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type InventoryItemsListByVCenterResponse = InventoryItemsList; + +// @public +export type InventoryType = string; + +// @public +export type IPAddressAllocationMethod = string; + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownDiskMode { + IndependentNonpersistent = "independent_nonpersistent", + IndependentPersistent = "independent_persistent", + Persistent = "persistent" +} + +// @public +export enum KnownDiskType { + Flat = "flat", + Pmem = "pmem", + Rawphysical = "rawphysical", + Rawvirtual = "rawvirtual", + Sesparse = "sesparse", + Sparse = "sparse", + Unknown = "unknown" +} + +// @public +export enum KnownFirmwareType { + Bios = "bios", + Efi = "efi" +} + +// @public +export enum KnownIdentityType { + None = "None", + SystemAssigned = "SystemAssigned" +} + +// @public +export enum KnownInventoryType { + Cluster = "Cluster", + Datastore = "Datastore", + Host = "Host", + ResourcePool = "ResourcePool", + VirtualMachine = "VirtualMachine", + VirtualMachineTemplate = "VirtualMachineTemplate", + VirtualNetwork = "VirtualNetwork" +} + +// @public +export enum KnownIPAddressAllocationMethod { + Dynamic = "dynamic", + Linklayer = "linklayer", + Other = "other", + Random = "random", + Static = "static", + Unset = "unset" +} + +// @public +export enum KnownNICType { + E1000 = "e1000", + E1000E = "e1000e", + Pcnet32 = "pcnet32", + Vmxnet = "vmxnet", + Vmxnet2 = "vmxnet2", + Vmxnet3 = "vmxnet3" +} + +// @public +export enum KnownOsType { + Linux = "Linux", + Other = "Other", + Windows = "Windows" +} + +// @public +export enum KnownOsTypeUM { + Linux = "Linux", + Windows = "Windows" +} + +// @public +export enum KnownPatchOperationStartedBy { + Platform = "Platform", + User = "User" +} + +// @public +export enum KnownPatchOperationStatus { + CompletedWithWarnings = "CompletedWithWarnings", + Failed = "Failed", + InProgress = "InProgress", + Succeeded = "Succeeded", + Unknown = "Unknown" +} + +// @public +export enum KnownPatchServiceUsed { + APT = "APT", + Unknown = "Unknown", + WU = "WU", + WUWsus = "WU_WSUS", + YUM = "YUM", + Zypper = "Zypper" +} + +// @public +export enum KnownPowerOnBootOption { + Disabled = "disabled", + Enabled = "enabled" +} + +// @public +export enum KnownProvisioningAction { + Install = "install", + Repair = "repair", + Uninstall = "uninstall" +} + +// @public +export enum KnownProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Created = "Created", + Deleting = "Deleting", + Failed = "Failed", + Provisioning = "Provisioning", + Succeeded = "Succeeded", + Updating = "Updating" +} + +// @public +export enum KnownScsiControllerType { + Buslogic = "buslogic", + Lsilogic = "lsilogic", + Lsilogicsas = "lsilogicsas", + Pvscsi = "pvscsi" +} + +// @public +export enum KnownStatusLevelTypes { + Error = "Error", + Info = "Info", + Warning = "Warning" +} + +// @public +export enum KnownStatusTypes { + Connected = "Connected", + Disconnected = "Disconnected", + Error = "Error" +} + +// @public +export enum KnownVirtualScsiSharing { + NoSharing = "noSharing", + PhysicalSharing = "physicalSharing", + VirtualSharing = "virtualSharing" +} + +// @public +export enum KnownVMGuestPatchClassificationLinux { + Critical = "Critical", + Other = "Other", + Security = "Security" +} + +// @public +export enum KnownVMGuestPatchClassificationWindows { + Critical = "Critical", + Definition = "Definition", + FeaturePack = "FeaturePack", + Security = "Security", + ServicePack = "ServicePack", + Tools = "Tools", + UpdateRollUp = "UpdateRollUp", + Updates = "Updates" +} + +// @public +export enum KnownVMGuestPatchRebootSetting { + Always = "Always", + IfRequired = "IfRequired", + Never = "Never" +} + +// @public +export enum KnownVMGuestPatchRebootStatus { + Completed = "Completed", + Failed = "Failed", + NotNeeded = "NotNeeded", + Required = "Required", + Started = "Started", + Unknown = "Unknown" +} + +// @public +export interface LinuxParameters { + classificationsToInclude?: VMGuestPatchClassificationLinux[]; + packageNameMasksToExclude?: string[]; + packageNameMasksToInclude?: string[]; +} + +// @public +export interface MachineExtension { + autoUpgradeMinorVersion?: boolean; + enableAutomaticUpgrade?: boolean; + forceUpdateTag?: string; + readonly id?: string; + instanceView?: MachineExtensionPropertiesInstanceView; + location?: string; + readonly name?: string; + protectedSettings?: Record; + readonly provisioningState?: string; + publisher?: string; + settings?: Record; + readonly systemData?: SystemData; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; + typeHandlerVersion?: string; + typePropertiesType?: string; +} + +// @public +export interface MachineExtensionInstanceView { + readonly name?: string; + status?: MachineExtensionInstanceViewStatus; + readonly type?: string; + readonly typeHandlerVersion?: string; +} + +// @public +export interface MachineExtensionInstanceViewStatus { + readonly code?: string; + readonly displayStatus?: string; + readonly level?: StatusLevelTypes; + readonly message?: string; + readonly time?: Date; +} + +// @public +export interface MachineExtensionPropertiesInstanceView extends MachineExtensionInstanceView { +} + +// @public +export interface MachineExtensions { + beginCreateOrUpdate(resourceGroupName: string, name: string, extensionName: string, extensionParameters: MachineExtension, options?: MachineExtensionsCreateOrUpdateOptionalParams): Promise, MachineExtensionsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, name: string, extensionName: string, extensionParameters: MachineExtension, options?: MachineExtensionsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, name: string, extensionName: string, options?: MachineExtensionsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, name: string, extensionName: string, options?: MachineExtensionsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, name: string, extensionName: string, extensionParameters: MachineExtensionUpdate, options?: MachineExtensionsUpdateOptionalParams): Promise, MachineExtensionsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, name: string, extensionName: string, extensionParameters: MachineExtensionUpdate, options?: MachineExtensionsUpdateOptionalParams): Promise; + get(resourceGroupName: string, name: string, extensionName: string, options?: MachineExtensionsGetOptionalParams): Promise; + list(resourceGroupName: string, name: string, options?: MachineExtensionsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface MachineExtensionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type MachineExtensionsCreateOrUpdateResponse = MachineExtension; + +// @public +export interface MachineExtensionsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface MachineExtensionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MachineExtensionsGetResponse = MachineExtension; + +// @public +export interface MachineExtensionsListNextOptionalParams extends coreClient.OperationOptions { + expand?: string; +} + +// @public +export type MachineExtensionsListNextResponse = MachineExtensionsListResult; + +// @public +export interface MachineExtensionsListOptionalParams extends coreClient.OperationOptions { + expand?: string; +} + +// @public +export type MachineExtensionsListResponse = MachineExtensionsListResult; + +// @public +export interface MachineExtensionsListResult { + nextLink?: string; + value?: MachineExtension[]; +} + +// @public +export interface MachineExtensionsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type MachineExtensionsUpdateResponse = MachineExtension; + +// @public +export interface MachineExtensionUpdate extends ResourcePatch { + autoUpgradeMinorVersion?: boolean; + enableAutomaticUpgrade?: boolean; + forceUpdateTag?: string; + protectedSettings?: Record; + publisher?: string; + settings?: Record; + type?: string; + typeHandlerVersion?: string; +} + +// @public +export interface NetworkInterface { + deviceKey?: number; + readonly ipAddresses?: string[]; + ipSettings?: NicIPSettings; + readonly label?: string; + readonly macAddress?: string; + name?: string; + networkId?: string; + readonly networkMoName?: string; + readonly networkMoRefId?: string; + nicType?: NICType; + powerOnBoot?: PowerOnBootOption; +} + +// @public +export interface NetworkInterfaceUpdate { + deviceKey?: number; + name?: string; + networkId?: string; + nicType?: NICType; + powerOnBoot?: PowerOnBootOption; +} + +// @public +export interface NetworkProfile { + networkInterfaces?: NetworkInterface[]; +} + +// @public +export interface NetworkProfileUpdate { + networkInterfaces?: NetworkInterfaceUpdate[]; +} + +// @public +export interface NicIPAddressSettings { + readonly allocationMethod?: string; + readonly ipAddress?: string; + readonly subnetMask?: string; +} + +// @public +export interface NicIPSettings { + allocationMethod?: IPAddressAllocationMethod; + dnsServers?: string[]; + gateway?: string[]; + ipAddress?: string; + readonly ipAddressInfo?: NicIPAddressSettings[]; + readonly primaryWinsServer?: string; + readonly secondaryWinsServer?: string; + subnetMask?: string; +} + +// @public +export type NICType = string; + +// @public +export interface Operation { + display?: OperationDisplay; + isDataAction?: boolean; + name?: string; +} + +// @public +export interface OperationDisplay { + description?: string; + operation?: string; + provider?: string; + resource?: string; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsList { + nextLink?: string; + value: Operation[]; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationsList; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationsList; + +// @public +export interface OsProfile { + adminPassword?: string; + adminUsername?: string; + readonly allowExtensionOperations?: boolean; + computerName?: string; + guestId?: string; + linuxConfiguration?: OsProfileLinuxConfiguration; + readonly osName?: string; + osType?: OsType; + readonly toolsRunningStatus?: string; + readonly toolsVersion?: string; + readonly toolsVersionStatus?: string; + windowsConfiguration?: OsProfileWindowsConfiguration; +} + +// @public +export interface OsProfileLinuxConfiguration { + assessmentMode?: string; + patchMode?: string; +} + +// @public +export interface OsProfileUpdate { + linuxConfiguration?: OsProfileUpdateLinuxConfiguration; + windowsConfiguration?: OsProfileUpdateWindowsConfiguration; +} + +// @public +export interface OsProfileUpdateLinuxConfiguration { + assessmentMode?: string; + patchMode?: string; +} + +// @public +export interface OsProfileUpdateWindowsConfiguration { + assessmentMode?: string; + patchMode?: string; +} + +// @public +export interface OsProfileWindowsConfiguration { + assessmentMode?: string; + patchMode?: string; +} + +// @public +export type OsType = string; + +// @public +export type OsTypeUM = string; + +// @public +export type PatchOperationStartedBy = string; + +// @public +export type PatchOperationStatus = string; + +// @public +export type PatchServiceUsed = string; + +// @public +export interface PlacementProfile { + clusterId?: string; + datastoreId?: string; + hostId?: string; + resourcePoolId?: string; +} + +// @public +export type PowerOnBootOption = string; + +// @public +export type ProvisioningAction = string; + +// @public +export type ProvisioningState = string; + +// @public +export interface ProxyResource extends Resource { +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export interface ResourcePatch { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface ResourcePool { + readonly cpuLimitMHz?: number; + readonly cpuReservationMHz?: number; + readonly cpuSharesLevel?: string; + readonly customResourceName?: string; + extendedLocation?: ExtendedLocation; + readonly id?: string; + inventoryItemId?: string; + kind?: string; + location: string; + readonly memLimitMB?: number; + readonly memReservationMB?: number; + readonly memSharesLevel?: string; + readonly moName?: string; + moRefId?: string; + readonly name?: string; + readonly provisioningState?: string; + readonly statuses?: ResourceStatus[]; + readonly systemData?: SystemData; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; + readonly uuid?: string; + vCenterId?: string; +} + +// @public +export interface ResourcePoolInventoryItem extends InventoryItemProperties { + inventoryType: "ResourcePool"; + parent?: InventoryItemDetails; +} + +// @public +export interface ResourcePools { + beginCreate(resourceGroupName: string, resourcePoolName: string, options?: ResourcePoolsCreateOptionalParams): Promise, ResourcePoolsCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, resourcePoolName: string, options?: ResourcePoolsCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, resourcePoolName: string, options?: ResourcePoolsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, resourcePoolName: string, options?: ResourcePoolsDeleteOptionalParams): Promise; + get(resourceGroupName: string, resourcePoolName: string, options?: ResourcePoolsGetOptionalParams): Promise; + list(options?: ResourcePoolsListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: ResourcePoolsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, resourcePoolName: string, options?: ResourcePoolsUpdateOptionalParams): Promise; +} + +// @public +export interface ResourcePoolsCreateOptionalParams extends coreClient.OperationOptions { + body?: ResourcePool; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ResourcePoolsCreateResponse = ResourcePool; + +// @public +export interface ResourcePoolsDeleteOptionalParams extends coreClient.OperationOptions { + force?: boolean; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ResourcePoolsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ResourcePoolsGetResponse = ResourcePool; + +// @public +export interface ResourcePoolsList { + nextLink?: string; + value: ResourcePool[]; +} + +// @public +export interface ResourcePoolsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ResourcePoolsListByResourceGroupNextResponse = ResourcePoolsList; + +// @public +export interface ResourcePoolsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ResourcePoolsListByResourceGroupResponse = ResourcePoolsList; + +// @public +export interface ResourcePoolsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ResourcePoolsListNextResponse = ResourcePoolsList; + +// @public +export interface ResourcePoolsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ResourcePoolsListResponse = ResourcePoolsList; + +// @public +export interface ResourcePoolsUpdateOptionalParams extends coreClient.OperationOptions { + body?: ResourcePatch; +} + +// @public +export type ResourcePoolsUpdateResponse = ResourcePool; + +// @public +export interface ResourceStatus { + readonly lastUpdatedAt?: Date; + readonly message?: string; + readonly reason?: string; + readonly severity?: string; + readonly status?: string; + readonly type?: string; +} + +// @public +export type ScsiControllerType = string; + +// @public +export interface SecurityProfile { + uefiSettings?: UefiSettings; +} + +// @public +export type StatusLevelTypes = string; + +// @public +export type StatusTypes = string; + +// @public +export interface StopVirtualMachineOptions { + skipShutdown?: boolean; +} + +// @public +export interface StorageProfile { + disks?: VirtualDisk[]; + readonly scsiControllers?: VirtualScsiController[]; +} + +// @public +export interface StorageProfileUpdate { + disks?: VirtualDiskUpdate[]; +} + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface UefiSettings { + secureBootEnabled?: boolean; +} + +// @public +export interface VCenter { + readonly connectionStatus?: string; + credentials?: VICredential; + readonly customResourceName?: string; + extendedLocation?: ExtendedLocation; + fqdn: string; + readonly id?: string; + readonly instanceUuid?: string; + kind?: string; + location: string; + readonly name?: string; + port?: number; + readonly provisioningState?: string; + readonly statuses?: ResourceStatus[]; + readonly systemData?: SystemData; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; + readonly uuid?: string; + readonly version?: string; +} + +// @public +export interface VCenters { + beginCreate(resourceGroupName: string, vcenterName: string, options?: VCentersCreateOptionalParams): Promise, VCentersCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, vcenterName: string, options?: VCentersCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, vcenterName: string, options?: VCentersDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, vcenterName: string, options?: VCentersDeleteOptionalParams): Promise; + get(resourceGroupName: string, vcenterName: string, options?: VCentersGetOptionalParams): Promise; + list(options?: VCentersListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: VCentersListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, vcenterName: string, options?: VCentersUpdateOptionalParams): Promise; +} + +// @public +export interface VCentersCreateOptionalParams extends coreClient.OperationOptions { + body?: VCenter; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VCentersCreateResponse = VCenter; + +// @public +export interface VCentersDeleteOptionalParams extends coreClient.OperationOptions { + force?: boolean; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface VCentersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VCentersGetResponse = VCenter; + +// @public +export interface VCentersList { + nextLink?: string; + value: VCenter[]; +} + +// @public +export interface VCentersListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VCentersListByResourceGroupNextResponse = VCentersList; + +// @public +export interface VCentersListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VCentersListByResourceGroupResponse = VCentersList; + +// @public +export interface VCentersListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VCentersListNextResponse = VCentersList; + +// @public +export interface VCentersListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VCentersListResponse = VCentersList; + +// @public +export interface VCentersUpdateOptionalParams extends coreClient.OperationOptions { + body?: ResourcePatch; +} + +// @public +export type VCentersUpdateResponse = VCenter; + +// @public +export interface VICredential { + password?: string; + username?: string; +} + +// @public +export interface VirtualDisk { + controllerKey?: number; + deviceKey?: number; + deviceName?: string; + diskMode?: DiskMode; + readonly diskObjectId?: string; + diskSizeGB?: number; + diskType?: DiskType; + readonly label?: string; + name?: string; + unitNumber?: number; +} + +// @public +export interface VirtualDiskUpdate { + controllerKey?: number; + deviceKey?: number; + deviceName?: string; + diskMode?: DiskMode; + diskSizeGB?: number; + diskType?: DiskType; + name?: string; + unitNumber?: number; +} + +// @public +export interface VirtualMachine { + readonly customResourceName?: string; + extendedLocation?: ExtendedLocation; + firmwareType?: FirmwareType; + readonly folderPath?: string; + guestAgentProfile?: GuestAgentProfile; + hardwareProfile?: HardwareProfile; + readonly id?: string; + identity?: Identity; + readonly instanceUuid?: string; + inventoryItemId?: string; + kind?: string; + location: string; + readonly moName?: string; + moRefId?: string; + readonly name?: string; + networkProfile?: NetworkProfile; + osProfile?: OsProfile; + placementProfile?: PlacementProfile; + readonly powerState?: string; + readonly provisioningState?: string; + resourcePoolId?: string; + securityProfile?: SecurityProfile; + smbiosUuid?: string; + readonly statuses?: ResourceStatus[]; + storageProfile?: StorageProfile; + readonly systemData?: SystemData; + tags?: { + [propertyName: string]: string; + }; + templateId?: string; + readonly type?: string; + readonly uuid?: string; + vCenterId?: string; + readonly vmId?: string; +} + +// @public +export interface VirtualMachineAssessPatchesResult { + readonly assessmentActivityId?: string; + availablePatchCountByClassification?: AvailablePatchCountByClassification; + readonly errorDetails?: ErrorDetail; + readonly lastModifiedDateTime?: Date; + readonly osType?: OsTypeUM; + readonly patchServiceUsed?: PatchServiceUsed; + readonly rebootPending?: boolean; + readonly startDateTime?: Date; + readonly startedBy?: PatchOperationStartedBy; + readonly status?: PatchOperationStatus; +} + +// @public +export interface VirtualMachineInstallPatchesParameters { + linuxParameters?: LinuxParameters; + maximumDuration: string; + rebootSetting: VMGuestPatchRebootSetting; + windowsParameters?: WindowsParameters; +} + +// @public +export interface VirtualMachineInstallPatchesResult { + readonly errorDetails?: ErrorDetail; + readonly excludedPatchCount?: number; + readonly failedPatchCount?: number; + readonly installationActivityId?: string; + readonly installedPatchCount?: number; + readonly lastModifiedDateTime?: Date; + readonly maintenanceWindowExceeded?: boolean; + readonly notSelectedPatchCount?: number; + readonly osType?: OsTypeUM; + readonly patchServiceUsed?: PatchServiceUsed; + readonly pendingPatchCount?: number; + readonly rebootStatus?: VMGuestPatchRebootStatus; + readonly startDateTime?: Date; + readonly startedBy?: PatchOperationStartedBy; + readonly status?: PatchOperationStatus; +} + +// @public +export interface VirtualMachineInventoryItem extends InventoryItemProperties { + folderPath?: string; + host?: InventoryItemDetails; + instanceUuid?: string; + inventoryType: "VirtualMachine"; + ipAddresses?: string[]; + osName?: string; + osType?: OsType; + readonly powerState?: string; + resourcePool?: InventoryItemDetails; + smbiosUuid?: string; + readonly toolsRunningStatus?: string; + readonly toolsVersion?: string; + readonly toolsVersionStatus?: string; +} + +// @public +export interface VirtualMachines { + beginAssessPatches(resourceGroupName: string, name: string, options?: VirtualMachinesAssessPatchesOptionalParams): Promise, VirtualMachinesAssessPatchesResponse>>; + beginAssessPatchesAndWait(resourceGroupName: string, name: string, options?: VirtualMachinesAssessPatchesOptionalParams): Promise; + beginCreate(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesCreateOptionalParams): Promise, VirtualMachinesCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesDeleteOptionalParams): Promise; + beginInstallPatches(resourceGroupName: string, name: string, installPatchesInput: VirtualMachineInstallPatchesParameters, options?: VirtualMachinesInstallPatchesOptionalParams): Promise, VirtualMachinesInstallPatchesResponse>>; + beginInstallPatchesAndWait(resourceGroupName: string, name: string, installPatchesInput: VirtualMachineInstallPatchesParameters, options?: VirtualMachinesInstallPatchesOptionalParams): Promise; + beginRestart(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesRestartOptionalParams): Promise, void>>; + beginRestartAndWait(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesRestartOptionalParams): Promise; + beginStart(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesStartOptionalParams): Promise, void>>; + beginStartAndWait(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesStartOptionalParams): Promise; + beginStop(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesStopOptionalParams): Promise, void>>; + beginStopAndWait(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesStopOptionalParams): Promise; + beginUpdate(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesUpdateOptionalParams): Promise, VirtualMachinesUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesUpdateOptionalParams): Promise; + get(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesGetOptionalParams): Promise; + list(options?: VirtualMachinesListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: VirtualMachinesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface VirtualMachinesAssessPatchesOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VirtualMachinesAssessPatchesResponse = VirtualMachineAssessPatchesResult; + +// @public +export interface VirtualMachinesCreateOptionalParams extends coreClient.OperationOptions { + body?: VirtualMachine; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VirtualMachinesCreateResponse = VirtualMachine; + +// @public +export interface VirtualMachinesDeleteOptionalParams extends coreClient.OperationOptions { + force?: boolean; + resumeFrom?: string; + retain?: boolean; + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachinesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualMachinesGetResponse = VirtualMachine; + +// @public +export interface VirtualMachinesInstallPatchesOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VirtualMachinesInstallPatchesResponse = VirtualMachineInstallPatchesResult; + +// @public +export interface VirtualMachinesList { + nextLink?: string; + value: VirtualMachine[]; +} + +// @public +export interface VirtualMachinesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualMachinesListByResourceGroupNextResponse = VirtualMachinesList; + +// @public +export interface VirtualMachinesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualMachinesListByResourceGroupResponse = VirtualMachinesList; + +// @public +export interface VirtualMachinesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualMachinesListNextResponse = VirtualMachinesList; + +// @public +export interface VirtualMachinesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualMachinesListResponse = VirtualMachinesList; + +// @public +export interface VirtualMachinesRestartOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachinesStartOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachinesStopOptionalParams extends coreClient.OperationOptions { + body?: StopVirtualMachineOptions; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachinesUpdateOptionalParams extends coreClient.OperationOptions { + body?: VirtualMachineUpdate; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VirtualMachinesUpdateResponse = VirtualMachine; + +// @public +export interface VirtualMachineTemplate { + readonly customResourceName?: string; + readonly disks?: VirtualDisk[]; + extendedLocation?: ExtendedLocation; + readonly firmwareType?: FirmwareType; + readonly folderPath?: string; + readonly id?: string; + inventoryItemId?: string; + kind?: string; + location: string; + readonly memorySizeMB?: number; + readonly moName?: string; + moRefId?: string; + readonly name?: string; + readonly networkInterfaces?: NetworkInterface[]; + readonly numCoresPerSocket?: number; + readonly numCPUs?: number; + readonly osName?: string; + readonly osType?: OsType; + readonly provisioningState?: string; + readonly statuses?: ResourceStatus[]; + readonly systemData?: SystemData; + tags?: { + [propertyName: string]: string; + }; + readonly toolsVersion?: string; + readonly toolsVersionStatus?: string; + readonly type?: string; + readonly uuid?: string; + vCenterId?: string; +} + +// @public +export interface VirtualMachineTemplateInventoryItem extends InventoryItemProperties { + folderPath?: string; + inventoryType: "VirtualMachineTemplate"; + memorySizeMB?: number; + numCoresPerSocket?: number; + numCPUs?: number; + osName?: string; + osType?: OsType; +} + +// @public +export interface VirtualMachineTemplates { + beginCreate(resourceGroupName: string, virtualMachineTemplateName: string, options?: VirtualMachineTemplatesCreateOptionalParams): Promise, VirtualMachineTemplatesCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, virtualMachineTemplateName: string, options?: VirtualMachineTemplatesCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, virtualMachineTemplateName: string, options?: VirtualMachineTemplatesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, virtualMachineTemplateName: string, options?: VirtualMachineTemplatesDeleteOptionalParams): Promise; + get(resourceGroupName: string, virtualMachineTemplateName: string, options?: VirtualMachineTemplatesGetOptionalParams): Promise; + list(options?: VirtualMachineTemplatesListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: VirtualMachineTemplatesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, virtualMachineTemplateName: string, options?: VirtualMachineTemplatesUpdateOptionalParams): Promise; +} + +// @public +export interface VirtualMachineTemplatesCreateOptionalParams extends coreClient.OperationOptions { + body?: VirtualMachineTemplate; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VirtualMachineTemplatesCreateResponse = VirtualMachineTemplate; + +// @public +export interface VirtualMachineTemplatesDeleteOptionalParams extends coreClient.OperationOptions { + force?: boolean; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineTemplatesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualMachineTemplatesGetResponse = VirtualMachineTemplate; + +// @public +export interface VirtualMachineTemplatesList { + nextLink?: string; + value: VirtualMachineTemplate[]; +} + +// @public +export interface VirtualMachineTemplatesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualMachineTemplatesListByResourceGroupNextResponse = VirtualMachineTemplatesList; + +// @public +export interface VirtualMachineTemplatesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualMachineTemplatesListByResourceGroupResponse = VirtualMachineTemplatesList; + +// @public +export interface VirtualMachineTemplatesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualMachineTemplatesListNextResponse = VirtualMachineTemplatesList; + +// @public +export interface VirtualMachineTemplatesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualMachineTemplatesListResponse = VirtualMachineTemplatesList; + +// @public +export interface VirtualMachineTemplatesUpdateOptionalParams extends coreClient.OperationOptions { + body?: ResourcePatch; +} + +// @public +export type VirtualMachineTemplatesUpdateResponse = VirtualMachineTemplate; + +// @public +export interface VirtualMachineUpdate { + hardwareProfile?: HardwareProfile; + identity?: Identity; + networkProfile?: NetworkProfileUpdate; + osProfile?: OsProfileUpdate; + storageProfile?: StorageProfileUpdate; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface VirtualNetwork { + readonly customResourceName?: string; + extendedLocation?: ExtendedLocation; + readonly id?: string; + inventoryItemId?: string; + kind?: string; + location: string; + readonly moName?: string; + moRefId?: string; + readonly name?: string; + readonly provisioningState?: string; + readonly statuses?: ResourceStatus[]; + readonly systemData?: SystemData; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; + readonly uuid?: string; + vCenterId?: string; +} + +// @public +export interface VirtualNetworkInventoryItem extends InventoryItemProperties { + inventoryType: "VirtualNetwork"; +} + +// @public +export interface VirtualNetworks { + beginCreate(resourceGroupName: string, virtualNetworkName: string, options?: VirtualNetworksCreateOptionalParams): Promise, VirtualNetworksCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, virtualNetworkName: string, options?: VirtualNetworksCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, virtualNetworkName: string, options?: VirtualNetworksDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, virtualNetworkName: string, options?: VirtualNetworksDeleteOptionalParams): Promise; + get(resourceGroupName: string, virtualNetworkName: string, options?: VirtualNetworksGetOptionalParams): Promise; + list(options?: VirtualNetworksListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: VirtualNetworksListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, virtualNetworkName: string, options?: VirtualNetworksUpdateOptionalParams): Promise; +} + +// @public +export interface VirtualNetworksCreateOptionalParams extends coreClient.OperationOptions { + body?: VirtualNetwork; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VirtualNetworksCreateResponse = VirtualNetwork; + +// @public +export interface VirtualNetworksDeleteOptionalParams extends coreClient.OperationOptions { + force?: boolean; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface VirtualNetworksGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualNetworksGetResponse = VirtualNetwork; + +// @public +export interface VirtualNetworksList { + nextLink?: string; + value: VirtualNetwork[]; +} + +// @public +export interface VirtualNetworksListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualNetworksListByResourceGroupNextResponse = VirtualNetworksList; + +// @public +export interface VirtualNetworksListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualNetworksListByResourceGroupResponse = VirtualNetworksList; + +// @public +export interface VirtualNetworksListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualNetworksListNextResponse = VirtualNetworksList; + +// @public +export interface VirtualNetworksListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualNetworksListResponse = VirtualNetworksList; + +// @public +export interface VirtualNetworksUpdateOptionalParams extends coreClient.OperationOptions { + body?: ResourcePatch; +} + +// @public +export type VirtualNetworksUpdateResponse = VirtualNetwork; + +// @public +export interface VirtualScsiController { + busNumber?: number; + controllerKey?: number; + scsiCtlrUnitNumber?: number; + sharing?: VirtualScsiSharing; + type?: ScsiControllerType; +} + +// @public +export type VirtualScsiSharing = string; + +// @public +export type VMGuestPatchClassificationLinux = string; + +// @public +export type VMGuestPatchClassificationWindows = string; + +// @public +export type VMGuestPatchRebootSetting = string; + +// @public +export type VMGuestPatchRebootStatus = string; + +// @public +export interface WindowsParameters { + classificationsToInclude?: VMGuestPatchClassificationWindows[]; + excludeKbsRequiringReboot?: boolean; + kbNumbersToExclude?: string[]; + kbNumbersToInclude?: string[]; + maxPatchPublishDate?: Date; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/connectedvmware/arm-connectedvmware/rollup.config.js b/sdk/connectedvmware/arm-connectedvmware/rollup.config.js new file mode 100644 index 000000000000..3f89d7309da5 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/rollup.config.js @@ -0,0 +1,122 @@ +/* + * 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"; + +// #region Warning Handler + +/** + * A function that can determine whether a rollup warning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEval(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependency(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval]; + +/** + * 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/**"] + }, + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs(), + 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 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()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/connectedvmware/arm-connectedvmware/sample.env b/sdk/connectedvmware/arm-connectedvmware/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/clustersCreateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/clustersCreateSample.ts new file mode 100644 index 000000000000..ce2d6e1fe796 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/clustersCreateSample.ts @@ -0,0 +1,53 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + Cluster, + ClustersCreateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create Or Update cluster. + * + * @summary Create Or Update cluster. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateCluster.json + */ +async function createCluster() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const clusterName = "HRCluster"; + const body: Cluster = { + extendedLocation: { + name: + "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso", + type: "customLocation" + }, + location: "East US", + moRefId: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + vCenterId: + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter" + }; + const options: ClustersCreateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.clusters.beginCreateAndWait( + resourceGroupName, + clusterName, + options + ); + console.log(result); +} + +createCluster().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/clustersDeleteSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/clustersDeleteSample.ts new file mode 100644 index 000000000000..61d42aad06f1 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/clustersDeleteSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements cluster DELETE method. + * + * @summary Implements cluster DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteCluster.json + */ +async function deleteCluster() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const clusterName = "HRCluster"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.clusters.beginDeleteAndWait( + resourceGroupName, + clusterName + ); + console.log(result); +} + +deleteCluster().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/clustersGetSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/clustersGetSample.ts new file mode 100644 index 000000000000..2cdbeb4a95bb --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/clustersGetSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements cluster GET method. + * + * @summary Implements cluster GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetCluster.json + */ +async function getCluster() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const clusterName = "HRCluster"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.clusters.get(resourceGroupName, clusterName); + console.log(result); +} + +getCluster().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/clustersListByResourceGroupSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/clustersListByResourceGroupSample.ts new file mode 100644 index 000000000000..2a708a22bb66 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/clustersListByResourceGroupSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of clusters in a resource group. + * + * @summary List of clusters in a resource group. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListClustersByResourceGroup.json + */ +async function listClustersByResourceGroup() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.clusters.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listClustersByResourceGroup().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/clustersListSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/clustersListSample.ts new file mode 100644 index 000000000000..e9ebb084e1a0 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/clustersListSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of clusters in a subscription. + * + * @summary List of clusters in a subscription. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListClusters.json + */ +async function listClusters() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.clusters.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listClusters().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/clustersUpdateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/clustersUpdateSample.ts new file mode 100644 index 000000000000..a09377b9e067 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/clustersUpdateSample.ts @@ -0,0 +1,43 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ResourcePatch, + ClustersUpdateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to API to update certain properties of the cluster resource. + * + * @summary API to update certain properties of the cluster resource. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateCluster.json + */ +async function updateCluster() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const clusterName = "HRCluster"; + const body: ResourcePatch = { tags: { tag1: "value1", tag2: "value2" } }; + const options: ClustersUpdateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.clusters.update( + resourceGroupName, + clusterName, + options + ); + console.log(result); +} + +updateCluster().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/datastoresCreateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/datastoresCreateSample.ts new file mode 100644 index 000000000000..ec0722840d48 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/datastoresCreateSample.ts @@ -0,0 +1,53 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + Datastore, + DatastoresCreateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create Or Update datastore. + * + * @summary Create Or Update datastore. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateDatastore.json + */ +async function createDatastore() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const datastoreName = "HRDatastore"; + const body: Datastore = { + extendedLocation: { + name: + "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso", + type: "customLocation" + }, + location: "East US", + moRefId: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + vCenterId: + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter" + }; + const options: DatastoresCreateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.datastores.beginCreateAndWait( + resourceGroupName, + datastoreName, + options + ); + console.log(result); +} + +createDatastore().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/datastoresDeleteSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/datastoresDeleteSample.ts new file mode 100644 index 000000000000..768b6542424d --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/datastoresDeleteSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements datastore DELETE method. + * + * @summary Implements datastore DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteDatastore.json + */ +async function deleteDatastore() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const datastoreName = "HRDatastore"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.datastores.beginDeleteAndWait( + resourceGroupName, + datastoreName + ); + console.log(result); +} + +deleteDatastore().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/datastoresGetSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/datastoresGetSample.ts new file mode 100644 index 000000000000..7312f920fd73 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/datastoresGetSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements datastore GET method. + * + * @summary Implements datastore GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetDatastore.json + */ +async function getDatastore() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const datastoreName = "HRDatastore"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.datastores.get(resourceGroupName, datastoreName); + console.log(result); +} + +getDatastore().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/datastoresListByResourceGroupSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/datastoresListByResourceGroupSample.ts new file mode 100644 index 000000000000..6ae7bb3c0837 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/datastoresListByResourceGroupSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of datastores in a resource group. + * + * @summary List of datastores in a resource group. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListDatastoresByResourceGroup.json + */ +async function listDatastoresByResourceGroup() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.datastores.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listDatastoresByResourceGroup().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/datastoresListSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/datastoresListSample.ts new file mode 100644 index 000000000000..2ddb006895f9 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/datastoresListSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of datastores in a subscription. + * + * @summary List of datastores in a subscription. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListDatastores.json + */ +async function listDatastores() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.datastores.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listDatastores().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/datastoresUpdateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/datastoresUpdateSample.ts new file mode 100644 index 000000000000..679db4e04405 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/datastoresUpdateSample.ts @@ -0,0 +1,43 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ResourcePatch, + DatastoresUpdateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to API to update certain properties of the datastore resource. + * + * @summary API to update certain properties of the datastore resource. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateDatastore.json + */ +async function updateDatastore() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const datastoreName = "HRDatastore"; + const body: ResourcePatch = { tags: { tag1: "value1", tag2: "value2" } }; + const options: DatastoresUpdateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.datastores.update( + resourceGroupName, + datastoreName, + options + ); + console.log(result); +} + +updateDatastore().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/guestAgentsCreateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/guestAgentsCreateSample.ts new file mode 100644 index 000000000000..038152763ba4 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/guestAgentsCreateSample.ts @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + GuestAgent, + GuestAgentsCreateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create Or Update GuestAgent. + * + * @summary Create Or Update GuestAgent. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateGuestAgent.json + */ +async function createGuestAgent() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "ContosoVm"; + const name = "default"; + const body: GuestAgent = { + credentials: { password: "", username: "tempuser" }, + httpProxyConfig: { httpsProxy: "http://192.1.2.3:8080" }, + provisioningAction: "install" + }; + const options: GuestAgentsCreateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.guestAgents.beginCreateAndWait( + resourceGroupName, + virtualMachineName, + name, + options + ); + console.log(result); +} + +createGuestAgent().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/guestAgentsDeleteSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/guestAgentsDeleteSample.ts new file mode 100644 index 000000000000..5e8b991ee04e --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/guestAgentsDeleteSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements GuestAgent DELETE method. + * + * @summary Implements GuestAgent DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteGuestAgent.json + */ +async function deleteGuestAgent() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "ContosoVm"; + const name = "default"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.guestAgents.beginDeleteAndWait( + resourceGroupName, + virtualMachineName, + name + ); + console.log(result); +} + +deleteGuestAgent().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/guestAgentsGetSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/guestAgentsGetSample.ts new file mode 100644 index 000000000000..85b31adc4311 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/guestAgentsGetSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements GuestAgent GET method. + * + * @summary Implements GuestAgent GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetGuestAgent.json + */ +async function getGuestAgent() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "ContosoVm"; + const name = "default"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.guestAgents.get( + resourceGroupName, + virtualMachineName, + name + ); + console.log(result); +} + +getGuestAgent().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/guestAgentsListByVMSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/guestAgentsListByVMSample.ts new file mode 100644 index 000000000000..4280ddd10f67 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/guestAgentsListByVMSample.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Returns the list of GuestAgent of the given vm. + * + * @summary Returns the list of GuestAgent of the given vm. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GuestAgent_ListByVm.json + */ +async function guestAgentListByVM() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "ContosoVm"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.guestAgents.listByVm( + resourceGroupName, + virtualMachineName + )) { + resArray.push(item); + } + console.log(resArray); +} + +guestAgentListByVM().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/hostsCreateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/hostsCreateSample.ts new file mode 100644 index 000000000000..96890ea8d011 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/hostsCreateSample.ts @@ -0,0 +1,53 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + Host, + HostsCreateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create Or Update host. + * + * @summary Create Or Update host. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateHost.json + */ +async function createHost() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const hostName = "HRHost"; + const body: Host = { + extendedLocation: { + name: + "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso", + type: "customLocation" + }, + location: "East US", + moRefId: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + vCenterId: + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter" + }; + const options: HostsCreateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.hosts.beginCreateAndWait( + resourceGroupName, + hostName, + options + ); + console.log(result); +} + +createHost().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/hostsDeleteSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/hostsDeleteSample.ts new file mode 100644 index 000000000000..28c461fd27a8 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/hostsDeleteSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements host DELETE method. + * + * @summary Implements host DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteHost.json + */ +async function deleteHost() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const hostName = "HRHost"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.hosts.beginDeleteAndWait( + resourceGroupName, + hostName + ); + console.log(result); +} + +deleteHost().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/hostsGetSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/hostsGetSample.ts new file mode 100644 index 000000000000..424a90115c08 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/hostsGetSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements host GET method. + * + * @summary Implements host GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetHost.json + */ +async function getHost() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const hostName = "HRHost"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.hosts.get(resourceGroupName, hostName); + console.log(result); +} + +getHost().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/hostsListByResourceGroupSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/hostsListByResourceGroupSample.ts new file mode 100644 index 000000000000..bbc65929d504 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/hostsListByResourceGroupSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of hosts in a resource group. + * + * @summary List of hosts in a resource group. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListHostsByResourceGroup.json + */ +async function listHostsByResourceGroup() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.hosts.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listHostsByResourceGroup().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/hostsListSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/hostsListSample.ts new file mode 100644 index 000000000000..38abf26ab397 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/hostsListSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of hosts in a subscription. + * + * @summary List of hosts in a subscription. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListHosts.json + */ +async function listHosts() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.hosts.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listHosts().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/hostsUpdateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/hostsUpdateSample.ts new file mode 100644 index 000000000000..987467e5ce49 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/hostsUpdateSample.ts @@ -0,0 +1,43 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ResourcePatch, + HostsUpdateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to API to update certain properties of the host resource. + * + * @summary API to update certain properties of the host resource. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateHost.json + */ +async function updateHost() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const hostName = "HRHost"; + const body: ResourcePatch = { tags: { tag1: "value1", tag2: "value2" } }; + const options: HostsUpdateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.hosts.update( + resourceGroupName, + hostName, + options + ); + console.log(result); +} + +updateHost().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/hybridIdentityMetadataCreateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/hybridIdentityMetadataCreateSample.ts new file mode 100644 index 000000000000..af8a656d67f1 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/hybridIdentityMetadataCreateSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + HybridIdentityMetadata, + HybridIdentityMetadataCreateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create Or Update HybridIdentityMetadata. + * + * @summary Create Or Update HybridIdentityMetadata. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateHybridIdentityMetadata.json + */ +async function createHybridIdentityMetadata() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "ContosoVm"; + const metadataName = "default"; + const body: HybridIdentityMetadata = { + publicKey: "8ec7d60c-9700-40b1-8e6e-e5b2f6f477f2", + vmId: "f8b82dff-38ef-4220-99ef-d3a3f86ddc6c" + }; + const options: HybridIdentityMetadataCreateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.hybridIdentityMetadataOperations.create( + resourceGroupName, + virtualMachineName, + metadataName, + options + ); + console.log(result); +} + +createHybridIdentityMetadata().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/hybridIdentityMetadataDeleteSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/hybridIdentityMetadataDeleteSample.ts new file mode 100644 index 000000000000..97f80eba6e57 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/hybridIdentityMetadataDeleteSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements HybridIdentityMetadata DELETE method. + * + * @summary Implements HybridIdentityMetadata DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteHybridIdentityMetadata.json + */ +async function deleteHybridIdentityMetadata() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "ContosoVm"; + const metadataName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.hybridIdentityMetadataOperations.delete( + resourceGroupName, + virtualMachineName, + metadataName + ); + console.log(result); +} + +deleteHybridIdentityMetadata().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/hybridIdentityMetadataGetSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/hybridIdentityMetadataGetSample.ts new file mode 100644 index 000000000000..b1391f0a45be --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/hybridIdentityMetadataGetSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements HybridIdentityMetadata GET method. + * + * @summary Implements HybridIdentityMetadata GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetHybridIdentityMetadata.json + */ +async function getHybridIdentityMetadata() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "ContosoVm"; + const metadataName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.hybridIdentityMetadataOperations.get( + resourceGroupName, + virtualMachineName, + metadataName + ); + console.log(result); +} + +getHybridIdentityMetadata().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/hybridIdentityMetadataListByVMSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/hybridIdentityMetadataListByVMSample.ts new file mode 100644 index 000000000000..2ecd86958f90 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/hybridIdentityMetadataListByVMSample.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Returns the list of HybridIdentityMetadata of the given vm. + * + * @summary Returns the list of HybridIdentityMetadata of the given vm. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/HybridIdentityMetadata_ListByVm.json + */ +async function hybridIdentityMetadataListByVM() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "ContosoVm"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.hybridIdentityMetadataOperations.listByVm( + resourceGroupName, + virtualMachineName + )) { + resArray.push(item); + } + console.log(resArray); +} + +hybridIdentityMetadataListByVM().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/inventoryItemsCreateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/inventoryItemsCreateSample.ts new file mode 100644 index 000000000000..805442214ecb --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/inventoryItemsCreateSample.ts @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + InventoryItem, + InventoryItemsCreateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create Or Update InventoryItem. + * + * @summary Create Or Update InventoryItem. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateInventoryItem.json + */ +async function createInventoryItem() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const vcenterName = "ContosoVCenter"; + const inventoryItemName = "testItem"; + const body: InventoryItem = { inventoryType: "ResourcePool" }; + const options: InventoryItemsCreateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.inventoryItems.create( + resourceGroupName, + vcenterName, + inventoryItemName, + options + ); + console.log(result); +} + +createInventoryItem().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/inventoryItemsDeleteSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/inventoryItemsDeleteSample.ts new file mode 100644 index 000000000000..42c684e7072d --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/inventoryItemsDeleteSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements inventoryItem DELETE method. + * + * @summary Implements inventoryItem DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteInventoryItem.json + */ +async function deleteInventoryItem() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const vcenterName = "ContosoVCenter"; + const inventoryItemName = "testItem"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.inventoryItems.delete( + resourceGroupName, + vcenterName, + inventoryItemName + ); + console.log(result); +} + +deleteInventoryItem().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/inventoryItemsGetSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/inventoryItemsGetSample.ts new file mode 100644 index 000000000000..c787c634d63a --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/inventoryItemsGetSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements InventoryItem GET method. + * + * @summary Implements InventoryItem GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetInventoryItem.json + */ +async function getInventoryItem() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const vcenterName = "ContosoVCenter"; + const inventoryItemName = "testItem"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.inventoryItems.get( + resourceGroupName, + vcenterName, + inventoryItemName + ); + console.log(result); +} + +getInventoryItem().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/inventoryItemsListByVCenterSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/inventoryItemsListByVCenterSample.ts new file mode 100644 index 000000000000..4e271a3d0980 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/inventoryItemsListByVCenterSample.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Returns the list of inventoryItems of the given vCenter. + * + * @summary Returns the list of inventoryItems of the given vCenter. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/InventoryItems_ListByVCenter.json + */ +async function inventoryItemsListByVCenter() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const vcenterName = "ContosoVCenter"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.inventoryItems.listByVCenter( + resourceGroupName, + vcenterName + )) { + resArray.push(item); + } + console.log(resArray); +} + +inventoryItemsListByVCenter().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/machineExtensionsCreateOrUpdateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/machineExtensionsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..4d1c61601a7b --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/machineExtensionsCreateOrUpdateSample.ts @@ -0,0 +1,52 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + MachineExtension, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create or update the extension. + * + * @summary The operation to create or update the extension. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/PUTExtension.json + */ +async function createOrUpdateAMachineExtensionPut() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const name = "myMachine"; + const extensionName = "CustomScriptExtension"; + const extensionParameters: MachineExtension = { + typePropertiesType: "CustomScriptExtension", + location: "eastus2euap", + publisher: "Microsoft.Compute", + settings: { + commandToExecute: + 'powershell.exe -c "Get-Process | Where-Object { $_.CPU -gt 10000 }"' + }, + typeHandlerVersion: "1.10" + }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.machineExtensions.beginCreateOrUpdateAndWait( + resourceGroupName, + name, + extensionName, + extensionParameters + ); + console.log(result); +} + +createOrUpdateAMachineExtensionPut().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/machineExtensionsDeleteSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/machineExtensionsDeleteSample.ts new file mode 100644 index 000000000000..f999d1248cdc --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/machineExtensionsDeleteSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete the extension. + * + * @summary The operation to delete the extension. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DELETEExtension.json + */ +async function deleteAMachineExtension() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const name = "myMachine"; + const extensionName = "MMA"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.machineExtensions.beginDeleteAndWait( + resourceGroupName, + name, + extensionName + ); + console.log(result); +} + +deleteAMachineExtension().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/machineExtensionsGetSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/machineExtensionsGetSample.ts new file mode 100644 index 000000000000..b9c8075b114f --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/machineExtensionsGetSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get the extension. + * + * @summary The operation to get the extension. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GETExtension.json + */ +async function getMachineExtension() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const name = "myMachine"; + const extensionName = "CustomScriptExtension"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.machineExtensions.get( + resourceGroupName, + name, + extensionName + ); + console.log(result); +} + +getMachineExtension().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/machineExtensionsListSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/machineExtensionsListSample.ts new file mode 100644 index 000000000000..4bb0e10adcb4 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/machineExtensionsListSample.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get all extensions of a non-Azure machine + * + * @summary The operation to get all extensions of a non-Azure machine + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/LISTExtension.json + */ +async function getAllMachineExtensions() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const name = "myMachine"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.machineExtensions.list( + resourceGroupName, + name + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAllMachineExtensions().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/machineExtensionsUpdateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/machineExtensionsUpdateSample.ts new file mode 100644 index 000000000000..da64ecdec9dc --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/machineExtensionsUpdateSample.ts @@ -0,0 +1,51 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + MachineExtensionUpdate, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update the extension. + * + * @summary The operation to update the extension. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateExtension.json + */ +async function createOrUpdateAMachineExtensionPatch() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const name = "myMachine"; + const extensionName = "CustomScriptExtension"; + const extensionParameters: MachineExtensionUpdate = { + type: "CustomScriptExtension", + publisher: "Microsoft.Compute", + settings: { + commandToExecute: + 'powershell.exe -c "Get-Process | Where-Object { $_.CPU -lt 100 }"' + }, + typeHandlerVersion: "1.10" + }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.machineExtensions.beginUpdateAndWait( + resourceGroupName, + name, + extensionName, + extensionParameters + ); + console.log(result); +} + +createOrUpdateAMachineExtensionPatch().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/operationsListSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/operationsListSample.ts new file mode 100644 index 000000000000..ba2142de6429 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/operationsListSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Returns list of all operations. + * + * @summary Returns list of all operations. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListOperations.json + */ +async function listOperations() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listOperations().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/resourcePoolsCreateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/resourcePoolsCreateSample.ts new file mode 100644 index 000000000000..dbd02297656f --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/resourcePoolsCreateSample.ts @@ -0,0 +1,53 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ResourcePool, + ResourcePoolsCreateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create Or Update resourcePool. + * + * @summary Create Or Update resourcePool. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateResourcePool.json + */ +async function createResourcePool() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const resourcePoolName = "HRPool"; + const body: ResourcePool = { + extendedLocation: { + name: + "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso", + type: "customLocation" + }, + location: "East US", + moRefId: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + vCenterId: + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter" + }; + const options: ResourcePoolsCreateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.resourcePools.beginCreateAndWait( + resourceGroupName, + resourcePoolName, + options + ); + console.log(result); +} + +createResourcePool().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/resourcePoolsDeleteSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/resourcePoolsDeleteSample.ts new file mode 100644 index 000000000000..c9271d7ac2f8 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/resourcePoolsDeleteSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements resourcePool DELETE method. + * + * @summary Implements resourcePool DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteResourcePool.json + */ +async function deleteResourcePool() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const resourcePoolName = "HRPool"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.resourcePools.beginDeleteAndWait( + resourceGroupName, + resourcePoolName + ); + console.log(result); +} + +deleteResourcePool().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/resourcePoolsGetSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/resourcePoolsGetSample.ts new file mode 100644 index 000000000000..dc1aaf15459d --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/resourcePoolsGetSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements resourcePool GET method. + * + * @summary Implements resourcePool GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetResourcePool.json + */ +async function getResourcePool() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const resourcePoolName = "HRPool"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.resourcePools.get( + resourceGroupName, + resourcePoolName + ); + console.log(result); +} + +getResourcePool().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/resourcePoolsListByResourceGroupSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/resourcePoolsListByResourceGroupSample.ts new file mode 100644 index 000000000000..dfc2ce9b713f --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/resourcePoolsListByResourceGroupSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of resourcePools in a resource group. + * + * @summary List of resourcePools in a resource group. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListResourcePoolsByResourceGroup.json + */ +async function listResourcePoolsByResourceGroup() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.resourcePools.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listResourcePoolsByResourceGroup().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/resourcePoolsListSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/resourcePoolsListSample.ts new file mode 100644 index 000000000000..3bc3a1a43c65 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/resourcePoolsListSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of resourcePools in a subscription. + * + * @summary List of resourcePools in a subscription. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListResourcePools.json + */ +async function listResourcePools() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.resourcePools.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listResourcePools().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/resourcePoolsUpdateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/resourcePoolsUpdateSample.ts new file mode 100644 index 000000000000..fb70d5b65354 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/resourcePoolsUpdateSample.ts @@ -0,0 +1,43 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ResourcePatch, + ResourcePoolsUpdateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to API to update certain properties of the resourcePool resource. + * + * @summary API to update certain properties of the resourcePool resource. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateResourcePool.json + */ +async function updateResourcePool() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const resourcePoolName = "HRPool"; + const body: ResourcePatch = { tags: { tag1: "value1", tag2: "value2" } }; + const options: ResourcePoolsUpdateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.resourcePools.update( + resourceGroupName, + resourcePoolName, + options + ); + console.log(result); +} + +updateResourcePool().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/vCentersCreateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/vCentersCreateSample.ts new file mode 100644 index 000000000000..4d740421502d --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/vCentersCreateSample.ts @@ -0,0 +1,53 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VCenter, + VCentersCreateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create Or Update vCenter. + * + * @summary Create Or Update vCenter. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVCenter.json + */ +async function createVCenter() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const vcenterName = "ContosoVCenter"; + const body: VCenter = { + credentials: { password: "", username: "tempuser" }, + extendedLocation: { + name: + "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso", + type: "customLocation" + }, + fqdn: "ContosoVMware.contoso.com", + location: "East US", + port: 1234 + }; + const options: VCentersCreateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.vCenters.beginCreateAndWait( + resourceGroupName, + vcenterName, + options + ); + console.log(result); +} + +createVCenter().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/vCentersDeleteSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/vCentersDeleteSample.ts new file mode 100644 index 000000000000..005d1bde5b34 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/vCentersDeleteSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements vCenter DELETE method. + * + * @summary Implements vCenter DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVCenter.json + */ +async function deleteVCenter() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const vcenterName = "ContosoVCenter"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.vCenters.beginDeleteAndWait( + resourceGroupName, + vcenterName + ); + console.log(result); +} + +deleteVCenter().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/vCentersGetSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/vCentersGetSample.ts new file mode 100644 index 000000000000..f087f39ee737 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/vCentersGetSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements vCenter GET method. + * + * @summary Implements vCenter GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVCenter.json + */ +async function getVCenter() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const vcenterName = "ContosoVCenter"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.vCenters.get(resourceGroupName, vcenterName); + console.log(result); +} + +getVCenter().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/vCentersListByResourceGroupSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/vCentersListByResourceGroupSample.ts new file mode 100644 index 000000000000..40c2514510bc --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/vCentersListByResourceGroupSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of vCenters in a resource group. + * + * @summary List of vCenters in a resource group. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVCentersByResourceGroup.json + */ +async function listVCentersByResourceGroup() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.vCenters.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listVCentersByResourceGroup().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/vCentersListSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/vCentersListSample.ts new file mode 100644 index 000000000000..ed7bba6bd743 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/vCentersListSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of vCenters in a subscription. + * + * @summary List of vCenters in a subscription. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVCenters.json + */ +async function listVCenters() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.vCenters.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listVCenters().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/vCentersUpdateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/vCentersUpdateSample.ts new file mode 100644 index 000000000000..257ebe61872e --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/vCentersUpdateSample.ts @@ -0,0 +1,43 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ResourcePatch, + VCentersUpdateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to API to update certain properties of the vCenter resource. + * + * @summary API to update certain properties of the vCenter resource. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVCenter.json + */ +async function updateVCenter() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const vcenterName = "ContosoVCenter"; + const body: ResourcePatch = { tags: { tag1: "value1", tag2: "value2" } }; + const options: VCentersUpdateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.vCenters.update( + resourceGroupName, + vcenterName, + options + ); + console.log(result); +} + +updateVCenter().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachineTemplatesCreateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachineTemplatesCreateSample.ts new file mode 100644 index 000000000000..8239fd0c77e5 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachineTemplatesCreateSample.ts @@ -0,0 +1,53 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineTemplate, + VirtualMachineTemplatesCreateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create Or Update virtual machine template. + * + * @summary Create Or Update virtual machine template. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVirtualMachineTemplate.json + */ +async function createVirtualMachineTemplate() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineTemplateName = "WebFrontEndTemplate"; + const body: VirtualMachineTemplate = { + extendedLocation: { + name: + "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso", + type: "customLocation" + }, + location: "East US", + moRefId: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + vCenterId: + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter" + }; + const options: VirtualMachineTemplatesCreateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualMachineTemplates.beginCreateAndWait( + resourceGroupName, + virtualMachineTemplateName, + options + ); + console.log(result); +} + +createVirtualMachineTemplate().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachineTemplatesDeleteSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachineTemplatesDeleteSample.ts new file mode 100644 index 000000000000..b6aa00d9c8d8 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachineTemplatesDeleteSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements virtual machine template DELETE method. + * + * @summary Implements virtual machine template DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVirtualMachineTemplate.json + */ +async function deleteVirtualMachineTemplate() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineTemplateName = "WebFrontEndTemplate"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualMachineTemplates.beginDeleteAndWait( + resourceGroupName, + virtualMachineTemplateName + ); + console.log(result); +} + +deleteVirtualMachineTemplate().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachineTemplatesGetSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachineTemplatesGetSample.ts new file mode 100644 index 000000000000..a20baaad981f --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachineTemplatesGetSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements virtual machine template GET method. + * + * @summary Implements virtual machine template GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVirtualMachineTemplate.json + */ +async function getVirtualMachineTemplate() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineTemplateName = "WebFrontEndTemplate"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualMachineTemplates.get( + resourceGroupName, + virtualMachineTemplateName + ); + console.log(result); +} + +getVirtualMachineTemplate().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachineTemplatesListByResourceGroupSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachineTemplatesListByResourceGroupSample.ts new file mode 100644 index 000000000000..274b818e457e --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachineTemplatesListByResourceGroupSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of virtualMachineTemplates in a resource group. + * + * @summary List of virtualMachineTemplates in a resource group. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachineTemplatesByResourceGroup.json + */ +async function listVirtualMachineTemplatesByResourceGroup() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.virtualMachineTemplates.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listVirtualMachineTemplatesByResourceGroup().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachineTemplatesListSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachineTemplatesListSample.ts new file mode 100644 index 000000000000..85e369d8de7f --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachineTemplatesListSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of virtualMachineTemplates in a subscription. + * + * @summary List of virtualMachineTemplates in a subscription. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachineTemplates.json + */ +async function listVirtualMachineTemplates() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.virtualMachineTemplates.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listVirtualMachineTemplates().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachineTemplatesUpdateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachineTemplatesUpdateSample.ts new file mode 100644 index 000000000000..4a300f63d783 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachineTemplatesUpdateSample.ts @@ -0,0 +1,43 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ResourcePatch, + VirtualMachineTemplatesUpdateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to API to update certain properties of the virtual machine template resource. + * + * @summary API to update certain properties of the virtual machine template resource. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVirtualMachineTemplate.json + */ +async function updateVirtualMachineTemplate() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineTemplateName = "WebFrontEndTemplate"; + const body: ResourcePatch = { tags: { tag1: "value1", tag2: "value2" } }; + const options: VirtualMachineTemplatesUpdateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualMachineTemplates.update( + resourceGroupName, + virtualMachineTemplateName, + options + ); + console.log(result); +} + +updateVirtualMachineTemplate().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesAssessPatchesSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesAssessPatchesSample.ts new file mode 100644 index 000000000000..7c2956717302 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesAssessPatchesSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to assess patches on a vSphere VMware machine identity in Azure. + * + * @summary The operation to assess patches on a vSphere VMware machine identity in Azure. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/VirtualMachineAssessPatches.json + */ +async function assessPatchStateOfAMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroupName"; + const name = "myMachineName"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualMachines.beginAssessPatchesAndWait( + resourceGroupName, + name + ); + console.log(result); +} + +assessPatchStateOfAMachine().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesCreateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesCreateSample.ts new file mode 100644 index 000000000000..4982845cc666 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesCreateSample.ts @@ -0,0 +1,57 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachine, + VirtualMachinesCreateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create Or Update virtual machine. + * + * @summary Create Or Update virtual machine. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVirtualMachine.json + */ +async function createVirtualMachine() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "DemoVM"; + const body: VirtualMachine = { + extendedLocation: { + name: + "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso", + type: "customLocation" + }, + hardwareProfile: { memorySizeMB: 4196, numCPUs: 4 }, + location: "East US", + resourcePoolId: + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/ResourcePools/HRPool", + templateId: + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VirtualMachineTemplates/WebFrontEndTemplate", + vCenterId: + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter" + }; + const options: VirtualMachinesCreateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualMachines.beginCreateAndWait( + resourceGroupName, + virtualMachineName, + options + ); + console.log(result); +} + +createVirtualMachine().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesDeleteSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesDeleteSample.ts new file mode 100644 index 000000000000..215f0bb6ab8b --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesDeleteSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements virtual machine DELETE method. + * + * @summary Implements virtual machine DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVirtualMachine.json + */ +async function deleteVirtualMachine() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "DemoVM"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualMachines.beginDeleteAndWait( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +deleteVirtualMachine().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesGetSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesGetSample.ts new file mode 100644 index 000000000000..6b181fcfd778 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesGetSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements virtual machine GET method. + * + * @summary Implements virtual machine GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVirtualMachine.json + */ +async function getVirtualMachine() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "DemoVM"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualMachines.get( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +getVirtualMachine().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesInstallPatchesSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesInstallPatchesSample.ts new file mode 100644 index 000000000000..adfc5c1b77bb --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesInstallPatchesSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineInstallPatchesParameters, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to install patches on a vSphere VMware machine identity in Azure. + * + * @summary The operation to install patches on a vSphere VMware machine identity in Azure. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/VirtualMachineInstallPatches.json + */ +async function installPatchStateOfAMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroupName"; + const name = "myMachineName"; + const installPatchesInput: VirtualMachineInstallPatchesParameters = { + maximumDuration: "PT3H", + rebootSetting: "IfRequired", + windowsParameters: { + classificationsToInclude: ["Critical", "Security"], + maxPatchPublishDate: new Date("2022-01-15T02:36:43.0539904+00:00") + } + }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualMachines.beginInstallPatchesAndWait( + resourceGroupName, + name, + installPatchesInput + ); + console.log(result); +} + +installPatchStateOfAMachine().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesListByResourceGroupSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesListByResourceGroupSample.ts new file mode 100644 index 000000000000..f1e0bf514dc4 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesListByResourceGroupSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of virtualMachines in a resource group. + * + * @summary List of virtualMachines in a resource group. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachinesByResourceGroup.json + */ +async function listVirtualMachinesByResourceGroup() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.virtualMachines.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listVirtualMachinesByResourceGroup().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesListSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesListSample.ts new file mode 100644 index 000000000000..4a51c8d4a49f --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesListSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of virtualMachines in a subscription. + * + * @summary List of virtualMachines in a subscription. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachines.json + */ +async function listVirtualMachines() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.virtualMachines.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listVirtualMachines().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesRestartSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesRestartSample.ts new file mode 100644 index 000000000000..c253def68ed3 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesRestartSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Restart virtual machine. + * + * @summary Restart virtual machine. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/RestartVirtualMachine.json + */ +async function restartVirtualMachine() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "DemoVM"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualMachines.beginRestartAndWait( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +restartVirtualMachine().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesStartSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesStartSample.ts new file mode 100644 index 000000000000..5af4a48df4ff --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesStartSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Start virtual machine. + * + * @summary Start virtual machine. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/StartVirtualMachine.json + */ +async function startVirtualMachine() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "DemoVM"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualMachines.beginStartAndWait( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +startVirtualMachine().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesStopSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesStopSample.ts new file mode 100644 index 000000000000..507c71c37cbc --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesStopSample.ts @@ -0,0 +1,43 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + StopVirtualMachineOptions, + VirtualMachinesStopOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Stop virtual machine. + * + * @summary Stop virtual machine. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/StopVirtualMachine.json + */ +async function stopVirtualMachine() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "DemoVM"; + const body: StopVirtualMachineOptions = { skipShutdown: true }; + const options: VirtualMachinesStopOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualMachines.beginStopAndWait( + resourceGroupName, + virtualMachineName, + options + ); + console.log(result); +} + +stopVirtualMachine().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesUpdateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesUpdateSample.ts new file mode 100644 index 000000000000..9983dbec1a15 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualMachinesUpdateSample.ts @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineUpdate, + VirtualMachinesUpdateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to API to update certain properties of the virtual machine resource. + * + * @summary API to update certain properties of the virtual machine resource. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVirtualMachine.json + */ +async function updateVirtualMachine() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "DemoVM"; + const body: VirtualMachineUpdate = { + tags: { tag1: "value1", tag2: "value2" } + }; + const options: VirtualMachinesUpdateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualMachines.beginUpdateAndWait( + resourceGroupName, + virtualMachineName, + options + ); + console.log(result); +} + +updateVirtualMachine().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualNetworksCreateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualNetworksCreateSample.ts new file mode 100644 index 000000000000..0472e6cce4cb --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualNetworksCreateSample.ts @@ -0,0 +1,53 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualNetwork, + VirtualNetworksCreateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create Or Update virtual network. + * + * @summary Create Or Update virtual network. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVirtualNetwork.json + */ +async function createVirtualNetwork() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualNetworkName = "ProdNetwork"; + const body: VirtualNetwork = { + extendedLocation: { + name: + "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso", + type: "customLocation" + }, + location: "East US", + moRefId: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + vCenterId: + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter" + }; + const options: VirtualNetworksCreateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualNetworks.beginCreateAndWait( + resourceGroupName, + virtualNetworkName, + options + ); + console.log(result); +} + +createVirtualNetwork().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualNetworksDeleteSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualNetworksDeleteSample.ts new file mode 100644 index 000000000000..5dcc3f0e0b04 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualNetworksDeleteSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements virtual network DELETE method. + * + * @summary Implements virtual network DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVirtualNetwork.json + */ +async function deleteVirtualNetwork() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualNetworkName = "ProdNetwork"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualNetworks.beginDeleteAndWait( + resourceGroupName, + virtualNetworkName + ); + console.log(result); +} + +deleteVirtualNetwork().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualNetworksGetSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualNetworksGetSample.ts new file mode 100644 index 000000000000..1ab7342b00e6 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualNetworksGetSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements virtual network GET method. + * + * @summary Implements virtual network GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVirtualNetwork.json + */ +async function getVirtualNetwork() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualNetworkName = "ProdNetwork"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualNetworks.get( + resourceGroupName, + virtualNetworkName + ); + console.log(result); +} + +getVirtualNetwork().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualNetworksListByResourceGroupSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualNetworksListByResourceGroupSample.ts new file mode 100644 index 000000000000..01bd4168daca --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualNetworksListByResourceGroupSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of virtualNetworks in a resource group. + * + * @summary List of virtualNetworks in a resource group. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualNetworksByResourceGroup.json + */ +async function listVirtualNetworksByResourceGroup() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.virtualNetworks.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listVirtualNetworksByResourceGroup().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualNetworksListSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualNetworksListSample.ts new file mode 100644 index 000000000000..2f6fc1c26ef8 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualNetworksListSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of virtualNetworks in a subscription. + * + * @summary List of virtualNetworks in a subscription. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualNetworks.json + */ +async function listVirtualNetworks() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.virtualNetworks.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listVirtualNetworks().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualNetworksUpdateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualNetworksUpdateSample.ts new file mode 100644 index 000000000000..13da7a9b5e24 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples-dev/virtualNetworksUpdateSample.ts @@ -0,0 +1,43 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ResourcePatch, + VirtualNetworksUpdateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to API to update certain properties of the virtual network resource. + * + * @summary API to update certain properties of the virtual network resource. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVirtualNetwork.json + */ +async function updateVirtualNetwork() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualNetworkName = "ProdNetwork"; + const body: ResourcePatch = { tags: { tag1: "value1", tag2: "value2" } }; + const options: VirtualNetworksUpdateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualNetworks.update( + resourceGroupName, + virtualNetworkName, + options + ); + console.log(result); +} + +updateVirtualNetwork().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/README.md b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/README.md new file mode 100644 index 000000000000..567a20686172 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/README.md @@ -0,0 +1,190 @@ +# client library samples for JavaScript (Beta) + +These sample programs show how to use the JavaScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [clustersCreateSample.js][clusterscreatesample] | Create Or Update cluster. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateCluster.json | +| [clustersDeleteSample.js][clustersdeletesample] | Implements cluster DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteCluster.json | +| [clustersGetSample.js][clustersgetsample] | Implements cluster GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetCluster.json | +| [clustersListByResourceGroupSample.js][clusterslistbyresourcegroupsample] | List of clusters in a resource group. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListClustersByResourceGroup.json | +| [clustersListSample.js][clusterslistsample] | List of clusters in a subscription. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListClusters.json | +| [clustersUpdateSample.js][clustersupdatesample] | API to update certain properties of the cluster resource. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateCluster.json | +| [datastoresCreateSample.js][datastorescreatesample] | Create Or Update datastore. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateDatastore.json | +| [datastoresDeleteSample.js][datastoresdeletesample] | Implements datastore DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteDatastore.json | +| [datastoresGetSample.js][datastoresgetsample] | Implements datastore GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetDatastore.json | +| [datastoresListByResourceGroupSample.js][datastoreslistbyresourcegroupsample] | List of datastores in a resource group. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListDatastoresByResourceGroup.json | +| [datastoresListSample.js][datastoreslistsample] | List of datastores in a subscription. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListDatastores.json | +| [datastoresUpdateSample.js][datastoresupdatesample] | API to update certain properties of the datastore resource. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateDatastore.json | +| [guestAgentsCreateSample.js][guestagentscreatesample] | Create Or Update GuestAgent. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateGuestAgent.json | +| [guestAgentsDeleteSample.js][guestagentsdeletesample] | Implements GuestAgent DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteGuestAgent.json | +| [guestAgentsGetSample.js][guestagentsgetsample] | Implements GuestAgent GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetGuestAgent.json | +| [guestAgentsListByVMSample.js][guestagentslistbyvmsample] | Returns the list of GuestAgent of the given vm. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GuestAgent_ListByVm.json | +| [hostsCreateSample.js][hostscreatesample] | Create Or Update host. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateHost.json | +| [hostsDeleteSample.js][hostsdeletesample] | Implements host DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteHost.json | +| [hostsGetSample.js][hostsgetsample] | Implements host GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetHost.json | +| [hostsListByResourceGroupSample.js][hostslistbyresourcegroupsample] | List of hosts in a resource group. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListHostsByResourceGroup.json | +| [hostsListSample.js][hostslistsample] | List of hosts in a subscription. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListHosts.json | +| [hostsUpdateSample.js][hostsupdatesample] | API to update certain properties of the host resource. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateHost.json | +| [hybridIdentityMetadataCreateSample.js][hybrididentitymetadatacreatesample] | Create Or Update HybridIdentityMetadata. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateHybridIdentityMetadata.json | +| [hybridIdentityMetadataDeleteSample.js][hybrididentitymetadatadeletesample] | Implements HybridIdentityMetadata DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteHybridIdentityMetadata.json | +| [hybridIdentityMetadataGetSample.js][hybrididentitymetadatagetsample] | Implements HybridIdentityMetadata GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetHybridIdentityMetadata.json | +| [hybridIdentityMetadataListByVMSample.js][hybrididentitymetadatalistbyvmsample] | Returns the list of HybridIdentityMetadata of the given vm. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/HybridIdentityMetadata_ListByVm.json | +| [inventoryItemsCreateSample.js][inventoryitemscreatesample] | Create Or Update InventoryItem. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateInventoryItem.json | +| [inventoryItemsDeleteSample.js][inventoryitemsdeletesample] | Implements inventoryItem DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteInventoryItem.json | +| [inventoryItemsGetSample.js][inventoryitemsgetsample] | Implements InventoryItem GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetInventoryItem.json | +| [inventoryItemsListByVCenterSample.js][inventoryitemslistbyvcentersample] | Returns the list of inventoryItems of the given vCenter. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/InventoryItems_ListByVCenter.json | +| [machineExtensionsCreateOrUpdateSample.js][machineextensionscreateorupdatesample] | The operation to create or update the extension. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/PUTExtension.json | +| [machineExtensionsDeleteSample.js][machineextensionsdeletesample] | The operation to delete the extension. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DELETEExtension.json | +| [machineExtensionsGetSample.js][machineextensionsgetsample] | The operation to get the extension. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GETExtension.json | +| [machineExtensionsListSample.js][machineextensionslistsample] | The operation to get all extensions of a non-Azure machine x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/LISTExtension.json | +| [machineExtensionsUpdateSample.js][machineextensionsupdatesample] | The operation to update the extension. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateExtension.json | +| [operationsListSample.js][operationslistsample] | Returns list of all operations. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListOperations.json | +| [resourcePoolsCreateSample.js][resourcepoolscreatesample] | Create Or Update resourcePool. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateResourcePool.json | +| [resourcePoolsDeleteSample.js][resourcepoolsdeletesample] | Implements resourcePool DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteResourcePool.json | +| [resourcePoolsGetSample.js][resourcepoolsgetsample] | Implements resourcePool GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetResourcePool.json | +| [resourcePoolsListByResourceGroupSample.js][resourcepoolslistbyresourcegroupsample] | List of resourcePools in a resource group. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListResourcePoolsByResourceGroup.json | +| [resourcePoolsListSample.js][resourcepoolslistsample] | List of resourcePools in a subscription. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListResourcePools.json | +| [resourcePoolsUpdateSample.js][resourcepoolsupdatesample] | API to update certain properties of the resourcePool resource. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateResourcePool.json | +| [vCentersCreateSample.js][vcenterscreatesample] | Create Or Update vCenter. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVCenter.json | +| [vCentersDeleteSample.js][vcentersdeletesample] | Implements vCenter DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVCenter.json | +| [vCentersGetSample.js][vcentersgetsample] | Implements vCenter GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVCenter.json | +| [vCentersListByResourceGroupSample.js][vcenterslistbyresourcegroupsample] | List of vCenters in a resource group. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVCentersByResourceGroup.json | +| [vCentersListSample.js][vcenterslistsample] | List of vCenters in a subscription. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVCenters.json | +| [vCentersUpdateSample.js][vcentersupdatesample] | API to update certain properties of the vCenter resource. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVCenter.json | +| [virtualMachineTemplatesCreateSample.js][virtualmachinetemplatescreatesample] | Create Or Update virtual machine template. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVirtualMachineTemplate.json | +| [virtualMachineTemplatesDeleteSample.js][virtualmachinetemplatesdeletesample] | Implements virtual machine template DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVirtualMachineTemplate.json | +| [virtualMachineTemplatesGetSample.js][virtualmachinetemplatesgetsample] | Implements virtual machine template GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVirtualMachineTemplate.json | +| [virtualMachineTemplatesListByResourceGroupSample.js][virtualmachinetemplateslistbyresourcegroupsample] | List of virtualMachineTemplates in a resource group. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachineTemplatesByResourceGroup.json | +| [virtualMachineTemplatesListSample.js][virtualmachinetemplateslistsample] | List of virtualMachineTemplates in a subscription. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachineTemplates.json | +| [virtualMachineTemplatesUpdateSample.js][virtualmachinetemplatesupdatesample] | API to update certain properties of the virtual machine template resource. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVirtualMachineTemplate.json | +| [virtualMachinesAssessPatchesSample.js][virtualmachinesassesspatchessample] | The operation to assess patches on a vSphere VMware machine identity in Azure. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/VirtualMachineAssessPatches.json | +| [virtualMachinesCreateSample.js][virtualmachinescreatesample] | Create Or Update virtual machine. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVirtualMachine.json | +| [virtualMachinesDeleteSample.js][virtualmachinesdeletesample] | Implements virtual machine DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVirtualMachine.json | +| [virtualMachinesGetSample.js][virtualmachinesgetsample] | Implements virtual machine GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVirtualMachine.json | +| [virtualMachinesInstallPatchesSample.js][virtualmachinesinstallpatchessample] | The operation to install patches on a vSphere VMware machine identity in Azure. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/VirtualMachineInstallPatches.json | +| [virtualMachinesListByResourceGroupSample.js][virtualmachineslistbyresourcegroupsample] | List of virtualMachines in a resource group. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachinesByResourceGroup.json | +| [virtualMachinesListSample.js][virtualmachineslistsample] | List of virtualMachines in a subscription. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachines.json | +| [virtualMachinesRestartSample.js][virtualmachinesrestartsample] | Restart virtual machine. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/RestartVirtualMachine.json | +| [virtualMachinesStartSample.js][virtualmachinesstartsample] | Start virtual machine. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/StartVirtualMachine.json | +| [virtualMachinesStopSample.js][virtualmachinesstopsample] | Stop virtual machine. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/StopVirtualMachine.json | +| [virtualMachinesUpdateSample.js][virtualmachinesupdatesample] | API to update certain properties of the virtual machine resource. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVirtualMachine.json | +| [virtualNetworksCreateSample.js][virtualnetworkscreatesample] | Create Or Update virtual network. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVirtualNetwork.json | +| [virtualNetworksDeleteSample.js][virtualnetworksdeletesample] | Implements virtual network DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVirtualNetwork.json | +| [virtualNetworksGetSample.js][virtualnetworksgetsample] | Implements virtual network GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVirtualNetwork.json | +| [virtualNetworksListByResourceGroupSample.js][virtualnetworkslistbyresourcegroupsample] | List of virtualNetworks in a resource group. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualNetworksByResourceGroup.json | +| [virtualNetworksListSample.js][virtualnetworkslistsample] | List of virtualNetworks in a subscription. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualNetworks.json | +| [virtualNetworksUpdateSample.js][virtualnetworksupdatesample] | API to update certain properties of the virtual network resource. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVirtualNetwork.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node clustersCreateSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node clustersCreateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[clusterscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersCreateSample.js +[clustersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersDeleteSample.js +[clustersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersGetSample.js +[clusterslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersListByResourceGroupSample.js +[clusterslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersListSample.js +[clustersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersUpdateSample.js +[datastorescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresCreateSample.js +[datastoresdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresDeleteSample.js +[datastoresgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresGetSample.js +[datastoreslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresListByResourceGroupSample.js +[datastoreslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresListSample.js +[datastoresupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresUpdateSample.js +[guestagentscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/guestAgentsCreateSample.js +[guestagentsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/guestAgentsDeleteSample.js +[guestagentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/guestAgentsGetSample.js +[guestagentslistbyvmsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/guestAgentsListByVMSample.js +[hostscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsCreateSample.js +[hostsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsDeleteSample.js +[hostsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsGetSample.js +[hostslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsListByResourceGroupSample.js +[hostslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsListSample.js +[hostsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsUpdateSample.js +[hybrididentitymetadatacreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hybridIdentityMetadataCreateSample.js +[hybrididentitymetadatadeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hybridIdentityMetadataDeleteSample.js +[hybrididentitymetadatagetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hybridIdentityMetadataGetSample.js +[hybrididentitymetadatalistbyvmsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hybridIdentityMetadataListByVMSample.js +[inventoryitemscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/inventoryItemsCreateSample.js +[inventoryitemsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/inventoryItemsDeleteSample.js +[inventoryitemsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/inventoryItemsGetSample.js +[inventoryitemslistbyvcentersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/inventoryItemsListByVCenterSample.js +[machineextensionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/machineExtensionsCreateOrUpdateSample.js +[machineextensionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/machineExtensionsDeleteSample.js +[machineextensionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/machineExtensionsGetSample.js +[machineextensionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/machineExtensionsListSample.js +[machineextensionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/machineExtensionsUpdateSample.js +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/operationsListSample.js +[resourcepoolscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsCreateSample.js +[resourcepoolsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsDeleteSample.js +[resourcepoolsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsGetSample.js +[resourcepoolslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsListByResourceGroupSample.js +[resourcepoolslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsListSample.js +[resourcepoolsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsUpdateSample.js +[vcenterscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersCreateSample.js +[vcentersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersDeleteSample.js +[vcentersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersGetSample.js +[vcenterslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersListByResourceGroupSample.js +[vcenterslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersListSample.js +[vcentersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersUpdateSample.js +[virtualmachinetemplatescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesCreateSample.js +[virtualmachinetemplatesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesDeleteSample.js +[virtualmachinetemplatesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesGetSample.js +[virtualmachinetemplateslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesListByResourceGroupSample.js +[virtualmachinetemplateslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesListSample.js +[virtualmachinetemplatesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesUpdateSample.js +[virtualmachinesassesspatchessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesAssessPatchesSample.js +[virtualmachinescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesCreateSample.js +[virtualmachinesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesDeleteSample.js +[virtualmachinesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesGetSample.js +[virtualmachinesinstallpatchessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesInstallPatchesSample.js +[virtualmachineslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesListByResourceGroupSample.js +[virtualmachineslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesListSample.js +[virtualmachinesrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesRestartSample.js +[virtualmachinesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesStartSample.js +[virtualmachinesstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesStopSample.js +[virtualmachinesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesUpdateSample.js +[virtualnetworkscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksCreateSample.js +[virtualnetworksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksDeleteSample.js +[virtualnetworksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksGetSample.js +[virtualnetworkslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksListByResourceGroupSample.js +[virtualnetworkslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksListSample.js +[virtualnetworksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksUpdateSample.js +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-connectedvmware?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/connectedvmware/arm-connectedvmware/README.md diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersCreateSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersCreateSample.js new file mode 100644 index 000000000000..bc3fde82f44f --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersCreateSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create Or Update cluster. + * + * @summary Create Or Update cluster. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateCluster.json + */ +async function createCluster() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const clusterName = "HRCluster"; + const body = { + extendedLocation: { + name: "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso", + type: "customLocation", + }, + location: "East US", + moRefId: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + vCenterId: + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter", + }; + const options = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.clusters.beginCreateAndWait(resourceGroupName, clusterName, options); + console.log(result); +} + +createCluster().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersDeleteSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersDeleteSample.js new file mode 100644 index 000000000000..2132556d36e8 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersDeleteSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Implements cluster DELETE method. + * + * @summary Implements cluster DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteCluster.json + */ +async function deleteCluster() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const clusterName = "HRCluster"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.clusters.beginDeleteAndWait(resourceGroupName, clusterName); + console.log(result); +} + +deleteCluster().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersGetSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersGetSample.js new file mode 100644 index 000000000000..b61a2c3cba46 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersGetSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Implements cluster GET method. + * + * @summary Implements cluster GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetCluster.json + */ +async function getCluster() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const clusterName = "HRCluster"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.clusters.get(resourceGroupName, clusterName); + console.log(result); +} + +getCluster().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersListByResourceGroupSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersListByResourceGroupSample.js new file mode 100644 index 000000000000..51bc1a772b98 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersListByResourceGroupSample.js @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List of clusters in a resource group. + * + * @summary List of clusters in a resource group. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListClustersByResourceGroup.json + */ +async function listClustersByResourceGroup() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.clusters.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listClustersByResourceGroup().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersListSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersListSample.js new file mode 100644 index 000000000000..3ba7bb55d19b --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersListSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List of clusters in a subscription. + * + * @summary List of clusters in a subscription. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListClusters.json + */ +async function listClusters() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.clusters.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listClusters().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersUpdateSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersUpdateSample.js new file mode 100644 index 000000000000..3df6c77e6858 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/clustersUpdateSample.js @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to API to update certain properties of the cluster resource. + * + * @summary API to update certain properties of the cluster resource. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateCluster.json + */ +async function updateCluster() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const clusterName = "HRCluster"; + const body = { tags: { tag1: "value1", tag2: "value2" } }; + const options = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.clusters.update(resourceGroupName, clusterName, options); + console.log(result); +} + +updateCluster().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresCreateSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresCreateSample.js new file mode 100644 index 000000000000..fc59f6e28378 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresCreateSample.js @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create Or Update datastore. + * + * @summary Create Or Update datastore. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateDatastore.json + */ +async function createDatastore() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const datastoreName = "HRDatastore"; + const body = { + extendedLocation: { + name: "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso", + type: "customLocation", + }, + location: "East US", + moRefId: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + vCenterId: + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter", + }; + const options = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.datastores.beginCreateAndWait( + resourceGroupName, + datastoreName, + options + ); + console.log(result); +} + +createDatastore().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresDeleteSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresDeleteSample.js new file mode 100644 index 000000000000..511c37c538b7 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresDeleteSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Implements datastore DELETE method. + * + * @summary Implements datastore DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteDatastore.json + */ +async function deleteDatastore() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const datastoreName = "HRDatastore"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.datastores.beginDeleteAndWait(resourceGroupName, datastoreName); + console.log(result); +} + +deleteDatastore().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresGetSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresGetSample.js new file mode 100644 index 000000000000..169f287fa719 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresGetSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Implements datastore GET method. + * + * @summary Implements datastore GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetDatastore.json + */ +async function getDatastore() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const datastoreName = "HRDatastore"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.datastores.get(resourceGroupName, datastoreName); + console.log(result); +} + +getDatastore().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresListByResourceGroupSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresListByResourceGroupSample.js new file mode 100644 index 000000000000..24bf51c10830 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresListByResourceGroupSample.js @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List of datastores in a resource group. + * + * @summary List of datastores in a resource group. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListDatastoresByResourceGroup.json + */ +async function listDatastoresByResourceGroup() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.datastores.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listDatastoresByResourceGroup().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresListSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresListSample.js new file mode 100644 index 000000000000..376adeefe842 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresListSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List of datastores in a subscription. + * + * @summary List of datastores in a subscription. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListDatastores.json + */ +async function listDatastores() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.datastores.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listDatastores().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresUpdateSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresUpdateSample.js new file mode 100644 index 000000000000..c47725a85866 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/datastoresUpdateSample.js @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to API to update certain properties of the datastore resource. + * + * @summary API to update certain properties of the datastore resource. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateDatastore.json + */ +async function updateDatastore() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const datastoreName = "HRDatastore"; + const body = { tags: { tag1: "value1", tag2: "value2" } }; + const options = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.datastores.update(resourceGroupName, datastoreName, options); + console.log(result); +} + +updateDatastore().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/guestAgentsCreateSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/guestAgentsCreateSample.js new file mode 100644 index 000000000000..4d94ba679c08 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/guestAgentsCreateSample.js @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create Or Update GuestAgent. + * + * @summary Create Or Update GuestAgent. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateGuestAgent.json + */ +async function createGuestAgent() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "ContosoVm"; + const name = "default"; + const body = { + credentials: { password: "", username: "tempuser" }, + httpProxyConfig: { httpsProxy: "http://192.1.2.3:8080" }, + provisioningAction: "install", + }; + const options = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.guestAgents.beginCreateAndWait( + resourceGroupName, + virtualMachineName, + name, + options + ); + console.log(result); +} + +createGuestAgent().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/guestAgentsDeleteSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/guestAgentsDeleteSample.js new file mode 100644 index 000000000000..33e2fb0479b2 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/guestAgentsDeleteSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Implements GuestAgent DELETE method. + * + * @summary Implements GuestAgent DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteGuestAgent.json + */ +async function deleteGuestAgent() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "ContosoVm"; + const name = "default"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.guestAgents.beginDeleteAndWait( + resourceGroupName, + virtualMachineName, + name + ); + console.log(result); +} + +deleteGuestAgent().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/guestAgentsGetSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/guestAgentsGetSample.js new file mode 100644 index 000000000000..9457da629c51 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/guestAgentsGetSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Implements GuestAgent GET method. + * + * @summary Implements GuestAgent GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetGuestAgent.json + */ +async function getGuestAgent() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "ContosoVm"; + const name = "default"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.guestAgents.get(resourceGroupName, virtualMachineName, name); + console.log(result); +} + +getGuestAgent().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/guestAgentsListByVMSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/guestAgentsListByVMSample.js new file mode 100644 index 000000000000..3ada4b800a0d --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/guestAgentsListByVMSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Returns the list of GuestAgent of the given vm. + * + * @summary Returns the list of GuestAgent of the given vm. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GuestAgent_ListByVm.json + */ +async function guestAgentListByVM() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "ContosoVm"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.guestAgents.listByVm(resourceGroupName, virtualMachineName)) { + resArray.push(item); + } + console.log(resArray); +} + +guestAgentListByVM().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsCreateSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsCreateSample.js new file mode 100644 index 000000000000..c8843461fcf9 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsCreateSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create Or Update host. + * + * @summary Create Or Update host. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateHost.json + */ +async function createHost() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const hostName = "HRHost"; + const body = { + extendedLocation: { + name: "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso", + type: "customLocation", + }, + location: "East US", + moRefId: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + vCenterId: + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter", + }; + const options = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.hosts.beginCreateAndWait(resourceGroupName, hostName, options); + console.log(result); +} + +createHost().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsDeleteSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsDeleteSample.js new file mode 100644 index 000000000000..d3a00c436f7e --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsDeleteSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Implements host DELETE method. + * + * @summary Implements host DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteHost.json + */ +async function deleteHost() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const hostName = "HRHost"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.hosts.beginDeleteAndWait(resourceGroupName, hostName); + console.log(result); +} + +deleteHost().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsGetSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsGetSample.js new file mode 100644 index 000000000000..493c1642fb45 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsGetSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Implements host GET method. + * + * @summary Implements host GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetHost.json + */ +async function getHost() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const hostName = "HRHost"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.hosts.get(resourceGroupName, hostName); + console.log(result); +} + +getHost().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsListByResourceGroupSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsListByResourceGroupSample.js new file mode 100644 index 000000000000..193839bcc288 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsListByResourceGroupSample.js @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List of hosts in a resource group. + * + * @summary List of hosts in a resource group. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListHostsByResourceGroup.json + */ +async function listHostsByResourceGroup() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.hosts.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listHostsByResourceGroup().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsListSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsListSample.js new file mode 100644 index 000000000000..52d849240412 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsListSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List of hosts in a subscription. + * + * @summary List of hosts in a subscription. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListHosts.json + */ +async function listHosts() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.hosts.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listHosts().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsUpdateSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsUpdateSample.js new file mode 100644 index 000000000000..51cd731fbd12 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hostsUpdateSample.js @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to API to update certain properties of the host resource. + * + * @summary API to update certain properties of the host resource. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateHost.json + */ +async function updateHost() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const hostName = "HRHost"; + const body = { tags: { tag1: "value1", tag2: "value2" } }; + const options = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.hosts.update(resourceGroupName, hostName, options); + console.log(result); +} + +updateHost().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hybridIdentityMetadataCreateSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hybridIdentityMetadataCreateSample.js new file mode 100644 index 000000000000..5ed586e05fe3 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hybridIdentityMetadataCreateSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create Or Update HybridIdentityMetadata. + * + * @summary Create Or Update HybridIdentityMetadata. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateHybridIdentityMetadata.json + */ +async function createHybridIdentityMetadata() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "ContosoVm"; + const metadataName = "default"; + const body = { + publicKey: "8ec7d60c-9700-40b1-8e6e-e5b2f6f477f2", + vmId: "f8b82dff-38ef-4220-99ef-d3a3f86ddc6c", + }; + const options = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.hybridIdentityMetadataOperations.create( + resourceGroupName, + virtualMachineName, + metadataName, + options + ); + console.log(result); +} + +createHybridIdentityMetadata().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hybridIdentityMetadataDeleteSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hybridIdentityMetadataDeleteSample.js new file mode 100644 index 000000000000..c33c73adab6e --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hybridIdentityMetadataDeleteSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Implements HybridIdentityMetadata DELETE method. + * + * @summary Implements HybridIdentityMetadata DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteHybridIdentityMetadata.json + */ +async function deleteHybridIdentityMetadata() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "ContosoVm"; + const metadataName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.hybridIdentityMetadataOperations.delete( + resourceGroupName, + virtualMachineName, + metadataName + ); + console.log(result); +} + +deleteHybridIdentityMetadata().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hybridIdentityMetadataGetSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hybridIdentityMetadataGetSample.js new file mode 100644 index 000000000000..99fa070b5263 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hybridIdentityMetadataGetSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Implements HybridIdentityMetadata GET method. + * + * @summary Implements HybridIdentityMetadata GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetHybridIdentityMetadata.json + */ +async function getHybridIdentityMetadata() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "ContosoVm"; + const metadataName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.hybridIdentityMetadataOperations.get( + resourceGroupName, + virtualMachineName, + metadataName + ); + console.log(result); +} + +getHybridIdentityMetadata().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hybridIdentityMetadataListByVMSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hybridIdentityMetadataListByVMSample.js new file mode 100644 index 000000000000..bd2ee8d4fa0b --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/hybridIdentityMetadataListByVMSample.js @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Returns the list of HybridIdentityMetadata of the given vm. + * + * @summary Returns the list of HybridIdentityMetadata of the given vm. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/HybridIdentityMetadata_ListByVm.json + */ +async function hybridIdentityMetadataListByVM() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "ContosoVm"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.hybridIdentityMetadataOperations.listByVm( + resourceGroupName, + virtualMachineName + )) { + resArray.push(item); + } + console.log(resArray); +} + +hybridIdentityMetadataListByVM().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/inventoryItemsCreateSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/inventoryItemsCreateSample.js new file mode 100644 index 000000000000..55350696b78d --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/inventoryItemsCreateSample.js @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create Or Update InventoryItem. + * + * @summary Create Or Update InventoryItem. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateInventoryItem.json + */ +async function createInventoryItem() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const vcenterName = "ContosoVCenter"; + const inventoryItemName = "testItem"; + const body = { inventoryType: "ResourcePool" }; + const options = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.inventoryItems.create( + resourceGroupName, + vcenterName, + inventoryItemName, + options + ); + console.log(result); +} + +createInventoryItem().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/inventoryItemsDeleteSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/inventoryItemsDeleteSample.js new file mode 100644 index 000000000000..9b43b2e3492d --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/inventoryItemsDeleteSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Implements inventoryItem DELETE method. + * + * @summary Implements inventoryItem DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteInventoryItem.json + */ +async function deleteInventoryItem() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const vcenterName = "ContosoVCenter"; + const inventoryItemName = "testItem"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.inventoryItems.delete( + resourceGroupName, + vcenterName, + inventoryItemName + ); + console.log(result); +} + +deleteInventoryItem().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/inventoryItemsGetSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/inventoryItemsGetSample.js new file mode 100644 index 000000000000..65459a96c02a --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/inventoryItemsGetSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Implements InventoryItem GET method. + * + * @summary Implements InventoryItem GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetInventoryItem.json + */ +async function getInventoryItem() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const vcenterName = "ContosoVCenter"; + const inventoryItemName = "testItem"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.inventoryItems.get(resourceGroupName, vcenterName, inventoryItemName); + console.log(result); +} + +getInventoryItem().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/inventoryItemsListByVCenterSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/inventoryItemsListByVCenterSample.js new file mode 100644 index 000000000000..b9a5cedffcfb --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/inventoryItemsListByVCenterSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Returns the list of inventoryItems of the given vCenter. + * + * @summary Returns the list of inventoryItems of the given vCenter. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/InventoryItems_ListByVCenter.json + */ +async function inventoryItemsListByVCenter() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const vcenterName = "ContosoVCenter"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.inventoryItems.listByVCenter(resourceGroupName, vcenterName)) { + resArray.push(item); + } + console.log(resArray); +} + +inventoryItemsListByVCenter().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/machineExtensionsCreateOrUpdateSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/machineExtensionsCreateOrUpdateSample.js new file mode 100644 index 000000000000..6fcffe1ce53c --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/machineExtensionsCreateOrUpdateSample.js @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to create or update the extension. + * + * @summary The operation to create or update the extension. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/PUTExtension.json + */ +async function createOrUpdateAMachineExtensionPut() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const name = "myMachine"; + const extensionName = "CustomScriptExtension"; + const extensionParameters = { + typePropertiesType: "CustomScriptExtension", + location: "eastus2euap", + publisher: "Microsoft.Compute", + settings: { + commandToExecute: 'powershell.exe -c "Get-Process | Where-Object { $_.CPU -gt 10000 }"', + }, + typeHandlerVersion: "1.10", + }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.machineExtensions.beginCreateOrUpdateAndWait( + resourceGroupName, + name, + extensionName, + extensionParameters + ); + console.log(result); +} + +createOrUpdateAMachineExtensionPut().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/machineExtensionsDeleteSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/machineExtensionsDeleteSample.js new file mode 100644 index 000000000000..4cb4a1d17453 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/machineExtensionsDeleteSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to delete the extension. + * + * @summary The operation to delete the extension. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DELETEExtension.json + */ +async function deleteAMachineExtension() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const name = "myMachine"; + const extensionName = "MMA"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.machineExtensions.beginDeleteAndWait( + resourceGroupName, + name, + extensionName + ); + console.log(result); +} + +deleteAMachineExtension().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/machineExtensionsGetSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/machineExtensionsGetSample.js new file mode 100644 index 000000000000..b7d9f4089420 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/machineExtensionsGetSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to get the extension. + * + * @summary The operation to get the extension. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GETExtension.json + */ +async function getMachineExtension() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const name = "myMachine"; + const extensionName = "CustomScriptExtension"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.machineExtensions.get(resourceGroupName, name, extensionName); + console.log(result); +} + +getMachineExtension().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/machineExtensionsListSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/machineExtensionsListSample.js new file mode 100644 index 000000000000..8cc34901473d --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/machineExtensionsListSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to get all extensions of a non-Azure machine + * + * @summary The operation to get all extensions of a non-Azure machine + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/LISTExtension.json + */ +async function getAllMachineExtensions() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const name = "myMachine"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.machineExtensions.list(resourceGroupName, name)) { + resArray.push(item); + } + console.log(resArray); +} + +getAllMachineExtensions().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/machineExtensionsUpdateSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/machineExtensionsUpdateSample.js new file mode 100644 index 000000000000..f383040c6aa4 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/machineExtensionsUpdateSample.js @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to update the extension. + * + * @summary The operation to update the extension. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateExtension.json + */ +async function createOrUpdateAMachineExtensionPatch() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const name = "myMachine"; + const extensionName = "CustomScriptExtension"; + const extensionParameters = { + type: "CustomScriptExtension", + publisher: "Microsoft.Compute", + settings: { + commandToExecute: 'powershell.exe -c "Get-Process | Where-Object { $_.CPU -lt 100 }"', + }, + typeHandlerVersion: "1.10", + }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.machineExtensions.beginUpdateAndWait( + resourceGroupName, + name, + extensionName, + extensionParameters + ); + console.log(result); +} + +createOrUpdateAMachineExtensionPatch().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/operationsListSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/operationsListSample.js new file mode 100644 index 000000000000..e4a7999fbda8 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/operationsListSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Returns list of all operations. + * + * @summary Returns list of all operations. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListOperations.json + */ +async function listOperations() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listOperations().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/package.json b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/package.json new file mode 100644 index 000000000000..b0917a9cdb7b --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/package.json @@ -0,0 +1,32 @@ +{ + "name": "@azure-samples/arm-connectedvmware-js-beta", + "private": true, + "version": "1.0.0", + "description": " client library samples for JavaScript (Beta)", + "engines": { + "node": ">=12.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/connectedvmware/arm-connectedvmware" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/connectedvmware/arm-connectedvmware", + "dependencies": { + "@azure/arm-connectedvmware": "next", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + } +} diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsCreateSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsCreateSample.js new file mode 100644 index 000000000000..2bee87172983 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsCreateSample.js @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create Or Update resourcePool. + * + * @summary Create Or Update resourcePool. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateResourcePool.json + */ +async function createResourcePool() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const resourcePoolName = "HRPool"; + const body = { + extendedLocation: { + name: "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso", + type: "customLocation", + }, + location: "East US", + moRefId: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + vCenterId: + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter", + }; + const options = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.resourcePools.beginCreateAndWait( + resourceGroupName, + resourcePoolName, + options + ); + console.log(result); +} + +createResourcePool().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsDeleteSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsDeleteSample.js new file mode 100644 index 000000000000..ae06540a1d43 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsDeleteSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Implements resourcePool DELETE method. + * + * @summary Implements resourcePool DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteResourcePool.json + */ +async function deleteResourcePool() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const resourcePoolName = "HRPool"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.resourcePools.beginDeleteAndWait(resourceGroupName, resourcePoolName); + console.log(result); +} + +deleteResourcePool().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsGetSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsGetSample.js new file mode 100644 index 000000000000..b370deff902e --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsGetSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Implements resourcePool GET method. + * + * @summary Implements resourcePool GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetResourcePool.json + */ +async function getResourcePool() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const resourcePoolName = "HRPool"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.resourcePools.get(resourceGroupName, resourcePoolName); + console.log(result); +} + +getResourcePool().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsListByResourceGroupSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsListByResourceGroupSample.js new file mode 100644 index 000000000000..bd57b26b6432 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsListByResourceGroupSample.js @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List of resourcePools in a resource group. + * + * @summary List of resourcePools in a resource group. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListResourcePoolsByResourceGroup.json + */ +async function listResourcePoolsByResourceGroup() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.resourcePools.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listResourcePoolsByResourceGroup().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsListSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsListSample.js new file mode 100644 index 000000000000..cb185602abbe --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsListSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List of resourcePools in a subscription. + * + * @summary List of resourcePools in a subscription. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListResourcePools.json + */ +async function listResourcePools() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.resourcePools.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listResourcePools().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsUpdateSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsUpdateSample.js new file mode 100644 index 000000000000..40fe4551f39a --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/resourcePoolsUpdateSample.js @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to API to update certain properties of the resourcePool resource. + * + * @summary API to update certain properties of the resourcePool resource. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateResourcePool.json + */ +async function updateResourcePool() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const resourcePoolName = "HRPool"; + const body = { tags: { tag1: "value1", tag2: "value2" } }; + const options = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.resourcePools.update(resourceGroupName, resourcePoolName, options); + console.log(result); +} + +updateResourcePool().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/sample.env b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersCreateSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersCreateSample.js new file mode 100644 index 000000000000..0b8aaf4aaddb --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersCreateSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create Or Update vCenter. + * + * @summary Create Or Update vCenter. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVCenter.json + */ +async function createVCenter() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const vcenterName = "ContosoVCenter"; + const body = { + credentials: { password: "", username: "tempuser" }, + extendedLocation: { + name: "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso", + type: "customLocation", + }, + fqdn: "ContosoVMware.contoso.com", + location: "East US", + port: 1234, + }; + const options = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.vCenters.beginCreateAndWait(resourceGroupName, vcenterName, options); + console.log(result); +} + +createVCenter().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersDeleteSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersDeleteSample.js new file mode 100644 index 000000000000..057b59353f08 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersDeleteSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Implements vCenter DELETE method. + * + * @summary Implements vCenter DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVCenter.json + */ +async function deleteVCenter() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const vcenterName = "ContosoVCenter"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.vCenters.beginDeleteAndWait(resourceGroupName, vcenterName); + console.log(result); +} + +deleteVCenter().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersGetSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersGetSample.js new file mode 100644 index 000000000000..7a5f8514cb2e --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersGetSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Implements vCenter GET method. + * + * @summary Implements vCenter GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVCenter.json + */ +async function getVCenter() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const vcenterName = "ContosoVCenter"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.vCenters.get(resourceGroupName, vcenterName); + console.log(result); +} + +getVCenter().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersListByResourceGroupSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersListByResourceGroupSample.js new file mode 100644 index 000000000000..83566e624f8a --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersListByResourceGroupSample.js @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List of vCenters in a resource group. + * + * @summary List of vCenters in a resource group. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVCentersByResourceGroup.json + */ +async function listVCentersByResourceGroup() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.vCenters.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listVCentersByResourceGroup().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersListSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersListSample.js new file mode 100644 index 000000000000..2591d1b18556 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersListSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List of vCenters in a subscription. + * + * @summary List of vCenters in a subscription. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVCenters.json + */ +async function listVCenters() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.vCenters.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listVCenters().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersUpdateSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersUpdateSample.js new file mode 100644 index 000000000000..ad1c0ae58073 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/vCentersUpdateSample.js @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to API to update certain properties of the vCenter resource. + * + * @summary API to update certain properties of the vCenter resource. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVCenter.json + */ +async function updateVCenter() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const vcenterName = "ContosoVCenter"; + const body = { tags: { tag1: "value1", tag2: "value2" } }; + const options = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.vCenters.update(resourceGroupName, vcenterName, options); + console.log(result); +} + +updateVCenter().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesCreateSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesCreateSample.js new file mode 100644 index 000000000000..8a8156b093dc --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesCreateSample.js @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create Or Update virtual machine template. + * + * @summary Create Or Update virtual machine template. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVirtualMachineTemplate.json + */ +async function createVirtualMachineTemplate() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineTemplateName = "WebFrontEndTemplate"; + const body = { + extendedLocation: { + name: "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso", + type: "customLocation", + }, + location: "East US", + moRefId: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + vCenterId: + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter", + }; + const options = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.virtualMachineTemplates.beginCreateAndWait( + resourceGroupName, + virtualMachineTemplateName, + options + ); + console.log(result); +} + +createVirtualMachineTemplate().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesDeleteSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesDeleteSample.js new file mode 100644 index 000000000000..54b402e4c73c --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesDeleteSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Implements virtual machine template DELETE method. + * + * @summary Implements virtual machine template DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVirtualMachineTemplate.json + */ +async function deleteVirtualMachineTemplate() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineTemplateName = "WebFrontEndTemplate"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.virtualMachineTemplates.beginDeleteAndWait( + resourceGroupName, + virtualMachineTemplateName + ); + console.log(result); +} + +deleteVirtualMachineTemplate().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesGetSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesGetSample.js new file mode 100644 index 000000000000..637f618e8660 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesGetSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Implements virtual machine template GET method. + * + * @summary Implements virtual machine template GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVirtualMachineTemplate.json + */ +async function getVirtualMachineTemplate() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineTemplateName = "WebFrontEndTemplate"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.virtualMachineTemplates.get( + resourceGroupName, + virtualMachineTemplateName + ); + console.log(result); +} + +getVirtualMachineTemplate().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesListByResourceGroupSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesListByResourceGroupSample.js new file mode 100644 index 000000000000..23404519e87a --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesListByResourceGroupSample.js @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List of virtualMachineTemplates in a resource group. + * + * @summary List of virtualMachineTemplates in a resource group. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachineTemplatesByResourceGroup.json + */ +async function listVirtualMachineTemplatesByResourceGroup() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineTemplates.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listVirtualMachineTemplatesByResourceGroup().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesListSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesListSample.js new file mode 100644 index 000000000000..5a76db9847d4 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesListSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List of virtualMachineTemplates in a subscription. + * + * @summary List of virtualMachineTemplates in a subscription. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachineTemplates.json + */ +async function listVirtualMachineTemplates() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineTemplates.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listVirtualMachineTemplates().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesUpdateSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesUpdateSample.js new file mode 100644 index 000000000000..38efda2add07 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachineTemplatesUpdateSample.js @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to API to update certain properties of the virtual machine template resource. + * + * @summary API to update certain properties of the virtual machine template resource. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVirtualMachineTemplate.json + */ +async function updateVirtualMachineTemplate() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineTemplateName = "WebFrontEndTemplate"; + const body = { tags: { tag1: "value1", tag2: "value2" } }; + const options = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.virtualMachineTemplates.update( + resourceGroupName, + virtualMachineTemplateName, + options + ); + console.log(result); +} + +updateVirtualMachineTemplate().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesAssessPatchesSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesAssessPatchesSample.js new file mode 100644 index 000000000000..4942a0076b72 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesAssessPatchesSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to assess patches on a vSphere VMware machine identity in Azure. + * + * @summary The operation to assess patches on a vSphere VMware machine identity in Azure. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/VirtualMachineAssessPatches.json + */ +async function assessPatchStateOfAMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroupName"; + const name = "myMachineName"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.virtualMachines.beginAssessPatchesAndWait(resourceGroupName, name); + console.log(result); +} + +assessPatchStateOfAMachine().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesCreateSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesCreateSample.js new file mode 100644 index 000000000000..b36ec4aeea69 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesCreateSample.js @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create Or Update virtual machine. + * + * @summary Create Or Update virtual machine. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVirtualMachine.json + */ +async function createVirtualMachine() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "DemoVM"; + const body = { + extendedLocation: { + name: "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso", + type: "customLocation", + }, + hardwareProfile: { memorySizeMB: 4196, numCPUs: 4 }, + location: "East US", + resourcePoolId: + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/ResourcePools/HRPool", + templateId: + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VirtualMachineTemplates/WebFrontEndTemplate", + vCenterId: + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter", + }; + const options = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateAndWait( + resourceGroupName, + virtualMachineName, + options + ); + console.log(result); +} + +createVirtualMachine().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesDeleteSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesDeleteSample.js new file mode 100644 index 000000000000..9d396fc61bac --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesDeleteSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Implements virtual machine DELETE method. + * + * @summary Implements virtual machine DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVirtualMachine.json + */ +async function deleteVirtualMachine() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "DemoVM"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.virtualMachines.beginDeleteAndWait( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +deleteVirtualMachine().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesGetSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesGetSample.js new file mode 100644 index 000000000000..5354f8e84238 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesGetSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Implements virtual machine GET method. + * + * @summary Implements virtual machine GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVirtualMachine.json + */ +async function getVirtualMachine() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "DemoVM"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.virtualMachines.get(resourceGroupName, virtualMachineName); + console.log(result); +} + +getVirtualMachine().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesInstallPatchesSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesInstallPatchesSample.js new file mode 100644 index 000000000000..1dc72e54a616 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesInstallPatchesSample.js @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to install patches on a vSphere VMware machine identity in Azure. + * + * @summary The operation to install patches on a vSphere VMware machine identity in Azure. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/VirtualMachineInstallPatches.json + */ +async function installPatchStateOfAMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroupName"; + const name = "myMachineName"; + const installPatchesInput = { + maximumDuration: "PT3H", + rebootSetting: "IfRequired", + windowsParameters: { + classificationsToInclude: ["Critical", "Security"], + maxPatchPublishDate: new Date("2022-01-15T02:36:43.0539904+00:00"), + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.virtualMachines.beginInstallPatchesAndWait( + resourceGroupName, + name, + installPatchesInput + ); + console.log(result); +} + +installPatchStateOfAMachine().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesListByResourceGroupSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesListByResourceGroupSample.js new file mode 100644 index 000000000000..e450cb6e3b29 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesListByResourceGroupSample.js @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List of virtualMachines in a resource group. + * + * @summary List of virtualMachines in a resource group. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachinesByResourceGroup.json + */ +async function listVirtualMachinesByResourceGroup() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachines.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listVirtualMachinesByResourceGroup().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesListSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesListSample.js new file mode 100644 index 000000000000..e75ea71cda05 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesListSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List of virtualMachines in a subscription. + * + * @summary List of virtualMachines in a subscription. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachines.json + */ +async function listVirtualMachines() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachines.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listVirtualMachines().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesRestartSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesRestartSample.js new file mode 100644 index 000000000000..7538e7ff435f --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesRestartSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Restart virtual machine. + * + * @summary Restart virtual machine. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/RestartVirtualMachine.json + */ +async function restartVirtualMachine() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "DemoVM"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.virtualMachines.beginRestartAndWait( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +restartVirtualMachine().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesStartSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesStartSample.js new file mode 100644 index 000000000000..230de8eed4f8 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesStartSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Start virtual machine. + * + * @summary Start virtual machine. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/StartVirtualMachine.json + */ +async function startVirtualMachine() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "DemoVM"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.virtualMachines.beginStartAndWait( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +startVirtualMachine().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesStopSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesStopSample.js new file mode 100644 index 000000000000..f426bf3601b6 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesStopSample.js @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Stop virtual machine. + * + * @summary Stop virtual machine. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/StopVirtualMachine.json + */ +async function stopVirtualMachine() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "DemoVM"; + const body = { skipShutdown: true }; + const options = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.virtualMachines.beginStopAndWait( + resourceGroupName, + virtualMachineName, + options + ); + console.log(result); +} + +stopVirtualMachine().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesUpdateSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesUpdateSample.js new file mode 100644 index 000000000000..80d2754275c4 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualMachinesUpdateSample.js @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to API to update certain properties of the virtual machine resource. + * + * @summary API to update certain properties of the virtual machine resource. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVirtualMachine.json + */ +async function updateVirtualMachine() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "DemoVM"; + const body = { + tags: { tag1: "value1", tag2: "value2" }, + }; + const options = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.virtualMachines.beginUpdateAndWait( + resourceGroupName, + virtualMachineName, + options + ); + console.log(result); +} + +updateVirtualMachine().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksCreateSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksCreateSample.js new file mode 100644 index 000000000000..e28b50f27209 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksCreateSample.js @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create Or Update virtual network. + * + * @summary Create Or Update virtual network. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVirtualNetwork.json + */ +async function createVirtualNetwork() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualNetworkName = "ProdNetwork"; + const body = { + extendedLocation: { + name: "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso", + type: "customLocation", + }, + location: "East US", + moRefId: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + vCenterId: + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter", + }; + const options = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.virtualNetworks.beginCreateAndWait( + resourceGroupName, + virtualNetworkName, + options + ); + console.log(result); +} + +createVirtualNetwork().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksDeleteSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksDeleteSample.js new file mode 100644 index 000000000000..5c83daef94df --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksDeleteSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Implements virtual network DELETE method. + * + * @summary Implements virtual network DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVirtualNetwork.json + */ +async function deleteVirtualNetwork() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualNetworkName = "ProdNetwork"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.virtualNetworks.beginDeleteAndWait( + resourceGroupName, + virtualNetworkName + ); + console.log(result); +} + +deleteVirtualNetwork().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksGetSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksGetSample.js new file mode 100644 index 000000000000..00c0fbf51462 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksGetSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Implements virtual network GET method. + * + * @summary Implements virtual network GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVirtualNetwork.json + */ +async function getVirtualNetwork() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualNetworkName = "ProdNetwork"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.virtualNetworks.get(resourceGroupName, virtualNetworkName); + console.log(result); +} + +getVirtualNetwork().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksListByResourceGroupSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksListByResourceGroupSample.js new file mode 100644 index 000000000000..44fffe26530c --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksListByResourceGroupSample.js @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List of virtualNetworks in a resource group. + * + * @summary List of virtualNetworks in a resource group. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualNetworksByResourceGroup.json + */ +async function listVirtualNetworksByResourceGroup() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualNetworks.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listVirtualNetworksByResourceGroup().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksListSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksListSample.js new file mode 100644 index 000000000000..d8e63c7292ca --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksListSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List of virtualNetworks in a subscription. + * + * @summary List of virtualNetworks in a subscription. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualNetworks.json + */ +async function listVirtualNetworks() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualNetworks.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listVirtualNetworks().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksUpdateSample.js b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksUpdateSample.js new file mode 100644 index 000000000000..ff41a4dd93b9 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/javascript/virtualNetworksUpdateSample.js @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to API to update certain properties of the virtual network resource. + * + * @summary API to update certain properties of the virtual network resource. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVirtualNetwork.json + */ +async function updateVirtualNetwork() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualNetworkName = "ProdNetwork"; + const body = { tags: { tag1: "value1", tag2: "value2" } }; + const options = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId); + const result = await client.virtualNetworks.update( + resourceGroupName, + virtualNetworkName, + options + ); + console.log(result); +} + +updateVirtualNetwork().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/README.md b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/README.md new file mode 100644 index 000000000000..ee2e318ca7c7 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/README.md @@ -0,0 +1,203 @@ +# client library samples for TypeScript (Beta) + +These sample programs show how to use the TypeScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [clustersCreateSample.ts][clusterscreatesample] | Create Or Update cluster. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateCluster.json | +| [clustersDeleteSample.ts][clustersdeletesample] | Implements cluster DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteCluster.json | +| [clustersGetSample.ts][clustersgetsample] | Implements cluster GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetCluster.json | +| [clustersListByResourceGroupSample.ts][clusterslistbyresourcegroupsample] | List of clusters in a resource group. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListClustersByResourceGroup.json | +| [clustersListSample.ts][clusterslistsample] | List of clusters in a subscription. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListClusters.json | +| [clustersUpdateSample.ts][clustersupdatesample] | API to update certain properties of the cluster resource. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateCluster.json | +| [datastoresCreateSample.ts][datastorescreatesample] | Create Or Update datastore. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateDatastore.json | +| [datastoresDeleteSample.ts][datastoresdeletesample] | Implements datastore DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteDatastore.json | +| [datastoresGetSample.ts][datastoresgetsample] | Implements datastore GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetDatastore.json | +| [datastoresListByResourceGroupSample.ts][datastoreslistbyresourcegroupsample] | List of datastores in a resource group. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListDatastoresByResourceGroup.json | +| [datastoresListSample.ts][datastoreslistsample] | List of datastores in a subscription. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListDatastores.json | +| [datastoresUpdateSample.ts][datastoresupdatesample] | API to update certain properties of the datastore resource. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateDatastore.json | +| [guestAgentsCreateSample.ts][guestagentscreatesample] | Create Or Update GuestAgent. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateGuestAgent.json | +| [guestAgentsDeleteSample.ts][guestagentsdeletesample] | Implements GuestAgent DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteGuestAgent.json | +| [guestAgentsGetSample.ts][guestagentsgetsample] | Implements GuestAgent GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetGuestAgent.json | +| [guestAgentsListByVMSample.ts][guestagentslistbyvmsample] | Returns the list of GuestAgent of the given vm. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GuestAgent_ListByVm.json | +| [hostsCreateSample.ts][hostscreatesample] | Create Or Update host. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateHost.json | +| [hostsDeleteSample.ts][hostsdeletesample] | Implements host DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteHost.json | +| [hostsGetSample.ts][hostsgetsample] | Implements host GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetHost.json | +| [hostsListByResourceGroupSample.ts][hostslistbyresourcegroupsample] | List of hosts in a resource group. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListHostsByResourceGroup.json | +| [hostsListSample.ts][hostslistsample] | List of hosts in a subscription. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListHosts.json | +| [hostsUpdateSample.ts][hostsupdatesample] | API to update certain properties of the host resource. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateHost.json | +| [hybridIdentityMetadataCreateSample.ts][hybrididentitymetadatacreatesample] | Create Or Update HybridIdentityMetadata. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateHybridIdentityMetadata.json | +| [hybridIdentityMetadataDeleteSample.ts][hybrididentitymetadatadeletesample] | Implements HybridIdentityMetadata DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteHybridIdentityMetadata.json | +| [hybridIdentityMetadataGetSample.ts][hybrididentitymetadatagetsample] | Implements HybridIdentityMetadata GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetHybridIdentityMetadata.json | +| [hybridIdentityMetadataListByVMSample.ts][hybrididentitymetadatalistbyvmsample] | Returns the list of HybridIdentityMetadata of the given vm. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/HybridIdentityMetadata_ListByVm.json | +| [inventoryItemsCreateSample.ts][inventoryitemscreatesample] | Create Or Update InventoryItem. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateInventoryItem.json | +| [inventoryItemsDeleteSample.ts][inventoryitemsdeletesample] | Implements inventoryItem DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteInventoryItem.json | +| [inventoryItemsGetSample.ts][inventoryitemsgetsample] | Implements InventoryItem GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetInventoryItem.json | +| [inventoryItemsListByVCenterSample.ts][inventoryitemslistbyvcentersample] | Returns the list of inventoryItems of the given vCenter. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/InventoryItems_ListByVCenter.json | +| [machineExtensionsCreateOrUpdateSample.ts][machineextensionscreateorupdatesample] | The operation to create or update the extension. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/PUTExtension.json | +| [machineExtensionsDeleteSample.ts][machineextensionsdeletesample] | The operation to delete the extension. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DELETEExtension.json | +| [machineExtensionsGetSample.ts][machineextensionsgetsample] | The operation to get the extension. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GETExtension.json | +| [machineExtensionsListSample.ts][machineextensionslistsample] | The operation to get all extensions of a non-Azure machine x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/LISTExtension.json | +| [machineExtensionsUpdateSample.ts][machineextensionsupdatesample] | The operation to update the extension. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateExtension.json | +| [operationsListSample.ts][operationslistsample] | Returns list of all operations. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListOperations.json | +| [resourcePoolsCreateSample.ts][resourcepoolscreatesample] | Create Or Update resourcePool. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateResourcePool.json | +| [resourcePoolsDeleteSample.ts][resourcepoolsdeletesample] | Implements resourcePool DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteResourcePool.json | +| [resourcePoolsGetSample.ts][resourcepoolsgetsample] | Implements resourcePool GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetResourcePool.json | +| [resourcePoolsListByResourceGroupSample.ts][resourcepoolslistbyresourcegroupsample] | List of resourcePools in a resource group. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListResourcePoolsByResourceGroup.json | +| [resourcePoolsListSample.ts][resourcepoolslistsample] | List of resourcePools in a subscription. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListResourcePools.json | +| [resourcePoolsUpdateSample.ts][resourcepoolsupdatesample] | API to update certain properties of the resourcePool resource. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateResourcePool.json | +| [vCentersCreateSample.ts][vcenterscreatesample] | Create Or Update vCenter. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVCenter.json | +| [vCentersDeleteSample.ts][vcentersdeletesample] | Implements vCenter DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVCenter.json | +| [vCentersGetSample.ts][vcentersgetsample] | Implements vCenter GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVCenter.json | +| [vCentersListByResourceGroupSample.ts][vcenterslistbyresourcegroupsample] | List of vCenters in a resource group. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVCentersByResourceGroup.json | +| [vCentersListSample.ts][vcenterslistsample] | List of vCenters in a subscription. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVCenters.json | +| [vCentersUpdateSample.ts][vcentersupdatesample] | API to update certain properties of the vCenter resource. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVCenter.json | +| [virtualMachineTemplatesCreateSample.ts][virtualmachinetemplatescreatesample] | Create Or Update virtual machine template. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVirtualMachineTemplate.json | +| [virtualMachineTemplatesDeleteSample.ts][virtualmachinetemplatesdeletesample] | Implements virtual machine template DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVirtualMachineTemplate.json | +| [virtualMachineTemplatesGetSample.ts][virtualmachinetemplatesgetsample] | Implements virtual machine template GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVirtualMachineTemplate.json | +| [virtualMachineTemplatesListByResourceGroupSample.ts][virtualmachinetemplateslistbyresourcegroupsample] | List of virtualMachineTemplates in a resource group. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachineTemplatesByResourceGroup.json | +| [virtualMachineTemplatesListSample.ts][virtualmachinetemplateslistsample] | List of virtualMachineTemplates in a subscription. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachineTemplates.json | +| [virtualMachineTemplatesUpdateSample.ts][virtualmachinetemplatesupdatesample] | API to update certain properties of the virtual machine template resource. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVirtualMachineTemplate.json | +| [virtualMachinesAssessPatchesSample.ts][virtualmachinesassesspatchessample] | The operation to assess patches on a vSphere VMware machine identity in Azure. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/VirtualMachineAssessPatches.json | +| [virtualMachinesCreateSample.ts][virtualmachinescreatesample] | Create Or Update virtual machine. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVirtualMachine.json | +| [virtualMachinesDeleteSample.ts][virtualmachinesdeletesample] | Implements virtual machine DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVirtualMachine.json | +| [virtualMachinesGetSample.ts][virtualmachinesgetsample] | Implements virtual machine GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVirtualMachine.json | +| [virtualMachinesInstallPatchesSample.ts][virtualmachinesinstallpatchessample] | The operation to install patches on a vSphere VMware machine identity in Azure. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/VirtualMachineInstallPatches.json | +| [virtualMachinesListByResourceGroupSample.ts][virtualmachineslistbyresourcegroupsample] | List of virtualMachines in a resource group. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachinesByResourceGroup.json | +| [virtualMachinesListSample.ts][virtualmachineslistsample] | List of virtualMachines in a subscription. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachines.json | +| [virtualMachinesRestartSample.ts][virtualmachinesrestartsample] | Restart virtual machine. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/RestartVirtualMachine.json | +| [virtualMachinesStartSample.ts][virtualmachinesstartsample] | Start virtual machine. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/StartVirtualMachine.json | +| [virtualMachinesStopSample.ts][virtualmachinesstopsample] | Stop virtual machine. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/StopVirtualMachine.json | +| [virtualMachinesUpdateSample.ts][virtualmachinesupdatesample] | API to update certain properties of the virtual machine resource. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVirtualMachine.json | +| [virtualNetworksCreateSample.ts][virtualnetworkscreatesample] | Create Or Update virtual network. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVirtualNetwork.json | +| [virtualNetworksDeleteSample.ts][virtualnetworksdeletesample] | Implements virtual network DELETE method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVirtualNetwork.json | +| [virtualNetworksGetSample.ts][virtualnetworksgetsample] | Implements virtual network GET method. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVirtualNetwork.json | +| [virtualNetworksListByResourceGroupSample.ts][virtualnetworkslistbyresourcegroupsample] | List of virtualNetworks in a resource group. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualNetworksByResourceGroup.json | +| [virtualNetworksListSample.ts][virtualnetworkslistsample] | List of virtualNetworks in a subscription. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualNetworks.json | +| [virtualNetworksUpdateSample.ts][virtualnetworksupdatesample] | API to update certain properties of the virtual network resource. x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVirtualNetwork.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). + +Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: + +```bash +npm install -g typescript +``` + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the samples: + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/clustersCreateSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node dist/clustersCreateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[clusterscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/clustersCreateSample.ts +[clustersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/clustersDeleteSample.ts +[clustersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/clustersGetSample.ts +[clusterslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/clustersListByResourceGroupSample.ts +[clusterslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/clustersListSample.ts +[clustersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/clustersUpdateSample.ts +[datastorescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/datastoresCreateSample.ts +[datastoresdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/datastoresDeleteSample.ts +[datastoresgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/datastoresGetSample.ts +[datastoreslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/datastoresListByResourceGroupSample.ts +[datastoreslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/datastoresListSample.ts +[datastoresupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/datastoresUpdateSample.ts +[guestagentscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/guestAgentsCreateSample.ts +[guestagentsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/guestAgentsDeleteSample.ts +[guestagentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/guestAgentsGetSample.ts +[guestagentslistbyvmsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/guestAgentsListByVMSample.ts +[hostscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hostsCreateSample.ts +[hostsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hostsDeleteSample.ts +[hostsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hostsGetSample.ts +[hostslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hostsListByResourceGroupSample.ts +[hostslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hostsListSample.ts +[hostsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hostsUpdateSample.ts +[hybrididentitymetadatacreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hybridIdentityMetadataCreateSample.ts +[hybrididentitymetadatadeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hybridIdentityMetadataDeleteSample.ts +[hybrididentitymetadatagetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hybridIdentityMetadataGetSample.ts +[hybrididentitymetadatalistbyvmsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hybridIdentityMetadataListByVMSample.ts +[inventoryitemscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/inventoryItemsCreateSample.ts +[inventoryitemsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/inventoryItemsDeleteSample.ts +[inventoryitemsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/inventoryItemsGetSample.ts +[inventoryitemslistbyvcentersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/inventoryItemsListByVCenterSample.ts +[machineextensionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/machineExtensionsCreateOrUpdateSample.ts +[machineextensionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/machineExtensionsDeleteSample.ts +[machineextensionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/machineExtensionsGetSample.ts +[machineextensionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/machineExtensionsListSample.ts +[machineextensionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/machineExtensionsUpdateSample.ts +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/operationsListSample.ts +[resourcepoolscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/resourcePoolsCreateSample.ts +[resourcepoolsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/resourcePoolsDeleteSample.ts +[resourcepoolsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/resourcePoolsGetSample.ts +[resourcepoolslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/resourcePoolsListByResourceGroupSample.ts +[resourcepoolslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/resourcePoolsListSample.ts +[resourcepoolsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/resourcePoolsUpdateSample.ts +[vcenterscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/vCentersCreateSample.ts +[vcentersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/vCentersDeleteSample.ts +[vcentersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/vCentersGetSample.ts +[vcenterslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/vCentersListByResourceGroupSample.ts +[vcenterslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/vCentersListSample.ts +[vcentersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/vCentersUpdateSample.ts +[virtualmachinetemplatescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachineTemplatesCreateSample.ts +[virtualmachinetemplatesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachineTemplatesDeleteSample.ts +[virtualmachinetemplatesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachineTemplatesGetSample.ts +[virtualmachinetemplateslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachineTemplatesListByResourceGroupSample.ts +[virtualmachinetemplateslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachineTemplatesListSample.ts +[virtualmachinetemplatesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachineTemplatesUpdateSample.ts +[virtualmachinesassesspatchessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesAssessPatchesSample.ts +[virtualmachinescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesCreateSample.ts +[virtualmachinesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesDeleteSample.ts +[virtualmachinesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesGetSample.ts +[virtualmachinesinstallpatchessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesInstallPatchesSample.ts +[virtualmachineslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesListByResourceGroupSample.ts +[virtualmachineslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesListSample.ts +[virtualmachinesrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesRestartSample.ts +[virtualmachinesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesStartSample.ts +[virtualmachinesstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesStopSample.ts +[virtualmachinesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesUpdateSample.ts +[virtualnetworkscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualNetworksCreateSample.ts +[virtualnetworksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualNetworksDeleteSample.ts +[virtualnetworksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualNetworksGetSample.ts +[virtualnetworkslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualNetworksListByResourceGroupSample.ts +[virtualnetworkslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualNetworksListSample.ts +[virtualnetworksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualNetworksUpdateSample.ts +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-connectedvmware?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/connectedvmware/arm-connectedvmware/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/package.json b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/package.json new file mode 100644 index 000000000000..cae9dc4da233 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/package.json @@ -0,0 +1,41 @@ +{ + "name": "@azure-samples/arm-connectedvmware-ts-beta", + "private": true, + "version": "1.0.0", + "description": " client library samples for TypeScript (Beta)", + "engines": { + "node": ">=12.0.0" + }, + "scripts": { + "build": "tsc", + "prebuild": "rimraf dist/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/connectedvmware/arm-connectedvmware" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/connectedvmware/arm-connectedvmware", + "dependencies": { + "@azure/arm-connectedvmware": "next", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + }, + "devDependencies": { + "@types/node": "^12.0.0", + "typescript": "~4.6.0", + "rimraf": "latest" + } +} diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/sample.env b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/clustersCreateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/clustersCreateSample.ts new file mode 100644 index 000000000000..ce2d6e1fe796 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/clustersCreateSample.ts @@ -0,0 +1,53 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + Cluster, + ClustersCreateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create Or Update cluster. + * + * @summary Create Or Update cluster. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateCluster.json + */ +async function createCluster() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const clusterName = "HRCluster"; + const body: Cluster = { + extendedLocation: { + name: + "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso", + type: "customLocation" + }, + location: "East US", + moRefId: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + vCenterId: + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter" + }; + const options: ClustersCreateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.clusters.beginCreateAndWait( + resourceGroupName, + clusterName, + options + ); + console.log(result); +} + +createCluster().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/clustersDeleteSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/clustersDeleteSample.ts new file mode 100644 index 000000000000..61d42aad06f1 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/clustersDeleteSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements cluster DELETE method. + * + * @summary Implements cluster DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteCluster.json + */ +async function deleteCluster() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const clusterName = "HRCluster"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.clusters.beginDeleteAndWait( + resourceGroupName, + clusterName + ); + console.log(result); +} + +deleteCluster().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/clustersGetSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/clustersGetSample.ts new file mode 100644 index 000000000000..2cdbeb4a95bb --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/clustersGetSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements cluster GET method. + * + * @summary Implements cluster GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetCluster.json + */ +async function getCluster() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const clusterName = "HRCluster"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.clusters.get(resourceGroupName, clusterName); + console.log(result); +} + +getCluster().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/clustersListByResourceGroupSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/clustersListByResourceGroupSample.ts new file mode 100644 index 000000000000..2a708a22bb66 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/clustersListByResourceGroupSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of clusters in a resource group. + * + * @summary List of clusters in a resource group. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListClustersByResourceGroup.json + */ +async function listClustersByResourceGroup() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.clusters.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listClustersByResourceGroup().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/clustersListSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/clustersListSample.ts new file mode 100644 index 000000000000..e9ebb084e1a0 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/clustersListSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of clusters in a subscription. + * + * @summary List of clusters in a subscription. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListClusters.json + */ +async function listClusters() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.clusters.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listClusters().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/clustersUpdateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/clustersUpdateSample.ts new file mode 100644 index 000000000000..a09377b9e067 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/clustersUpdateSample.ts @@ -0,0 +1,43 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ResourcePatch, + ClustersUpdateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to API to update certain properties of the cluster resource. + * + * @summary API to update certain properties of the cluster resource. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateCluster.json + */ +async function updateCluster() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const clusterName = "HRCluster"; + const body: ResourcePatch = { tags: { tag1: "value1", tag2: "value2" } }; + const options: ClustersUpdateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.clusters.update( + resourceGroupName, + clusterName, + options + ); + console.log(result); +} + +updateCluster().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/datastoresCreateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/datastoresCreateSample.ts new file mode 100644 index 000000000000..ec0722840d48 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/datastoresCreateSample.ts @@ -0,0 +1,53 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + Datastore, + DatastoresCreateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create Or Update datastore. + * + * @summary Create Or Update datastore. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateDatastore.json + */ +async function createDatastore() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const datastoreName = "HRDatastore"; + const body: Datastore = { + extendedLocation: { + name: + "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso", + type: "customLocation" + }, + location: "East US", + moRefId: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + vCenterId: + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter" + }; + const options: DatastoresCreateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.datastores.beginCreateAndWait( + resourceGroupName, + datastoreName, + options + ); + console.log(result); +} + +createDatastore().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/datastoresDeleteSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/datastoresDeleteSample.ts new file mode 100644 index 000000000000..768b6542424d --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/datastoresDeleteSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements datastore DELETE method. + * + * @summary Implements datastore DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteDatastore.json + */ +async function deleteDatastore() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const datastoreName = "HRDatastore"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.datastores.beginDeleteAndWait( + resourceGroupName, + datastoreName + ); + console.log(result); +} + +deleteDatastore().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/datastoresGetSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/datastoresGetSample.ts new file mode 100644 index 000000000000..7312f920fd73 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/datastoresGetSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements datastore GET method. + * + * @summary Implements datastore GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetDatastore.json + */ +async function getDatastore() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const datastoreName = "HRDatastore"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.datastores.get(resourceGroupName, datastoreName); + console.log(result); +} + +getDatastore().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/datastoresListByResourceGroupSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/datastoresListByResourceGroupSample.ts new file mode 100644 index 000000000000..6ae7bb3c0837 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/datastoresListByResourceGroupSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of datastores in a resource group. + * + * @summary List of datastores in a resource group. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListDatastoresByResourceGroup.json + */ +async function listDatastoresByResourceGroup() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.datastores.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listDatastoresByResourceGroup().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/datastoresListSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/datastoresListSample.ts new file mode 100644 index 000000000000..2ddb006895f9 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/datastoresListSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of datastores in a subscription. + * + * @summary List of datastores in a subscription. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListDatastores.json + */ +async function listDatastores() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.datastores.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listDatastores().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/datastoresUpdateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/datastoresUpdateSample.ts new file mode 100644 index 000000000000..679db4e04405 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/datastoresUpdateSample.ts @@ -0,0 +1,43 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ResourcePatch, + DatastoresUpdateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to API to update certain properties of the datastore resource. + * + * @summary API to update certain properties of the datastore resource. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateDatastore.json + */ +async function updateDatastore() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const datastoreName = "HRDatastore"; + const body: ResourcePatch = { tags: { tag1: "value1", tag2: "value2" } }; + const options: DatastoresUpdateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.datastores.update( + resourceGroupName, + datastoreName, + options + ); + console.log(result); +} + +updateDatastore().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/guestAgentsCreateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/guestAgentsCreateSample.ts new file mode 100644 index 000000000000..038152763ba4 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/guestAgentsCreateSample.ts @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + GuestAgent, + GuestAgentsCreateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create Or Update GuestAgent. + * + * @summary Create Or Update GuestAgent. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateGuestAgent.json + */ +async function createGuestAgent() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "ContosoVm"; + const name = "default"; + const body: GuestAgent = { + credentials: { password: "", username: "tempuser" }, + httpProxyConfig: { httpsProxy: "http://192.1.2.3:8080" }, + provisioningAction: "install" + }; + const options: GuestAgentsCreateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.guestAgents.beginCreateAndWait( + resourceGroupName, + virtualMachineName, + name, + options + ); + console.log(result); +} + +createGuestAgent().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/guestAgentsDeleteSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/guestAgentsDeleteSample.ts new file mode 100644 index 000000000000..5e8b991ee04e --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/guestAgentsDeleteSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements GuestAgent DELETE method. + * + * @summary Implements GuestAgent DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteGuestAgent.json + */ +async function deleteGuestAgent() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "ContosoVm"; + const name = "default"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.guestAgents.beginDeleteAndWait( + resourceGroupName, + virtualMachineName, + name + ); + console.log(result); +} + +deleteGuestAgent().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/guestAgentsGetSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/guestAgentsGetSample.ts new file mode 100644 index 000000000000..85b31adc4311 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/guestAgentsGetSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements GuestAgent GET method. + * + * @summary Implements GuestAgent GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetGuestAgent.json + */ +async function getGuestAgent() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "ContosoVm"; + const name = "default"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.guestAgents.get( + resourceGroupName, + virtualMachineName, + name + ); + console.log(result); +} + +getGuestAgent().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/guestAgentsListByVMSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/guestAgentsListByVMSample.ts new file mode 100644 index 000000000000..4280ddd10f67 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/guestAgentsListByVMSample.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Returns the list of GuestAgent of the given vm. + * + * @summary Returns the list of GuestAgent of the given vm. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GuestAgent_ListByVm.json + */ +async function guestAgentListByVM() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "ContosoVm"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.guestAgents.listByVm( + resourceGroupName, + virtualMachineName + )) { + resArray.push(item); + } + console.log(resArray); +} + +guestAgentListByVM().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hostsCreateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hostsCreateSample.ts new file mode 100644 index 000000000000..96890ea8d011 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hostsCreateSample.ts @@ -0,0 +1,53 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + Host, + HostsCreateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create Or Update host. + * + * @summary Create Or Update host. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateHost.json + */ +async function createHost() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const hostName = "HRHost"; + const body: Host = { + extendedLocation: { + name: + "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso", + type: "customLocation" + }, + location: "East US", + moRefId: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + vCenterId: + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter" + }; + const options: HostsCreateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.hosts.beginCreateAndWait( + resourceGroupName, + hostName, + options + ); + console.log(result); +} + +createHost().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hostsDeleteSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hostsDeleteSample.ts new file mode 100644 index 000000000000..28c461fd27a8 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hostsDeleteSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements host DELETE method. + * + * @summary Implements host DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteHost.json + */ +async function deleteHost() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const hostName = "HRHost"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.hosts.beginDeleteAndWait( + resourceGroupName, + hostName + ); + console.log(result); +} + +deleteHost().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hostsGetSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hostsGetSample.ts new file mode 100644 index 000000000000..424a90115c08 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hostsGetSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements host GET method. + * + * @summary Implements host GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetHost.json + */ +async function getHost() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const hostName = "HRHost"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.hosts.get(resourceGroupName, hostName); + console.log(result); +} + +getHost().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hostsListByResourceGroupSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hostsListByResourceGroupSample.ts new file mode 100644 index 000000000000..bbc65929d504 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hostsListByResourceGroupSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of hosts in a resource group. + * + * @summary List of hosts in a resource group. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListHostsByResourceGroup.json + */ +async function listHostsByResourceGroup() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.hosts.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listHostsByResourceGroup().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hostsListSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hostsListSample.ts new file mode 100644 index 000000000000..38abf26ab397 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hostsListSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of hosts in a subscription. + * + * @summary List of hosts in a subscription. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListHosts.json + */ +async function listHosts() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.hosts.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listHosts().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hostsUpdateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hostsUpdateSample.ts new file mode 100644 index 000000000000..987467e5ce49 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hostsUpdateSample.ts @@ -0,0 +1,43 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ResourcePatch, + HostsUpdateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to API to update certain properties of the host resource. + * + * @summary API to update certain properties of the host resource. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateHost.json + */ +async function updateHost() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const hostName = "HRHost"; + const body: ResourcePatch = { tags: { tag1: "value1", tag2: "value2" } }; + const options: HostsUpdateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.hosts.update( + resourceGroupName, + hostName, + options + ); + console.log(result); +} + +updateHost().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hybridIdentityMetadataCreateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hybridIdentityMetadataCreateSample.ts new file mode 100644 index 000000000000..af8a656d67f1 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hybridIdentityMetadataCreateSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + HybridIdentityMetadata, + HybridIdentityMetadataCreateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create Or Update HybridIdentityMetadata. + * + * @summary Create Or Update HybridIdentityMetadata. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateHybridIdentityMetadata.json + */ +async function createHybridIdentityMetadata() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "ContosoVm"; + const metadataName = "default"; + const body: HybridIdentityMetadata = { + publicKey: "8ec7d60c-9700-40b1-8e6e-e5b2f6f477f2", + vmId: "f8b82dff-38ef-4220-99ef-d3a3f86ddc6c" + }; + const options: HybridIdentityMetadataCreateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.hybridIdentityMetadataOperations.create( + resourceGroupName, + virtualMachineName, + metadataName, + options + ); + console.log(result); +} + +createHybridIdentityMetadata().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hybridIdentityMetadataDeleteSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hybridIdentityMetadataDeleteSample.ts new file mode 100644 index 000000000000..97f80eba6e57 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hybridIdentityMetadataDeleteSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements HybridIdentityMetadata DELETE method. + * + * @summary Implements HybridIdentityMetadata DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteHybridIdentityMetadata.json + */ +async function deleteHybridIdentityMetadata() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "ContosoVm"; + const metadataName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.hybridIdentityMetadataOperations.delete( + resourceGroupName, + virtualMachineName, + metadataName + ); + console.log(result); +} + +deleteHybridIdentityMetadata().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hybridIdentityMetadataGetSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hybridIdentityMetadataGetSample.ts new file mode 100644 index 000000000000..b1391f0a45be --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hybridIdentityMetadataGetSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements HybridIdentityMetadata GET method. + * + * @summary Implements HybridIdentityMetadata GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetHybridIdentityMetadata.json + */ +async function getHybridIdentityMetadata() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "ContosoVm"; + const metadataName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.hybridIdentityMetadataOperations.get( + resourceGroupName, + virtualMachineName, + metadataName + ); + console.log(result); +} + +getHybridIdentityMetadata().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hybridIdentityMetadataListByVMSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hybridIdentityMetadataListByVMSample.ts new file mode 100644 index 000000000000..2ecd86958f90 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/hybridIdentityMetadataListByVMSample.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Returns the list of HybridIdentityMetadata of the given vm. + * + * @summary Returns the list of HybridIdentityMetadata of the given vm. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/HybridIdentityMetadata_ListByVm.json + */ +async function hybridIdentityMetadataListByVM() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "ContosoVm"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.hybridIdentityMetadataOperations.listByVm( + resourceGroupName, + virtualMachineName + )) { + resArray.push(item); + } + console.log(resArray); +} + +hybridIdentityMetadataListByVM().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/inventoryItemsCreateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/inventoryItemsCreateSample.ts new file mode 100644 index 000000000000..805442214ecb --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/inventoryItemsCreateSample.ts @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + InventoryItem, + InventoryItemsCreateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create Or Update InventoryItem. + * + * @summary Create Or Update InventoryItem. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateInventoryItem.json + */ +async function createInventoryItem() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const vcenterName = "ContosoVCenter"; + const inventoryItemName = "testItem"; + const body: InventoryItem = { inventoryType: "ResourcePool" }; + const options: InventoryItemsCreateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.inventoryItems.create( + resourceGroupName, + vcenterName, + inventoryItemName, + options + ); + console.log(result); +} + +createInventoryItem().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/inventoryItemsDeleteSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/inventoryItemsDeleteSample.ts new file mode 100644 index 000000000000..42c684e7072d --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/inventoryItemsDeleteSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements inventoryItem DELETE method. + * + * @summary Implements inventoryItem DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteInventoryItem.json + */ +async function deleteInventoryItem() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const vcenterName = "ContosoVCenter"; + const inventoryItemName = "testItem"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.inventoryItems.delete( + resourceGroupName, + vcenterName, + inventoryItemName + ); + console.log(result); +} + +deleteInventoryItem().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/inventoryItemsGetSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/inventoryItemsGetSample.ts new file mode 100644 index 000000000000..c787c634d63a --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/inventoryItemsGetSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements InventoryItem GET method. + * + * @summary Implements InventoryItem GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetInventoryItem.json + */ +async function getInventoryItem() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const vcenterName = "ContosoVCenter"; + const inventoryItemName = "testItem"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.inventoryItems.get( + resourceGroupName, + vcenterName, + inventoryItemName + ); + console.log(result); +} + +getInventoryItem().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/inventoryItemsListByVCenterSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/inventoryItemsListByVCenterSample.ts new file mode 100644 index 000000000000..4e271a3d0980 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/inventoryItemsListByVCenterSample.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Returns the list of inventoryItems of the given vCenter. + * + * @summary Returns the list of inventoryItems of the given vCenter. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/InventoryItems_ListByVCenter.json + */ +async function inventoryItemsListByVCenter() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const vcenterName = "ContosoVCenter"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.inventoryItems.listByVCenter( + resourceGroupName, + vcenterName + )) { + resArray.push(item); + } + console.log(resArray); +} + +inventoryItemsListByVCenter().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/machineExtensionsCreateOrUpdateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/machineExtensionsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..4d1c61601a7b --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/machineExtensionsCreateOrUpdateSample.ts @@ -0,0 +1,52 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + MachineExtension, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create or update the extension. + * + * @summary The operation to create or update the extension. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/PUTExtension.json + */ +async function createOrUpdateAMachineExtensionPut() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const name = "myMachine"; + const extensionName = "CustomScriptExtension"; + const extensionParameters: MachineExtension = { + typePropertiesType: "CustomScriptExtension", + location: "eastus2euap", + publisher: "Microsoft.Compute", + settings: { + commandToExecute: + 'powershell.exe -c "Get-Process | Where-Object { $_.CPU -gt 10000 }"' + }, + typeHandlerVersion: "1.10" + }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.machineExtensions.beginCreateOrUpdateAndWait( + resourceGroupName, + name, + extensionName, + extensionParameters + ); + console.log(result); +} + +createOrUpdateAMachineExtensionPut().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/machineExtensionsDeleteSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/machineExtensionsDeleteSample.ts new file mode 100644 index 000000000000..f999d1248cdc --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/machineExtensionsDeleteSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete the extension. + * + * @summary The operation to delete the extension. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DELETEExtension.json + */ +async function deleteAMachineExtension() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const name = "myMachine"; + const extensionName = "MMA"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.machineExtensions.beginDeleteAndWait( + resourceGroupName, + name, + extensionName + ); + console.log(result); +} + +deleteAMachineExtension().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/machineExtensionsGetSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/machineExtensionsGetSample.ts new file mode 100644 index 000000000000..b9c8075b114f --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/machineExtensionsGetSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get the extension. + * + * @summary The operation to get the extension. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GETExtension.json + */ +async function getMachineExtension() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const name = "myMachine"; + const extensionName = "CustomScriptExtension"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.machineExtensions.get( + resourceGroupName, + name, + extensionName + ); + console.log(result); +} + +getMachineExtension().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/machineExtensionsListSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/machineExtensionsListSample.ts new file mode 100644 index 000000000000..4bb0e10adcb4 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/machineExtensionsListSample.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get all extensions of a non-Azure machine + * + * @summary The operation to get all extensions of a non-Azure machine + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/LISTExtension.json + */ +async function getAllMachineExtensions() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const name = "myMachine"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.machineExtensions.list( + resourceGroupName, + name + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAllMachineExtensions().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/machineExtensionsUpdateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/machineExtensionsUpdateSample.ts new file mode 100644 index 000000000000..da64ecdec9dc --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/machineExtensionsUpdateSample.ts @@ -0,0 +1,51 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + MachineExtensionUpdate, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update the extension. + * + * @summary The operation to update the extension. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateExtension.json + */ +async function createOrUpdateAMachineExtensionPatch() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const name = "myMachine"; + const extensionName = "CustomScriptExtension"; + const extensionParameters: MachineExtensionUpdate = { + type: "CustomScriptExtension", + publisher: "Microsoft.Compute", + settings: { + commandToExecute: + 'powershell.exe -c "Get-Process | Where-Object { $_.CPU -lt 100 }"' + }, + typeHandlerVersion: "1.10" + }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.machineExtensions.beginUpdateAndWait( + resourceGroupName, + name, + extensionName, + extensionParameters + ); + console.log(result); +} + +createOrUpdateAMachineExtensionPatch().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/operationsListSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/operationsListSample.ts new file mode 100644 index 000000000000..ba2142de6429 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/operationsListSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Returns list of all operations. + * + * @summary Returns list of all operations. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListOperations.json + */ +async function listOperations() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listOperations().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/resourcePoolsCreateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/resourcePoolsCreateSample.ts new file mode 100644 index 000000000000..dbd02297656f --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/resourcePoolsCreateSample.ts @@ -0,0 +1,53 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ResourcePool, + ResourcePoolsCreateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create Or Update resourcePool. + * + * @summary Create Or Update resourcePool. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateResourcePool.json + */ +async function createResourcePool() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const resourcePoolName = "HRPool"; + const body: ResourcePool = { + extendedLocation: { + name: + "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso", + type: "customLocation" + }, + location: "East US", + moRefId: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + vCenterId: + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter" + }; + const options: ResourcePoolsCreateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.resourcePools.beginCreateAndWait( + resourceGroupName, + resourcePoolName, + options + ); + console.log(result); +} + +createResourcePool().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/resourcePoolsDeleteSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/resourcePoolsDeleteSample.ts new file mode 100644 index 000000000000..c9271d7ac2f8 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/resourcePoolsDeleteSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements resourcePool DELETE method. + * + * @summary Implements resourcePool DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteResourcePool.json + */ +async function deleteResourcePool() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const resourcePoolName = "HRPool"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.resourcePools.beginDeleteAndWait( + resourceGroupName, + resourcePoolName + ); + console.log(result); +} + +deleteResourcePool().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/resourcePoolsGetSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/resourcePoolsGetSample.ts new file mode 100644 index 000000000000..dc1aaf15459d --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/resourcePoolsGetSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements resourcePool GET method. + * + * @summary Implements resourcePool GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetResourcePool.json + */ +async function getResourcePool() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const resourcePoolName = "HRPool"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.resourcePools.get( + resourceGroupName, + resourcePoolName + ); + console.log(result); +} + +getResourcePool().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/resourcePoolsListByResourceGroupSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/resourcePoolsListByResourceGroupSample.ts new file mode 100644 index 000000000000..dfc2ce9b713f --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/resourcePoolsListByResourceGroupSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of resourcePools in a resource group. + * + * @summary List of resourcePools in a resource group. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListResourcePoolsByResourceGroup.json + */ +async function listResourcePoolsByResourceGroup() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.resourcePools.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listResourcePoolsByResourceGroup().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/resourcePoolsListSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/resourcePoolsListSample.ts new file mode 100644 index 000000000000..3bc3a1a43c65 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/resourcePoolsListSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of resourcePools in a subscription. + * + * @summary List of resourcePools in a subscription. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListResourcePools.json + */ +async function listResourcePools() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.resourcePools.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listResourcePools().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/resourcePoolsUpdateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/resourcePoolsUpdateSample.ts new file mode 100644 index 000000000000..fb70d5b65354 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/resourcePoolsUpdateSample.ts @@ -0,0 +1,43 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ResourcePatch, + ResourcePoolsUpdateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to API to update certain properties of the resourcePool resource. + * + * @summary API to update certain properties of the resourcePool resource. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateResourcePool.json + */ +async function updateResourcePool() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const resourcePoolName = "HRPool"; + const body: ResourcePatch = { tags: { tag1: "value1", tag2: "value2" } }; + const options: ResourcePoolsUpdateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.resourcePools.update( + resourceGroupName, + resourcePoolName, + options + ); + console.log(result); +} + +updateResourcePool().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/vCentersCreateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/vCentersCreateSample.ts new file mode 100644 index 000000000000..4d740421502d --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/vCentersCreateSample.ts @@ -0,0 +1,53 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VCenter, + VCentersCreateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create Or Update vCenter. + * + * @summary Create Or Update vCenter. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVCenter.json + */ +async function createVCenter() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const vcenterName = "ContosoVCenter"; + const body: VCenter = { + credentials: { password: "", username: "tempuser" }, + extendedLocation: { + name: + "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso", + type: "customLocation" + }, + fqdn: "ContosoVMware.contoso.com", + location: "East US", + port: 1234 + }; + const options: VCentersCreateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.vCenters.beginCreateAndWait( + resourceGroupName, + vcenterName, + options + ); + console.log(result); +} + +createVCenter().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/vCentersDeleteSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/vCentersDeleteSample.ts new file mode 100644 index 000000000000..005d1bde5b34 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/vCentersDeleteSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements vCenter DELETE method. + * + * @summary Implements vCenter DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVCenter.json + */ +async function deleteVCenter() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const vcenterName = "ContosoVCenter"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.vCenters.beginDeleteAndWait( + resourceGroupName, + vcenterName + ); + console.log(result); +} + +deleteVCenter().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/vCentersGetSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/vCentersGetSample.ts new file mode 100644 index 000000000000..f087f39ee737 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/vCentersGetSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements vCenter GET method. + * + * @summary Implements vCenter GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVCenter.json + */ +async function getVCenter() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const vcenterName = "ContosoVCenter"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.vCenters.get(resourceGroupName, vcenterName); + console.log(result); +} + +getVCenter().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/vCentersListByResourceGroupSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/vCentersListByResourceGroupSample.ts new file mode 100644 index 000000000000..40c2514510bc --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/vCentersListByResourceGroupSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of vCenters in a resource group. + * + * @summary List of vCenters in a resource group. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVCentersByResourceGroup.json + */ +async function listVCentersByResourceGroup() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.vCenters.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listVCentersByResourceGroup().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/vCentersListSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/vCentersListSample.ts new file mode 100644 index 000000000000..ed7bba6bd743 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/vCentersListSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of vCenters in a subscription. + * + * @summary List of vCenters in a subscription. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVCenters.json + */ +async function listVCenters() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.vCenters.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listVCenters().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/vCentersUpdateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/vCentersUpdateSample.ts new file mode 100644 index 000000000000..257ebe61872e --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/vCentersUpdateSample.ts @@ -0,0 +1,43 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ResourcePatch, + VCentersUpdateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to API to update certain properties of the vCenter resource. + * + * @summary API to update certain properties of the vCenter resource. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVCenter.json + */ +async function updateVCenter() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const vcenterName = "ContosoVCenter"; + const body: ResourcePatch = { tags: { tag1: "value1", tag2: "value2" } }; + const options: VCentersUpdateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.vCenters.update( + resourceGroupName, + vcenterName, + options + ); + console.log(result); +} + +updateVCenter().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachineTemplatesCreateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachineTemplatesCreateSample.ts new file mode 100644 index 000000000000..8239fd0c77e5 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachineTemplatesCreateSample.ts @@ -0,0 +1,53 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineTemplate, + VirtualMachineTemplatesCreateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create Or Update virtual machine template. + * + * @summary Create Or Update virtual machine template. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVirtualMachineTemplate.json + */ +async function createVirtualMachineTemplate() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineTemplateName = "WebFrontEndTemplate"; + const body: VirtualMachineTemplate = { + extendedLocation: { + name: + "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso", + type: "customLocation" + }, + location: "East US", + moRefId: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + vCenterId: + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter" + }; + const options: VirtualMachineTemplatesCreateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualMachineTemplates.beginCreateAndWait( + resourceGroupName, + virtualMachineTemplateName, + options + ); + console.log(result); +} + +createVirtualMachineTemplate().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachineTemplatesDeleteSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachineTemplatesDeleteSample.ts new file mode 100644 index 000000000000..b6aa00d9c8d8 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachineTemplatesDeleteSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements virtual machine template DELETE method. + * + * @summary Implements virtual machine template DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVirtualMachineTemplate.json + */ +async function deleteVirtualMachineTemplate() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineTemplateName = "WebFrontEndTemplate"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualMachineTemplates.beginDeleteAndWait( + resourceGroupName, + virtualMachineTemplateName + ); + console.log(result); +} + +deleteVirtualMachineTemplate().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachineTemplatesGetSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachineTemplatesGetSample.ts new file mode 100644 index 000000000000..a20baaad981f --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachineTemplatesGetSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements virtual machine template GET method. + * + * @summary Implements virtual machine template GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVirtualMachineTemplate.json + */ +async function getVirtualMachineTemplate() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineTemplateName = "WebFrontEndTemplate"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualMachineTemplates.get( + resourceGroupName, + virtualMachineTemplateName + ); + console.log(result); +} + +getVirtualMachineTemplate().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachineTemplatesListByResourceGroupSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachineTemplatesListByResourceGroupSample.ts new file mode 100644 index 000000000000..274b818e457e --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachineTemplatesListByResourceGroupSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of virtualMachineTemplates in a resource group. + * + * @summary List of virtualMachineTemplates in a resource group. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachineTemplatesByResourceGroup.json + */ +async function listVirtualMachineTemplatesByResourceGroup() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.virtualMachineTemplates.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listVirtualMachineTemplatesByResourceGroup().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachineTemplatesListSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachineTemplatesListSample.ts new file mode 100644 index 000000000000..85e369d8de7f --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachineTemplatesListSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of virtualMachineTemplates in a subscription. + * + * @summary List of virtualMachineTemplates in a subscription. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachineTemplates.json + */ +async function listVirtualMachineTemplates() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.virtualMachineTemplates.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listVirtualMachineTemplates().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachineTemplatesUpdateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachineTemplatesUpdateSample.ts new file mode 100644 index 000000000000..4a300f63d783 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachineTemplatesUpdateSample.ts @@ -0,0 +1,43 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ResourcePatch, + VirtualMachineTemplatesUpdateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to API to update certain properties of the virtual machine template resource. + * + * @summary API to update certain properties of the virtual machine template resource. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVirtualMachineTemplate.json + */ +async function updateVirtualMachineTemplate() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineTemplateName = "WebFrontEndTemplate"; + const body: ResourcePatch = { tags: { tag1: "value1", tag2: "value2" } }; + const options: VirtualMachineTemplatesUpdateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualMachineTemplates.update( + resourceGroupName, + virtualMachineTemplateName, + options + ); + console.log(result); +} + +updateVirtualMachineTemplate().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesAssessPatchesSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesAssessPatchesSample.ts new file mode 100644 index 000000000000..7c2956717302 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesAssessPatchesSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to assess patches on a vSphere VMware machine identity in Azure. + * + * @summary The operation to assess patches on a vSphere VMware machine identity in Azure. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/VirtualMachineAssessPatches.json + */ +async function assessPatchStateOfAMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroupName"; + const name = "myMachineName"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualMachines.beginAssessPatchesAndWait( + resourceGroupName, + name + ); + console.log(result); +} + +assessPatchStateOfAMachine().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesCreateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesCreateSample.ts new file mode 100644 index 000000000000..4982845cc666 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesCreateSample.ts @@ -0,0 +1,57 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachine, + VirtualMachinesCreateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create Or Update virtual machine. + * + * @summary Create Or Update virtual machine. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVirtualMachine.json + */ +async function createVirtualMachine() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "DemoVM"; + const body: VirtualMachine = { + extendedLocation: { + name: + "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso", + type: "customLocation" + }, + hardwareProfile: { memorySizeMB: 4196, numCPUs: 4 }, + location: "East US", + resourcePoolId: + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/ResourcePools/HRPool", + templateId: + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VirtualMachineTemplates/WebFrontEndTemplate", + vCenterId: + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter" + }; + const options: VirtualMachinesCreateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualMachines.beginCreateAndWait( + resourceGroupName, + virtualMachineName, + options + ); + console.log(result); +} + +createVirtualMachine().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesDeleteSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesDeleteSample.ts new file mode 100644 index 000000000000..215f0bb6ab8b --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesDeleteSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements virtual machine DELETE method. + * + * @summary Implements virtual machine DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVirtualMachine.json + */ +async function deleteVirtualMachine() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "DemoVM"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualMachines.beginDeleteAndWait( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +deleteVirtualMachine().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesGetSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesGetSample.ts new file mode 100644 index 000000000000..6b181fcfd778 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesGetSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements virtual machine GET method. + * + * @summary Implements virtual machine GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVirtualMachine.json + */ +async function getVirtualMachine() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "DemoVM"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualMachines.get( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +getVirtualMachine().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesInstallPatchesSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesInstallPatchesSample.ts new file mode 100644 index 000000000000..adfc5c1b77bb --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesInstallPatchesSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineInstallPatchesParameters, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to install patches on a vSphere VMware machine identity in Azure. + * + * @summary The operation to install patches on a vSphere VMware machine identity in Azure. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/VirtualMachineInstallPatches.json + */ +async function installPatchStateOfAMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroupName"; + const name = "myMachineName"; + const installPatchesInput: VirtualMachineInstallPatchesParameters = { + maximumDuration: "PT3H", + rebootSetting: "IfRequired", + windowsParameters: { + classificationsToInclude: ["Critical", "Security"], + maxPatchPublishDate: new Date("2022-01-15T02:36:43.0539904+00:00") + } + }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualMachines.beginInstallPatchesAndWait( + resourceGroupName, + name, + installPatchesInput + ); + console.log(result); +} + +installPatchStateOfAMachine().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesListByResourceGroupSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesListByResourceGroupSample.ts new file mode 100644 index 000000000000..f1e0bf514dc4 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesListByResourceGroupSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of virtualMachines in a resource group. + * + * @summary List of virtualMachines in a resource group. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachinesByResourceGroup.json + */ +async function listVirtualMachinesByResourceGroup() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.virtualMachines.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listVirtualMachinesByResourceGroup().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesListSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesListSample.ts new file mode 100644 index 000000000000..4a51c8d4a49f --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesListSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of virtualMachines in a subscription. + * + * @summary List of virtualMachines in a subscription. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachines.json + */ +async function listVirtualMachines() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.virtualMachines.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listVirtualMachines().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesRestartSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesRestartSample.ts new file mode 100644 index 000000000000..c253def68ed3 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesRestartSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Restart virtual machine. + * + * @summary Restart virtual machine. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/RestartVirtualMachine.json + */ +async function restartVirtualMachine() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "DemoVM"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualMachines.beginRestartAndWait( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +restartVirtualMachine().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesStartSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesStartSample.ts new file mode 100644 index 000000000000..5af4a48df4ff --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesStartSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Start virtual machine. + * + * @summary Start virtual machine. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/StartVirtualMachine.json + */ +async function startVirtualMachine() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "DemoVM"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualMachines.beginStartAndWait( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +startVirtualMachine().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesStopSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesStopSample.ts new file mode 100644 index 000000000000..507c71c37cbc --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesStopSample.ts @@ -0,0 +1,43 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + StopVirtualMachineOptions, + VirtualMachinesStopOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Stop virtual machine. + * + * @summary Stop virtual machine. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/StopVirtualMachine.json + */ +async function stopVirtualMachine() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "DemoVM"; + const body: StopVirtualMachineOptions = { skipShutdown: true }; + const options: VirtualMachinesStopOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualMachines.beginStopAndWait( + resourceGroupName, + virtualMachineName, + options + ); + console.log(result); +} + +stopVirtualMachine().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesUpdateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesUpdateSample.ts new file mode 100644 index 000000000000..9983dbec1a15 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualMachinesUpdateSample.ts @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineUpdate, + VirtualMachinesUpdateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to API to update certain properties of the virtual machine resource. + * + * @summary API to update certain properties of the virtual machine resource. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVirtualMachine.json + */ +async function updateVirtualMachine() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualMachineName = "DemoVM"; + const body: VirtualMachineUpdate = { + tags: { tag1: "value1", tag2: "value2" } + }; + const options: VirtualMachinesUpdateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualMachines.beginUpdateAndWait( + resourceGroupName, + virtualMachineName, + options + ); + console.log(result); +} + +updateVirtualMachine().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualNetworksCreateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualNetworksCreateSample.ts new file mode 100644 index 000000000000..0472e6cce4cb --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualNetworksCreateSample.ts @@ -0,0 +1,53 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualNetwork, + VirtualNetworksCreateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create Or Update virtual network. + * + * @summary Create Or Update virtual network. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVirtualNetwork.json + */ +async function createVirtualNetwork() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualNetworkName = "ProdNetwork"; + const body: VirtualNetwork = { + extendedLocation: { + name: + "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso", + type: "customLocation" + }, + location: "East US", + moRefId: "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + vCenterId: + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter" + }; + const options: VirtualNetworksCreateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualNetworks.beginCreateAndWait( + resourceGroupName, + virtualNetworkName, + options + ); + console.log(result); +} + +createVirtualNetwork().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualNetworksDeleteSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualNetworksDeleteSample.ts new file mode 100644 index 000000000000..5dcc3f0e0b04 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualNetworksDeleteSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements virtual network DELETE method. + * + * @summary Implements virtual network DELETE method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVirtualNetwork.json + */ +async function deleteVirtualNetwork() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualNetworkName = "ProdNetwork"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualNetworks.beginDeleteAndWait( + resourceGroupName, + virtualNetworkName + ); + console.log(result); +} + +deleteVirtualNetwork().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualNetworksGetSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualNetworksGetSample.ts new file mode 100644 index 000000000000..1ab7342b00e6 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualNetworksGetSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Implements virtual network GET method. + * + * @summary Implements virtual network GET method. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVirtualNetwork.json + */ +async function getVirtualNetwork() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualNetworkName = "ProdNetwork"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualNetworks.get( + resourceGroupName, + virtualNetworkName + ); + console.log(result); +} + +getVirtualNetwork().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualNetworksListByResourceGroupSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualNetworksListByResourceGroupSample.ts new file mode 100644 index 000000000000..01bd4168daca --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualNetworksListByResourceGroupSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of virtualNetworks in a resource group. + * + * @summary List of virtualNetworks in a resource group. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualNetworksByResourceGroup.json + */ +async function listVirtualNetworksByResourceGroup() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.virtualNetworks.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listVirtualNetworksByResourceGroup().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualNetworksListSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualNetworksListSample.ts new file mode 100644 index 000000000000..2f6fc1c26ef8 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualNetworksListSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List of virtualNetworks in a subscription. + * + * @summary List of virtualNetworks in a subscription. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualNetworks.json + */ +async function listVirtualNetworks() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const resArray = new Array(); + for await (let item of client.virtualNetworks.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listVirtualNetworks().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualNetworksUpdateSample.ts b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualNetworksUpdateSample.ts new file mode 100644 index 000000000000..13da7a9b5e24 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/src/virtualNetworksUpdateSample.ts @@ -0,0 +1,43 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ResourcePatch, + VirtualNetworksUpdateOptionalParams, + AzureArcVMwareManagementServiceAPI +} from "@azure/arm-connectedvmware"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to API to update certain properties of the virtual network resource. + * + * @summary API to update certain properties of the virtual network resource. + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVirtualNetwork.json + */ +async function updateVirtualNetwork() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const virtualNetworkName = "ProdNetwork"; + const body: ResourcePatch = { tags: { tag1: "value1", tag2: "value2" } }; + const options: VirtualNetworksUpdateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new AzureArcVMwareManagementServiceAPI( + credential, + subscriptionId + ); + const result = await client.virtualNetworks.update( + resourceGroupName, + virtualNetworkName, + options + ); + console.log(result); +} + +updateVirtualNetwork().catch(console.error); diff --git a/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/tsconfig.json b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/tsconfig.json new file mode 100644 index 000000000000..416c2dd82e00 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/samples/v1-beta/typescript/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2018", + "module": "commonjs", + "moduleResolution": "node", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "alwaysStrict": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src/**.ts" + ] +} diff --git a/sdk/connectedvmware/arm-connectedvmware/src/azureArcVMwareManagementServiceAPI.ts b/sdk/connectedvmware/arm-connectedvmware/src/azureArcVMwareManagementServiceAPI.ts new file mode 100644 index 000000000000..dc09bd898523 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/azureArcVMwareManagementServiceAPI.ts @@ -0,0 +1,195 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import * as coreRestPipeline from "@azure/core-rest-pipeline"; +import { + PipelineRequest, + PipelineResponse, + SendRequest +} from "@azure/core-rest-pipeline"; +import * as coreAuth from "@azure/core-auth"; +import { + OperationsImpl, + VirtualMachinesImpl, + ResourcePoolsImpl, + ClustersImpl, + HostsImpl, + DatastoresImpl, + VCentersImpl, + VirtualMachineTemplatesImpl, + VirtualNetworksImpl, + InventoryItemsImpl, + HybridIdentityMetadataOperationsImpl, + MachineExtensionsImpl, + GuestAgentsImpl +} from "./operations"; +import { + Operations, + VirtualMachines, + ResourcePools, + Clusters, + Hosts, + Datastores, + VCenters, + VirtualMachineTemplates, + VirtualNetworks, + InventoryItems, + HybridIdentityMetadataOperations, + MachineExtensions, + GuestAgents +} from "./operationsInterfaces"; +import { AzureArcVMwareManagementServiceAPIOptionalParams } from "./models"; + +export class AzureArcVMwareManagementServiceAPI extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + + /** + * Initializes a new instance of the AzureArcVMwareManagementServiceAPI class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The Subscription ID. + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: AzureArcVMwareManagementServiceAPIOptionalParams + ) { + 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: AzureArcVMwareManagementServiceAPIOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-connectedvmware/1.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: + options.endpoint ?? options.baseUri ?? "https://management.azure.com" + }; + super(optionsWithDefaults); + + let bearerTokenAuthenticationPolicyFound: boolean = false; + if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + (pipelinePolicy) => + pipelinePolicy.name === + coreRestPipeline.bearerTokenAuthenticationPolicyName + ); + } + if ( + !options || + !options.pipeline || + options.pipeline.getOrderedPolicies().length == 0 || + !bearerTokenAuthenticationPolicyFound + ) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + credential: credentials, + scopes: `${optionsWithDefaults.credentialScopes}`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge + } + }) + ); + } + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2022-01-10-preview"; + this.operations = new OperationsImpl(this); + this.virtualMachines = new VirtualMachinesImpl(this); + this.resourcePools = new ResourcePoolsImpl(this); + this.clusters = new ClustersImpl(this); + this.hosts = new HostsImpl(this); + this.datastores = new DatastoresImpl(this); + this.vCenters = new VCentersImpl(this); + this.virtualMachineTemplates = new VirtualMachineTemplatesImpl(this); + this.virtualNetworks = new VirtualNetworksImpl(this); + this.inventoryItems = new InventoryItemsImpl(this); + this.hybridIdentityMetadataOperations = new HybridIdentityMetadataOperationsImpl( + this + ); + this.machineExtensions = new MachineExtensionsImpl(this); + this.guestAgents = new GuestAgentsImpl(this); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return "api-version=" + apiVersion; + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + } + }; + this.pipeline.addPolicy(apiVersionPolicy); + } + + operations: Operations; + virtualMachines: VirtualMachines; + resourcePools: ResourcePools; + clusters: Clusters; + hosts: Hosts; + datastores: Datastores; + vCenters: VCenters; + virtualMachineTemplates: VirtualMachineTemplates; + virtualNetworks: VirtualNetworks; + inventoryItems: InventoryItems; + hybridIdentityMetadataOperations: HybridIdentityMetadataOperations; + machineExtensions: MachineExtensions; + guestAgents: GuestAgents; +} diff --git a/sdk/connectedvmware/arm-connectedvmware/src/index.ts b/sdk/connectedvmware/arm-connectedvmware/src/index.ts new file mode 100644 index 000000000000..6368a3faba8f --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/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 { AzureArcVMwareManagementServiceAPI } from "./azureArcVMwareManagementServiceAPI"; +export * from "./operationsInterfaces"; diff --git a/sdk/connectedvmware/arm-connectedvmware/src/lroImpl.ts b/sdk/connectedvmware/arm-connectedvmware/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/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/connectedvmware/arm-connectedvmware/src/models/index.ts b/sdk/connectedvmware/arm-connectedvmware/src/models/index.ts new file mode 100644 index 000000000000..ffe7dd53ff43 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/models/index.ts @@ -0,0 +1,3341 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; + +export type InventoryItemPropertiesUnion = + | InventoryItemProperties + | ResourcePoolInventoryItem + | VirtualMachineInventoryItem + | VirtualMachineTemplateInventoryItem + | VirtualNetworkInventoryItem + | ClusterInventoryItem + | DatastoreInventoryItem + | HostInventoryItem; + +/** Lists the operations available. */ +export interface OperationsList { + /** Url to follow for getting next page of operations. */ + nextLink?: string; + /** Array of operations */ + value: Operation[]; +} + +/** Operation provided by provider */ +export interface Operation { + /** Name of the operation */ + name?: string; + /** Indicates whether the operation is data action or not. */ + isDataAction?: boolean; + /** Properties of the operation */ + display?: OperationDisplay; +} + +/** Properties of the operation */ +export interface OperationDisplay { + /** Provider name */ + provider?: string; + /** Resource name */ + resource?: string; + /** Operation name */ + operation?: string; + /** Description of the operation */ + description?: string; +} + +/** Error response. */ +export interface ErrorResponse { + /** The error details. */ + error?: ErrorDefinition; +} + +/** Error definition. */ +export interface ErrorDefinition { + /** + * Service specific error code which serves as the substatus for the HTTP error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * Description of the error. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * Internal error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDefinition[]; +} + +/** Describes the properties of an AssessPatches result. */ +export interface VirtualMachineAssessPatchesResult { + /** + * The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings." + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: PatchOperationStatus; + /** + * The activity ID of the operation that produced this result. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly assessmentActivityId?: string; + /** + * The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete installation but the reboot has not yet occurred. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly rebootPending?: boolean; + /** Summarization of patches available for installation on the machine by classification. */ + availablePatchCountByClassification?: AvailablePatchCountByClassification; + /** + * The UTC timestamp when the operation began. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly startDateTime?: Date; + /** + * The UTC timestamp when the operation finished. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastModifiedDateTime?: Date; + /** + * Indicates if operation was triggered by user or by platform. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly startedBy?: PatchOperationStartedBy; + /** + * Specifies the patch service used for the operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly patchServiceUsed?: PatchServiceUsed; + /** + * The operating system type of the machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly osType?: OsTypeUM; + /** + * The errors that were encountered during execution of the operation. The details array contains the list of them. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly errorDetails?: ErrorDetail; +} + +/** Summarization of patches available for installation on the machine by classification. */ +export interface AvailablePatchCountByClassification { + /** + * Number of security patches available for installation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly security?: number; + /** + * Number of critical patches available for installation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly critical?: number; + /** + * Number of definition patches available for installation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly definition?: number; + /** + * Number of update Rollup patches available for installation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly updateRollup?: number; + /** + * Number of feature pack patches available for installation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly featurePack?: number; + /** + * Number of service pack patches available for installation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly servicePack?: number; + /** + * Number of tools patches available for installation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tools?: number; + /** + * Number of updates category patches available for installation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly updates?: number; + /** + * Number of other patches available for installation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly other?: number; +} + +/** Error details. */ +export interface ErrorDetail { + /** The error's code. */ + code: string; + /** A human readable error message. */ + message: string; + /** Indicates which property in the request is responsible for the error. */ + target?: string; + /** Additional error details. */ + details?: ErrorDetail[]; +} + +/** Input for InstallPatches as directly received by the API */ +export interface VirtualMachineInstallPatchesParameters { + /** Specifies the maximum amount of time that the operation will run. It must be an ISO 8601-compliant duration string such as PT4H (4 hours) */ + maximumDuration: string; + /** Defines when it is acceptable to reboot a VM during a software update operation. */ + rebootSetting: VMGuestPatchRebootSetting; + /** Input for InstallPatches on a Windows VM, as directly received by the API */ + windowsParameters?: WindowsParameters; + /** Input for InstallPatches on a Linux VM, as directly received by the API */ + linuxParameters?: LinuxParameters; +} + +/** Input for InstallPatches on a Windows VM, as directly received by the API */ +export interface WindowsParameters { + /** The update classifications to select when installing patches for Windows. */ + classificationsToInclude?: VMGuestPatchClassificationWindows[]; + /** Kbs to include in the patch operation */ + kbNumbersToInclude?: string[]; + /** Kbs to exclude in the patch operation */ + kbNumbersToExclude?: string[]; + /** Filters out Kbs that don't have an InstallationRebootBehavior of 'NeverReboots' when this is set to true. */ + excludeKbsRequiringReboot?: boolean; + /** This is used to install patches that were published on or before this given max published date. */ + maxPatchPublishDate?: Date; +} + +/** Input for InstallPatches on a Linux VM, as directly received by the API */ +export interface LinuxParameters { + /** The update classifications to select when installing patches for Linux. */ + classificationsToInclude?: VMGuestPatchClassificationLinux[]; + /** packages to include in the patch operation. Format: packageName_packageVersion */ + packageNameMasksToInclude?: string[]; + /** packages to exclude in the patch operation. Format: packageName_packageVersion */ + packageNameMasksToExclude?: string[]; +} + +/** The result summary of an installation operation. */ +export interface VirtualMachineInstallPatchesResult { + /** + * The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Failed", "Succeeded", "Unknown" or "CompletedWithWarnings." + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: PatchOperationStatus; + /** + * The activity ID of the operation that produced this result. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly installationActivityId?: string; + /** + * The reboot state of the VM following completion of the operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly rebootStatus?: VMGuestPatchRebootStatus; + /** + * Whether the operation ran out of time before it completed all its intended actions. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly maintenanceWindowExceeded?: boolean; + /** + * The number of patches that were not installed due to the user blocking their installation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly excludedPatchCount?: number; + /** + * The number of patches that were detected as available for install, but did not meet the operation's criteria. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly notSelectedPatchCount?: number; + /** + * The number of patches that were identified as meeting the installation criteria, but were not able to be installed. Typically this happens when maintenanceWindowExceeded == true. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly pendingPatchCount?: number; + /** + * The number of patches successfully installed. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly installedPatchCount?: number; + /** + * The number of patches that could not be installed due to some issue. See errors for details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly failedPatchCount?: number; + /** + * The UTC timestamp when the operation began. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly startDateTime?: Date; + /** + * The UTC timestamp when the operation finished. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastModifiedDateTime?: Date; + /** + * Indicates if operation was triggered by user or by platform. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly startedBy?: PatchOperationStartedBy; + /** + * Specifies the patch service used for the operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly patchServiceUsed?: PatchServiceUsed; + /** + * The operating system type of the machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly osType?: OsTypeUM; + /** + * The errors that were encountered during execution of the operation. The details array contains the list of them. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly errorDetails?: ErrorDetail; +} + +/** Define the resourcePool. */ +export interface ResourcePool { + /** Gets or sets the location. */ + location: string; + /** Gets or sets the extended location. */ + extendedLocation?: ExtendedLocation; + /** + * The system data. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** Gets or sets the Resource tags. */ + tags?: { [propertyName: string]: string }; + /** + * Gets or sets the name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Gets or sets the Id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Gets or sets the type of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. */ + kind?: string; + /** + * Gets or sets a unique identifier for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly uuid?: string; + /** Gets or sets the ARM Id of the vCenter resource in which this resource pool resides. */ + vCenterId?: string; + /** Gets or sets the vCenter MoRef (Managed Object Reference) ID for the resource pool. */ + moRefId?: string; + /** Gets or sets the inventory Item ID for the resource pool. */ + inventoryItemId?: string; + /** + * Gets or sets the vCenter Managed Object name for the resource pool. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly moName?: string; + /** + * Gets or sets CPUSharesLevel which specifies the CPU allocation level for this pool. + * This property is used in relative allocation between resource consumers. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly cpuSharesLevel?: string; + /** + * Gets or sets CPUReservationMHz which specifies the CPU size in MHz that is guaranteed + * to be available. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly cpuReservationMHz?: number; + /** + * Gets or sets CPULimitMHz which specifies a CPU usage limit in MHz. + * Utilization will not exceed this limit even if there are available resources. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly cpuLimitMHz?: number; + /** + * Gets or sets CPUSharesLevel which specifies the memory allocation level for this pool. + * This property is used in relative allocation between resource consumers. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly memSharesLevel?: string; + /** + * Gets or sets MemReservationMB which specifies the guaranteed available memory in + * megabytes. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly memReservationMB?: number; + /** + * Gets or sets MemLimitMB specifies a memory usage limit in megabytes. + * Utilization will not exceed the specified limit even if there are available resources. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly memLimitMB?: number; + /** + * Gets the name of the corresponding resource in Kubernetes. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly customResourceName?: string; + /** + * The resource status information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly statuses?: ResourceStatus[]; + /** + * Gets or sets the provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +} + +/** The resource status information. */ +export interface ResourceStatus { + /** + * The type of the condition. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * Status of the condition. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: string; + /** + * The reason for the condition's status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly reason?: string; + /** + * A human readable message indicating details about the status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * Severity with which to treat failures of this type of condition. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly severity?: string; + /** + * The last update time for this condition. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastUpdatedAt?: Date; +} + +/** The extended location. */ +export interface ExtendedLocation { + /** The extended location type. */ + type?: string; + /** The extended location name. */ + name?: string; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** 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; +} + +/** Object containing updates for patch operations. */ +export interface ResourcePatch { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; +} + +/** List of ResourcePools. */ +export interface ResourcePoolsList { + /** Url to follow for getting next page of ResourcePools. */ + nextLink?: string; + /** Array of ResourcePools */ + value: ResourcePool[]; +} + +/** Define the cluster. */ +export interface Cluster { + /** Gets or sets the location. */ + location: string; + /** Gets or sets the extended location. */ + extendedLocation?: ExtendedLocation; + /** + * The system data. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** Gets or sets the Resource tags. */ + tags?: { [propertyName: string]: string }; + /** + * Gets or sets the name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Gets or sets the Id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Gets or sets the type of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. */ + kind?: string; + /** + * Gets or sets a unique identifier for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly uuid?: string; + /** Gets or sets the ARM Id of the vCenter resource in which this cluster resides. */ + vCenterId?: string; + /** Gets or sets the vCenter MoRef (Managed Object Reference) ID for the cluster. */ + moRefId?: string; + /** Gets or sets the inventory Item ID for the cluster. */ + inventoryItemId?: string; + /** + * Gets or sets the vCenter Managed Object name for the cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly moName?: string; + /** + * The resource status information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly statuses?: ResourceStatus[]; + /** + * Gets the name of the corresponding resource in Kubernetes. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly customResourceName?: string; + /** + * Gets or sets the datastore ARM ids. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly datastoreIds?: string[]; + /** + * Gets or sets the network ARM ids. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly networkIds?: string[]; + /** + * Gets or sets the provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +} + +/** List of Clusters. */ +export interface ClustersList { + /** Url to follow for getting next page of Clusters. */ + nextLink?: string; + /** Array of Clusters */ + value: Cluster[]; +} + +/** Define the host. */ +export interface Host { + /** Gets or sets the location. */ + location: string; + /** Gets or sets the extended location. */ + extendedLocation?: ExtendedLocation; + /** + * The system data. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** Gets or sets the Resource tags. */ + tags?: { [propertyName: string]: string }; + /** + * Gets or sets the name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Gets or sets the Id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Gets or sets the type of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. */ + kind?: string; + /** + * Gets or sets a unique identifier for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly uuid?: string; + /** Gets or sets the ARM Id of the vCenter resource in which this host resides. */ + vCenterId?: string; + /** Gets or sets the vCenter MoRef (Managed Object Reference) ID for the host. */ + moRefId?: string; + /** Gets or sets the inventory Item ID for the host. */ + inventoryItemId?: string; + /** + * Gets or sets the vCenter Managed Object name for the host. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly moName?: string; + /** + * The resource status information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly statuses?: ResourceStatus[]; + /** + * Gets the name of the corresponding resource in Kubernetes. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly customResourceName?: string; + /** + * Gets or sets the provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +} + +/** List of Hosts. */ +export interface HostsList { + /** Url to follow for getting next page of Hosts. */ + nextLink?: string; + /** Array of Hosts */ + value: Host[]; +} + +/** Define the datastore. */ +export interface Datastore { + /** Gets or sets the location. */ + location: string; + /** Gets or sets the extended location. */ + extendedLocation?: ExtendedLocation; + /** + * The system data. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** Gets or sets the Resource tags. */ + tags?: { [propertyName: string]: string }; + /** + * Gets or sets the name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Gets or sets the Id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Gets or sets the type of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. */ + kind?: string; + /** + * Gets or sets a unique identifier for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly uuid?: string; + /** Gets or sets the ARM Id of the vCenter resource in which this datastore resides. */ + vCenterId?: string; + /** Gets or sets the vCenter MoRef (Managed Object Reference) ID for the datastore. */ + moRefId?: string; + /** Gets or sets the inventory Item ID for the datastore. */ + inventoryItemId?: string; + /** + * Gets or sets the vCenter Managed Object name for the datastore. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly moName?: string; + /** + * The resource status information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly statuses?: ResourceStatus[]; + /** + * Gets the name of the corresponding resource in Kubernetes. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly customResourceName?: string; + /** + * Provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; +} + +/** List of Datastores. */ +export interface DatastoresList { + /** Url to follow for getting next page of Datastores. */ + nextLink?: string; + /** Array of Datastores */ + value: Datastore[]; +} + +/** Defines the vCenter. */ +export interface VCenter { + /** Gets or sets the location. */ + location: string; + /** Gets or sets the extended location. */ + extendedLocation?: ExtendedLocation; + /** + * The system data. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** Gets or sets the Resource tags. */ + tags?: { [propertyName: string]: string }; + /** + * Gets or sets the name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Gets or sets the Id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Gets or sets the type of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. */ + kind?: string; + /** + * Gets or sets a unique identifier for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly uuid?: string; + /** Gets or sets the FQDN/IPAddress of the vCenter. */ + fqdn: string; + /** Gets or sets the port of the vCenter. */ + port?: number; + /** + * Gets or sets the version of the vCenter. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly version?: string; + /** + * Gets or sets the instance UUID of the vCenter. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly instanceUuid?: string; + /** + * Gets or sets the connection status to the vCenter. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly connectionStatus?: string; + /** + * Gets the name of the corresponding resource in Kubernetes. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly customResourceName?: string; + /** Username / Password Credentials to connect to vcenter. */ + credentials?: VICredential; + /** + * The resource status information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly statuses?: ResourceStatus[]; + /** + * Gets or sets the provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +} + +/** Username / Password Credentials to connect to vcenter. */ +export interface VICredential { + /** Gets or sets username to connect with the vCenter. */ + username?: string; + /** Gets or sets the password to connect with the vCenter. */ + password?: string; +} + +/** List of VCenters. */ +export interface VCentersList { + /** Url to follow for getting next page of VCenters. */ + nextLink?: string; + /** Array of VCenters */ + value: VCenter[]; +} + +/** Define the virtualMachine. */ +export interface VirtualMachine { + /** Gets or sets the location. */ + location: string; + /** Gets or sets the extended location. */ + extendedLocation?: ExtendedLocation; + /** + * The system data. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** Gets or sets the Resource tags. */ + tags?: { [propertyName: string]: string }; + /** + * Gets or sets the name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Gets or sets the Id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Gets or sets the type of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. */ + kind?: string; + /** The identity of the resource. */ + identity?: Identity; + /** + * Gets or sets the ARM Id of the resourcePool resource on which this virtual machine will + * deploy. + */ + resourcePoolId?: string; + /** Gets or sets the ARM Id of the template resource to deploy the virtual machine. */ + templateId?: string; + /** Gets or sets the ARM Id of the vCenter resource in which this resource pool resides. */ + vCenterId?: string; + /** Placement properties. */ + placementProfile?: PlacementProfile; + /** OS properties. */ + osProfile?: OsProfile; + /** Hardware properties. */ + hardwareProfile?: HardwareProfile; + /** Network properties. */ + networkProfile?: NetworkProfile; + /** Storage properties. */ + storageProfile?: StorageProfile; + /** Guest agent status properties. */ + guestAgentProfile?: GuestAgentProfile; + /** Gets the security profile. */ + securityProfile?: SecurityProfile; + /** Gets or sets the vCenter MoRef (Managed Object Reference) ID for the virtual machine. */ + moRefId?: string; + /** Gets or sets the inventory Item ID for the virtual machine. */ + inventoryItemId?: string; + /** + * Gets or sets the vCenter Managed Object name for the virtual machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly moName?: string; + /** + * Gets or sets the folder path of the vm. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly folderPath?: string; + /** + * Gets or sets the instance uuid of the vm. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly instanceUuid?: string; + /** Gets or sets the SMBIOS UUID of the vm. */ + smbiosUuid?: string; + /** Firmware type */ + firmwareType?: FirmwareType; + /** + * Gets the power state of the virtual machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly powerState?: string; + /** + * Gets the name of the corresponding resource in Kubernetes. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly customResourceName?: string; + /** + * Gets or sets a unique identifier for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly uuid?: string; + /** + * The resource status information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly statuses?: ResourceStatus[]; + /** + * Gets or sets the provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** + * Gets or sets a unique identifier for the vm resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly vmId?: string; +} + +/** Defines the resource properties. */ +export interface PlacementProfile { + /** Gets or sets the ARM Id of the resourcePool resource on which this virtual machine will deploy. */ + resourcePoolId?: string; + /** Gets or sets the ARM Id of the cluster resource on which this virtual machine will deploy. */ + clusterId?: string; + /** Gets or sets the ARM Id of the host resource on which this virtual machine will deploy. */ + hostId?: string; + /** Gets or sets the ARM Id of the datastore resource on which the data for the virtual machine will be kept. */ + datastoreId?: string; +} + +/** Defines the resource properties. */ +export interface OsProfile { + /** Gets or sets computer name. */ + computerName?: string; + /** Gets or sets administrator username. */ + adminUsername?: string; + /** Gets or sets administrator password. */ + adminPassword?: string; + /** Gets or sets the guestId. */ + guestId?: string; + /** + * Gets or sets a value indicating whether the VM is ready for extension operations. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly allowExtensionOperations?: boolean; + /** Gets or sets the type of the os. */ + osType?: OsType; + /** + * Gets or sets os name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly osName?: string; + /** + * Gets or sets the current running status of VMware Tools running in the guest operating system. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly toolsRunningStatus?: string; + /** + * Gets or sets the current version status of VMware Tools installed in the guest operating system. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly toolsVersionStatus?: string; + /** + * Gets or sets the current version of VMware Tools. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly toolsVersion?: string; + /** Specifies the windows configuration for update management. */ + windowsConfiguration?: OsProfileWindowsConfiguration; + /** Specifies the linux configuration for update management. */ + linuxConfiguration?: OsProfileLinuxConfiguration; +} + +/** Specifies the windows configuration for update management. */ +export interface OsProfileWindowsConfiguration { + /** Specifies the assessment mode. */ + assessmentMode?: string; + /** Specifies the patch mode. */ + patchMode?: string; +} + +/** Specifies the linux configuration for update management. */ +export interface OsProfileLinuxConfiguration { + /** Specifies the assessment mode. */ + assessmentMode?: string; + /** Specifies the patch mode. */ + patchMode?: string; +} + +/** Defines the resource properties. */ +export interface HardwareProfile { + /** Gets or sets memory size in MBs for the vm. */ + memorySizeMB?: number; + /** Gets or sets the number of vCPUs for the vm. */ + numCPUs?: number; + /** Gets or sets the number of cores per socket for the vm. Defaults to 1 if unspecified. */ + numCoresPerSocket?: number; + /** + * Gets or sets a value indicating whether virtual processors can be added while this virtual machine is running. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly cpuHotAddEnabled?: boolean; + /** + * Gets or sets a value indicating whether virtual processors can be removed while this virtual machine is running. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly cpuHotRemoveEnabled?: boolean; + /** + * Gets or sets a value indicating whether memory can be added while this virtual machine is running. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly memoryHotAddEnabled?: boolean; +} + +/** Defines the resource properties. */ +export interface NetworkProfile { + /** Gets or sets the list of network interfaces associated with the virtual machine. */ + networkInterfaces?: NetworkInterface[]; +} + +/** Network Interface model */ +export interface NetworkInterface { + /** Gets or sets the name of the network interface. */ + name?: string; + /** + * Gets or sets the label of the virtual network in vCenter that the nic is connected to. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly label?: string; + /** + * Gets or sets the nic ip addresses. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly ipAddresses?: string[]; + /** + * Gets or sets the NIC MAC address. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly macAddress?: string; + /** Gets or sets the ARM Id of the network resource to connect the virtual machine. */ + networkId?: string; + /** NIC type */ + nicType?: NICType; + /** Gets or sets the power on boot. */ + powerOnBoot?: PowerOnBootOption; + /** + * Gets or sets the vCenter MoRef (Managed Object Reference) ID of the virtual network + * that the nic is connected to. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly networkMoRefId?: string; + /** + * Gets or sets the name of the virtual network in vCenter that the nic is connected to. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly networkMoName?: string; + /** Gets or sets the device key value. */ + deviceKey?: number; + /** Gets or sets the ipsettings. */ + ipSettings?: NicIPSettings; +} + +/** Defines the network interface ip settings. */ +export interface NicIPSettings { + /** Gets or sets the nic allocation method. */ + allocationMethod?: IPAddressAllocationMethod; + /** Gets or sets the dns servers. */ + dnsServers?: string[]; + /** Gets or sets the gateway. */ + gateway?: string[]; + /** Gets or sets the ip address for the nic. */ + ipAddress?: string; + /** Gets or sets the mask. */ + subnetMask?: string; + /** + * Gets or sets the primary server. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly primaryWinsServer?: string; + /** + * Gets or sets the secondary server. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly secondaryWinsServer?: string; + /** + * Gets or sets the IP address information being reported for this NIC. This contains the same IPv4 information above plus IPV6 information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly ipAddressInfo?: NicIPAddressSettings[]; +} + +/** IP address information for a virtual network adapter reported by the fabric. */ +export interface NicIPAddressSettings { + /** + * Gets the ip address allocation method. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly allocationMethod?: string; + /** + * Gets the ip address for the nic. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly ipAddress?: string; + /** + * Gets the mask. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly subnetMask?: string; +} + +/** Defines the resource properties. */ +export interface StorageProfile { + /** Gets or sets the list of virtual disks associated with the virtual machine. */ + disks?: VirtualDisk[]; + /** + * Gets or sets the list of virtual SCSI controllers associated with the virtual machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly scsiControllers?: VirtualScsiController[]; +} + +/** Virtual disk model */ +export interface VirtualDisk { + /** Gets or sets the name of the virtual disk. */ + name?: string; + /** + * Gets or sets the label of the virtual disk in vCenter. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly label?: string; + /** + * Gets or sets the disk object id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly diskObjectId?: string; + /** Gets or sets the disk total size. */ + diskSizeGB?: number; + /** Gets or sets the device key value. */ + deviceKey?: number; + /** Gets or sets the disk mode. */ + diskMode?: DiskMode; + /** Gets or sets the controller id. */ + controllerKey?: number; + /** Gets or sets the unit number of the disk on the controller. */ + unitNumber?: number; + /** Gets or sets the device name. */ + deviceName?: string; + /** Gets or sets the disk backing type. */ + diskType?: DiskType; +} + +/** This data object type contains the properties of a SCSI controller device attached to a virtual machine that is reported by the controller. */ +export interface VirtualScsiController { + /** Gets or sets the controller type. */ + type?: ScsiControllerType; + /** Gets or sets the key of the controller. */ + controllerKey?: number; + /** Gets or sets the bus number of the controller. */ + busNumber?: number; + /** Gets or sets the SCSI controller unit number. */ + scsiCtlrUnitNumber?: number; + /** Gets or sets the sharing mode. */ + sharing?: VirtualScsiSharing; +} + +/** Defines the resource properties. */ +export interface GuestAgentProfile { + /** + * Specifies the VM's unique SMBIOS ID. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly vmUuid?: string; + /** + * The status of the hybrid machine agent. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: StatusTypes; + /** + * The time of the last status change. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastStatusChange?: Date; + /** + * The hybrid machine agent full version. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly agentVersion?: string; + /** + * Details about the error state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly errorDetails?: ErrorDetail[]; +} + +/** Specifies the Security profile settings for the virtual machine. */ +export interface SecurityProfile { + /** Specifies the security settings like secure boot used while creating the virtual machine. */ + uefiSettings?: UefiSettings; +} + +/** Specifies the security settings like secure boot used while creating the virtual machine. */ +export interface UefiSettings { + /** Specifies whether secure boot should be enabled on the virtual machine. */ + secureBootEnabled?: boolean; +} + +/** Managed service identity. */ +export interface Identity { + /** + * The principal id of managed service identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The tenant of managed service identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** The type of managed service identity. */ + type: IdentityType; +} + +/** Defines the virtualMachineUpdate. */ +export interface VirtualMachineUpdate { + /** Gets or sets the Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The identity of the resource. */ + identity?: Identity; + /** Defines the resource properties. */ + hardwareProfile?: HardwareProfile; + /** OS properties. */ + osProfile?: OsProfileUpdate; + /** Defines the resource update properties. */ + storageProfile?: StorageProfileUpdate; + /** Defines the update resource properties. */ + networkProfile?: NetworkProfileUpdate; +} + +/** Defines the os update properties. */ +export interface OsProfileUpdate { + /** Specifies the windows configuration for update management. */ + windowsConfiguration?: OsProfileUpdateWindowsConfiguration; + /** Specifies the linux configuration for update management. */ + linuxConfiguration?: OsProfileUpdateLinuxConfiguration; +} + +/** Specifies the windows configuration for update management. */ +export interface OsProfileUpdateWindowsConfiguration { + /** Specifies the assessment mode. */ + assessmentMode?: string; + /** Specifies the patch mode. */ + patchMode?: string; +} + +/** Specifies the linux configuration for update management. */ +export interface OsProfileUpdateLinuxConfiguration { + /** Specifies the assessment mode. */ + assessmentMode?: string; + /** Specifies the patch mode. */ + patchMode?: string; +} + +/** Defines the resource update properties. */ +export interface StorageProfileUpdate { + /** Gets or sets the list of virtual disks associated with the virtual machine. */ + disks?: VirtualDiskUpdate[]; +} + +/** Defines the virtual disk update. */ +export interface VirtualDiskUpdate { + /** Gets or sets the name of the virtual disk. */ + name?: string; + /** Gets or sets the disk total size. */ + diskSizeGB?: number; + /** Gets or sets the device key value. */ + deviceKey?: number; + /** Gets or sets the disk mode. */ + diskMode?: DiskMode; + /** Gets or sets the controller id. */ + controllerKey?: number; + /** Gets or sets the unit number of the disk on the controller. */ + unitNumber?: number; + /** Gets or sets the device name. */ + deviceName?: string; + /** Gets or sets the disk backing type. */ + diskType?: DiskType; +} + +/** Defines the update resource properties. */ +export interface NetworkProfileUpdate { + /** Gets or sets the list of network interfaces associated with the virtual machine. */ + networkInterfaces?: NetworkInterfaceUpdate[]; +} + +/** Defines the network interface update. */ +export interface NetworkInterfaceUpdate { + /** Gets or sets the name of the network interface. */ + name?: string; + /** Gets or sets the ARM Id of the network resource to connect the virtual machine. */ + networkId?: string; + /** NIC type */ + nicType?: NICType; + /** Gets or sets the power on boot. */ + powerOnBoot?: PowerOnBootOption; + /** Gets or sets the device key value. */ + deviceKey?: number; +} + +/** Defines the stop action properties. */ +export interface StopVirtualMachineOptions { + /** Gets or sets a value indicating whether to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false indicates otherwise. Defaults to false. */ + skipShutdown?: boolean; +} + +/** List of VirtualMachines. */ +export interface VirtualMachinesList { + /** Url to follow for getting next page of VirtualMachines. */ + nextLink?: string; + /** Array of VirtualMachines */ + value: VirtualMachine[]; +} + +/** Define the virtualMachineTemplate. */ +export interface VirtualMachineTemplate { + /** Gets or sets the location. */ + location: string; + /** Gets or sets the extended location. */ + extendedLocation?: ExtendedLocation; + /** + * The system data. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** Gets or sets the Resource tags. */ + tags?: { [propertyName: string]: string }; + /** + * Gets or sets the name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Gets or sets the Id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Gets or sets the type of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. */ + kind?: string; + /** + * Gets or sets a unique identifier for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly uuid?: string; + /** Gets or sets the ARM Id of the vCenter resource in which this template resides. */ + vCenterId?: string; + /** + * Gets or sets the vCenter MoRef (Managed Object Reference) ID for the virtual machine + * template. + */ + moRefId?: string; + /** Gets or sets the inventory Item ID for the virtual machine template. */ + inventoryItemId?: string; + /** + * Gets or sets the vCenter Managed Object name for the virtual machine template. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly moName?: string; + /** + * Gets or sets memory size in MBs for the template. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly memorySizeMB?: number; + /** + * Gets or sets the number of vCPUs for the template. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly numCPUs?: number; + /** + * Gets or sets the number of cores per socket for the template. + * Defaults to 1 if unspecified. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly numCoresPerSocket?: number; + /** + * Gets or sets the type of the os. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly osType?: OsType; + /** + * Gets or sets os name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly osName?: string; + /** + * Gets or sets the folder path of the template. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly folderPath?: string; + /** + * Gets or sets the network interfaces of the template. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly networkInterfaces?: NetworkInterface[]; + /** + * Gets or sets the disks the template. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly disks?: VirtualDisk[]; + /** + * Gets the name of the corresponding resource in Kubernetes. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly customResourceName?: string; + /** + * Gets or sets the current version status of VMware Tools installed in the guest operating system. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly toolsVersionStatus?: string; + /** + * Gets or sets the current version of VMware Tools. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly toolsVersion?: string; + /** + * Firmware type + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly firmwareType?: FirmwareType; + /** + * The resource status information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly statuses?: ResourceStatus[]; + /** + * Gets or sets the provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +} + +/** List of VirtualMachineTemplates. */ +export interface VirtualMachineTemplatesList { + /** Url to follow for getting next page of VirtualMachineTemplates. */ + nextLink?: string; + /** Array of VirtualMachineTemplates */ + value: VirtualMachineTemplate[]; +} + +/** Define the virtualNetwork. */ +export interface VirtualNetwork { + /** Gets or sets the location. */ + location: string; + /** Gets or sets the extended location. */ + extendedLocation?: ExtendedLocation; + /** + * The system data. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** Gets or sets the Resource tags. */ + tags?: { [propertyName: string]: string }; + /** + * Gets or sets the name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Gets or sets the Id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Gets or sets the type of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. */ + kind?: string; + /** + * Gets or sets a unique identifier for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly uuid?: string; + /** Gets or sets the ARM Id of the vCenter resource in which this template resides. */ + vCenterId?: string; + /** Gets or sets the vCenter MoRef (Managed Object Reference) ID for the virtual network. */ + moRefId?: string; + /** Gets or sets the inventory Item ID for the virtual network. */ + inventoryItemId?: string; + /** + * Gets or sets the vCenter Managed Object name for the virtual network. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly moName?: string; + /** + * Gets the name of the corresponding resource in Kubernetes. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly customResourceName?: string; + /** + * The resource status information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly statuses?: ResourceStatus[]; + /** + * Gets or sets the provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +} + +/** List of VirtualNetworks. */ +export interface VirtualNetworksList { + /** Url to follow for getting next page of VirtualNetworks. */ + nextLink?: string; + /** Array of VirtualNetworks */ + value: VirtualNetwork[]; +} + +/** Defines the resource properties. */ +export interface InventoryItemProperties { + /** Polymorphic discriminator, which specifies the different types this object can be */ + inventoryType: + | "ResourcePool" + | "VirtualMachine" + | "VirtualMachineTemplate" + | "VirtualNetwork" + | "Cluster" + | "Datastore" + | "Host"; + /** Gets or sets the tracked resource id corresponding to the inventory resource. */ + managedResourceId?: string; + /** Gets or sets the MoRef (Managed Object Reference) ID for the inventory item. */ + moRefId?: string; + /** Gets or sets the vCenter Managed Object name for the inventory item. */ + moName?: string; + /** + * Gets or sets the provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; +} + +/** List of InventoryItems. */ +export interface InventoryItemsList { + /** Url to follow for getting next page of InventoryItems. */ + nextLink?: string; + /** Array of InventoryItems */ + value: InventoryItem[]; +} + +/** List of HybridIdentityMetadata. */ +export interface HybridIdentityMetadataList { + /** Url to follow for getting next page of HybridIdentityMetadata. */ + nextLink?: string; + /** Array of HybridIdentityMetadata */ + value: HybridIdentityMetadata[]; +} + +/** Describes a Machine Extension. */ +export interface MachineExtension { + /** Gets or sets the location. */ + location?: string; + /** + * The system data. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** Gets or sets the Resource tags. */ + tags?: { [propertyName: string]: string }; + /** + * Gets or sets the name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Gets or sets the Id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Gets or sets the type of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** 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". */ + typePropertiesType?: string; + /** Specifies the version of the script handler. */ + typeHandlerVersion?: string; + /** Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. */ + enableAutomaticUpgrade?: boolean; + /** 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; + /** The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. */ + protectedSettings?: Record; + /** + * The provisioning state, which only appears in the response. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** The machine extension instance view. */ + instanceView?: MachineExtensionPropertiesInstanceView; +} + +/** Describes the Machine Extension Instance View. */ +export interface MachineExtensionInstanceView { + /** + * The machine extension name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Specifies the type of the extension; an example is "CustomScriptExtension". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * Specifies the version of the script handler. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly typeHandlerVersion?: string; + /** Instance view status. */ + status?: MachineExtensionInstanceViewStatus; +} + +/** Instance view status. */ +export interface MachineExtensionInstanceViewStatus { + /** + * The status code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * The level code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly level?: StatusLevelTypes; + /** + * The short localizable label for the status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly displayStatus?: string; + /** + * The detailed status message, including for alerts and error messages. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * The time of the status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly time?: Date; +} + +/** Describes the Machine Extensions List Result. */ +export interface MachineExtensionsListResult { + /** The list of extensions */ + value?: MachineExtension[]; + /** The uri to fetch the next page of machine extensions. Call ListNext() with this to fetch the next page of extensions. */ + nextLink?: string; +} + +/** Username / Password Credentials to connect to guest. */ +export interface GuestCredential { + /** Gets or sets username to connect with the guest. */ + username?: string; + /** Gets or sets the password to connect with the guest. */ + password?: string; +} + +/** HTTP Proxy configuration for the VM. */ +export interface HttpProxyConfiguration { + /** Gets or sets httpsProxy url. */ + httpsProxy?: string; +} + +/** List of GuestAgent. */ +export interface GuestAgentList { + /** Url to follow for getting next page of GuestAgent. */ + nextLink?: string; + /** Array of GuestAgent */ + value: GuestAgent[]; +} + +/** Condition defines an extension to status. */ +export interface Condition { + /** + * Status of the condition. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: string; + /** + * The reason for the condition's status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly reason?: string; + /** + * A human readable message indicating details about the status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * Severity with which to treat failures of this type of condition. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly severity?: string; +} + +/** Defines the resource properties. */ +export interface InventoryItemDetails { + /** Gets or sets the inventory Item ID for the resource. */ + inventoryItemId?: string; + /** Gets or sets the vCenter Managed Object name for the resource. */ + moName?: string; +} + +/** Describes a Machine Extension Update. */ +export interface MachineExtensionUpdate extends ResourcePatch { + /** 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". */ + type?: string; + /** Specifies the version of the script handler. */ + typeHandlerVersion?: string; + /** Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. */ + enableAutomaticUpgrade?: boolean; + /** 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; + /** The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. */ + protectedSettings?: Record; +} + +/** The resource pool inventory item. */ +export interface ResourcePoolInventoryItem extends InventoryItemProperties { + /** Polymorphic discriminator, which specifies the different types this object can be */ + inventoryType: "ResourcePool"; + /** Parent resourcePool inventory resource details. */ + parent?: InventoryItemDetails; +} + +/** The VM inventory item. */ +export interface VirtualMachineInventoryItem extends InventoryItemProperties { + /** Polymorphic discriminator, which specifies the different types this object can be */ + inventoryType: "VirtualMachine"; + /** Gets or sets the type of the os. */ + osType?: OsType; + /** Gets or sets os name. */ + osName?: string; + /** Gets or sets the nic ip addresses. */ + ipAddresses?: string[]; + /** Gets or sets the folder path of the vm. */ + folderPath?: string; + /** Host inventory resource details. */ + host?: InventoryItemDetails; + /** ResourcePool inventory resource details. */ + resourcePool?: InventoryItemDetails; + /** Gets or sets the instance uuid of the vm. */ + instanceUuid?: string; + /** Gets or sets the SMBIOS UUID of the vm. */ + smbiosUuid?: string; + /** + * Gets the power state of the virtual machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly powerState?: string; + /** + * Gets or sets the current running status of VMware Tools running in the guest operating system. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly toolsRunningStatus?: string; + /** + * Gets or sets the current version status of VMware Tools installed in the guest operating system. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly toolsVersionStatus?: string; + /** + * Gets or sets the current version of VMware Tools. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly toolsVersion?: string; +} + +/** The VM Template inventory item. */ +export interface VirtualMachineTemplateInventoryItem + extends InventoryItemProperties { + /** Polymorphic discriminator, which specifies the different types this object can be */ + inventoryType: "VirtualMachineTemplate"; + /** Gets or sets memory size in MBs for the template. */ + memorySizeMB?: number; + /** Gets or sets the number of vCPUs for the template. */ + numCPUs?: number; + /** + * Gets or sets the number of cores per socket for the template. + * Defaults to 1 if unspecified. + */ + numCoresPerSocket?: number; + /** Gets or sets the type of the os. */ + osType?: OsType; + /** Gets or sets os name. */ + osName?: string; + /** Gets or sets the folder path of the template. */ + folderPath?: string; +} + +/** The Virtual network inventory item. */ +export interface VirtualNetworkInventoryItem extends InventoryItemProperties { + /** Polymorphic discriminator, which specifies the different types this object can be */ + inventoryType: "VirtualNetwork"; +} + +/** The cluster inventory item. */ +export interface ClusterInventoryItem extends InventoryItemProperties { + /** Polymorphic discriminator, which specifies the different types this object can be */ + inventoryType: "Cluster"; +} + +/** The datastore inventory item. */ +export interface DatastoreInventoryItem extends InventoryItemProperties { + /** Polymorphic discriminator, which specifies the different types this object can be */ + inventoryType: "Datastore"; + /** Gets or sets Maximum capacity of this datastore, in GBs. */ + capacityGB?: number; + /** Gets or sets Available space of this datastore, in GBs. */ + freeSpaceGB?: number; +} + +/** The host inventory item. */ +export interface HostInventoryItem extends InventoryItemProperties { + /** Polymorphic discriminator, which specifies the different types this object can be */ + inventoryType: "Host"; + /** Parent host inventory resource details. */ + parent?: InventoryItemDetails; +} + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + +/** The machine extension instance view. */ +export interface MachineExtensionPropertiesInstanceView + extends MachineExtensionInstanceView {} + +/** Defines the inventory item. */ +export interface InventoryItem extends ProxyResource { + /** + * The system data. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. */ + kind?: string; + /** They inventory type. */ + inventoryType: InventoryType; + /** Gets or sets the tracked resource id corresponding to the inventory resource. */ + managedResourceId?: string; + /** Gets or sets the MoRef (Managed Object Reference) ID for the inventory item. */ + moRefId?: string; + /** Gets or sets the vCenter Managed Object name for the inventory item. */ + moName?: string; + /** + * Gets or sets the provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +} + +/** Defines the HybridIdentityMetadata. */ +export interface HybridIdentityMetadata extends ProxyResource { + /** + * The system data. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** Gets or sets the Vm Id. */ + vmId?: string; + /** Gets or sets the Public Key. */ + publicKey?: string; + /** + * The identity of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly identity?: Identity; + /** + * Gets or sets the provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +} + +/** Defines the GuestAgent. */ +export interface GuestAgent extends ProxyResource { + /** + * The system data. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** + * Gets or sets a unique identifier for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly uuid?: string; + /** Username / Password Credentials to provision guest agent. */ + credentials?: GuestCredential; + /** HTTP Proxy configuration for the VM. */ + httpProxyConfig?: HttpProxyConfiguration; + /** Gets or sets the guest agent provisioning action. */ + provisioningAction?: ProvisioningAction; + /** + * Gets or sets the guest agent status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: string; + /** + * Gets the name of the corresponding resource in Kubernetes. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly customResourceName?: string; + /** + * The resource status information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly statuses?: ResourceStatus[]; + /** + * Gets or sets the provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +} + +/** Known values of {@link PatchOperationStatus} that the service accepts. */ +export enum KnownPatchOperationStatus { + /** Unknown */ + Unknown = "Unknown", + /** InProgress */ + InProgress = "InProgress", + /** Failed */ + Failed = "Failed", + /** Succeeded */ + Succeeded = "Succeeded", + /** CompletedWithWarnings */ + CompletedWithWarnings = "CompletedWithWarnings" +} + +/** + * Defines values for PatchOperationStatus. \ + * {@link KnownPatchOperationStatus} can be used interchangeably with PatchOperationStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **InProgress** \ + * **Failed** \ + * **Succeeded** \ + * **CompletedWithWarnings** + */ +export type PatchOperationStatus = string; + +/** Known values of {@link PatchOperationStartedBy} that the service accepts. */ +export enum KnownPatchOperationStartedBy { + /** User */ + User = "User", + /** Platform */ + Platform = "Platform" +} + +/** + * Defines values for PatchOperationStartedBy. \ + * {@link KnownPatchOperationStartedBy} can be used interchangeably with PatchOperationStartedBy, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Platform** + */ +export type PatchOperationStartedBy = string; + +/** Known values of {@link PatchServiceUsed} that the service accepts. */ +export enum KnownPatchServiceUsed { + /** Unknown */ + Unknown = "Unknown", + /** WU */ + WU = "WU", + /** WUWsus */ + WUWsus = "WU_WSUS", + /** YUM */ + YUM = "YUM", + /** APT */ + APT = "APT", + /** Zypper */ + Zypper = "Zypper" +} + +/** + * Defines values for PatchServiceUsed. \ + * {@link KnownPatchServiceUsed} can be used interchangeably with PatchServiceUsed, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **WU** \ + * **WU_WSUS** \ + * **YUM** \ + * **APT** \ + * **Zypper** + */ +export type PatchServiceUsed = string; + +/** Known values of {@link OsTypeUM} that the service accepts. */ +export enum KnownOsTypeUM { + /** Windows */ + Windows = "Windows", + /** Linux */ + Linux = "Linux" +} + +/** + * Defines values for OsTypeUM. \ + * {@link KnownOsTypeUM} can be used interchangeably with OsTypeUM, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Windows** \ + * **Linux** + */ +export type OsTypeUM = string; + +/** Known values of {@link VMGuestPatchRebootSetting} that the service accepts. */ +export enum KnownVMGuestPatchRebootSetting { + /** IfRequired */ + IfRequired = "IfRequired", + /** Never */ + Never = "Never", + /** Always */ + Always = "Always" +} + +/** + * Defines values for VMGuestPatchRebootSetting. \ + * {@link KnownVMGuestPatchRebootSetting} can be used interchangeably with VMGuestPatchRebootSetting, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **IfRequired** \ + * **Never** \ + * **Always** + */ +export type VMGuestPatchRebootSetting = string; + +/** Known values of {@link VMGuestPatchClassificationWindows} that the service accepts. */ +export enum KnownVMGuestPatchClassificationWindows { + /** Critical */ + Critical = "Critical", + /** Security */ + Security = "Security", + /** UpdateRollUp */ + UpdateRollUp = "UpdateRollUp", + /** FeaturePack */ + FeaturePack = "FeaturePack", + /** ServicePack */ + ServicePack = "ServicePack", + /** Definition */ + Definition = "Definition", + /** Tools */ + Tools = "Tools", + /** Updates */ + Updates = "Updates" +} + +/** + * Defines values for VMGuestPatchClassificationWindows. \ + * {@link KnownVMGuestPatchClassificationWindows} can be used interchangeably with VMGuestPatchClassificationWindows, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Critical** \ + * **Security** \ + * **UpdateRollUp** \ + * **FeaturePack** \ + * **ServicePack** \ + * **Definition** \ + * **Tools** \ + * **Updates** + */ +export type VMGuestPatchClassificationWindows = string; + +/** Known values of {@link VMGuestPatchClassificationLinux} that the service accepts. */ +export enum KnownVMGuestPatchClassificationLinux { + /** Critical */ + Critical = "Critical", + /** Security */ + Security = "Security", + /** Other */ + Other = "Other" +} + +/** + * Defines values for VMGuestPatchClassificationLinux. \ + * {@link KnownVMGuestPatchClassificationLinux} can be used interchangeably with VMGuestPatchClassificationLinux, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Critical** \ + * **Security** \ + * **Other** + */ +export type VMGuestPatchClassificationLinux = string; + +/** Known values of {@link VMGuestPatchRebootStatus} that the service accepts. */ +export enum KnownVMGuestPatchRebootStatus { + /** Unknown */ + Unknown = "Unknown", + /** NotNeeded */ + NotNeeded = "NotNeeded", + /** Required */ + Required = "Required", + /** Started */ + Started = "Started", + /** Failed */ + Failed = "Failed", + /** Completed */ + Completed = "Completed" +} + +/** + * Defines values for VMGuestPatchRebootStatus. \ + * {@link KnownVMGuestPatchRebootStatus} can be used interchangeably with VMGuestPatchRebootStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **NotNeeded** \ + * **Required** \ + * **Started** \ + * **Failed** \ + * **Completed** + */ +export type VMGuestPatchRebootStatus = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + /** User */ + User = "User", + /** Application */ + Application = "Application", + /** ManagedIdentity */ + ManagedIdentity = "ManagedIdentity", + /** Key */ + Key = "Key" +} + +/** + * 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 type CreatedByType = string; + +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Provisioning */ + Provisioning = "Provisioning", + /** Updating */ + Updating = "Updating", + /** Deleting */ + Deleting = "Deleting", + /** Accepted */ + Accepted = "Accepted", + /** Created */ + Created = "Created" +} + +/** + * 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** \ + * **Provisioning** \ + * **Updating** \ + * **Deleting** \ + * **Accepted** \ + * **Created** + */ +export type ProvisioningState = string; + +/** Known values of {@link OsType} that the service accepts. */ +export enum KnownOsType { + /** Windows */ + Windows = "Windows", + /** Linux */ + Linux = "Linux", + /** Other */ + Other = "Other" +} + +/** + * Defines values for OsType. \ + * {@link KnownOsType} can be used interchangeably with OsType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Windows** \ + * **Linux** \ + * **Other** + */ +export type OsType = string; + +/** Known values of {@link NICType} that the service accepts. */ +export enum KnownNICType { + /** Vmxnet3 */ + Vmxnet3 = "vmxnet3", + /** Vmxnet2 */ + Vmxnet2 = "vmxnet2", + /** Vmxnet */ + Vmxnet = "vmxnet", + /** E1000 */ + E1000 = "e1000", + /** E1000E */ + E1000E = "e1000e", + /** Pcnet32 */ + Pcnet32 = "pcnet32" +} + +/** + * Defines values for NICType. \ + * {@link KnownNICType} can be used interchangeably with NICType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **vmxnet3** \ + * **vmxnet2** \ + * **vmxnet** \ + * **e1000** \ + * **e1000e** \ + * **pcnet32** + */ +export type NICType = string; + +/** Known values of {@link PowerOnBootOption} that the service accepts. */ +export enum KnownPowerOnBootOption { + /** Enabled */ + Enabled = "enabled", + /** Disabled */ + Disabled = "disabled" +} + +/** + * Defines values for PowerOnBootOption. \ + * {@link KnownPowerOnBootOption} can be used interchangeably with PowerOnBootOption, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **enabled** \ + * **disabled** + */ +export type PowerOnBootOption = string; + +/** Known values of {@link IPAddressAllocationMethod} that the service accepts. */ +export enum KnownIPAddressAllocationMethod { + /** Unset */ + Unset = "unset", + /** Dynamic */ + Dynamic = "dynamic", + /** Static */ + Static = "static", + /** Linklayer */ + Linklayer = "linklayer", + /** Random */ + Random = "random", + /** Other */ + Other = "other" +} + +/** + * Defines values for IPAddressAllocationMethod. \ + * {@link KnownIPAddressAllocationMethod} can be used interchangeably with IPAddressAllocationMethod, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **unset** \ + * **dynamic** \ + * **static** \ + * **linklayer** \ + * **random** \ + * **other** + */ +export type IPAddressAllocationMethod = string; + +/** Known values of {@link DiskMode} that the service accepts. */ +export enum KnownDiskMode { + /** Persistent */ + Persistent = "persistent", + /** IndependentPersistent */ + IndependentPersistent = "independent_persistent", + /** IndependentNonpersistent */ + IndependentNonpersistent = "independent_nonpersistent" +} + +/** + * Defines values for DiskMode. \ + * {@link KnownDiskMode} can be used interchangeably with DiskMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **persistent** \ + * **independent_persistent** \ + * **independent_nonpersistent** + */ +export type DiskMode = string; + +/** Known values of {@link DiskType} that the service accepts. */ +export enum KnownDiskType { + /** Flat */ + Flat = "flat", + /** Pmem */ + Pmem = "pmem", + /** Rawphysical */ + Rawphysical = "rawphysical", + /** Rawvirtual */ + Rawvirtual = "rawvirtual", + /** Sparse */ + Sparse = "sparse", + /** Sesparse */ + Sesparse = "sesparse", + /** Unknown */ + Unknown = "unknown" +} + +/** + * Defines values for DiskType. \ + * {@link KnownDiskType} can be used interchangeably with DiskType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **flat** \ + * **pmem** \ + * **rawphysical** \ + * **rawvirtual** \ + * **sparse** \ + * **sesparse** \ + * **unknown** + */ +export type DiskType = string; + +/** Known values of {@link ScsiControllerType} that the service accepts. */ +export enum KnownScsiControllerType { + /** Lsilogic */ + Lsilogic = "lsilogic", + /** Buslogic */ + Buslogic = "buslogic", + /** Pvscsi */ + Pvscsi = "pvscsi", + /** Lsilogicsas */ + Lsilogicsas = "lsilogicsas" +} + +/** + * Defines values for ScsiControllerType. \ + * {@link KnownScsiControllerType} can be used interchangeably with ScsiControllerType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **lsilogic** \ + * **buslogic** \ + * **pvscsi** \ + * **lsilogicsas** + */ +export type ScsiControllerType = string; + +/** Known values of {@link VirtualScsiSharing} that the service accepts. */ +export enum KnownVirtualScsiSharing { + /** NoSharing */ + NoSharing = "noSharing", + /** PhysicalSharing */ + PhysicalSharing = "physicalSharing", + /** VirtualSharing */ + VirtualSharing = "virtualSharing" +} + +/** + * Defines values for VirtualScsiSharing. \ + * {@link KnownVirtualScsiSharing} can be used interchangeably with VirtualScsiSharing, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **noSharing** \ + * **physicalSharing** \ + * **virtualSharing** + */ +export type VirtualScsiSharing = string; + +/** Known values of {@link StatusTypes} that the service accepts. */ +export enum KnownStatusTypes { + /** Connected */ + Connected = "Connected", + /** Disconnected */ + Disconnected = "Disconnected", + /** Error */ + Error = "Error" +} + +/** + * Defines values for StatusTypes. \ + * {@link KnownStatusTypes} can be used interchangeably with StatusTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Connected** \ + * **Disconnected** \ + * **Error** + */ +export type StatusTypes = string; + +/** Known values of {@link FirmwareType} that the service accepts. */ +export enum KnownFirmwareType { + /** Bios */ + Bios = "bios", + /** Efi */ + Efi = "efi" +} + +/** + * Defines values for FirmwareType. \ + * {@link KnownFirmwareType} can be used interchangeably with FirmwareType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **bios** \ + * **efi** + */ +export type FirmwareType = string; + +/** Known values of {@link IdentityType} that the service accepts. */ +export enum KnownIdentityType { + /** None */ + None = "None", + /** SystemAssigned */ + SystemAssigned = "SystemAssigned" +} + +/** + * Defines values for IdentityType. \ + * {@link KnownIdentityType} can be used interchangeably with IdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **SystemAssigned** + */ +export type IdentityType = string; + +/** Known values of {@link InventoryType} that the service accepts. */ +export enum KnownInventoryType { + /** ResourcePool */ + ResourcePool = "ResourcePool", + /** VirtualMachine */ + VirtualMachine = "VirtualMachine", + /** VirtualMachineTemplate */ + VirtualMachineTemplate = "VirtualMachineTemplate", + /** VirtualNetwork */ + VirtualNetwork = "VirtualNetwork", + /** Cluster */ + Cluster = "Cluster", + /** Datastore */ + Datastore = "Datastore", + /** Host */ + Host = "Host" +} + +/** + * Defines values for InventoryType. \ + * {@link KnownInventoryType} can be used interchangeably with InventoryType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ResourcePool** \ + * **VirtualMachine** \ + * **VirtualMachineTemplate** \ + * **VirtualNetwork** \ + * **Cluster** \ + * **Datastore** \ + * **Host** + */ +export type InventoryType = string; + +/** Known values of {@link StatusLevelTypes} that the service accepts. */ +export enum KnownStatusLevelTypes { + /** Info */ + Info = "Info", + /** Warning */ + Warning = "Warning", + /** Error */ + Error = "Error" +} + +/** + * Defines values for StatusLevelTypes. \ + * {@link KnownStatusLevelTypes} can be used interchangeably with StatusLevelTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Info** \ + * **Warning** \ + * **Error** + */ +export type StatusLevelTypes = string; + +/** Known values of {@link ProvisioningAction} that the service accepts. */ +export enum KnownProvisioningAction { + /** Install */ + Install = "install", + /** Uninstall */ + Uninstall = "uninstall", + /** Repair */ + Repair = "repair" +} + +/** + * Defines values for ProvisioningAction. \ + * {@link KnownProvisioningAction} can be used interchangeably with ProvisioningAction, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **install** \ + * **uninstall** \ + * **repair** + */ +export type ProvisioningAction = string; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationsList; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationsList; + +/** Optional parameters. */ +export interface VirtualMachinesAssessPatchesOptionalParams + 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 assessPatches operation. */ +export type VirtualMachinesAssessPatchesResponse = VirtualMachineAssessPatchesResult; + +/** Optional parameters. */ +export interface VirtualMachinesInstallPatchesOptionalParams + 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 installPatches operation. */ +export type VirtualMachinesInstallPatchesResponse = VirtualMachineInstallPatchesResult; + +/** Optional parameters. */ +export interface VirtualMachinesCreateOptionalParams + extends coreClient.OperationOptions { + /** Request payload. */ + body?: VirtualMachine; + /** 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 VirtualMachinesCreateResponse = VirtualMachine; + +/** Optional parameters. */ +export interface VirtualMachinesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type VirtualMachinesGetResponse = VirtualMachine; + +/** Optional parameters. */ +export interface VirtualMachinesUpdateOptionalParams + extends coreClient.OperationOptions { + /** Resource properties to update. */ + body?: VirtualMachineUpdate; + /** 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 VirtualMachinesUpdateResponse = VirtualMachine; + +/** Optional parameters. */ +export interface VirtualMachinesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Whether force delete was specified. */ + force?: boolean; + /** Whether to just disable the VM from azure and retain the VM in the VMM. */ + retain?: boolean; + /** 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 VirtualMachinesStopOptionalParams + extends coreClient.OperationOptions { + /** Virtualmachine stop action payload. */ + body?: StopVirtualMachineOptions; + /** 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 VirtualMachinesStartOptionalParams + 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 VirtualMachinesRestartOptionalParams + 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 VirtualMachinesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type VirtualMachinesListResponse = VirtualMachinesList; + +/** Optional parameters. */ +export interface VirtualMachinesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type VirtualMachinesListByResourceGroupResponse = VirtualMachinesList; + +/** Optional parameters. */ +export interface VirtualMachinesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type VirtualMachinesListNextResponse = VirtualMachinesList; + +/** Optional parameters. */ +export interface VirtualMachinesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type VirtualMachinesListByResourceGroupNextResponse = VirtualMachinesList; + +/** Optional parameters. */ +export interface ResourcePoolsCreateOptionalParams + extends coreClient.OperationOptions { + /** Request payload. */ + body?: ResourcePool; + /** 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 ResourcePoolsCreateResponse = ResourcePool; + +/** Optional parameters. */ +export interface ResourcePoolsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ResourcePoolsGetResponse = ResourcePool; + +/** Optional parameters. */ +export interface ResourcePoolsUpdateOptionalParams + extends coreClient.OperationOptions { + /** Resource properties to update. */ + body?: ResourcePatch; +} + +/** Contains response data for the update operation. */ +export type ResourcePoolsUpdateResponse = ResourcePool; + +/** Optional parameters. */ +export interface ResourcePoolsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Whether force delete was specified. */ + force?: boolean; + /** 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 ResourcePoolsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type ResourcePoolsListResponse = ResourcePoolsList; + +/** Optional parameters. */ +export interface ResourcePoolsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type ResourcePoolsListByResourceGroupResponse = ResourcePoolsList; + +/** Optional parameters. */ +export interface ResourcePoolsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type ResourcePoolsListNextResponse = ResourcePoolsList; + +/** Optional parameters. */ +export interface ResourcePoolsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type ResourcePoolsListByResourceGroupNextResponse = ResourcePoolsList; + +/** Optional parameters. */ +export interface ClustersCreateOptionalParams + extends coreClient.OperationOptions { + /** Request payload. */ + body?: Cluster; + /** 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 ClustersCreateResponse = Cluster; + +/** Optional parameters. */ +export interface ClustersGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ClustersGetResponse = Cluster; + +/** Optional parameters. */ +export interface ClustersUpdateOptionalParams + extends coreClient.OperationOptions { + /** Resource properties to update. */ + body?: ResourcePatch; +} + +/** Contains response data for the update operation. */ +export type ClustersUpdateResponse = Cluster; + +/** Optional parameters. */ +export interface ClustersDeleteOptionalParams + extends coreClient.OperationOptions { + /** Whether force delete was specified. */ + force?: boolean; + /** 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 ClustersListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type ClustersListResponse = ClustersList; + +/** Optional parameters. */ +export interface ClustersListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type ClustersListByResourceGroupResponse = ClustersList; + +/** Optional parameters. */ +export interface ClustersListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type ClustersListNextResponse = ClustersList; + +/** Optional parameters. */ +export interface ClustersListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type ClustersListByResourceGroupNextResponse = ClustersList; + +/** Optional parameters. */ +export interface HostsCreateOptionalParams extends coreClient.OperationOptions { + /** Request payload. */ + body?: Host; + /** 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 HostsCreateResponse = Host; + +/** Optional parameters. */ +export interface HostsGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type HostsGetResponse = Host; + +/** Optional parameters. */ +export interface HostsUpdateOptionalParams extends coreClient.OperationOptions { + /** Resource properties to update. */ + body?: ResourcePatch; +} + +/** Contains response data for the update operation. */ +export type HostsUpdateResponse = Host; + +/** Optional parameters. */ +export interface HostsDeleteOptionalParams extends coreClient.OperationOptions { + /** Whether force delete was specified. */ + force?: boolean; + /** 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 HostsListOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type HostsListResponse = HostsList; + +/** Optional parameters. */ +export interface HostsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type HostsListByResourceGroupResponse = HostsList; + +/** Optional parameters. */ +export interface HostsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type HostsListNextResponse = HostsList; + +/** Optional parameters. */ +export interface HostsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type HostsListByResourceGroupNextResponse = HostsList; + +/** Optional parameters. */ +export interface DatastoresCreateOptionalParams + extends coreClient.OperationOptions { + /** Request payload. */ + body?: Datastore; + /** 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 DatastoresCreateResponse = Datastore; + +/** Optional parameters. */ +export interface DatastoresGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type DatastoresGetResponse = Datastore; + +/** Optional parameters. */ +export interface DatastoresUpdateOptionalParams + extends coreClient.OperationOptions { + /** Resource properties to update. */ + body?: ResourcePatch; +} + +/** Contains response data for the update operation. */ +export type DatastoresUpdateResponse = Datastore; + +/** Optional parameters. */ +export interface DatastoresDeleteOptionalParams + extends coreClient.OperationOptions { + /** Whether force delete was specified. */ + force?: boolean; + /** 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 DatastoresListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type DatastoresListResponse = DatastoresList; + +/** Optional parameters. */ +export interface DatastoresListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type DatastoresListByResourceGroupResponse = DatastoresList; + +/** Optional parameters. */ +export interface DatastoresListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type DatastoresListNextResponse = DatastoresList; + +/** Optional parameters. */ +export interface DatastoresListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type DatastoresListByResourceGroupNextResponse = DatastoresList; + +/** Optional parameters. */ +export interface VCentersCreateOptionalParams + extends coreClient.OperationOptions { + /** Request payload. */ + body?: VCenter; + /** 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 VCentersCreateResponse = VCenter; + +/** Optional parameters. */ +export interface VCentersGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type VCentersGetResponse = VCenter; + +/** Optional parameters. */ +export interface VCentersUpdateOptionalParams + extends coreClient.OperationOptions { + /** Resource properties to update. */ + body?: ResourcePatch; +} + +/** Contains response data for the update operation. */ +export type VCentersUpdateResponse = VCenter; + +/** Optional parameters. */ +export interface VCentersDeleteOptionalParams + extends coreClient.OperationOptions { + /** Whether force delete was specified. */ + force?: boolean; + /** 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 VCentersListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type VCentersListResponse = VCentersList; + +/** Optional parameters. */ +export interface VCentersListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type VCentersListByResourceGroupResponse = VCentersList; + +/** Optional parameters. */ +export interface VCentersListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type VCentersListNextResponse = VCentersList; + +/** Optional parameters. */ +export interface VCentersListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type VCentersListByResourceGroupNextResponse = VCentersList; + +/** Optional parameters. */ +export interface VirtualMachineTemplatesCreateOptionalParams + extends coreClient.OperationOptions { + /** Request payload. */ + body?: VirtualMachineTemplate; + /** 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 VirtualMachineTemplatesCreateResponse = VirtualMachineTemplate; + +/** Optional parameters. */ +export interface VirtualMachineTemplatesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type VirtualMachineTemplatesGetResponse = VirtualMachineTemplate; + +/** Optional parameters. */ +export interface VirtualMachineTemplatesUpdateOptionalParams + extends coreClient.OperationOptions { + /** Resource properties to update. */ + body?: ResourcePatch; +} + +/** Contains response data for the update operation. */ +export type VirtualMachineTemplatesUpdateResponse = VirtualMachineTemplate; + +/** Optional parameters. */ +export interface VirtualMachineTemplatesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Whether force delete was specified. */ + force?: boolean; + /** 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 VirtualMachineTemplatesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type VirtualMachineTemplatesListResponse = VirtualMachineTemplatesList; + +/** Optional parameters. */ +export interface VirtualMachineTemplatesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type VirtualMachineTemplatesListByResourceGroupResponse = VirtualMachineTemplatesList; + +/** Optional parameters. */ +export interface VirtualMachineTemplatesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type VirtualMachineTemplatesListNextResponse = VirtualMachineTemplatesList; + +/** Optional parameters. */ +export interface VirtualMachineTemplatesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type VirtualMachineTemplatesListByResourceGroupNextResponse = VirtualMachineTemplatesList; + +/** Optional parameters. */ +export interface VirtualNetworksCreateOptionalParams + extends coreClient.OperationOptions { + /** Request payload. */ + body?: VirtualNetwork; + /** 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 VirtualNetworksCreateResponse = VirtualNetwork; + +/** Optional parameters. */ +export interface VirtualNetworksGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type VirtualNetworksGetResponse = VirtualNetwork; + +/** Optional parameters. */ +export interface VirtualNetworksUpdateOptionalParams + extends coreClient.OperationOptions { + /** Resource properties to update. */ + body?: ResourcePatch; +} + +/** Contains response data for the update operation. */ +export type VirtualNetworksUpdateResponse = VirtualNetwork; + +/** Optional parameters. */ +export interface VirtualNetworksDeleteOptionalParams + extends coreClient.OperationOptions { + /** Whether force delete was specified. */ + force?: boolean; + /** 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 VirtualNetworksListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type VirtualNetworksListResponse = VirtualNetworksList; + +/** Optional parameters. */ +export interface VirtualNetworksListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type VirtualNetworksListByResourceGroupResponse = VirtualNetworksList; + +/** Optional parameters. */ +export interface VirtualNetworksListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type VirtualNetworksListNextResponse = VirtualNetworksList; + +/** Optional parameters. */ +export interface VirtualNetworksListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type VirtualNetworksListByResourceGroupNextResponse = VirtualNetworksList; + +/** Optional parameters. */ +export interface InventoryItemsCreateOptionalParams + extends coreClient.OperationOptions { + /** Request payload. */ + body?: InventoryItem; +} + +/** Contains response data for the create operation. */ +export type InventoryItemsCreateResponse = InventoryItem; + +/** Optional parameters. */ +export interface InventoryItemsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type InventoryItemsGetResponse = InventoryItem; + +/** Optional parameters. */ +export interface InventoryItemsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface InventoryItemsListByVCenterOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByVCenter operation. */ +export type InventoryItemsListByVCenterResponse = InventoryItemsList; + +/** Optional parameters. */ +export interface InventoryItemsListByVCenterNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByVCenterNext operation. */ +export type InventoryItemsListByVCenterNextResponse = InventoryItemsList; + +/** Optional parameters. */ +export interface HybridIdentityMetadataCreateOptionalParams + extends coreClient.OperationOptions { + /** Request payload. */ + body?: HybridIdentityMetadata; +} + +/** Contains response data for the create operation. */ +export type HybridIdentityMetadataCreateResponse = HybridIdentityMetadata; + +/** Optional parameters. */ +export interface HybridIdentityMetadataGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type HybridIdentityMetadataGetResponse = HybridIdentityMetadata; + +/** Optional parameters. */ +export interface HybridIdentityMetadataDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface HybridIdentityMetadataListByVmOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByVm operation. */ +export type HybridIdentityMetadataListByVmResponse = HybridIdentityMetadataList; + +/** Optional parameters. */ +export interface HybridIdentityMetadataListByVmNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByVmNext operation. */ +export type HybridIdentityMetadataListByVmNextResponse = HybridIdentityMetadataList; + +/** Optional parameters. */ +export interface MachineExtensionsCreateOrUpdateOptionalParams + 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 createOrUpdate operation. */ +export type MachineExtensionsCreateOrUpdateResponse = MachineExtension; + +/** Optional parameters. */ +export interface MachineExtensionsUpdateOptionalParams + 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 MachineExtensionsUpdateResponse = MachineExtension; + +/** Optional parameters. */ +export interface MachineExtensionsDeleteOptionalParams + 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 MachineExtensionsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type MachineExtensionsGetResponse = MachineExtension; + +/** Optional parameters. */ +export interface MachineExtensionsListOptionalParams + extends coreClient.OperationOptions { + /** The expand expression to apply on the operation. */ + expand?: string; +} + +/** Contains response data for the list operation. */ +export type MachineExtensionsListResponse = MachineExtensionsListResult; + +/** Optional parameters. */ +export interface MachineExtensionsListNextOptionalParams + extends coreClient.OperationOptions { + /** The expand expression to apply on the operation. */ + expand?: string; +} + +/** Contains response data for the listNext operation. */ +export type MachineExtensionsListNextResponse = MachineExtensionsListResult; + +/** Optional parameters. */ +export interface GuestAgentsCreateOptionalParams + extends coreClient.OperationOptions { + /** Request payload. */ + body?: GuestAgent; + /** 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 GuestAgentsCreateResponse = GuestAgent; + +/** Optional parameters. */ +export interface GuestAgentsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type GuestAgentsGetResponse = GuestAgent; + +/** Optional parameters. */ +export interface GuestAgentsDeleteOptionalParams + 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 GuestAgentsListByVmOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByVm operation. */ +export type GuestAgentsListByVmResponse = GuestAgentList; + +/** Optional parameters. */ +export interface GuestAgentsListByVmNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByVmNext operation. */ +export type GuestAgentsListByVmNextResponse = GuestAgentList; + +/** Optional parameters. */ +export interface AzureArcVMwareManagementServiceAPIOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/connectedvmware/arm-connectedvmware/src/models/mappers.ts b/sdk/connectedvmware/arm-connectedvmware/src/models/mappers.ts new file mode 100644 index 000000000000..8d5331ccb4d3 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/models/mappers.ts @@ -0,0 +1,4169 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; + +export const OperationsList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationsList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + } + } + } +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + type: { + name: "Boolean" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + } + } + } +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDefinition" + } + } + } + } +}; + +export const ErrorDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDefinition", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDefinition" + } + } + } + } + } + } +}; + +export const VirtualMachineAssessPatchesResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualMachineAssessPatchesResult", + modelProperties: { + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String" + } + }, + assessmentActivityId: { + serializedName: "assessmentActivityId", + readOnly: true, + type: { + name: "String" + } + }, + rebootPending: { + serializedName: "rebootPending", + readOnly: true, + type: { + name: "Boolean" + } + }, + availablePatchCountByClassification: { + serializedName: "availablePatchCountByClassification", + type: { + name: "Composite", + className: "AvailablePatchCountByClassification" + } + }, + startDateTime: { + serializedName: "startDateTime", + readOnly: true, + type: { + name: "DateTime" + } + }, + lastModifiedDateTime: { + serializedName: "lastModifiedDateTime", + readOnly: true, + type: { + name: "DateTime" + } + }, + startedBy: { + serializedName: "startedBy", + readOnly: true, + type: { + name: "String" + } + }, + patchServiceUsed: { + serializedName: "patchServiceUsed", + readOnly: true, + type: { + name: "String" + } + }, + osType: { + serializedName: "osType", + readOnly: true, + type: { + name: "String" + } + }, + errorDetails: { + serializedName: "errorDetails", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const AvailablePatchCountByClassification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AvailablePatchCountByClassification", + modelProperties: { + security: { + serializedName: "security", + readOnly: true, + type: { + name: "Number" + } + }, + critical: { + serializedName: "critical", + readOnly: true, + type: { + name: "Number" + } + }, + definition: { + serializedName: "definition", + readOnly: true, + type: { + name: "Number" + } + }, + updateRollup: { + serializedName: "updateRollup", + readOnly: true, + type: { + name: "Number" + } + }, + featurePack: { + serializedName: "featurePack", + readOnly: true, + type: { + name: "Number" + } + }, + servicePack: { + serializedName: "servicePack", + readOnly: true, + type: { + name: "Number" + } + }, + tools: { + serializedName: "tools", + readOnly: true, + type: { + name: "Number" + } + }, + updates: { + serializedName: "updates", + readOnly: true, + type: { + name: "Number" + } + }, + other: { + serializedName: "other", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + serializedName: "code", + required: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + required: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + type: { + name: "String" + } + }, + details: { + serializedName: "details", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } + } + } +}; + +export const VirtualMachineInstallPatchesParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualMachineInstallPatchesParameters", + modelProperties: { + maximumDuration: { + serializedName: "maximumDuration", + required: true, + type: { + name: "String" + } + }, + rebootSetting: { + serializedName: "rebootSetting", + required: true, + type: { + name: "String" + } + }, + windowsParameters: { + serializedName: "windowsParameters", + type: { + name: "Composite", + className: "WindowsParameters" + } + }, + linuxParameters: { + serializedName: "linuxParameters", + type: { + name: "Composite", + className: "LinuxParameters" + } + } + } + } +}; + +export const WindowsParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WindowsParameters", + modelProperties: { + classificationsToInclude: { + serializedName: "classificationsToInclude", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + kbNumbersToInclude: { + serializedName: "kbNumbersToInclude", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + kbNumbersToExclude: { + serializedName: "kbNumbersToExclude", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + excludeKbsRequiringReboot: { + serializedName: "excludeKbsRequiringReboot", + type: { + name: "Boolean" + } + }, + maxPatchPublishDate: { + serializedName: "maxPatchPublishDate", + type: { + name: "DateTime" + } + } + } + } +}; + +export const LinuxParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LinuxParameters", + modelProperties: { + classificationsToInclude: { + serializedName: "classificationsToInclude", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + packageNameMasksToInclude: { + serializedName: "packageNameMasksToInclude", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + packageNameMasksToExclude: { + serializedName: "packageNameMasksToExclude", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const VirtualMachineInstallPatchesResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualMachineInstallPatchesResult", + modelProperties: { + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String" + } + }, + installationActivityId: { + serializedName: "installationActivityId", + readOnly: true, + type: { + name: "String" + } + }, + rebootStatus: { + serializedName: "rebootStatus", + readOnly: true, + type: { + name: "String" + } + }, + maintenanceWindowExceeded: { + serializedName: "maintenanceWindowExceeded", + readOnly: true, + type: { + name: "Boolean" + } + }, + excludedPatchCount: { + serializedName: "excludedPatchCount", + readOnly: true, + type: { + name: "Number" + } + }, + notSelectedPatchCount: { + serializedName: "notSelectedPatchCount", + readOnly: true, + type: { + name: "Number" + } + }, + pendingPatchCount: { + serializedName: "pendingPatchCount", + readOnly: true, + type: { + name: "Number" + } + }, + installedPatchCount: { + serializedName: "installedPatchCount", + readOnly: true, + type: { + name: "Number" + } + }, + failedPatchCount: { + serializedName: "failedPatchCount", + readOnly: true, + type: { + name: "Number" + } + }, + startDateTime: { + serializedName: "startDateTime", + readOnly: true, + type: { + name: "DateTime" + } + }, + lastModifiedDateTime: { + serializedName: "lastModifiedDateTime", + readOnly: true, + type: { + name: "DateTime" + } + }, + startedBy: { + serializedName: "startedBy", + readOnly: true, + type: { + name: "String" + } + }, + patchServiceUsed: { + serializedName: "patchServiceUsed", + readOnly: true, + type: { + name: "String" + } + }, + osType: { + serializedName: "osType", + readOnly: true, + type: { + name: "String" + } + }, + errorDetails: { + serializedName: "errorDetails", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const ResourcePool: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourcePool", + modelProperties: { + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + }, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + kind: { + serializedName: "kind", + type: { + name: "String" + } + }, + uuid: { + serializedName: "properties.uuid", + readOnly: true, + type: { + name: "String" + } + }, + vCenterId: { + serializedName: "properties.vCenterId", + type: { + name: "String" + } + }, + moRefId: { + serializedName: "properties.moRefId", + type: { + name: "String" + } + }, + inventoryItemId: { + serializedName: "properties.inventoryItemId", + type: { + name: "String" + } + }, + moName: { + serializedName: "properties.moName", + readOnly: true, + type: { + name: "String" + } + }, + cpuSharesLevel: { + serializedName: "properties.cpuSharesLevel", + readOnly: true, + type: { + name: "String" + } + }, + cpuReservationMHz: { + serializedName: "properties.cpuReservationMHz", + readOnly: true, + type: { + name: "Number" + } + }, + cpuLimitMHz: { + serializedName: "properties.cpuLimitMHz", + readOnly: true, + type: { + name: "Number" + } + }, + memSharesLevel: { + serializedName: "properties.memSharesLevel", + readOnly: true, + type: { + name: "String" + } + }, + memReservationMB: { + serializedName: "properties.memReservationMB", + readOnly: true, + type: { + name: "Number" + } + }, + memLimitMB: { + serializedName: "properties.memLimitMB", + readOnly: true, + type: { + name: "Number" + } + }, + customResourceName: { + serializedName: "properties.customResourceName", + readOnly: true, + type: { + name: "String" + } + }, + statuses: { + serializedName: "properties.statuses", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceStatus" + } + } + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ResourceStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceStatus", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String" + } + }, + reason: { + serializedName: "reason", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + severity: { + serializedName: "severity", + readOnly: true, + type: { + name: "String" + } + }, + lastUpdatedAt: { + serializedName: "lastUpdatedAt", + readOnly: true, + type: { + name: "DateTime" + } + } + } + } +}; + +export const ExtendedLocation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExtendedLocation", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } + } + } + } +}; + +export const ResourcePatch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourcePatch", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const ResourcePoolsList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourcePoolsList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourcePool" + } + } + } + } + } + } +}; + +export const Cluster: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Cluster", + modelProperties: { + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + }, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + kind: { + serializedName: "kind", + type: { + name: "String" + } + }, + uuid: { + serializedName: "properties.uuid", + readOnly: true, + type: { + name: "String" + } + }, + vCenterId: { + serializedName: "properties.vCenterId", + type: { + name: "String" + } + }, + moRefId: { + serializedName: "properties.moRefId", + type: { + name: "String" + } + }, + inventoryItemId: { + serializedName: "properties.inventoryItemId", + type: { + name: "String" + } + }, + moName: { + serializedName: "properties.moName", + readOnly: true, + type: { + name: "String" + } + }, + statuses: { + serializedName: "properties.statuses", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceStatus" + } + } + } + }, + customResourceName: { + serializedName: "properties.customResourceName", + readOnly: true, + type: { + name: "String" + } + }, + datastoreIds: { + serializedName: "properties.datastoreIds", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + networkIds: { + serializedName: "properties.networkIds", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ClustersList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClustersList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Cluster" + } + } + } + } + } + } +}; + +export const Host: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Host", + modelProperties: { + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + }, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + kind: { + serializedName: "kind", + type: { + name: "String" + } + }, + uuid: { + serializedName: "properties.uuid", + readOnly: true, + type: { + name: "String" + } + }, + vCenterId: { + serializedName: "properties.vCenterId", + type: { + name: "String" + } + }, + moRefId: { + serializedName: "properties.moRefId", + type: { + name: "String" + } + }, + inventoryItemId: { + serializedName: "properties.inventoryItemId", + type: { + name: "String" + } + }, + moName: { + serializedName: "properties.moName", + readOnly: true, + type: { + name: "String" + } + }, + statuses: { + serializedName: "properties.statuses", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceStatus" + } + } + } + }, + customResourceName: { + serializedName: "properties.customResourceName", + readOnly: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const HostsList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HostsList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Host" + } + } + } + } + } + } +}; + +export const Datastore: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Datastore", + modelProperties: { + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + }, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + kind: { + serializedName: "kind", + type: { + name: "String" + } + }, + uuid: { + serializedName: "properties.uuid", + readOnly: true, + type: { + name: "String" + } + }, + vCenterId: { + serializedName: "properties.vCenterId", + type: { + name: "String" + } + }, + moRefId: { + serializedName: "properties.moRefId", + type: { + name: "String" + } + }, + inventoryItemId: { + serializedName: "properties.inventoryItemId", + type: { + name: "String" + } + }, + moName: { + serializedName: "properties.moName", + readOnly: true, + type: { + name: "String" + } + }, + statuses: { + serializedName: "properties.statuses", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceStatus" + } + } + } + }, + customResourceName: { + serializedName: "properties.customResourceName", + readOnly: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const DatastoresList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DatastoresList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Datastore" + } + } + } + } + } + } +}; + +export const VCenter: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VCenter", + modelProperties: { + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + }, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + kind: { + serializedName: "kind", + type: { + name: "String" + } + }, + uuid: { + serializedName: "properties.uuid", + readOnly: true, + type: { + name: "String" + } + }, + fqdn: { + serializedName: "properties.fqdn", + required: true, + type: { + name: "String" + } + }, + port: { + constraints: { + InclusiveMaximum: 65535, + InclusiveMinimum: 1 + }, + serializedName: "properties.port", + type: { + name: "Number" + } + }, + version: { + serializedName: "properties.version", + readOnly: true, + type: { + name: "String" + } + }, + instanceUuid: { + serializedName: "properties.instanceUuid", + readOnly: true, + type: { + name: "String" + } + }, + connectionStatus: { + serializedName: "properties.connectionStatus", + readOnly: true, + type: { + name: "String" + } + }, + customResourceName: { + serializedName: "properties.customResourceName", + readOnly: true, + type: { + name: "String" + } + }, + credentials: { + serializedName: "properties.credentials", + type: { + name: "Composite", + className: "VICredential" + } + }, + statuses: { + serializedName: "properties.statuses", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceStatus" + } + } + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const VICredential: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VICredential", + modelProperties: { + username: { + serializedName: "username", + type: { + name: "String" + } + }, + password: { + serializedName: "password", + type: { + name: "String" + } + } + } + } +}; + +export const VCentersList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VCentersList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VCenter" + } + } + } + } + } + } +}; + +export const VirtualMachine: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualMachine", + modelProperties: { + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + }, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + kind: { + serializedName: "kind", + type: { + name: "String" + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity" + } + }, + resourcePoolId: { + serializedName: "properties.resourcePoolId", + type: { + name: "String" + } + }, + templateId: { + serializedName: "properties.templateId", + type: { + name: "String" + } + }, + vCenterId: { + serializedName: "properties.vCenterId", + type: { + name: "String" + } + }, + placementProfile: { + serializedName: "properties.placementProfile", + type: { + name: "Composite", + className: "PlacementProfile" + } + }, + osProfile: { + serializedName: "properties.osProfile", + type: { + name: "Composite", + className: "OsProfile" + } + }, + hardwareProfile: { + serializedName: "properties.hardwareProfile", + type: { + name: "Composite", + className: "HardwareProfile" + } + }, + networkProfile: { + serializedName: "properties.networkProfile", + type: { + name: "Composite", + className: "NetworkProfile" + } + }, + storageProfile: { + serializedName: "properties.storageProfile", + type: { + name: "Composite", + className: "StorageProfile" + } + }, + guestAgentProfile: { + serializedName: "properties.guestAgentProfile", + type: { + name: "Composite", + className: "GuestAgentProfile" + } + }, + securityProfile: { + serializedName: "properties.securityProfile", + type: { + name: "Composite", + className: "SecurityProfile" + } + }, + moRefId: { + serializedName: "properties.moRefId", + type: { + name: "String" + } + }, + inventoryItemId: { + serializedName: "properties.inventoryItemId", + type: { + name: "String" + } + }, + moName: { + serializedName: "properties.moName", + readOnly: true, + type: { + name: "String" + } + }, + folderPath: { + serializedName: "properties.folderPath", + readOnly: true, + type: { + name: "String" + } + }, + instanceUuid: { + serializedName: "properties.instanceUuid", + readOnly: true, + type: { + name: "String" + } + }, + smbiosUuid: { + serializedName: "properties.smbiosUuid", + type: { + name: "String" + } + }, + firmwareType: { + serializedName: "properties.firmwareType", + type: { + name: "String" + } + }, + powerState: { + serializedName: "properties.powerState", + readOnly: true, + type: { + name: "String" + } + }, + customResourceName: { + serializedName: "properties.customResourceName", + readOnly: true, + type: { + name: "String" + } + }, + uuid: { + serializedName: "properties.uuid", + readOnly: true, + type: { + name: "String" + } + }, + statuses: { + serializedName: "properties.statuses", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceStatus" + } + } + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + vmId: { + serializedName: "properties.vmId", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PlacementProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PlacementProfile", + modelProperties: { + resourcePoolId: { + serializedName: "resourcePoolId", + type: { + name: "String" + } + }, + clusterId: { + serializedName: "clusterId", + type: { + name: "String" + } + }, + hostId: { + serializedName: "hostId", + type: { + name: "String" + } + }, + datastoreId: { + serializedName: "datastoreId", + type: { + name: "String" + } + } + } + } +}; + +export const OsProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OsProfile", + modelProperties: { + computerName: { + serializedName: "computerName", + type: { + name: "String" + } + }, + adminUsername: { + serializedName: "adminUsername", + type: { + name: "String" + } + }, + adminPassword: { + serializedName: "adminPassword", + type: { + name: "String" + } + }, + guestId: { + serializedName: "guestId", + type: { + name: "String" + } + }, + allowExtensionOperations: { + serializedName: "allowExtensionOperations", + readOnly: true, + type: { + name: "Boolean" + } + }, + osType: { + serializedName: "osType", + type: { + name: "String" + } + }, + osName: { + serializedName: "osName", + readOnly: true, + type: { + name: "String" + } + }, + toolsRunningStatus: { + serializedName: "toolsRunningStatus", + readOnly: true, + type: { + name: "String" + } + }, + toolsVersionStatus: { + serializedName: "toolsVersionStatus", + readOnly: true, + type: { + name: "String" + } + }, + toolsVersion: { + serializedName: "toolsVersion", + readOnly: true, + type: { + name: "String" + } + }, + windowsConfiguration: { + serializedName: "windowsConfiguration", + type: { + name: "Composite", + className: "OsProfileWindowsConfiguration" + } + }, + linuxConfiguration: { + serializedName: "linuxConfiguration", + type: { + name: "Composite", + className: "OsProfileLinuxConfiguration" + } + } + } + } +}; + +export const OsProfileWindowsConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OsProfileWindowsConfiguration", + modelProperties: { + assessmentMode: { + serializedName: "patchSettings.assessmentMode", + type: { + name: "String" + } + }, + patchMode: { + serializedName: "patchSettings.patchMode", + type: { + name: "String" + } + } + } + } +}; + +export const OsProfileLinuxConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OsProfileLinuxConfiguration", + modelProperties: { + assessmentMode: { + serializedName: "patchSettings.assessmentMode", + type: { + name: "String" + } + }, + patchMode: { + serializedName: "patchSettings.patchMode", + type: { + name: "String" + } + } + } + } +}; + +export const HardwareProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HardwareProfile", + modelProperties: { + memorySizeMB: { + serializedName: "memorySizeMB", + type: { + name: "Number" + } + }, + numCPUs: { + serializedName: "numCPUs", + type: { + name: "Number" + } + }, + numCoresPerSocket: { + serializedName: "numCoresPerSocket", + type: { + name: "Number" + } + }, + cpuHotAddEnabled: { + serializedName: "cpuHotAddEnabled", + readOnly: true, + type: { + name: "Boolean" + } + }, + cpuHotRemoveEnabled: { + serializedName: "cpuHotRemoveEnabled", + readOnly: true, + type: { + name: "Boolean" + } + }, + memoryHotAddEnabled: { + serializedName: "memoryHotAddEnabled", + readOnly: true, + type: { + name: "Boolean" + } + } + } + } +}; + +export const NetworkProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkProfile", + modelProperties: { + networkInterfaces: { + serializedName: "networkInterfaces", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkInterface" + } + } + } + } + } + } +}; + +export const NetworkInterface: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkInterface", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + label: { + serializedName: "label", + readOnly: true, + type: { + name: "String" + } + }, + ipAddresses: { + serializedName: "ipAddresses", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + macAddress: { + serializedName: "macAddress", + readOnly: true, + type: { + name: "String" + } + }, + networkId: { + serializedName: "networkId", + type: { + name: "String" + } + }, + nicType: { + serializedName: "nicType", + type: { + name: "String" + } + }, + powerOnBoot: { + serializedName: "powerOnBoot", + type: { + name: "String" + } + }, + networkMoRefId: { + serializedName: "networkMoRefId", + readOnly: true, + type: { + name: "String" + } + }, + networkMoName: { + serializedName: "networkMoName", + readOnly: true, + type: { + name: "String" + } + }, + deviceKey: { + serializedName: "deviceKey", + type: { + name: "Number" + } + }, + ipSettings: { + serializedName: "ipSettings", + type: { + name: "Composite", + className: "NicIPSettings" + } + } + } + } +}; + +export const NicIPSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NicIPSettings", + modelProperties: { + allocationMethod: { + serializedName: "allocationMethod", + type: { + name: "String" + } + }, + dnsServers: { + serializedName: "dnsServers", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + gateway: { + serializedName: "gateway", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + ipAddress: { + serializedName: "ipAddress", + type: { + name: "String" + } + }, + subnetMask: { + serializedName: "subnetMask", + type: { + name: "String" + } + }, + primaryWinsServer: { + serializedName: "primaryWinsServer", + readOnly: true, + type: { + name: "String" + } + }, + secondaryWinsServer: { + serializedName: "secondaryWinsServer", + readOnly: true, + type: { + name: "String" + } + }, + ipAddressInfo: { + serializedName: "ipAddressInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NicIPAddressSettings" + } + } + } + } + } + } +}; + +export const NicIPAddressSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NicIPAddressSettings", + modelProperties: { + allocationMethod: { + serializedName: "allocationMethod", + readOnly: true, + type: { + name: "String" + } + }, + ipAddress: { + serializedName: "ipAddress", + readOnly: true, + type: { + name: "String" + } + }, + subnetMask: { + serializedName: "subnetMask", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const StorageProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageProfile", + modelProperties: { + disks: { + serializedName: "disks", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VirtualDisk" + } + } + } + }, + scsiControllers: { + serializedName: "scsiControllers", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VirtualScsiController" + } + } + } + } + } + } +}; + +export const VirtualDisk: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualDisk", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + label: { + serializedName: "label", + readOnly: true, + type: { + name: "String" + } + }, + diskObjectId: { + serializedName: "diskObjectId", + readOnly: true, + type: { + name: "String" + } + }, + diskSizeGB: { + serializedName: "diskSizeGB", + type: { + name: "Number" + } + }, + deviceKey: { + serializedName: "deviceKey", + type: { + name: "Number" + } + }, + diskMode: { + serializedName: "diskMode", + type: { + name: "String" + } + }, + controllerKey: { + serializedName: "controllerKey", + type: { + name: "Number" + } + }, + unitNumber: { + serializedName: "unitNumber", + type: { + name: "Number" + } + }, + deviceName: { + serializedName: "deviceName", + type: { + name: "String" + } + }, + diskType: { + serializedName: "diskType", + type: { + name: "String" + } + } + } + } +}; + +export const VirtualScsiController: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualScsiController", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String" + } + }, + controllerKey: { + serializedName: "controllerKey", + type: { + name: "Number" + } + }, + busNumber: { + serializedName: "busNumber", + type: { + name: "Number" + } + }, + scsiCtlrUnitNumber: { + serializedName: "scsiCtlrUnitNumber", + type: { + name: "Number" + } + }, + sharing: { + serializedName: "sharing", + type: { + name: "String" + } + } + } + } +}; + +export const GuestAgentProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GuestAgentProfile", + modelProperties: { + vmUuid: { + serializedName: "vmUuid", + readOnly: true, + type: { + name: "String" + } + }, + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String" + } + }, + lastStatusChange: { + serializedName: "lastStatusChange", + readOnly: true, + type: { + name: "DateTime" + } + }, + agentVersion: { + serializedName: "agentVersion", + readOnly: true, + type: { + name: "String" + } + }, + errorDetails: { + serializedName: "errorDetails", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } + } + } +}; + +export const SecurityProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SecurityProfile", + modelProperties: { + uefiSettings: { + serializedName: "uefiSettings", + type: { + name: "Composite", + className: "UefiSettings" + } + } + } + } +}; + +export const UefiSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UefiSettings", + modelProperties: { + secureBootEnabled: { + serializedName: "secureBootEnabled", + type: { + name: "Boolean" + } + } + } + } +}; + +export const Identity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Identity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "String" + } + }, + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const VirtualMachineUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualMachineUpdate", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity" + } + }, + hardwareProfile: { + serializedName: "properties.hardwareProfile", + type: { + name: "Composite", + className: "HardwareProfile" + } + }, + osProfile: { + serializedName: "properties.osProfile", + type: { + name: "Composite", + className: "OsProfileUpdate" + } + }, + storageProfile: { + serializedName: "properties.storageProfile", + type: { + name: "Composite", + className: "StorageProfileUpdate" + } + }, + networkProfile: { + serializedName: "properties.networkProfile", + type: { + name: "Composite", + className: "NetworkProfileUpdate" + } + } + } + } +}; + +export const OsProfileUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OsProfileUpdate", + modelProperties: { + windowsConfiguration: { + serializedName: "windowsConfiguration", + type: { + name: "Composite", + className: "OsProfileUpdateWindowsConfiguration" + } + }, + linuxConfiguration: { + serializedName: "linuxConfiguration", + type: { + name: "Composite", + className: "OsProfileUpdateLinuxConfiguration" + } + } + } + } +}; + +export const OsProfileUpdateWindowsConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OsProfileUpdateWindowsConfiguration", + modelProperties: { + assessmentMode: { + serializedName: "patchSettings.assessmentMode", + type: { + name: "String" + } + }, + patchMode: { + serializedName: "patchSettings.patchMode", + type: { + name: "String" + } + } + } + } +}; + +export const OsProfileUpdateLinuxConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OsProfileUpdateLinuxConfiguration", + modelProperties: { + assessmentMode: { + serializedName: "patchSettings.assessmentMode", + type: { + name: "String" + } + }, + patchMode: { + serializedName: "patchSettings.patchMode", + type: { + name: "String" + } + } + } + } +}; + +export const StorageProfileUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageProfileUpdate", + modelProperties: { + disks: { + serializedName: "disks", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VirtualDiskUpdate" + } + } + } + } + } + } +}; + +export const VirtualDiskUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualDiskUpdate", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + diskSizeGB: { + serializedName: "diskSizeGB", + type: { + name: "Number" + } + }, + deviceKey: { + serializedName: "deviceKey", + type: { + name: "Number" + } + }, + diskMode: { + serializedName: "diskMode", + type: { + name: "String" + } + }, + controllerKey: { + serializedName: "controllerKey", + type: { + name: "Number" + } + }, + unitNumber: { + serializedName: "unitNumber", + type: { + name: "Number" + } + }, + deviceName: { + serializedName: "deviceName", + type: { + name: "String" + } + }, + diskType: { + serializedName: "diskType", + type: { + name: "String" + } + } + } + } +}; + +export const NetworkProfileUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkProfileUpdate", + modelProperties: { + networkInterfaces: { + serializedName: "networkInterfaces", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkInterfaceUpdate" + } + } + } + } + } + } +}; + +export const NetworkInterfaceUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkInterfaceUpdate", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + networkId: { + serializedName: "networkId", + type: { + name: "String" + } + }, + nicType: { + serializedName: "nicType", + type: { + name: "String" + } + }, + powerOnBoot: { + serializedName: "powerOnBoot", + type: { + name: "String" + } + }, + deviceKey: { + serializedName: "deviceKey", + type: { + name: "Number" + } + } + } + } +}; + +export const StopVirtualMachineOptions: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StopVirtualMachineOptions", + modelProperties: { + skipShutdown: { + defaultValue: false, + serializedName: "skipShutdown", + type: { + name: "Boolean" + } + } + } + } +}; + +export const VirtualMachinesList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualMachinesList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VirtualMachine" + } + } + } + } + } + } +}; + +export const VirtualMachineTemplate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualMachineTemplate", + modelProperties: { + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + }, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + kind: { + serializedName: "kind", + type: { + name: "String" + } + }, + uuid: { + serializedName: "properties.uuid", + readOnly: true, + type: { + name: "String" + } + }, + vCenterId: { + serializedName: "properties.vCenterId", + type: { + name: "String" + } + }, + moRefId: { + serializedName: "properties.moRefId", + type: { + name: "String" + } + }, + inventoryItemId: { + serializedName: "properties.inventoryItemId", + type: { + name: "String" + } + }, + moName: { + serializedName: "properties.moName", + readOnly: true, + type: { + name: "String" + } + }, + memorySizeMB: { + serializedName: "properties.memorySizeMB", + readOnly: true, + type: { + name: "Number" + } + }, + numCPUs: { + serializedName: "properties.numCPUs", + readOnly: true, + type: { + name: "Number" + } + }, + numCoresPerSocket: { + serializedName: "properties.numCoresPerSocket", + readOnly: true, + type: { + name: "Number" + } + }, + osType: { + serializedName: "properties.osType", + readOnly: true, + type: { + name: "String" + } + }, + osName: { + serializedName: "properties.osName", + readOnly: true, + type: { + name: "String" + } + }, + folderPath: { + serializedName: "properties.folderPath", + readOnly: true, + type: { + name: "String" + } + }, + networkInterfaces: { + serializedName: "properties.networkInterfaces", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkInterface" + } + } + } + }, + disks: { + serializedName: "properties.disks", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VirtualDisk" + } + } + } + }, + customResourceName: { + serializedName: "properties.customResourceName", + readOnly: true, + type: { + name: "String" + } + }, + toolsVersionStatus: { + serializedName: "properties.toolsVersionStatus", + readOnly: true, + type: { + name: "String" + } + }, + toolsVersion: { + serializedName: "properties.toolsVersion", + readOnly: true, + type: { + name: "String" + } + }, + firmwareType: { + serializedName: "properties.firmwareType", + readOnly: true, + type: { + name: "String" + } + }, + statuses: { + serializedName: "properties.statuses", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceStatus" + } + } + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const VirtualMachineTemplatesList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualMachineTemplatesList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VirtualMachineTemplate" + } + } + } + } + } + } +}; + +export const VirtualNetwork: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualNetwork", + modelProperties: { + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + }, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + kind: { + serializedName: "kind", + type: { + name: "String" + } + }, + uuid: { + serializedName: "properties.uuid", + readOnly: true, + type: { + name: "String" + } + }, + vCenterId: { + serializedName: "properties.vCenterId", + type: { + name: "String" + } + }, + moRefId: { + serializedName: "properties.moRefId", + type: { + name: "String" + } + }, + inventoryItemId: { + serializedName: "properties.inventoryItemId", + type: { + name: "String" + } + }, + moName: { + serializedName: "properties.moName", + readOnly: true, + type: { + name: "String" + } + }, + customResourceName: { + serializedName: "properties.customResourceName", + readOnly: true, + type: { + name: "String" + } + }, + statuses: { + serializedName: "properties.statuses", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceStatus" + } + } + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const VirtualNetworksList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualNetworksList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VirtualNetwork" + } + } + } + } + } + } +}; + +export const InventoryItemProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "InventoryItemProperties", + uberParent: "InventoryItemProperties", + polymorphicDiscriminator: { + serializedName: "inventoryType", + clientName: "inventoryType" + }, + modelProperties: { + inventoryType: { + serializedName: "inventoryType", + required: true, + type: { + name: "String" + } + }, + managedResourceId: { + serializedName: "managedResourceId", + type: { + name: "String" + } + }, + moRefId: { + serializedName: "moRefId", + type: { + name: "String" + } + }, + moName: { + serializedName: "moName", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const InventoryItemsList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "InventoryItemsList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "InventoryItem" + } + } + } + } + } + } +}; + +export const HybridIdentityMetadataList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HybridIdentityMetadataList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "HybridIdentityMetadata" + } + } + } + } + } + } +}; + +export const MachineExtension: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MachineExtension", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + forceUpdateTag: { + serializedName: "properties.forceUpdateTag", + type: { + name: "String" + } + }, + publisher: { + serializedName: "properties.publisher", + type: { + name: "String" + } + }, + typePropertiesType: { + serializedName: "properties.type", + type: { + name: "String" + } + }, + typeHandlerVersion: { + serializedName: "properties.typeHandlerVersion", + type: { + name: "String" + } + }, + enableAutomaticUpgrade: { + serializedName: "properties.enableAutomaticUpgrade", + type: { + name: "Boolean" + } + }, + autoUpgradeMinorVersion: { + serializedName: "properties.autoUpgradeMinorVersion", + type: { + name: "Boolean" + } + }, + settings: { + serializedName: "properties.settings", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + }, + protectedSettings: { + serializedName: "properties.protectedSettings", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + instanceView: { + serializedName: "properties.instanceView", + type: { + name: "Composite", + className: "MachineExtensionPropertiesInstanceView" + } + } + } + } +}; + +export const MachineExtensionInstanceView: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MachineExtensionInstanceView", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + typeHandlerVersion: { + serializedName: "typeHandlerVersion", + readOnly: true, + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "Composite", + className: "MachineExtensionInstanceViewStatus" + } + } + } + } +}; + +export const MachineExtensionInstanceViewStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MachineExtensionInstanceViewStatus", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + level: { + serializedName: "level", + readOnly: true, + type: { + name: "String" + } + }, + displayStatus: { + serializedName: "displayStatus", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + time: { + serializedName: "time", + readOnly: true, + type: { + name: "DateTime" + } + } + } + } +}; + +export const MachineExtensionsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MachineExtensionsListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MachineExtension" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const GuestCredential: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GuestCredential", + modelProperties: { + username: { + serializedName: "username", + type: { + name: "String" + } + }, + password: { + serializedName: "password", + type: { + name: "String" + } + } + } + } +}; + +export const HttpProxyConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HttpProxyConfiguration", + modelProperties: { + httpsProxy: { + serializedName: "httpsProxy", + type: { + name: "String" + } + } + } + } +}; + +export const GuestAgentList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GuestAgentList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "GuestAgent" + } + } + } + } + } + } +}; + +export const Condition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Condition", + modelProperties: { + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String" + } + }, + reason: { + serializedName: "reason", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + severity: { + serializedName: "severity", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const InventoryItemDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "InventoryItemDetails", + modelProperties: { + inventoryItemId: { + serializedName: "inventoryItemId", + type: { + name: "String" + } + }, + moName: { + serializedName: "moName", + type: { + name: "String" + } + } + } + } +}; + +export const MachineExtensionUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MachineExtensionUpdate", + modelProperties: { + ...ResourcePatch.type.modelProperties, + forceUpdateTag: { + serializedName: "properties.forceUpdateTag", + type: { + name: "String" + } + }, + publisher: { + serializedName: "properties.publisher", + type: { + name: "String" + } + }, + type: { + serializedName: "properties.type", + type: { + name: "String" + } + }, + typeHandlerVersion: { + serializedName: "properties.typeHandlerVersion", + type: { + name: "String" + } + }, + enableAutomaticUpgrade: { + serializedName: "properties.enableAutomaticUpgrade", + type: { + name: "Boolean" + } + }, + autoUpgradeMinorVersion: { + serializedName: "properties.autoUpgradeMinorVersion", + type: { + name: "Boolean" + } + }, + settings: { + serializedName: "properties.settings", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + }, + protectedSettings: { + serializedName: "properties.protectedSettings", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const ResourcePoolInventoryItem: coreClient.CompositeMapper = { + serializedName: "ResourcePool", + type: { + name: "Composite", + className: "ResourcePoolInventoryItem", + uberParent: "InventoryItemProperties", + polymorphicDiscriminator: + InventoryItemProperties.type.polymorphicDiscriminator, + modelProperties: { + ...InventoryItemProperties.type.modelProperties, + parent: { + serializedName: "parent", + type: { + name: "Composite", + className: "InventoryItemDetails" + } + } + } + } +}; + +export const VirtualMachineInventoryItem: coreClient.CompositeMapper = { + serializedName: "VirtualMachine", + type: { + name: "Composite", + className: "VirtualMachineInventoryItem", + uberParent: "InventoryItemProperties", + polymorphicDiscriminator: + InventoryItemProperties.type.polymorphicDiscriminator, + modelProperties: { + ...InventoryItemProperties.type.modelProperties, + osType: { + serializedName: "osType", + type: { + name: "String" + } + }, + osName: { + serializedName: "osName", + type: { + name: "String" + } + }, + ipAddresses: { + serializedName: "ipAddresses", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + folderPath: { + serializedName: "folderPath", + type: { + name: "String" + } + }, + host: { + serializedName: "host", + type: { + name: "Composite", + className: "InventoryItemDetails" + } + }, + resourcePool: { + serializedName: "resourcePool", + type: { + name: "Composite", + className: "InventoryItemDetails" + } + }, + instanceUuid: { + serializedName: "instanceUuid", + type: { + name: "String" + } + }, + smbiosUuid: { + serializedName: "smbiosUuid", + type: { + name: "String" + } + }, + powerState: { + serializedName: "powerState", + readOnly: true, + type: { + name: "String" + } + }, + toolsRunningStatus: { + serializedName: "toolsRunningStatus", + readOnly: true, + type: { + name: "String" + } + }, + toolsVersionStatus: { + serializedName: "toolsVersionStatus", + readOnly: true, + type: { + name: "String" + } + }, + toolsVersion: { + serializedName: "toolsVersion", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const VirtualMachineTemplateInventoryItem: coreClient.CompositeMapper = { + serializedName: "VirtualMachineTemplate", + type: { + name: "Composite", + className: "VirtualMachineTemplateInventoryItem", + uberParent: "InventoryItemProperties", + polymorphicDiscriminator: + InventoryItemProperties.type.polymorphicDiscriminator, + modelProperties: { + ...InventoryItemProperties.type.modelProperties, + memorySizeMB: { + serializedName: "memorySizeMB", + type: { + name: "Number" + } + }, + numCPUs: { + serializedName: "numCPUs", + type: { + name: "Number" + } + }, + numCoresPerSocket: { + serializedName: "numCoresPerSocket", + type: { + name: "Number" + } + }, + osType: { + serializedName: "osType", + type: { + name: "String" + } + }, + osName: { + serializedName: "osName", + type: { + name: "String" + } + }, + folderPath: { + serializedName: "folderPath", + type: { + name: "String" + } + } + } + } +}; + +export const VirtualNetworkInventoryItem: coreClient.CompositeMapper = { + serializedName: "VirtualNetwork", + type: { + name: "Composite", + className: "VirtualNetworkInventoryItem", + uberParent: "InventoryItemProperties", + polymorphicDiscriminator: + InventoryItemProperties.type.polymorphicDiscriminator, + modelProperties: { + ...InventoryItemProperties.type.modelProperties + } + } +}; + +export const ClusterInventoryItem: coreClient.CompositeMapper = { + serializedName: "Cluster", + type: { + name: "Composite", + className: "ClusterInventoryItem", + uberParent: "InventoryItemProperties", + polymorphicDiscriminator: + InventoryItemProperties.type.polymorphicDiscriminator, + modelProperties: { + ...InventoryItemProperties.type.modelProperties + } + } +}; + +export const DatastoreInventoryItem: coreClient.CompositeMapper = { + serializedName: "Datastore", + type: { + name: "Composite", + className: "DatastoreInventoryItem", + uberParent: "InventoryItemProperties", + polymorphicDiscriminator: + InventoryItemProperties.type.polymorphicDiscriminator, + modelProperties: { + ...InventoryItemProperties.type.modelProperties, + capacityGB: { + serializedName: "capacityGB", + type: { + name: "Number" + } + }, + freeSpaceGB: { + serializedName: "freeSpaceGB", + type: { + name: "Number" + } + } + } + } +}; + +export const HostInventoryItem: coreClient.CompositeMapper = { + serializedName: "Host", + type: { + name: "Composite", + className: "HostInventoryItem", + uberParent: "InventoryItemProperties", + polymorphicDiscriminator: + InventoryItemProperties.type.polymorphicDiscriminator, + modelProperties: { + ...InventoryItemProperties.type.modelProperties, + parent: { + serializedName: "parent", + type: { + name: "Composite", + className: "InventoryItemDetails" + } + } + } + } +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + +export const MachineExtensionPropertiesInstanceView: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MachineExtensionPropertiesInstanceView", + modelProperties: { + ...MachineExtensionInstanceView.type.modelProperties + } + } +}; + +export const InventoryItem: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "InventoryItem", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + kind: { + serializedName: "kind", + type: { + name: "String" + } + }, + inventoryType: { + serializedName: "properties.inventoryType", + required: true, + type: { + name: "String" + } + }, + managedResourceId: { + serializedName: "properties.managedResourceId", + type: { + name: "String" + } + }, + moRefId: { + serializedName: "properties.moRefId", + type: { + name: "String" + } + }, + moName: { + serializedName: "properties.moName", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const HybridIdentityMetadata: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HybridIdentityMetadata", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + vmId: { + serializedName: "properties.vmId", + type: { + name: "String" + } + }, + publicKey: { + serializedName: "properties.publicKey", + type: { + name: "String" + } + }, + identity: { + serializedName: "properties.identity", + type: { + name: "Composite", + className: "Identity" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const GuestAgent: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GuestAgent", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + uuid: { + serializedName: "properties.uuid", + readOnly: true, + type: { + name: "String" + } + }, + credentials: { + serializedName: "properties.credentials", + type: { + name: "Composite", + className: "GuestCredential" + } + }, + httpProxyConfig: { + serializedName: "properties.httpProxyConfig", + type: { + name: "Composite", + className: "HttpProxyConfiguration" + } + }, + provisioningAction: { + serializedName: "properties.provisioningAction", + type: { + name: "String" + } + }, + status: { + serializedName: "properties.status", + readOnly: true, + type: { + name: "String" + } + }, + customResourceName: { + serializedName: "properties.customResourceName", + readOnly: true, + type: { + name: "String" + } + }, + statuses: { + serializedName: "properties.statuses", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceStatus" + } + } + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export let discriminators = { + InventoryItemProperties: InventoryItemProperties, + "InventoryItemProperties.ResourcePool": ResourcePoolInventoryItem, + "InventoryItemProperties.VirtualMachine": VirtualMachineInventoryItem, + "InventoryItemProperties.VirtualMachineTemplate": VirtualMachineTemplateInventoryItem, + "InventoryItemProperties.VirtualNetwork": VirtualNetworkInventoryItem, + "InventoryItemProperties.Cluster": ClusterInventoryItem, + "InventoryItemProperties.Datastore": DatastoreInventoryItem, + "InventoryItemProperties.Host": HostInventoryItem +}; diff --git a/sdk/connectedvmware/arm-connectedvmware/src/models/parameters.ts b/sdk/connectedvmware/arm-connectedvmware/src/models/parameters.ts new file mode 100644 index 000000000000..5aa8366991c1 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/models/parameters.ts @@ -0,0 +1,361 @@ +/* + * 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 { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + VirtualMachineInstallPatchesParameters as VirtualMachineInstallPatchesParametersMapper, + VirtualMachine as VirtualMachineMapper, + VirtualMachineUpdate as VirtualMachineUpdateMapper, + StopVirtualMachineOptions as StopVirtualMachineOptionsMapper, + ResourcePool as ResourcePoolMapper, + ResourcePatch as ResourcePatchMapper, + Cluster as ClusterMapper, + Host as HostMapper, + Datastore as DatastoreMapper, + VCenter as VCenterMapper, + VirtualMachineTemplate as VirtualMachineTemplateMapper, + VirtualNetwork as VirtualNetworkMapper, + InventoryItem as InventoryItemMapper, + HybridIdentityMetadata as HybridIdentityMetadataMapper, + MachineExtension as MachineExtensionMapper, + MachineExtensionUpdate as MachineExtensionUpdateMapper, + GuestAgent as GuestAgentMapper +} from "../models/mappers"; + +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" + } + } +}; + +export const $host: OperationURLParameter = { + parameterPath: "$host", + mapper: { + serializedName: "$host", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2022-01-10-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + serializedName: "subscriptionId", + required: true, + type: { + name: "String" + } + } +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + serializedName: "resourceGroupName", + required: true, + type: { + name: "String" + } + } +}; + +export const name: OperationURLParameter = { + parameterPath: "name", + mapper: { + serializedName: "name", + required: true, + type: { + name: "String" + } + } +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const installPatchesInput: OperationParameter = { + parameterPath: "installPatchesInput", + mapper: VirtualMachineInstallPatchesParametersMapper +}; + +export const body: OperationParameter = { + parameterPath: ["options", "body"], + mapper: VirtualMachineMapper +}; + +export const virtualMachineName: OperationURLParameter = { + parameterPath: "virtualMachineName", + mapper: { + serializedName: "virtualMachineName", + required: true, + type: { + name: "String" + } + } +}; + +export const body1: OperationParameter = { + parameterPath: ["options", "body"], + mapper: VirtualMachineUpdateMapper +}; + +export const force: OperationQueryParameter = { + parameterPath: ["options", "force"], + mapper: { + serializedName: "force", + type: { + name: "Boolean" + } + } +}; + +export const retain: OperationQueryParameter = { + parameterPath: ["options", "retain"], + mapper: { + serializedName: "retain", + type: { + name: "Boolean" + } + } +}; + +export const body2: OperationParameter = { + parameterPath: ["options", "body"], + mapper: StopVirtualMachineOptionsMapper +}; + +export const body3: OperationParameter = { + parameterPath: ["options", "body"], + mapper: ResourcePoolMapper +}; + +export const resourcePoolName: OperationURLParameter = { + parameterPath: "resourcePoolName", + mapper: { + serializedName: "resourcePoolName", + required: true, + type: { + name: "String" + } + } +}; + +export const body4: OperationParameter = { + parameterPath: ["options", "body"], + mapper: ResourcePatchMapper +}; + +export const body5: OperationParameter = { + parameterPath: ["options", "body"], + mapper: ClusterMapper +}; + +export const clusterName: OperationURLParameter = { + parameterPath: "clusterName", + mapper: { + serializedName: "clusterName", + required: true, + type: { + name: "String" + } + } +}; + +export const body6: OperationParameter = { + parameterPath: ["options", "body"], + mapper: HostMapper +}; + +export const hostName: OperationURLParameter = { + parameterPath: "hostName", + mapper: { + serializedName: "hostName", + required: true, + type: { + name: "String" + } + } +}; + +export const body7: OperationParameter = { + parameterPath: ["options", "body"], + mapper: DatastoreMapper +}; + +export const datastoreName: OperationURLParameter = { + parameterPath: "datastoreName", + mapper: { + serializedName: "datastoreName", + required: true, + type: { + name: "String" + } + } +}; + +export const body8: OperationParameter = { + parameterPath: ["options", "body"], + mapper: VCenterMapper +}; + +export const vcenterName: OperationURLParameter = { + parameterPath: "vcenterName", + mapper: { + serializedName: "vcenterName", + required: true, + type: { + name: "String" + } + } +}; + +export const body9: OperationParameter = { + parameterPath: ["options", "body"], + mapper: VirtualMachineTemplateMapper +}; + +export const virtualMachineTemplateName: OperationURLParameter = { + parameterPath: "virtualMachineTemplateName", + mapper: { + serializedName: "virtualMachineTemplateName", + required: true, + type: { + name: "String" + } + } +}; + +export const body10: OperationParameter = { + parameterPath: ["options", "body"], + mapper: VirtualNetworkMapper +}; + +export const virtualNetworkName: OperationURLParameter = { + parameterPath: "virtualNetworkName", + mapper: { + serializedName: "virtualNetworkName", + required: true, + type: { + name: "String" + } + } +}; + +export const body11: OperationParameter = { + parameterPath: ["options", "body"], + mapper: InventoryItemMapper +}; + +export const inventoryItemName: OperationURLParameter = { + parameterPath: "inventoryItemName", + mapper: { + serializedName: "inventoryItemName", + required: true, + type: { + name: "String" + } + } +}; + +export const body12: OperationParameter = { + parameterPath: ["options", "body"], + mapper: HybridIdentityMetadataMapper +}; + +export const metadataName: OperationURLParameter = { + parameterPath: "metadataName", + mapper: { + serializedName: "metadataName", + required: true, + type: { + name: "String" + } + } +}; + +export const extensionParameters: OperationParameter = { + parameterPath: "extensionParameters", + mapper: MachineExtensionMapper +}; + +export const extensionName: OperationURLParameter = { + parameterPath: "extensionName", + mapper: { + serializedName: "extensionName", + required: true, + type: { + name: "String" + } + } +}; + +export const extensionParameters1: OperationParameter = { + parameterPath: "extensionParameters", + mapper: MachineExtensionUpdateMapper +}; + +export const expand: OperationQueryParameter = { + parameterPath: ["options", "expand"], + mapper: { + serializedName: "$expand", + type: { + name: "String" + } + } +}; + +export const body13: OperationParameter = { + parameterPath: ["options", "body"], + mapper: GuestAgentMapper +}; diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operations/clusters.ts b/sdk/connectedvmware/arm-connectedvmware/src/operations/clusters.ts new file mode 100644 index 000000000000..3fe6980e64fe --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operations/clusters.ts @@ -0,0 +1,588 @@ +/* + * 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 { Clusters } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureArcVMwareManagementServiceAPI } from "../azureArcVMwareManagementServiceAPI"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Cluster, + ClustersListNextOptionalParams, + ClustersListOptionalParams, + ClustersListByResourceGroupNextOptionalParams, + ClustersListByResourceGroupOptionalParams, + ClustersCreateOptionalParams, + ClustersCreateResponse, + ClustersGetOptionalParams, + ClustersGetResponse, + ClustersUpdateOptionalParams, + ClustersUpdateResponse, + ClustersDeleteOptionalParams, + ClustersListResponse, + ClustersListByResourceGroupResponse, + ClustersListNextResponse, + ClustersListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing Clusters operations. */ +export class ClustersImpl implements Clusters { + private readonly client: AzureArcVMwareManagementServiceAPI; + + /** + * Initialize a new instance of the class Clusters class. + * @param client Reference to the service client + */ + constructor(client: AzureArcVMwareManagementServiceAPI) { + this.client = client; + } + + /** + * List of clusters in a subscription. + * @param options The options parameters. + */ + public list( + options?: ClustersListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: ClustersListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: ClustersListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * List of clusters in a resource group. + * @param resourceGroupName The Resource Group Name. + * @param options The options parameters. + */ + 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 + ); + 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; + } + } + + /** + * Create Or Update cluster. + * @param resourceGroupName The Resource Group Name. + * @param clusterName Name of the cluster. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + clusterName: string, + options?: ClustersCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ClustersCreateResponse + > + > { + 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, options }, + createOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Create Or Update cluster. + * @param resourceGroupName The Resource Group Name. + * @param clusterName Name of the cluster. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + clusterName: string, + options?: ClustersCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + clusterName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Implements cluster GET method. + * @param resourceGroupName The Resource Group Name. + * @param clusterName Name of the cluster. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + clusterName: string, + options?: ClustersGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, options }, + getOperationSpec + ); + } + + /** + * API to update certain properties of the cluster resource. + * @param resourceGroupName The Resource Group Name. + * @param clusterName Name of the cluster. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + clusterName: string, + options?: ClustersUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, options }, + updateOperationSpec + ); + } + + /** + * Implements cluster DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param clusterName Name of the cluster. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + clusterName: string, + options?: ClustersDeleteOptionalParams + ): 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, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Implements cluster DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param clusterName Name of the cluster. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + clusterName: string, + options?: ClustersDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + clusterName, + options + ); + return poller.pollUntilDone(); + } + + /** + * List of clusters in a subscription. + * @param options The options parameters. + */ + private _list( + options?: ClustersListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * List of clusters in a resource group. + * @param resourceGroupName The Resource Group Name. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: ClustersListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: ClustersListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The Resource Group Name. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: ClustersListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/clusters/{clusterName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Cluster + }, + 201: { + bodyMapper: Mappers.Cluster + }, + 202: { + bodyMapper: Mappers.Cluster + }, + 204: { + bodyMapper: Mappers.Cluster + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body5, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/clusters/{clusterName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Cluster + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/clusters/{clusterName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Cluster + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/clusters/{clusterName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.force], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedVMwarevSphere/clusters", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ClustersList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/clusters", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ClustersList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ClustersList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ClustersList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operations/datastores.ts b/sdk/connectedvmware/arm-connectedvmware/src/operations/datastores.ts new file mode 100644 index 000000000000..c91ec56c68e4 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operations/datastores.ts @@ -0,0 +1,588 @@ +/* + * 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 { Datastores } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureArcVMwareManagementServiceAPI } from "../azureArcVMwareManagementServiceAPI"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Datastore, + DatastoresListNextOptionalParams, + DatastoresListOptionalParams, + DatastoresListByResourceGroupNextOptionalParams, + DatastoresListByResourceGroupOptionalParams, + DatastoresCreateOptionalParams, + DatastoresCreateResponse, + DatastoresGetOptionalParams, + DatastoresGetResponse, + DatastoresUpdateOptionalParams, + DatastoresUpdateResponse, + DatastoresDeleteOptionalParams, + DatastoresListResponse, + DatastoresListByResourceGroupResponse, + DatastoresListNextResponse, + DatastoresListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing Datastores operations. */ +export class DatastoresImpl implements Datastores { + private readonly client: AzureArcVMwareManagementServiceAPI; + + /** + * Initialize a new instance of the class Datastores class. + * @param client Reference to the service client + */ + constructor(client: AzureArcVMwareManagementServiceAPI) { + this.client = client; + } + + /** + * List of datastores in a subscription. + * @param options The options parameters. + */ + public list( + options?: DatastoresListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: DatastoresListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: DatastoresListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * List of datastores in a resource group. + * @param resourceGroupName The Resource Group Name. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: DatastoresListByResourceGroupOptionalParams + ): 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?: DatastoresListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: DatastoresListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Create Or Update datastore. + * @param resourceGroupName The Resource Group Name. + * @param datastoreName Name of the datastore. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + datastoreName: string, + options?: DatastoresCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DatastoresCreateResponse + > + > { + 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, datastoreName, options }, + createOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Create Or Update datastore. + * @param resourceGroupName The Resource Group Name. + * @param datastoreName Name of the datastore. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + datastoreName: string, + options?: DatastoresCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + datastoreName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Implements datastore GET method. + * @param resourceGroupName The Resource Group Name. + * @param datastoreName Name of the datastore. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + datastoreName: string, + options?: DatastoresGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, datastoreName, options }, + getOperationSpec + ); + } + + /** + * API to update certain properties of the datastore resource. + * @param resourceGroupName The Resource Group Name. + * @param datastoreName Name of the datastore. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + datastoreName: string, + options?: DatastoresUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, datastoreName, options }, + updateOperationSpec + ); + } + + /** + * Implements datastore DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param datastoreName Name of the datastore. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + datastoreName: string, + options?: DatastoresDeleteOptionalParams + ): 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, datastoreName, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Implements datastore DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param datastoreName Name of the datastore. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + datastoreName: string, + options?: DatastoresDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + datastoreName, + options + ); + return poller.pollUntilDone(); + } + + /** + * List of datastores in a subscription. + * @param options The options parameters. + */ + private _list( + options?: DatastoresListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * List of datastores in a resource group. + * @param resourceGroupName The Resource Group Name. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: DatastoresListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: DatastoresListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The Resource Group Name. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: DatastoresListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/datastores/{datastoreName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Datastore + }, + 201: { + bodyMapper: Mappers.Datastore + }, + 202: { + bodyMapper: Mappers.Datastore + }, + 204: { + bodyMapper: Mappers.Datastore + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body7, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.datastoreName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/datastores/{datastoreName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Datastore + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.datastoreName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/datastores/{datastoreName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Datastore + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.datastoreName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/datastores/{datastoreName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.force], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.datastoreName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedVMwarevSphere/datastores", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DatastoresList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/datastores", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DatastoresList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DatastoresList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DatastoresList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operations/guestAgents.ts b/sdk/connectedvmware/arm-connectedvmware/src/operations/guestAgents.ts new file mode 100644 index 000000000000..8f842e366ec3 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operations/guestAgents.ts @@ -0,0 +1,476 @@ +/* + * 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 { GuestAgents } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureArcVMwareManagementServiceAPI } from "../azureArcVMwareManagementServiceAPI"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + GuestAgent, + GuestAgentsListByVmNextOptionalParams, + GuestAgentsListByVmOptionalParams, + GuestAgentsCreateOptionalParams, + GuestAgentsCreateResponse, + GuestAgentsGetOptionalParams, + GuestAgentsGetResponse, + GuestAgentsDeleteOptionalParams, + GuestAgentsListByVmResponse, + GuestAgentsListByVmNextResponse +} from "../models"; + +/// +/** Class containing GuestAgents operations. */ +export class GuestAgentsImpl implements GuestAgents { + private readonly client: AzureArcVMwareManagementServiceAPI; + + /** + * Initialize a new instance of the class GuestAgents class. + * @param client Reference to the service client + */ + constructor(client: AzureArcVMwareManagementServiceAPI) { + this.client = client; + } + + /** + * Returns the list of GuestAgent of the given vm. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the vm. + * @param options The options parameters. + */ + public listByVm( + resourceGroupName: string, + virtualMachineName: string, + options?: GuestAgentsListByVmOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByVmPagingAll( + resourceGroupName, + virtualMachineName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByVmPagingPage( + resourceGroupName, + virtualMachineName, + options + ); + } + }; + } + + private async *listByVmPagingPage( + resourceGroupName: string, + virtualMachineName: string, + options?: GuestAgentsListByVmOptionalParams + ): AsyncIterableIterator { + let result = await this._listByVm( + resourceGroupName, + virtualMachineName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByVmNext( + resourceGroupName, + virtualMachineName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByVmPagingAll( + resourceGroupName: string, + virtualMachineName: string, + options?: GuestAgentsListByVmOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByVmPagingPage( + resourceGroupName, + virtualMachineName, + options + )) { + yield* page; + } + } + + /** + * Create Or Update GuestAgent. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the vm. + * @param name Name of the guestAgents. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + virtualMachineName: string, + name: string, + options?: GuestAgentsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + GuestAgentsCreateResponse + > + > { + 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, virtualMachineName, name, options }, + createOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Create Or Update GuestAgent. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the vm. + * @param name Name of the guestAgents. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + virtualMachineName: string, + name: string, + options?: GuestAgentsCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + virtualMachineName, + name, + options + ); + return poller.pollUntilDone(); + } + + /** + * Implements GuestAgent GET method. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the vm. + * @param name Name of the GuestAgent. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + virtualMachineName: string, + name: string, + options?: GuestAgentsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, virtualMachineName, name, options }, + getOperationSpec + ); + } + + /** + * Implements GuestAgent DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the vm. + * @param name Name of the GuestAgent. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + virtualMachineName: string, + name: string, + options?: GuestAgentsDeleteOptionalParams + ): 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, virtualMachineName, name, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Implements GuestAgent DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the vm. + * @param name Name of the GuestAgent. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + virtualMachineName: string, + name: string, + options?: GuestAgentsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + virtualMachineName, + name, + options + ); + return poller.pollUntilDone(); + } + + /** + * Returns the list of GuestAgent of the given vm. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the vm. + * @param options The options parameters. + */ + private _listByVm( + resourceGroupName: string, + virtualMachineName: string, + options?: GuestAgentsListByVmOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, virtualMachineName, options }, + listByVmOperationSpec + ); + } + + /** + * ListByVmNext + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the vm. + * @param nextLink The nextLink from the previous successful call to the ListByVm method. + * @param options The options parameters. + */ + private _listByVmNext( + resourceGroupName: string, + virtualMachineName: string, + nextLink: string, + options?: GuestAgentsListByVmNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, virtualMachineName, nextLink, options }, + listByVmNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/guestAgents/{name}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.GuestAgent + }, + 201: { + bodyMapper: Mappers.GuestAgent + }, + 202: { + bodyMapper: Mappers.GuestAgent + }, + 204: { + bodyMapper: Mappers.GuestAgent + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body13, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.name, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/guestAgents/{name}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.GuestAgent + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.name, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/guestAgents/{name}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.name, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByVmOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/guestAgents", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.GuestAgentList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByVmNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.GuestAgentList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operations/hosts.ts b/sdk/connectedvmware/arm-connectedvmware/src/operations/hosts.ts new file mode 100644 index 000000000000..ae5cad9fd48c --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operations/hosts.ts @@ -0,0 +1,575 @@ +/* + * 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 { Hosts } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureArcVMwareManagementServiceAPI } from "../azureArcVMwareManagementServiceAPI"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Host, + HostsListNextOptionalParams, + HostsListOptionalParams, + HostsListByResourceGroupNextOptionalParams, + HostsListByResourceGroupOptionalParams, + HostsCreateOptionalParams, + HostsCreateResponse, + HostsGetOptionalParams, + HostsGetResponse, + HostsUpdateOptionalParams, + HostsUpdateResponse, + HostsDeleteOptionalParams, + HostsListResponse, + HostsListByResourceGroupResponse, + HostsListNextResponse, + HostsListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing Hosts operations. */ +export class HostsImpl implements Hosts { + private readonly client: AzureArcVMwareManagementServiceAPI; + + /** + * Initialize a new instance of the class Hosts class. + * @param client Reference to the service client + */ + constructor(client: AzureArcVMwareManagementServiceAPI) { + this.client = client; + } + + /** + * List of hosts in a subscription. + * @param options The options parameters. + */ + public list( + options?: HostsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: HostsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: HostsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * List of hosts in a resource group. + * @param resourceGroupName The Resource Group Name. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: HostsListByResourceGroupOptionalParams + ): 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?: HostsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: HostsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Create Or Update host. + * @param resourceGroupName The Resource Group Name. + * @param hostName Name of the host. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + hostName: string, + options?: HostsCreateOptionalParams + ): Promise< + PollerLike, HostsCreateResponse> + > { + 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, hostName, options }, + createOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Create Or Update host. + * @param resourceGroupName The Resource Group Name. + * @param hostName Name of the host. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + hostName: string, + options?: HostsCreateOptionalParams + ): Promise { + const poller = await this.beginCreate(resourceGroupName, hostName, options); + return poller.pollUntilDone(); + } + + /** + * Implements host GET method. + * @param resourceGroupName The Resource Group Name. + * @param hostName Name of the host. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + hostName: string, + options?: HostsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, hostName, options }, + getOperationSpec + ); + } + + /** + * API to update certain properties of the host resource. + * @param resourceGroupName The Resource Group Name. + * @param hostName Name of the host. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + hostName: string, + options?: HostsUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, hostName, options }, + updateOperationSpec + ); + } + + /** + * Implements host DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param hostName Name of the host. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + hostName: string, + options?: HostsDeleteOptionalParams + ): 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, hostName, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Implements host DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param hostName Name of the host. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + hostName: string, + options?: HostsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete(resourceGroupName, hostName, options); + return poller.pollUntilDone(); + } + + /** + * List of hosts in a subscription. + * @param options The options parameters. + */ + private _list(options?: HostsListOptionalParams): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * List of hosts in a resource group. + * @param resourceGroupName The Resource Group Name. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: HostsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: HostsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The Resource Group Name. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: HostsListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/hosts/{hostName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Host + }, + 201: { + bodyMapper: Mappers.Host + }, + 202: { + bodyMapper: Mappers.Host + }, + 204: { + bodyMapper: Mappers.Host + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body6, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.hostName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/hosts/{hostName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Host + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.hostName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/hosts/{hostName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Host + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.hostName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/hosts/{hostName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.force], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.hostName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedVMwarevSphere/hosts", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.HostsList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/hosts", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.HostsList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.HostsList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.HostsList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operations/hybridIdentityMetadataOperations.ts b/sdk/connectedvmware/arm-connectedvmware/src/operations/hybridIdentityMetadataOperations.ts new file mode 100644 index 000000000000..6b54335e3ae3 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operations/hybridIdentityMetadataOperations.ts @@ -0,0 +1,322 @@ +/* + * 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 { HybridIdentityMetadataOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureArcVMwareManagementServiceAPI } from "../azureArcVMwareManagementServiceAPI"; +import { + HybridIdentityMetadata, + HybridIdentityMetadataListByVmNextOptionalParams, + HybridIdentityMetadataListByVmOptionalParams, + HybridIdentityMetadataCreateOptionalParams, + HybridIdentityMetadataCreateResponse, + HybridIdentityMetadataGetOptionalParams, + HybridIdentityMetadataGetResponse, + HybridIdentityMetadataDeleteOptionalParams, + HybridIdentityMetadataListByVmResponse, + HybridIdentityMetadataListByVmNextResponse +} from "../models"; + +/// +/** Class containing HybridIdentityMetadataOperations operations. */ +export class HybridIdentityMetadataOperationsImpl + implements HybridIdentityMetadataOperations { + private readonly client: AzureArcVMwareManagementServiceAPI; + + /** + * Initialize a new instance of the class HybridIdentityMetadataOperations class. + * @param client Reference to the service client + */ + constructor(client: AzureArcVMwareManagementServiceAPI) { + this.client = client; + } + + /** + * Returns the list of HybridIdentityMetadata of the given vm. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the vm. + * @param options The options parameters. + */ + public listByVm( + resourceGroupName: string, + virtualMachineName: string, + options?: HybridIdentityMetadataListByVmOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByVmPagingAll( + resourceGroupName, + virtualMachineName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByVmPagingPage( + resourceGroupName, + virtualMachineName, + options + ); + } + }; + } + + private async *listByVmPagingPage( + resourceGroupName: string, + virtualMachineName: string, + options?: HybridIdentityMetadataListByVmOptionalParams + ): AsyncIterableIterator { + let result = await this._listByVm( + resourceGroupName, + virtualMachineName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByVmNext( + resourceGroupName, + virtualMachineName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByVmPagingAll( + resourceGroupName: string, + virtualMachineName: string, + options?: HybridIdentityMetadataListByVmOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByVmPagingPage( + resourceGroupName, + virtualMachineName, + options + )) { + yield* page; + } + } + + /** + * Create Or Update HybridIdentityMetadata. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the vm. + * @param metadataName Name of the hybridIdentityMetadata. + * @param options The options parameters. + */ + create( + resourceGroupName: string, + virtualMachineName: string, + metadataName: string, + options?: HybridIdentityMetadataCreateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, virtualMachineName, metadataName, options }, + createOperationSpec + ); + } + + /** + * Implements HybridIdentityMetadata GET method. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the vm. + * @param metadataName Name of the HybridIdentityMetadata. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + virtualMachineName: string, + metadataName: string, + options?: HybridIdentityMetadataGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, virtualMachineName, metadataName, options }, + getOperationSpec + ); + } + + /** + * Implements HybridIdentityMetadata DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the vm. + * @param metadataName Name of the HybridIdentityMetadata. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + virtualMachineName: string, + metadataName: string, + options?: HybridIdentityMetadataDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, virtualMachineName, metadataName, options }, + deleteOperationSpec + ); + } + + /** + * Returns the list of HybridIdentityMetadata of the given vm. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the vm. + * @param options The options parameters. + */ + private _listByVm( + resourceGroupName: string, + virtualMachineName: string, + options?: HybridIdentityMetadataListByVmOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, virtualMachineName, options }, + listByVmOperationSpec + ); + } + + /** + * ListByVmNext + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the vm. + * @param nextLink The nextLink from the previous successful call to the ListByVm method. + * @param options The options parameters. + */ + private _listByVmNext( + resourceGroupName: string, + virtualMachineName: string, + nextLink: string, + options?: HybridIdentityMetadataListByVmNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, virtualMachineName, nextLink, options }, + listByVmNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/hybridIdentityMetadata/{metadataName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.HybridIdentityMetadata + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body12, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName, + Parameters.metadataName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/hybridIdentityMetadata/{metadataName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.HybridIdentityMetadata + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName, + Parameters.metadataName + ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/hybridIdentityMetadata/{metadataName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName, + Parameters.metadataName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByVmOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/hybridIdentityMetadata", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.HybridIdentityMetadataList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByVmNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.HybridIdentityMetadataList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operations/index.ts b/sdk/connectedvmware/arm-connectedvmware/src/operations/index.ts new file mode 100644 index 000000000000..5adaf861d073 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operations/index.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. + */ + +export * from "./operations"; +export * from "./virtualMachines"; +export * from "./resourcePools"; +export * from "./clusters"; +export * from "./hosts"; +export * from "./datastores"; +export * from "./vCenters"; +export * from "./virtualMachineTemplates"; +export * from "./virtualNetworks"; +export * from "./inventoryItems"; +export * from "./hybridIdentityMetadataOperations"; +export * from "./machineExtensions"; +export * from "./guestAgents"; diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operations/inventoryItems.ts b/sdk/connectedvmware/arm-connectedvmware/src/operations/inventoryItems.ts new file mode 100644 index 000000000000..1a36c302bc66 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operations/inventoryItems.ts @@ -0,0 +1,321 @@ +/* + * 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 { InventoryItems } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureArcVMwareManagementServiceAPI } from "../azureArcVMwareManagementServiceAPI"; +import { + InventoryItem, + InventoryItemsListByVCenterNextOptionalParams, + InventoryItemsListByVCenterOptionalParams, + InventoryItemsCreateOptionalParams, + InventoryItemsCreateResponse, + InventoryItemsGetOptionalParams, + InventoryItemsGetResponse, + InventoryItemsDeleteOptionalParams, + InventoryItemsListByVCenterResponse, + InventoryItemsListByVCenterNextResponse +} from "../models"; + +/// +/** Class containing InventoryItems operations. */ +export class InventoryItemsImpl implements InventoryItems { + private readonly client: AzureArcVMwareManagementServiceAPI; + + /** + * Initialize a new instance of the class InventoryItems class. + * @param client Reference to the service client + */ + constructor(client: AzureArcVMwareManagementServiceAPI) { + this.client = client; + } + + /** + * Returns the list of inventoryItems of the given vCenter. + * @param resourceGroupName The Resource Group Name. + * @param vcenterName Name of the vCenter. + * @param options The options parameters. + */ + public listByVCenter( + resourceGroupName: string, + vcenterName: string, + options?: InventoryItemsListByVCenterOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByVCenterPagingAll( + resourceGroupName, + vcenterName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByVCenterPagingPage( + resourceGroupName, + vcenterName, + options + ); + } + }; + } + + private async *listByVCenterPagingPage( + resourceGroupName: string, + vcenterName: string, + options?: InventoryItemsListByVCenterOptionalParams + ): AsyncIterableIterator { + let result = await this._listByVCenter( + resourceGroupName, + vcenterName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByVCenterNext( + resourceGroupName, + vcenterName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByVCenterPagingAll( + resourceGroupName: string, + vcenterName: string, + options?: InventoryItemsListByVCenterOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByVCenterPagingPage( + resourceGroupName, + vcenterName, + options + )) { + yield* page; + } + } + + /** + * Create Or Update InventoryItem. + * @param resourceGroupName The Resource Group Name. + * @param vcenterName Name of the vCenter. + * @param inventoryItemName Name of the inventoryItem. + * @param options The options parameters. + */ + create( + resourceGroupName: string, + vcenterName: string, + inventoryItemName: string, + options?: InventoryItemsCreateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, vcenterName, inventoryItemName, options }, + createOperationSpec + ); + } + + /** + * Implements InventoryItem GET method. + * @param resourceGroupName The Resource Group Name. + * @param vcenterName Name of the vCenter. + * @param inventoryItemName Name of the inventoryItem. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + vcenterName: string, + inventoryItemName: string, + options?: InventoryItemsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, vcenterName, inventoryItemName, options }, + getOperationSpec + ); + } + + /** + * Implements inventoryItem DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param vcenterName Name of the vCenter. + * @param inventoryItemName Name of the inventoryItem. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + vcenterName: string, + inventoryItemName: string, + options?: InventoryItemsDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, vcenterName, inventoryItemName, options }, + deleteOperationSpec + ); + } + + /** + * Returns the list of inventoryItems of the given vCenter. + * @param resourceGroupName The Resource Group Name. + * @param vcenterName Name of the vCenter. + * @param options The options parameters. + */ + private _listByVCenter( + resourceGroupName: string, + vcenterName: string, + options?: InventoryItemsListByVCenterOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, vcenterName, options }, + listByVCenterOperationSpec + ); + } + + /** + * ListByVCenterNext + * @param resourceGroupName The Resource Group Name. + * @param vcenterName Name of the vCenter. + * @param nextLink The nextLink from the previous successful call to the ListByVCenter method. + * @param options The options parameters. + */ + private _listByVCenterNext( + resourceGroupName: string, + vcenterName: string, + nextLink: string, + options?: InventoryItemsListByVCenterNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, vcenterName, nextLink, options }, + listByVCenterNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}/inventoryItems/{inventoryItemName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.InventoryItem + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body11, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vcenterName, + Parameters.inventoryItemName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}/inventoryItems/{inventoryItemName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.InventoryItem + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vcenterName, + Parameters.inventoryItemName + ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}/inventoryItems/{inventoryItemName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vcenterName, + Parameters.inventoryItemName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByVCenterOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}/inventoryItems", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.InventoryItemsList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vcenterName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByVCenterNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.InventoryItemsList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vcenterName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operations/machineExtensions.ts b/sdk/connectedvmware/arm-connectedvmware/src/operations/machineExtensions.ts new file mode 100644 index 000000000000..749163b5f8c5 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operations/machineExtensions.ts @@ -0,0 +1,603 @@ +/* + * 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 { MachineExtensions } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureArcVMwareManagementServiceAPI } from "../azureArcVMwareManagementServiceAPI"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + MachineExtension, + MachineExtensionsListNextOptionalParams, + MachineExtensionsListOptionalParams, + MachineExtensionsCreateOrUpdateOptionalParams, + MachineExtensionsCreateOrUpdateResponse, + MachineExtensionUpdate, + MachineExtensionsUpdateOptionalParams, + MachineExtensionsUpdateResponse, + MachineExtensionsDeleteOptionalParams, + MachineExtensionsGetOptionalParams, + MachineExtensionsGetResponse, + MachineExtensionsListResponse, + MachineExtensionsListNextResponse +} from "../models"; + +/// +/** Class containing MachineExtensions operations. */ +export class MachineExtensionsImpl implements MachineExtensions { + private readonly client: AzureArcVMwareManagementServiceAPI; + + /** + * Initialize a new instance of the class MachineExtensions class. + * @param client Reference to the service client + */ + constructor(client: AzureArcVMwareManagementServiceAPI) { + this.client = client; + } + + /** + * The operation to get all extensions of a non-Azure machine + * @param resourceGroupName The Resource Group Name. + * @param name The name of the machine containing the extension. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + name: string, + options?: MachineExtensionsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, name, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceGroupName, name, options); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + name: string, + options?: MachineExtensionsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, name, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + name, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + name: string, + options?: MachineExtensionsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + name, + options + )) { + yield* page; + } + } + + /** + * The operation to create or update the extension. + * @param resourceGroupName The Resource Group Name. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + name: string, + extensionName: string, + extensionParameters: MachineExtension, + options?: MachineExtensionsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + MachineExtensionsCreateOrUpdateResponse + > + > { + 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, name, extensionName, extensionParameters, options }, + createOrUpdateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * The operation to create or update the extension. + * @param resourceGroupName The Resource Group Name. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + name: string, + extensionName: string, + extensionParameters: MachineExtension, + options?: MachineExtensionsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + name, + extensionName, + extensionParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * The operation to update the extension. + * @param resourceGroupName The Resource Group Name. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + name: string, + extensionName: string, + extensionParameters: MachineExtensionUpdate, + options?: MachineExtensionsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + MachineExtensionsUpdateResponse + > + > { + 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, name, extensionName, extensionParameters, options }, + updateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * The operation to update the extension. + * @param resourceGroupName The Resource Group Name. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + name: string, + extensionName: string, + extensionParameters: MachineExtensionUpdate, + options?: MachineExtensionsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + name, + extensionName, + extensionParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * The operation to delete the extension. + * @param resourceGroupName The Resource Group Name. + * @param name The name of the machine where the extension should be deleted. + * @param extensionName The name of the machine extension. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + name: string, + extensionName: string, + options?: MachineExtensionsDeleteOptionalParams + ): 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, name, extensionName, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * The operation to delete the extension. + * @param resourceGroupName The Resource Group Name. + * @param name The name of the machine where the extension should be deleted. + * @param extensionName The name of the machine extension. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + name: string, + extensionName: string, + options?: MachineExtensionsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + name, + extensionName, + options + ); + return poller.pollUntilDone(); + } + + /** + * The operation to get the extension. + * @param resourceGroupName The Resource Group Name. + * @param name The name of the machine containing the extension. + * @param extensionName The name of the machine extension. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + name: string, + extensionName: string, + options?: MachineExtensionsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, name, extensionName, options }, + getOperationSpec + ); + } + + /** + * The operation to get all extensions of a non-Azure machine + * @param resourceGroupName The Resource Group Name. + * @param name The name of the machine containing the extension. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + name: string, + options?: MachineExtensionsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, name, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The Resource Group Name. + * @param name The name of the machine containing the extension. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + name: string, + nextLink: string, + options?: MachineExtensionsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, name, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/extensions/{extensionName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.MachineExtension + }, + 201: { + bodyMapper: Mappers.MachineExtension + }, + 202: { + bodyMapper: Mappers.MachineExtension + }, + 204: { + bodyMapper: Mappers.MachineExtension + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.extensionParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.name, + Parameters.extensionName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/extensions/{extensionName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.MachineExtension + }, + 201: { + bodyMapper: Mappers.MachineExtension + }, + 202: { + bodyMapper: Mappers.MachineExtension + }, + 204: { + bodyMapper: Mappers.MachineExtension + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.extensionParameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.name, + Parameters.extensionName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/extensions/{extensionName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.name, + Parameters.extensionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/extensions/{extensionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MachineExtension + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.name, + Parameters.extensionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/extensions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MachineExtensionsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.expand], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.name + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MachineExtensionsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.expand], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.name + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operations/operations.ts b/sdk/connectedvmware/arm-connectedvmware/src/operations/operations.ts new file mode 100644 index 000000000000..7e658c256468 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operations/operations.ts @@ -0,0 +1,137 @@ +/* + * 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 { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureArcVMwareManagementServiceAPI } from "../azureArcVMwareManagementServiceAPI"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: AzureArcVMwareManagementServiceAPI; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: AzureArcVMwareManagementServiceAPI) { + this.client = client; + } + + /** + * Returns list of all operations. + * @param options The options parameters. + */ + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Returns list of all operations. + * @param options The options parameters. + */ + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.ConnectedVMwarevSphere/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationsList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationsList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operations/resourcePools.ts b/sdk/connectedvmware/arm-connectedvmware/src/operations/resourcePools.ts new file mode 100644 index 000000000000..8576903291ab --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operations/resourcePools.ts @@ -0,0 +1,588 @@ +/* + * 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 { ResourcePools } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureArcVMwareManagementServiceAPI } from "../azureArcVMwareManagementServiceAPI"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + ResourcePool, + ResourcePoolsListNextOptionalParams, + ResourcePoolsListOptionalParams, + ResourcePoolsListByResourceGroupNextOptionalParams, + ResourcePoolsListByResourceGroupOptionalParams, + ResourcePoolsCreateOptionalParams, + ResourcePoolsCreateResponse, + ResourcePoolsGetOptionalParams, + ResourcePoolsGetResponse, + ResourcePoolsUpdateOptionalParams, + ResourcePoolsUpdateResponse, + ResourcePoolsDeleteOptionalParams, + ResourcePoolsListResponse, + ResourcePoolsListByResourceGroupResponse, + ResourcePoolsListNextResponse, + ResourcePoolsListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing ResourcePools operations. */ +export class ResourcePoolsImpl implements ResourcePools { + private readonly client: AzureArcVMwareManagementServiceAPI; + + /** + * Initialize a new instance of the class ResourcePools class. + * @param client Reference to the service client + */ + constructor(client: AzureArcVMwareManagementServiceAPI) { + this.client = client; + } + + /** + * List of resourcePools in a subscription. + * @param options The options parameters. + */ + public list( + options?: ResourcePoolsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: ResourcePoolsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: ResourcePoolsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * List of resourcePools in a resource group. + * @param resourceGroupName The Resource Group Name. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: ResourcePoolsListByResourceGroupOptionalParams + ): 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?: ResourcePoolsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: ResourcePoolsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Create Or Update resourcePool. + * @param resourceGroupName The Resource Group Name. + * @param resourcePoolName Name of the resourcePool. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + resourcePoolName: string, + options?: ResourcePoolsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ResourcePoolsCreateResponse + > + > { + 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, resourcePoolName, options }, + createOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Create Or Update resourcePool. + * @param resourceGroupName The Resource Group Name. + * @param resourcePoolName Name of the resourcePool. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + resourcePoolName: string, + options?: ResourcePoolsCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + resourcePoolName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Implements resourcePool GET method. + * @param resourceGroupName The Resource Group Name. + * @param resourcePoolName Name of the resourcePool. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourcePoolName: string, + options?: ResourcePoolsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourcePoolName, options }, + getOperationSpec + ); + } + + /** + * API to update certain properties of the resourcePool resource. + * @param resourceGroupName The Resource Group Name. + * @param resourcePoolName Name of the resourcePool. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + resourcePoolName: string, + options?: ResourcePoolsUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourcePoolName, options }, + updateOperationSpec + ); + } + + /** + * Implements resourcePool DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param resourcePoolName Name of the resourcePool. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + resourcePoolName: string, + options?: ResourcePoolsDeleteOptionalParams + ): 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, resourcePoolName, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Implements resourcePool DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param resourcePoolName Name of the resourcePool. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + resourcePoolName: string, + options?: ResourcePoolsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + resourcePoolName, + options + ); + return poller.pollUntilDone(); + } + + /** + * List of resourcePools in a subscription. + * @param options The options parameters. + */ + private _list( + options?: ResourcePoolsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * List of resourcePools in a resource group. + * @param resourceGroupName The Resource Group Name. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: ResourcePoolsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: ResourcePoolsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The Resource Group Name. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: ResourcePoolsListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ResourcePool + }, + 201: { + bodyMapper: Mappers.ResourcePool + }, + 202: { + bodyMapper: Mappers.ResourcePool + }, + 204: { + bodyMapper: Mappers.ResourcePool + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourcePoolName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ResourcePool + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourcePoolName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.ResourcePool + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourcePoolName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.force], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourcePoolName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ResourcePoolsList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ResourcePoolsList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ResourcePoolsList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ResourcePoolsList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operations/vCenters.ts b/sdk/connectedvmware/arm-connectedvmware/src/operations/vCenters.ts new file mode 100644 index 000000000000..0a712af5ff3a --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operations/vCenters.ts @@ -0,0 +1,588 @@ +/* + * 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 { VCenters } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureArcVMwareManagementServiceAPI } from "../azureArcVMwareManagementServiceAPI"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + VCenter, + VCentersListNextOptionalParams, + VCentersListOptionalParams, + VCentersListByResourceGroupNextOptionalParams, + VCentersListByResourceGroupOptionalParams, + VCentersCreateOptionalParams, + VCentersCreateResponse, + VCentersGetOptionalParams, + VCentersGetResponse, + VCentersUpdateOptionalParams, + VCentersUpdateResponse, + VCentersDeleteOptionalParams, + VCentersListResponse, + VCentersListByResourceGroupResponse, + VCentersListNextResponse, + VCentersListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing VCenters operations. */ +export class VCentersImpl implements VCenters { + private readonly client: AzureArcVMwareManagementServiceAPI; + + /** + * Initialize a new instance of the class VCenters class. + * @param client Reference to the service client + */ + constructor(client: AzureArcVMwareManagementServiceAPI) { + this.client = client; + } + + /** + * List of vCenters in a subscription. + * @param options The options parameters. + */ + public list( + options?: VCentersListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: VCentersListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: VCentersListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * List of vCenters in a resource group. + * @param resourceGroupName The Resource Group Name. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: VCentersListByResourceGroupOptionalParams + ): 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?: VCentersListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: VCentersListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Create Or Update vCenter. + * @param resourceGroupName The Resource Group Name. + * @param vcenterName Name of the vCenter. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + vcenterName: string, + options?: VCentersCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VCentersCreateResponse + > + > { + 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, vcenterName, options }, + createOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Create Or Update vCenter. + * @param resourceGroupName The Resource Group Name. + * @param vcenterName Name of the vCenter. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + vcenterName: string, + options?: VCentersCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + vcenterName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Implements vCenter GET method. + * @param resourceGroupName The Resource Group Name. + * @param vcenterName Name of the vCenter. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + vcenterName: string, + options?: VCentersGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, vcenterName, options }, + getOperationSpec + ); + } + + /** + * API to update certain properties of the vCenter resource. + * @param resourceGroupName The Resource Group Name. + * @param vcenterName Name of the vCenter. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + vcenterName: string, + options?: VCentersUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, vcenterName, options }, + updateOperationSpec + ); + } + + /** + * Implements vCenter DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param vcenterName Name of the vCenter. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + vcenterName: string, + options?: VCentersDeleteOptionalParams + ): 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, vcenterName, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Implements vCenter DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param vcenterName Name of the vCenter. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + vcenterName: string, + options?: VCentersDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + vcenterName, + options + ); + return poller.pollUntilDone(); + } + + /** + * List of vCenters in a subscription. + * @param options The options parameters. + */ + private _list( + options?: VCentersListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * List of vCenters in a resource group. + * @param resourceGroupName The Resource Group Name. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: VCentersListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: VCentersListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The Resource Group Name. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: VCentersListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.VCenter + }, + 201: { + bodyMapper: Mappers.VCenter + }, + 202: { + bodyMapper: Mappers.VCenter + }, + 204: { + bodyMapper: Mappers.VCenter + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body8, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vcenterName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VCenter + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vcenterName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.VCenter + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vcenterName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.force], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vcenterName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedVMwarevSphere/vcenters", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VCentersList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VCentersList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VCentersList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VCentersList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operations/virtualMachineTemplates.ts b/sdk/connectedvmware/arm-connectedvmware/src/operations/virtualMachineTemplates.ts new file mode 100644 index 000000000000..b97f4c41e895 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operations/virtualMachineTemplates.ts @@ -0,0 +1,588 @@ +/* + * 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 { VirtualMachineTemplates } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureArcVMwareManagementServiceAPI } from "../azureArcVMwareManagementServiceAPI"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + VirtualMachineTemplate, + VirtualMachineTemplatesListNextOptionalParams, + VirtualMachineTemplatesListOptionalParams, + VirtualMachineTemplatesListByResourceGroupNextOptionalParams, + VirtualMachineTemplatesListByResourceGroupOptionalParams, + VirtualMachineTemplatesCreateOptionalParams, + VirtualMachineTemplatesCreateResponse, + VirtualMachineTemplatesGetOptionalParams, + VirtualMachineTemplatesGetResponse, + VirtualMachineTemplatesUpdateOptionalParams, + VirtualMachineTemplatesUpdateResponse, + VirtualMachineTemplatesDeleteOptionalParams, + VirtualMachineTemplatesListResponse, + VirtualMachineTemplatesListByResourceGroupResponse, + VirtualMachineTemplatesListNextResponse, + VirtualMachineTemplatesListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing VirtualMachineTemplates operations. */ +export class VirtualMachineTemplatesImpl implements VirtualMachineTemplates { + private readonly client: AzureArcVMwareManagementServiceAPI; + + /** + * Initialize a new instance of the class VirtualMachineTemplates class. + * @param client Reference to the service client + */ + constructor(client: AzureArcVMwareManagementServiceAPI) { + this.client = client; + } + + /** + * List of virtualMachineTemplates in a subscription. + * @param options The options parameters. + */ + public list( + options?: VirtualMachineTemplatesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: VirtualMachineTemplatesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: VirtualMachineTemplatesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * List of virtualMachineTemplates in a resource group. + * @param resourceGroupName The Resource Group Name. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: VirtualMachineTemplatesListByResourceGroupOptionalParams + ): 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?: VirtualMachineTemplatesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: VirtualMachineTemplatesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Create Or Update virtual machine template. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineTemplateName Name of the virtual machine template resource. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + virtualMachineTemplateName: string, + options?: VirtualMachineTemplatesCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VirtualMachineTemplatesCreateResponse + > + > { + 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, virtualMachineTemplateName, options }, + createOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Create Or Update virtual machine template. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineTemplateName Name of the virtual machine template resource. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + virtualMachineTemplateName: string, + options?: VirtualMachineTemplatesCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + virtualMachineTemplateName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Implements virtual machine template GET method. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineTemplateName Name of the virtual machine template resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + virtualMachineTemplateName: string, + options?: VirtualMachineTemplatesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, virtualMachineTemplateName, options }, + getOperationSpec + ); + } + + /** + * API to update certain properties of the virtual machine template resource. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineTemplateName Name of the virtual machine template resource. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + virtualMachineTemplateName: string, + options?: VirtualMachineTemplatesUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, virtualMachineTemplateName, options }, + updateOperationSpec + ); + } + + /** + * Implements virtual machine template DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineTemplateName Name of the virtual machine template resource. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + virtualMachineTemplateName: string, + options?: VirtualMachineTemplatesDeleteOptionalParams + ): 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, virtualMachineTemplateName, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Implements virtual machine template DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineTemplateName Name of the virtual machine template resource. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + virtualMachineTemplateName: string, + options?: VirtualMachineTemplatesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + virtualMachineTemplateName, + options + ); + return poller.pollUntilDone(); + } + + /** + * List of virtualMachineTemplates in a subscription. + * @param options The options parameters. + */ + private _list( + options?: VirtualMachineTemplatesListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * List of virtualMachineTemplates in a resource group. + * @param resourceGroupName The Resource Group Name. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: VirtualMachineTemplatesListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: VirtualMachineTemplatesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The Resource Group Name. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: VirtualMachineTemplatesListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.VirtualMachineTemplate + }, + 201: { + bodyMapper: Mappers.VirtualMachineTemplate + }, + 202: { + bodyMapper: Mappers.VirtualMachineTemplate + }, + 204: { + bodyMapper: Mappers.VirtualMachineTemplate + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body9, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineTemplateName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualMachineTemplate + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineTemplateName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.VirtualMachineTemplate + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineTemplateName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.force], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineTemplateName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualMachineTemplatesList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualMachineTemplatesList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualMachineTemplatesList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualMachineTemplatesList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operations/virtualMachines.ts b/sdk/connectedvmware/arm-connectedvmware/src/operations/virtualMachines.ts new file mode 100644 index 000000000000..399b349e02ef --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operations/virtualMachines.ts @@ -0,0 +1,1237 @@ +/* + * 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 { VirtualMachines } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureArcVMwareManagementServiceAPI } from "../azureArcVMwareManagementServiceAPI"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + VirtualMachine, + VirtualMachinesListNextOptionalParams, + VirtualMachinesListOptionalParams, + VirtualMachinesListByResourceGroupNextOptionalParams, + VirtualMachinesListByResourceGroupOptionalParams, + VirtualMachinesAssessPatchesOptionalParams, + VirtualMachinesAssessPatchesResponse, + VirtualMachineInstallPatchesParameters, + VirtualMachinesInstallPatchesOptionalParams, + VirtualMachinesInstallPatchesResponse, + VirtualMachinesCreateOptionalParams, + VirtualMachinesCreateResponse, + VirtualMachinesGetOptionalParams, + VirtualMachinesGetResponse, + VirtualMachinesUpdateOptionalParams, + VirtualMachinesUpdateResponse, + VirtualMachinesDeleteOptionalParams, + VirtualMachinesStopOptionalParams, + VirtualMachinesStartOptionalParams, + VirtualMachinesRestartOptionalParams, + VirtualMachinesListResponse, + VirtualMachinesListByResourceGroupResponse, + VirtualMachinesListNextResponse, + VirtualMachinesListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing VirtualMachines operations. */ +export class VirtualMachinesImpl implements VirtualMachines { + private readonly client: AzureArcVMwareManagementServiceAPI; + + /** + * Initialize a new instance of the class VirtualMachines class. + * @param client Reference to the service client + */ + constructor(client: AzureArcVMwareManagementServiceAPI) { + this.client = client; + } + + /** + * List of virtualMachines in a subscription. + * @param options The options parameters. + */ + public list( + options?: VirtualMachinesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: VirtualMachinesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: VirtualMachinesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * List of virtualMachines in a resource group. + * @param resourceGroupName The Resource Group Name. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: VirtualMachinesListByResourceGroupOptionalParams + ): 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?: VirtualMachinesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: VirtualMachinesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * The operation to assess patches on a vSphere VMware machine identity in Azure. + * @param resourceGroupName The name of the resource group. + * @param name The name of the vSphere VMware machine. + * @param options The options parameters. + */ + async beginAssessPatches( + resourceGroupName: string, + name: string, + options?: VirtualMachinesAssessPatchesOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VirtualMachinesAssessPatchesResponse + > + > { + 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, name, options }, + assessPatchesOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * The operation to assess patches on a vSphere VMware machine identity in Azure. + * @param resourceGroupName The name of the resource group. + * @param name The name of the vSphere VMware machine. + * @param options The options parameters. + */ + async beginAssessPatchesAndWait( + resourceGroupName: string, + name: string, + options?: VirtualMachinesAssessPatchesOptionalParams + ): Promise { + const poller = await this.beginAssessPatches( + resourceGroupName, + name, + options + ); + return poller.pollUntilDone(); + } + + /** + * The operation to install patches on a vSphere VMware machine identity in Azure. + * @param resourceGroupName The name of the resource group. + * @param name The name of the vSphere VMware machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API + * @param options The options parameters. + */ + async beginInstallPatches( + resourceGroupName: string, + name: string, + installPatchesInput: VirtualMachineInstallPatchesParameters, + options?: VirtualMachinesInstallPatchesOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VirtualMachinesInstallPatchesResponse + > + > { + 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, name, installPatchesInput, options }, + installPatchesOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * The operation to install patches on a vSphere VMware machine identity in Azure. + * @param resourceGroupName The name of the resource group. + * @param name The name of the vSphere VMware machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API + * @param options The options parameters. + */ + async beginInstallPatchesAndWait( + resourceGroupName: string, + name: string, + installPatchesInput: VirtualMachineInstallPatchesParameters, + options?: VirtualMachinesInstallPatchesOptionalParams + ): Promise { + const poller = await this.beginInstallPatches( + resourceGroupName, + name, + installPatchesInput, + options + ); + return poller.pollUntilDone(); + } + + /** + * Create Or Update virtual machine. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the virtual machine resource. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VirtualMachinesCreateResponse + > + > { + 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, virtualMachineName, options }, + createOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Create Or Update virtual machine. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the virtual machine resource. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + virtualMachineName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Implements virtual machine GET method. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the virtual machine resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, virtualMachineName, options }, + getOperationSpec + ); + } + + /** + * API to update certain properties of the virtual machine resource. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the virtual machine resource. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VirtualMachinesUpdateResponse + > + > { + 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, virtualMachineName, options }, + updateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * API to update certain properties of the virtual machine resource. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the virtual machine resource. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + virtualMachineName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Implements virtual machine DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the virtual machine resource. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesDeleteOptionalParams + ): 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, virtualMachineName, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Implements virtual machine DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the virtual machine resource. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + virtualMachineName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Stop virtual machine. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the virtual machine resource. + * @param options The options parameters. + */ + async beginStop( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesStopOptionalParams + ): 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, virtualMachineName, options }, + stopOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Stop virtual machine. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the virtual machine resource. + * @param options The options parameters. + */ + async beginStopAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesStopOptionalParams + ): Promise { + const poller = await this.beginStop( + resourceGroupName, + virtualMachineName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Start virtual machine. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the virtual machine resource. + * @param options The options parameters. + */ + async beginStart( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesStartOptionalParams + ): 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, virtualMachineName, options }, + startOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Start virtual machine. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the virtual machine resource. + * @param options The options parameters. + */ + async beginStartAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesStartOptionalParams + ): Promise { + const poller = await this.beginStart( + resourceGroupName, + virtualMachineName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Restart virtual machine. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the virtual machine resource. + * @param options The options parameters. + */ + async beginRestart( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesRestartOptionalParams + ): 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, virtualMachineName, options }, + restartOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Restart virtual machine. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the virtual machine resource. + * @param options The options parameters. + */ + async beginRestartAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesRestartOptionalParams + ): Promise { + const poller = await this.beginRestart( + resourceGroupName, + virtualMachineName, + options + ); + return poller.pollUntilDone(); + } + + /** + * List of virtualMachines in a subscription. + * @param options The options parameters. + */ + private _list( + options?: VirtualMachinesListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * List of virtualMachines in a resource group. + * @param resourceGroupName The Resource Group Name. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: VirtualMachinesListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: VirtualMachinesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The Resource Group Name. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: VirtualMachinesListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const assessPatchesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/assessPatches", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.VirtualMachineAssessPatchesResult + }, + 201: { + bodyMapper: Mappers.VirtualMachineAssessPatchesResult + }, + 202: { + bodyMapper: Mappers.VirtualMachineAssessPatchesResult + }, + 204: { + bodyMapper: Mappers.VirtualMachineAssessPatchesResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.name + ], + headerParameters: [Parameters.accept], + serializer +}; +const installPatchesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/installPatches", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.VirtualMachineInstallPatchesResult + }, + 201: { + bodyMapper: Mappers.VirtualMachineInstallPatchesResult + }, + 202: { + bodyMapper: Mappers.VirtualMachineInstallPatchesResult + }, + 204: { + bodyMapper: Mappers.VirtualMachineInstallPatchesResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.installPatchesInput, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.name + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.VirtualMachine + }, + 201: { + bodyMapper: Mappers.VirtualMachine + }, + 202: { + bodyMapper: Mappers.VirtualMachine + }, + 204: { + bodyMapper: Mappers.VirtualMachine + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualMachine + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.VirtualMachine + }, + 201: { + bodyMapper: Mappers.VirtualMachine + }, + 202: { + bodyMapper: Mappers.VirtualMachine + }, + 204: { + bodyMapper: Mappers.VirtualMachine + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.force, Parameters.retain], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const stopOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/stop", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const startOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/start", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const restartOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/restart", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualMachinesList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualMachinesList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualMachinesList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualMachinesList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operations/virtualNetworks.ts b/sdk/connectedvmware/arm-connectedvmware/src/operations/virtualNetworks.ts new file mode 100644 index 000000000000..5d07ef7ced5c --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operations/virtualNetworks.ts @@ -0,0 +1,588 @@ +/* + * 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 { VirtualNetworks } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureArcVMwareManagementServiceAPI } from "../azureArcVMwareManagementServiceAPI"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + VirtualNetwork, + VirtualNetworksListNextOptionalParams, + VirtualNetworksListOptionalParams, + VirtualNetworksListByResourceGroupNextOptionalParams, + VirtualNetworksListByResourceGroupOptionalParams, + VirtualNetworksCreateOptionalParams, + VirtualNetworksCreateResponse, + VirtualNetworksGetOptionalParams, + VirtualNetworksGetResponse, + VirtualNetworksUpdateOptionalParams, + VirtualNetworksUpdateResponse, + VirtualNetworksDeleteOptionalParams, + VirtualNetworksListResponse, + VirtualNetworksListByResourceGroupResponse, + VirtualNetworksListNextResponse, + VirtualNetworksListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing VirtualNetworks operations. */ +export class VirtualNetworksImpl implements VirtualNetworks { + private readonly client: AzureArcVMwareManagementServiceAPI; + + /** + * Initialize a new instance of the class VirtualNetworks class. + * @param client Reference to the service client + */ + constructor(client: AzureArcVMwareManagementServiceAPI) { + this.client = client; + } + + /** + * List of virtualNetworks in a subscription. + * @param options The options parameters. + */ + public list( + options?: VirtualNetworksListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: VirtualNetworksListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: VirtualNetworksListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * List of virtualNetworks in a resource group. + * @param resourceGroupName The Resource Group Name. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: VirtualNetworksListByResourceGroupOptionalParams + ): 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?: VirtualNetworksListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: VirtualNetworksListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Create Or Update virtual network. + * @param resourceGroupName The Resource Group Name. + * @param virtualNetworkName Name of the virtual network resource. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + virtualNetworkName: string, + options?: VirtualNetworksCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VirtualNetworksCreateResponse + > + > { + 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, virtualNetworkName, options }, + createOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Create Or Update virtual network. + * @param resourceGroupName The Resource Group Name. + * @param virtualNetworkName Name of the virtual network resource. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + virtualNetworkName: string, + options?: VirtualNetworksCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + virtualNetworkName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Implements virtual network GET method. + * @param resourceGroupName The Resource Group Name. + * @param virtualNetworkName Name of the virtual network resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + virtualNetworkName: string, + options?: VirtualNetworksGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, virtualNetworkName, options }, + getOperationSpec + ); + } + + /** + * API to update certain properties of the virtual network resource. + * @param resourceGroupName The Resource Group Name. + * @param virtualNetworkName Name of the virtual network resource. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + virtualNetworkName: string, + options?: VirtualNetworksUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, virtualNetworkName, options }, + updateOperationSpec + ); + } + + /** + * Implements virtual network DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param virtualNetworkName Name of the virtual network resource. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + virtualNetworkName: string, + options?: VirtualNetworksDeleteOptionalParams + ): 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, virtualNetworkName, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Implements virtual network DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param virtualNetworkName Name of the virtual network resource. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + virtualNetworkName: string, + options?: VirtualNetworksDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + virtualNetworkName, + options + ); + return poller.pollUntilDone(); + } + + /** + * List of virtualNetworks in a subscription. + * @param options The options parameters. + */ + private _list( + options?: VirtualNetworksListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * List of virtualNetworks in a resource group. + * @param resourceGroupName The Resource Group Name. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: VirtualNetworksListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: VirtualNetworksListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The Resource Group Name. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: VirtualNetworksListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.VirtualNetwork + }, + 201: { + bodyMapper: Mappers.VirtualNetwork + }, + 202: { + bodyMapper: Mappers.VirtualNetwork + }, + 204: { + bodyMapper: Mappers.VirtualNetwork + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body10, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualNetworkName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualNetwork + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualNetworkName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.VirtualNetwork + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualNetworkName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.force], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualNetworkName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualNetworksList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualNetworksList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualNetworksList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualNetworksList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/clusters.ts b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/clusters.ts new file mode 100644 index 000000000000..faf01b7f2f6d --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/clusters.ts @@ -0,0 +1,114 @@ +/* + * 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 { + Cluster, + ClustersListOptionalParams, + ClustersListByResourceGroupOptionalParams, + ClustersCreateOptionalParams, + ClustersCreateResponse, + ClustersGetOptionalParams, + ClustersGetResponse, + ClustersUpdateOptionalParams, + ClustersUpdateResponse, + ClustersDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a Clusters. */ +export interface Clusters { + /** + * List of clusters in a subscription. + * @param options The options parameters. + */ + list( + options?: ClustersListOptionalParams + ): PagedAsyncIterableIterator; + /** + * List of clusters in a resource group. + * @param resourceGroupName The Resource Group Name. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: ClustersListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create Or Update cluster. + * @param resourceGroupName The Resource Group Name. + * @param clusterName Name of the cluster. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + clusterName: string, + options?: ClustersCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ClustersCreateResponse + > + >; + /** + * Create Or Update cluster. + * @param resourceGroupName The Resource Group Name. + * @param clusterName Name of the cluster. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + clusterName: string, + options?: ClustersCreateOptionalParams + ): Promise; + /** + * Implements cluster GET method. + * @param resourceGroupName The Resource Group Name. + * @param clusterName Name of the cluster. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + clusterName: string, + options?: ClustersGetOptionalParams + ): Promise; + /** + * API to update certain properties of the cluster resource. + * @param resourceGroupName The Resource Group Name. + * @param clusterName Name of the cluster. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + clusterName: string, + options?: ClustersUpdateOptionalParams + ): Promise; + /** + * Implements cluster DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param clusterName Name of the cluster. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + clusterName: string, + options?: ClustersDeleteOptionalParams + ): Promise, void>>; + /** + * Implements cluster DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param clusterName Name of the cluster. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + clusterName: string, + options?: ClustersDeleteOptionalParams + ): Promise; +} diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/datastores.ts b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/datastores.ts new file mode 100644 index 000000000000..a1a38711b1e2 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/datastores.ts @@ -0,0 +1,114 @@ +/* + * 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 { + Datastore, + DatastoresListOptionalParams, + DatastoresListByResourceGroupOptionalParams, + DatastoresCreateOptionalParams, + DatastoresCreateResponse, + DatastoresGetOptionalParams, + DatastoresGetResponse, + DatastoresUpdateOptionalParams, + DatastoresUpdateResponse, + DatastoresDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a Datastores. */ +export interface Datastores { + /** + * List of datastores in a subscription. + * @param options The options parameters. + */ + list( + options?: DatastoresListOptionalParams + ): PagedAsyncIterableIterator; + /** + * List of datastores in a resource group. + * @param resourceGroupName The Resource Group Name. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: DatastoresListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create Or Update datastore. + * @param resourceGroupName The Resource Group Name. + * @param datastoreName Name of the datastore. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + datastoreName: string, + options?: DatastoresCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DatastoresCreateResponse + > + >; + /** + * Create Or Update datastore. + * @param resourceGroupName The Resource Group Name. + * @param datastoreName Name of the datastore. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + datastoreName: string, + options?: DatastoresCreateOptionalParams + ): Promise; + /** + * Implements datastore GET method. + * @param resourceGroupName The Resource Group Name. + * @param datastoreName Name of the datastore. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + datastoreName: string, + options?: DatastoresGetOptionalParams + ): Promise; + /** + * API to update certain properties of the datastore resource. + * @param resourceGroupName The Resource Group Name. + * @param datastoreName Name of the datastore. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + datastoreName: string, + options?: DatastoresUpdateOptionalParams + ): Promise; + /** + * Implements datastore DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param datastoreName Name of the datastore. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + datastoreName: string, + options?: DatastoresDeleteOptionalParams + ): Promise, void>>; + /** + * Implements datastore DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param datastoreName Name of the datastore. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + datastoreName: string, + options?: DatastoresDeleteOptionalParams + ): Promise; +} diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/guestAgents.ts b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/guestAgents.ts new file mode 100644 index 000000000000..d6119b3a49c4 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/guestAgents.ts @@ -0,0 +1,105 @@ +/* + * 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 { + GuestAgent, + GuestAgentsListByVmOptionalParams, + GuestAgentsCreateOptionalParams, + GuestAgentsCreateResponse, + GuestAgentsGetOptionalParams, + GuestAgentsGetResponse, + GuestAgentsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a GuestAgents. */ +export interface GuestAgents { + /** + * Returns the list of GuestAgent of the given vm. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the vm. + * @param options The options parameters. + */ + listByVm( + resourceGroupName: string, + virtualMachineName: string, + options?: GuestAgentsListByVmOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create Or Update GuestAgent. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the vm. + * @param name Name of the guestAgents. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + virtualMachineName: string, + name: string, + options?: GuestAgentsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + GuestAgentsCreateResponse + > + >; + /** + * Create Or Update GuestAgent. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the vm. + * @param name Name of the guestAgents. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + virtualMachineName: string, + name: string, + options?: GuestAgentsCreateOptionalParams + ): Promise; + /** + * Implements GuestAgent GET method. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the vm. + * @param name Name of the GuestAgent. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + virtualMachineName: string, + name: string, + options?: GuestAgentsGetOptionalParams + ): Promise; + /** + * Implements GuestAgent DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the vm. + * @param name Name of the GuestAgent. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + virtualMachineName: string, + name: string, + options?: GuestAgentsDeleteOptionalParams + ): Promise, void>>; + /** + * Implements GuestAgent DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the vm. + * @param name Name of the GuestAgent. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + virtualMachineName: string, + name: string, + options?: GuestAgentsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/hosts.ts b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/hosts.ts new file mode 100644 index 000000000000..101dc6a8237b --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/hosts.ts @@ -0,0 +1,109 @@ +/* + * 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 { + Host, + HostsListOptionalParams, + HostsListByResourceGroupOptionalParams, + HostsCreateOptionalParams, + HostsCreateResponse, + HostsGetOptionalParams, + HostsGetResponse, + HostsUpdateOptionalParams, + HostsUpdateResponse, + HostsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a Hosts. */ +export interface Hosts { + /** + * List of hosts in a subscription. + * @param options The options parameters. + */ + list(options?: HostsListOptionalParams): PagedAsyncIterableIterator; + /** + * List of hosts in a resource group. + * @param resourceGroupName The Resource Group Name. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: HostsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create Or Update host. + * @param resourceGroupName The Resource Group Name. + * @param hostName Name of the host. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + hostName: string, + options?: HostsCreateOptionalParams + ): Promise< + PollerLike, HostsCreateResponse> + >; + /** + * Create Or Update host. + * @param resourceGroupName The Resource Group Name. + * @param hostName Name of the host. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + hostName: string, + options?: HostsCreateOptionalParams + ): Promise; + /** + * Implements host GET method. + * @param resourceGroupName The Resource Group Name. + * @param hostName Name of the host. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + hostName: string, + options?: HostsGetOptionalParams + ): Promise; + /** + * API to update certain properties of the host resource. + * @param resourceGroupName The Resource Group Name. + * @param hostName Name of the host. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + hostName: string, + options?: HostsUpdateOptionalParams + ): Promise; + /** + * Implements host DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param hostName Name of the host. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + hostName: string, + options?: HostsDeleteOptionalParams + ): Promise, void>>; + /** + * Implements host DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param hostName Name of the host. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + hostName: string, + options?: HostsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/hybridIdentityMetadataOperations.ts b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/hybridIdentityMetadataOperations.ts new file mode 100644 index 000000000000..899c06efe1bf --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/hybridIdentityMetadataOperations.ts @@ -0,0 +1,73 @@ +/* + * 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 { + HybridIdentityMetadata, + HybridIdentityMetadataListByVmOptionalParams, + HybridIdentityMetadataCreateOptionalParams, + HybridIdentityMetadataCreateResponse, + HybridIdentityMetadataGetOptionalParams, + HybridIdentityMetadataGetResponse, + HybridIdentityMetadataDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a HybridIdentityMetadataOperations. */ +export interface HybridIdentityMetadataOperations { + /** + * Returns the list of HybridIdentityMetadata of the given vm. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the vm. + * @param options The options parameters. + */ + listByVm( + resourceGroupName: string, + virtualMachineName: string, + options?: HybridIdentityMetadataListByVmOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create Or Update HybridIdentityMetadata. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the vm. + * @param metadataName Name of the hybridIdentityMetadata. + * @param options The options parameters. + */ + create( + resourceGroupName: string, + virtualMachineName: string, + metadataName: string, + options?: HybridIdentityMetadataCreateOptionalParams + ): Promise; + /** + * Implements HybridIdentityMetadata GET method. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the vm. + * @param metadataName Name of the HybridIdentityMetadata. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + virtualMachineName: string, + metadataName: string, + options?: HybridIdentityMetadataGetOptionalParams + ): Promise; + /** + * Implements HybridIdentityMetadata DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the vm. + * @param metadataName Name of the HybridIdentityMetadata. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + virtualMachineName: string, + metadataName: string, + options?: HybridIdentityMetadataDeleteOptionalParams + ): Promise; +} diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/index.ts b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..5adaf861d073 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/index.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. + */ + +export * from "./operations"; +export * from "./virtualMachines"; +export * from "./resourcePools"; +export * from "./clusters"; +export * from "./hosts"; +export * from "./datastores"; +export * from "./vCenters"; +export * from "./virtualMachineTemplates"; +export * from "./virtualNetworks"; +export * from "./inventoryItems"; +export * from "./hybridIdentityMetadataOperations"; +export * from "./machineExtensions"; +export * from "./guestAgents"; diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/inventoryItems.ts b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/inventoryItems.ts new file mode 100644 index 000000000000..7614f36f0ee4 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/inventoryItems.ts @@ -0,0 +1,73 @@ +/* + * 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 { + InventoryItem, + InventoryItemsListByVCenterOptionalParams, + InventoryItemsCreateOptionalParams, + InventoryItemsCreateResponse, + InventoryItemsGetOptionalParams, + InventoryItemsGetResponse, + InventoryItemsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a InventoryItems. */ +export interface InventoryItems { + /** + * Returns the list of inventoryItems of the given vCenter. + * @param resourceGroupName The Resource Group Name. + * @param vcenterName Name of the vCenter. + * @param options The options parameters. + */ + listByVCenter( + resourceGroupName: string, + vcenterName: string, + options?: InventoryItemsListByVCenterOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create Or Update InventoryItem. + * @param resourceGroupName The Resource Group Name. + * @param vcenterName Name of the vCenter. + * @param inventoryItemName Name of the inventoryItem. + * @param options The options parameters. + */ + create( + resourceGroupName: string, + vcenterName: string, + inventoryItemName: string, + options?: InventoryItemsCreateOptionalParams + ): Promise; + /** + * Implements InventoryItem GET method. + * @param resourceGroupName The Resource Group Name. + * @param vcenterName Name of the vCenter. + * @param inventoryItemName Name of the inventoryItem. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + vcenterName: string, + inventoryItemName: string, + options?: InventoryItemsGetOptionalParams + ): Promise; + /** + * Implements inventoryItem DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param vcenterName Name of the vCenter. + * @param inventoryItemName Name of the inventoryItem. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + vcenterName: string, + inventoryItemName: string, + options?: InventoryItemsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/machineExtensions.ts b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/machineExtensions.ts new file mode 100644 index 000000000000..c7d8fa7b6b61 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/machineExtensions.ts @@ -0,0 +1,147 @@ +/* + * 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 { + MachineExtension, + MachineExtensionsListOptionalParams, + MachineExtensionsCreateOrUpdateOptionalParams, + MachineExtensionsCreateOrUpdateResponse, + MachineExtensionUpdate, + MachineExtensionsUpdateOptionalParams, + MachineExtensionsUpdateResponse, + MachineExtensionsDeleteOptionalParams, + MachineExtensionsGetOptionalParams, + MachineExtensionsGetResponse +} from "../models"; + +/// +/** Interface representing a MachineExtensions. */ +export interface MachineExtensions { + /** + * The operation to get all extensions of a non-Azure machine + * @param resourceGroupName The Resource Group Name. + * @param name The name of the machine containing the extension. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + name: string, + options?: MachineExtensionsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * The operation to create or update the extension. + * @param resourceGroupName The Resource Group Name. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + name: string, + extensionName: string, + extensionParameters: MachineExtension, + options?: MachineExtensionsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + MachineExtensionsCreateOrUpdateResponse + > + >; + /** + * The operation to create or update the extension. + * @param resourceGroupName The Resource Group Name. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + name: string, + extensionName: string, + extensionParameters: MachineExtension, + options?: MachineExtensionsCreateOrUpdateOptionalParams + ): Promise; + /** + * The operation to update the extension. + * @param resourceGroupName The Resource Group Name. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + name: string, + extensionName: string, + extensionParameters: MachineExtensionUpdate, + options?: MachineExtensionsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + MachineExtensionsUpdateResponse + > + >; + /** + * The operation to update the extension. + * @param resourceGroupName The Resource Group Name. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + name: string, + extensionName: string, + extensionParameters: MachineExtensionUpdate, + options?: MachineExtensionsUpdateOptionalParams + ): Promise; + /** + * The operation to delete the extension. + * @param resourceGroupName The Resource Group Name. + * @param name The name of the machine where the extension should be deleted. + * @param extensionName The name of the machine extension. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + name: string, + extensionName: string, + options?: MachineExtensionsDeleteOptionalParams + ): Promise, void>>; + /** + * The operation to delete the extension. + * @param resourceGroupName The Resource Group Name. + * @param name The name of the machine where the extension should be deleted. + * @param extensionName The name of the machine extension. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + name: string, + extensionName: string, + options?: MachineExtensionsDeleteOptionalParams + ): Promise; + /** + * The operation to get the extension. + * @param resourceGroupName The Resource Group Name. + * @param name The name of the machine containing the extension. + * @param extensionName The name of the machine extension. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + name: string, + extensionName: string, + options?: MachineExtensionsGetOptionalParams + ): Promise; +} diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/operations.ts b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..b0b35b8f194b --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/operations.ts @@ -0,0 +1,22 @@ +/* + * 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 { Operation, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * Returns list of all operations. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/resourcePools.ts b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/resourcePools.ts new file mode 100644 index 000000000000..f38af51a4768 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/resourcePools.ts @@ -0,0 +1,114 @@ +/* + * 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 { + ResourcePool, + ResourcePoolsListOptionalParams, + ResourcePoolsListByResourceGroupOptionalParams, + ResourcePoolsCreateOptionalParams, + ResourcePoolsCreateResponse, + ResourcePoolsGetOptionalParams, + ResourcePoolsGetResponse, + ResourcePoolsUpdateOptionalParams, + ResourcePoolsUpdateResponse, + ResourcePoolsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a ResourcePools. */ +export interface ResourcePools { + /** + * List of resourcePools in a subscription. + * @param options The options parameters. + */ + list( + options?: ResourcePoolsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * List of resourcePools in a resource group. + * @param resourceGroupName The Resource Group Name. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: ResourcePoolsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create Or Update resourcePool. + * @param resourceGroupName The Resource Group Name. + * @param resourcePoolName Name of the resourcePool. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + resourcePoolName: string, + options?: ResourcePoolsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ResourcePoolsCreateResponse + > + >; + /** + * Create Or Update resourcePool. + * @param resourceGroupName The Resource Group Name. + * @param resourcePoolName Name of the resourcePool. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + resourcePoolName: string, + options?: ResourcePoolsCreateOptionalParams + ): Promise; + /** + * Implements resourcePool GET method. + * @param resourceGroupName The Resource Group Name. + * @param resourcePoolName Name of the resourcePool. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourcePoolName: string, + options?: ResourcePoolsGetOptionalParams + ): Promise; + /** + * API to update certain properties of the resourcePool resource. + * @param resourceGroupName The Resource Group Name. + * @param resourcePoolName Name of the resourcePool. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + resourcePoolName: string, + options?: ResourcePoolsUpdateOptionalParams + ): Promise; + /** + * Implements resourcePool DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param resourcePoolName Name of the resourcePool. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + resourcePoolName: string, + options?: ResourcePoolsDeleteOptionalParams + ): Promise, void>>; + /** + * Implements resourcePool DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param resourcePoolName Name of the resourcePool. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + resourcePoolName: string, + options?: ResourcePoolsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/vCenters.ts b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/vCenters.ts new file mode 100644 index 000000000000..9e64ad5f4f79 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/vCenters.ts @@ -0,0 +1,114 @@ +/* + * 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 { + VCenter, + VCentersListOptionalParams, + VCentersListByResourceGroupOptionalParams, + VCentersCreateOptionalParams, + VCentersCreateResponse, + VCentersGetOptionalParams, + VCentersGetResponse, + VCentersUpdateOptionalParams, + VCentersUpdateResponse, + VCentersDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a VCenters. */ +export interface VCenters { + /** + * List of vCenters in a subscription. + * @param options The options parameters. + */ + list( + options?: VCentersListOptionalParams + ): PagedAsyncIterableIterator; + /** + * List of vCenters in a resource group. + * @param resourceGroupName The Resource Group Name. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: VCentersListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create Or Update vCenter. + * @param resourceGroupName The Resource Group Name. + * @param vcenterName Name of the vCenter. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + vcenterName: string, + options?: VCentersCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VCentersCreateResponse + > + >; + /** + * Create Or Update vCenter. + * @param resourceGroupName The Resource Group Name. + * @param vcenterName Name of the vCenter. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + vcenterName: string, + options?: VCentersCreateOptionalParams + ): Promise; + /** + * Implements vCenter GET method. + * @param resourceGroupName The Resource Group Name. + * @param vcenterName Name of the vCenter. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + vcenterName: string, + options?: VCentersGetOptionalParams + ): Promise; + /** + * API to update certain properties of the vCenter resource. + * @param resourceGroupName The Resource Group Name. + * @param vcenterName Name of the vCenter. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + vcenterName: string, + options?: VCentersUpdateOptionalParams + ): Promise; + /** + * Implements vCenter DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param vcenterName Name of the vCenter. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + vcenterName: string, + options?: VCentersDeleteOptionalParams + ): Promise, void>>; + /** + * Implements vCenter DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param vcenterName Name of the vCenter. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + vcenterName: string, + options?: VCentersDeleteOptionalParams + ): Promise; +} diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/virtualMachineTemplates.ts b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/virtualMachineTemplates.ts new file mode 100644 index 000000000000..3ede0b5755fd --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/virtualMachineTemplates.ts @@ -0,0 +1,114 @@ +/* + * 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 { + VirtualMachineTemplate, + VirtualMachineTemplatesListOptionalParams, + VirtualMachineTemplatesListByResourceGroupOptionalParams, + VirtualMachineTemplatesCreateOptionalParams, + VirtualMachineTemplatesCreateResponse, + VirtualMachineTemplatesGetOptionalParams, + VirtualMachineTemplatesGetResponse, + VirtualMachineTemplatesUpdateOptionalParams, + VirtualMachineTemplatesUpdateResponse, + VirtualMachineTemplatesDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a VirtualMachineTemplates. */ +export interface VirtualMachineTemplates { + /** + * List of virtualMachineTemplates in a subscription. + * @param options The options parameters. + */ + list( + options?: VirtualMachineTemplatesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * List of virtualMachineTemplates in a resource group. + * @param resourceGroupName The Resource Group Name. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: VirtualMachineTemplatesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create Or Update virtual machine template. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineTemplateName Name of the virtual machine template resource. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + virtualMachineTemplateName: string, + options?: VirtualMachineTemplatesCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VirtualMachineTemplatesCreateResponse + > + >; + /** + * Create Or Update virtual machine template. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineTemplateName Name of the virtual machine template resource. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + virtualMachineTemplateName: string, + options?: VirtualMachineTemplatesCreateOptionalParams + ): Promise; + /** + * Implements virtual machine template GET method. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineTemplateName Name of the virtual machine template resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + virtualMachineTemplateName: string, + options?: VirtualMachineTemplatesGetOptionalParams + ): Promise; + /** + * API to update certain properties of the virtual machine template resource. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineTemplateName Name of the virtual machine template resource. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + virtualMachineTemplateName: string, + options?: VirtualMachineTemplatesUpdateOptionalParams + ): Promise; + /** + * Implements virtual machine template DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineTemplateName Name of the virtual machine template resource. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + virtualMachineTemplateName: string, + options?: VirtualMachineTemplatesDeleteOptionalParams + ): Promise, void>>; + /** + * Implements virtual machine template DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineTemplateName Name of the virtual machine template resource. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + virtualMachineTemplateName: string, + options?: VirtualMachineTemplatesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/virtualMachines.ts b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/virtualMachines.ts new file mode 100644 index 000000000000..198d86b32801 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/virtualMachines.ts @@ -0,0 +1,262 @@ +/* + * 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 { + VirtualMachine, + VirtualMachinesListOptionalParams, + VirtualMachinesListByResourceGroupOptionalParams, + VirtualMachinesAssessPatchesOptionalParams, + VirtualMachinesAssessPatchesResponse, + VirtualMachineInstallPatchesParameters, + VirtualMachinesInstallPatchesOptionalParams, + VirtualMachinesInstallPatchesResponse, + VirtualMachinesCreateOptionalParams, + VirtualMachinesCreateResponse, + VirtualMachinesGetOptionalParams, + VirtualMachinesGetResponse, + VirtualMachinesUpdateOptionalParams, + VirtualMachinesUpdateResponse, + VirtualMachinesDeleteOptionalParams, + VirtualMachinesStopOptionalParams, + VirtualMachinesStartOptionalParams, + VirtualMachinesRestartOptionalParams +} from "../models"; + +/// +/** Interface representing a VirtualMachines. */ +export interface VirtualMachines { + /** + * List of virtualMachines in a subscription. + * @param options The options parameters. + */ + list( + options?: VirtualMachinesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * List of virtualMachines in a resource group. + * @param resourceGroupName The Resource Group Name. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: VirtualMachinesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * The operation to assess patches on a vSphere VMware machine identity in Azure. + * @param resourceGroupName The name of the resource group. + * @param name The name of the vSphere VMware machine. + * @param options The options parameters. + */ + beginAssessPatches( + resourceGroupName: string, + name: string, + options?: VirtualMachinesAssessPatchesOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VirtualMachinesAssessPatchesResponse + > + >; + /** + * The operation to assess patches on a vSphere VMware machine identity in Azure. + * @param resourceGroupName The name of the resource group. + * @param name The name of the vSphere VMware machine. + * @param options The options parameters. + */ + beginAssessPatchesAndWait( + resourceGroupName: string, + name: string, + options?: VirtualMachinesAssessPatchesOptionalParams + ): Promise; + /** + * The operation to install patches on a vSphere VMware machine identity in Azure. + * @param resourceGroupName The name of the resource group. + * @param name The name of the vSphere VMware machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API + * @param options The options parameters. + */ + beginInstallPatches( + resourceGroupName: string, + name: string, + installPatchesInput: VirtualMachineInstallPatchesParameters, + options?: VirtualMachinesInstallPatchesOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VirtualMachinesInstallPatchesResponse + > + >; + /** + * The operation to install patches on a vSphere VMware machine identity in Azure. + * @param resourceGroupName The name of the resource group. + * @param name The name of the vSphere VMware machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API + * @param options The options parameters. + */ + beginInstallPatchesAndWait( + resourceGroupName: string, + name: string, + installPatchesInput: VirtualMachineInstallPatchesParameters, + options?: VirtualMachinesInstallPatchesOptionalParams + ): Promise; + /** + * Create Or Update virtual machine. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the virtual machine resource. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VirtualMachinesCreateResponse + > + >; + /** + * Create Or Update virtual machine. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the virtual machine resource. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesCreateOptionalParams + ): Promise; + /** + * Implements virtual machine GET method. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the virtual machine resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesGetOptionalParams + ): Promise; + /** + * API to update certain properties of the virtual machine resource. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the virtual machine resource. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VirtualMachinesUpdateResponse + > + >; + /** + * API to update certain properties of the virtual machine resource. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the virtual machine resource. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesUpdateOptionalParams + ): Promise; + /** + * Implements virtual machine DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the virtual machine resource. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesDeleteOptionalParams + ): Promise, void>>; + /** + * Implements virtual machine DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the virtual machine resource. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesDeleteOptionalParams + ): Promise; + /** + * Stop virtual machine. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the virtual machine resource. + * @param options The options parameters. + */ + beginStop( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesStopOptionalParams + ): Promise, void>>; + /** + * Stop virtual machine. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the virtual machine resource. + * @param options The options parameters. + */ + beginStopAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesStopOptionalParams + ): Promise; + /** + * Start virtual machine. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the virtual machine resource. + * @param options The options parameters. + */ + beginStart( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesStartOptionalParams + ): Promise, void>>; + /** + * Start virtual machine. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the virtual machine resource. + * @param options The options parameters. + */ + beginStartAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesStartOptionalParams + ): Promise; + /** + * Restart virtual machine. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the virtual machine resource. + * @param options The options parameters. + */ + beginRestart( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesRestartOptionalParams + ): Promise, void>>; + /** + * Restart virtual machine. + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineName Name of the virtual machine resource. + * @param options The options parameters. + */ + beginRestartAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesRestartOptionalParams + ): Promise; +} diff --git a/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/virtualNetworks.ts b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/virtualNetworks.ts new file mode 100644 index 000000000000..a777b889ed4f --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/src/operationsInterfaces/virtualNetworks.ts @@ -0,0 +1,114 @@ +/* + * 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 { + VirtualNetwork, + VirtualNetworksListOptionalParams, + VirtualNetworksListByResourceGroupOptionalParams, + VirtualNetworksCreateOptionalParams, + VirtualNetworksCreateResponse, + VirtualNetworksGetOptionalParams, + VirtualNetworksGetResponse, + VirtualNetworksUpdateOptionalParams, + VirtualNetworksUpdateResponse, + VirtualNetworksDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a VirtualNetworks. */ +export interface VirtualNetworks { + /** + * List of virtualNetworks in a subscription. + * @param options The options parameters. + */ + list( + options?: VirtualNetworksListOptionalParams + ): PagedAsyncIterableIterator; + /** + * List of virtualNetworks in a resource group. + * @param resourceGroupName The Resource Group Name. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: VirtualNetworksListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create Or Update virtual network. + * @param resourceGroupName The Resource Group Name. + * @param virtualNetworkName Name of the virtual network resource. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + virtualNetworkName: string, + options?: VirtualNetworksCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VirtualNetworksCreateResponse + > + >; + /** + * Create Or Update virtual network. + * @param resourceGroupName The Resource Group Name. + * @param virtualNetworkName Name of the virtual network resource. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + virtualNetworkName: string, + options?: VirtualNetworksCreateOptionalParams + ): Promise; + /** + * Implements virtual network GET method. + * @param resourceGroupName The Resource Group Name. + * @param virtualNetworkName Name of the virtual network resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + virtualNetworkName: string, + options?: VirtualNetworksGetOptionalParams + ): Promise; + /** + * API to update certain properties of the virtual network resource. + * @param resourceGroupName The Resource Group Name. + * @param virtualNetworkName Name of the virtual network resource. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + virtualNetworkName: string, + options?: VirtualNetworksUpdateOptionalParams + ): Promise; + /** + * Implements virtual network DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param virtualNetworkName Name of the virtual network resource. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + virtualNetworkName: string, + options?: VirtualNetworksDeleteOptionalParams + ): Promise, void>>; + /** + * Implements virtual network DELETE method. + * @param resourceGroupName The Resource Group Name. + * @param virtualNetworkName Name of the virtual network resource. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + virtualNetworkName: string, + options?: VirtualNetworksDeleteOptionalParams + ): Promise; +} diff --git a/sdk/connectedvmware/arm-connectedvmware/test/sampleTest.ts b/sdk/connectedvmware/arm-connectedvmware/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * 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 { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + 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" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/connectedvmware/arm-connectedvmware/tsconfig.json b/sdk/connectedvmware/arm-connectedvmware/tsconfig.json new file mode 100644 index 000000000000..4a017261a66a --- /dev/null +++ b/sdk/connectedvmware/arm-connectedvmware/tsconfig.json @@ -0,0 +1,33 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "dom" + ], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true, + "paths": { + "@azure/arm-connectedvmware": [ + "./src/index" + ] + } + }, + "include": [ + "./src/**/*.ts", + "./test/**/*.ts", + "samples-dev/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/sdk/connectedvmware/ci.mgmt.yml b/sdk/connectedvmware/ci.mgmt.yml new file mode 100644 index 000000000000..bd3334da27d2 --- /dev/null +++ b/sdk/connectedvmware/ci.mgmt.yml @@ -0,0 +1,38 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/connectedvmware/arm-connectedvmware + - sdk/connectedvmware/ci.mgmt.yml + +pr: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/connectedvmware/arm-connectedvmware + - sdk/connectedvmware/ci.mgmt.yml + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: connectedvmware + Artifacts: + - name: azure-arm-connectedvmware + safeName: azurearmconnectedvmware + \ No newline at end of file