diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index ed826a7b8d14..3d37b30020c8 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -4303,6 +4303,28 @@ packages: vitest: 1.6.0(@types/node@18.19.43)(@vitest/browser@1.6.0) dev: false + /@vitest/browser@1.6.0(playwright@1.46.0)(vitest@1.6.0): + resolution: {integrity: sha512-3Wpp9h1hf++rRVPvoXevkdHybLhJVn7MwIMKMIh08tVaoDMmT6fnNhbP222Z48V9PptpYeA5zvH9Ct/ZcaAzmQ==} + peerDependencies: + playwright: '*' + safaridriver: '*' + vitest: 1.6.0 + webdriverio: '*' + peerDependenciesMeta: + playwright: + optional: true + safaridriver: + optional: true + webdriverio: + optional: true + dependencies: + '@vitest/utils': 1.6.0 + magic-string: 0.30.11 + playwright: 1.46.0 + sirv: 2.0.4 + vitest: 1.6.0(@types/node@18.19.43)(@vitest/browser@1.6.0) + dev: false + /@vitest/browser@2.0.5(playwright@1.45.3)(typescript@5.5.4)(vitest@2.0.5): resolution: {integrity: sha512-VbOYtu/6R3d7ASZREcrJmRY/sQuRFO9wMVsEDqfYbWiJRh2fDNi8CL1Csn7Ux31pOcPmmM5QvzFCMpiojvVh8g==} peerDependencies: @@ -18930,7 +18952,7 @@ packages: dev: false file:projects/arm-scvmm.tgz: - resolution: {integrity: sha512-Ww4OxXaLiQyIXp5EZLfQSG+T/l/3cXm3KG8/T99zwwXdmwPII9/Wsv8SZmid0SMY6GDdb+8E9ZoHGVjC+/yrtA==, tarball: file:projects/arm-scvmm.tgz} + resolution: {integrity: sha512-K+CnI/r5T5EWwBcQvrlO31Wg8HlPqIyU3uw/+b66GnIUSZNysRRJGeQUHmb7nmSbOL0VF5jKfw+CBk/Cz81LdA==, tarball: file:projects/arm-scvmm.tgz} name: '@rush-temp/arm-scvmm' version: 0.0.0 dependencies: @@ -18943,21 +18965,38 @@ packages: '@types/chai': 4.3.17 '@types/mocha': 10.0.7 '@types/node': 18.19.43 + '@vitest/browser': 1.6.0(playwright@1.46.0)(vitest@1.6.0) + '@vitest/coverage-istanbul': 1.6.0(vitest@1.6.0) chai: 4.3.10 cross-env: 7.0.3 dotenv: 16.4.5 + eslint: 8.57.0 mkdirp: 3.0.1 mocha: 10.7.0 + playwright: 1.46.0 + prettier: 3.3.3 rimraf: 5.0.10 ts-node: 10.9.2(@types/node@18.19.43)(typescript@5.5.4) + tshy: 1.18.0 tslib: 2.6.3 tsx: 4.16.5 typescript: 5.5.4 uglify-js: 3.19.1 + vitest: 1.6.0(@types/node@18.19.43)(@vitest/browser@1.6.0) transitivePeerDependencies: - - '@swc/core' - - '@swc/wasm' + - '@edge-runtime/vm' + - '@vitest/ui' + - happy-dom + - jsdom + - less + - lightningcss + - safaridriver + - sass + - stylus + - sugarss - supports-color + - terser + - webdriverio dev: false file:projects/arm-search.tgz: @@ -25516,7 +25555,7 @@ packages: '@types/express-serve-static-core': 4.19.5 '@types/jsonwebtoken': 9.0.6 '@types/node': 18.19.43 - '@vitest/browser': 1.6.0(playwright@1.45.3)(vitest@1.6.0) + '@vitest/browser': 1.6.0(playwright@1.46.0)(vitest@1.6.0) '@vitest/coverage-istanbul': 1.6.0(vitest@1.6.0) dotenv: 16.4.5 eslint: 8.57.0 diff --git a/sdk/scvmm/arm-scvmm/.eslintrc.json b/sdk/scvmm/arm-scvmm/.eslintrc.json new file mode 100644 index 000000000000..8793fba07e9d --- /dev/null +++ b/sdk/scvmm/arm-scvmm/.eslintrc.json @@ -0,0 +1,14 @@ +{ + "plugins": ["@azure/azure-sdk"], + "extends": ["plugin:@azure/azure-sdk/azure-sdk-base"], + "rules": { + "@azure/azure-sdk/ts-modules-only-named": "warn", + "@azure/azure-sdk/ts-apiextractor-json-types": "warn", + "@azure/azure-sdk/ts-package-json-types": "warn", + "@azure/azure-sdk/ts-package-json-engine-is-present": "warn", + "tsdoc/syntax": "warn", + "@azure/azure-sdk/ts-package-json-module": "off", + "@azure/azure-sdk/ts-package-json-files-required": "off", + "@azure/azure-sdk/ts-package-json-main-is-cjs": "off" + } +} diff --git a/sdk/scvmm/arm-scvmm/CHANGELOG.md b/sdk/scvmm/arm-scvmm/CHANGELOG.md index 5b01b392c183..13b68d5d05c3 100644 --- a/sdk/scvmm/arm-scvmm/CHANGELOG.md +++ b/sdk/scvmm/arm-scvmm/CHANGELOG.md @@ -1,15 +1,199 @@ -# Release History - -## 1.0.1 (Unreleased) - +## 1.0.0-beta.1 (2024-08-15) + ### Features Added -### Breaking Changes + - Added operation AvailabilitySetsOperations.createOrUpdate + - Added operation AvailabilitySetsOperations.delete + - Added operation AvailabilitySetsOperations.update + - Added operation CloudsOperations.createOrUpdate + - Added operation CloudsOperations.delete + - Added operation CloudsOperations.update + - Added operation GuestAgentsOperations.create + - Added operation VirtualMachineInstancesOperations.createCheckpoint + - Added operation VirtualMachineInstancesOperations.createOrUpdate + - Added operation VirtualMachineInstancesOperations.delete + - Added operation VirtualMachineInstancesOperations.deleteCheckpoint + - Added operation VirtualMachineInstancesOperations.restart + - Added operation VirtualMachineInstancesOperations.restoreCheckpoint + - Added operation VirtualMachineInstancesOperations.start + - Added operation VirtualMachineInstancesOperations.stop + - Added operation VirtualMachineInstancesOperations.update + - Added operation VirtualMachineTemplatesOperations.createOrUpdate + - Added operation VirtualMachineTemplatesOperations.delete + - Added operation VirtualMachineTemplatesOperations.update + - Added operation VirtualNetworksOperations.createOrUpdate + - Added operation VirtualNetworksOperations.delete + - Added operation VirtualNetworksOperations.update + - Added operation VmmServersOperations.createOrUpdate + - Added operation VmmServersOperations.delete + - Added operation VmmServersOperations.update + - Added Interface ExtensionResource + - Added Interface PagedAsyncIterableIterator + - Added Interface PageSettings + - Added Interface RestorePollerOptions + - Added Interface ScVmmClientOptionalParams + - Added Class ScVmmClient + - Added Type Alias ContinuablePage + - Added Type Alias ResourceProvisioningState + - Added Type Alias Versions + - Interface GuestAgentProperties has a new optional parameter privateLinkScopeResourceId + - Interface OsProfileForVmInstance has a new optional parameter domainName + - Interface OsProfileForVmInstance has a new optional parameter domainPassword + - Interface OsProfileForVmInstance has a new optional parameter domainUsername + - Interface OsProfileForVmInstance has a new optional parameter productKey + - Interface OsProfileForVmInstance has a new optional parameter runOnceCommands + - Interface OsProfileForVmInstance has a new optional parameter timezone + - Interface OsProfileForVmInstance has a new optional parameter workgroup + - Added Enum KnownResourceProvisioningState + - Enum KnownCreateDiffDisk has a new value "false" + - Enum KnownCreateDiffDisk has a new value "true" + - Enum KnownDeleteFromHost has a new value "false" + - Enum KnownDeleteFromHost has a new value "true" + - Enum KnownDynamicMemoryEnabled has a new value "false" + - Enum KnownDynamicMemoryEnabled has a new value "true" + - Enum KnownForceDelete has a new value "false" + - Enum KnownForceDelete has a new value "true" + - Enum KnownIsCustomizable has a new value "false" + - Enum KnownIsCustomizable has a new value "true" + - Enum KnownIsHighlyAvailable has a new value "false" + - Enum KnownIsHighlyAvailable has a new value "true" + - Enum KnownLimitCpuForMigration has a new value "false" + - Enum KnownLimitCpuForMigration has a new value "true" + - Enum KnownOrigin has a new value "user,system" + - Enum KnownOrigin has a new value system + - Enum KnownOrigin has a new value user + - Enum KnownProvisioningAction has a new value install + - Enum KnownProvisioningAction has a new value repair + - Enum KnownProvisioningAction has a new value uninstall + - Enum KnownSkipShutdown has a new value "false" + - Enum KnownSkipShutdown has a new value "true" + - Added function restorePoller -### Bugs Fixed - -### Other Changes +### Breaking Changes + - Removed operation AvailabilitySets.beginCreateOrUpdate + - Removed operation AvailabilitySets.beginCreateOrUpdateAndWait + - Removed operation AvailabilitySets.beginDelete + - Removed operation AvailabilitySets.beginDeleteAndWait + - Removed operation AvailabilitySets.beginUpdate + - Removed operation AvailabilitySets.beginUpdateAndWait + - Removed operation Clouds.beginCreateOrUpdate + - Removed operation Clouds.beginCreateOrUpdateAndWait + - Removed operation Clouds.beginDelete + - Removed operation Clouds.beginDeleteAndWait + - Removed operation Clouds.beginUpdate + - Removed operation Clouds.beginUpdateAndWait + - Removed operation GuestAgents.beginCreate + - Removed operation GuestAgents.beginCreateAndWait + - Removed operation VirtualMachineInstances.beginCreateCheckpoint + - Removed operation VirtualMachineInstances.beginCreateCheckpointAndWait + - Removed operation VirtualMachineInstances.beginCreateOrUpdate + - Removed operation VirtualMachineInstances.beginCreateOrUpdateAndWait + - Removed operation VirtualMachineInstances.beginDelete + - Removed operation VirtualMachineInstances.beginDeleteAndWait + - Removed operation VirtualMachineInstances.beginDeleteCheckpoint + - Removed operation VirtualMachineInstances.beginDeleteCheckpointAndWait + - Removed operation VirtualMachineInstances.beginRestart + - Removed operation VirtualMachineInstances.beginRestartAndWait + - Removed operation VirtualMachineInstances.beginRestoreCheckpoint + - Removed operation VirtualMachineInstances.beginRestoreCheckpointAndWait + - Removed operation VirtualMachineInstances.beginStart + - Removed operation VirtualMachineInstances.beginStartAndWait + - Removed operation VirtualMachineInstances.beginStop + - Removed operation VirtualMachineInstances.beginStopAndWait + - Removed operation VirtualMachineInstances.beginUpdate + - Removed operation VirtualMachineInstances.beginUpdateAndWait + - Removed operation VirtualMachineTemplates.beginCreateOrUpdate + - Removed operation VirtualMachineTemplates.beginCreateOrUpdateAndWait + - Removed operation VirtualMachineTemplates.beginDelete + - Removed operation VirtualMachineTemplates.beginDeleteAndWait + - Removed operation VirtualMachineTemplates.beginUpdate + - Removed operation VirtualMachineTemplates.beginUpdateAndWait + - Removed operation VirtualNetworks.beginCreateOrUpdate + - Removed operation VirtualNetworks.beginCreateOrUpdateAndWait + - Removed operation VirtualNetworks.beginDelete + - Removed operation VirtualNetworks.beginDeleteAndWait + - Removed operation VirtualNetworks.beginUpdate + - Removed operation VirtualNetworks.beginUpdateAndWait + - Removed operation VmmServers.beginCreateOrUpdate + - Removed operation VmmServers.beginCreateOrUpdateAndWait + - Removed operation VmmServers.beginDelete + - Removed operation VmmServers.beginDeleteAndWait + - Removed operation VmmServers.beginUpdate + - Removed operation VmmServers.beginUpdateAndWait + - Deleted Class ScVmm + - Interface AvailabilitySetsCreateOrUpdateOptionalParams no longer has parameter resumeFrom + - Interface AvailabilitySetsDeleteOptionalParams no longer has parameter resumeFrom + - Interface AvailabilitySetsUpdateOptionalParams no longer has parameter resumeFrom + - Interface CloudsCreateOrUpdateOptionalParams no longer has parameter resumeFrom + - Interface CloudsDeleteOptionalParams no longer has parameter resumeFrom + - Interface CloudsUpdateOptionalParams no longer has parameter resumeFrom + - Interface GuestAgentsCreateOptionalParams no longer has parameter resumeFrom + - Interface VirtualMachineInstancesCreateCheckpointOptionalParams no longer has parameter resumeFrom + - Interface VirtualMachineInstancesCreateOrUpdateOptionalParams no longer has parameter resumeFrom + - Interface VirtualMachineInstancesDeleteCheckpointOptionalParams no longer has parameter resumeFrom + - Interface VirtualMachineInstancesDeleteOptionalParams no longer has parameter resumeFrom + - Interface VirtualMachineInstancesRestartOptionalParams no longer has parameter resumeFrom + - Interface VirtualMachineInstancesRestoreCheckpointOptionalParams no longer has parameter resumeFrom + - Interface VirtualMachineInstancesStartOptionalParams no longer has parameter resumeFrom + - Interface VirtualMachineInstancesStopOptionalParams no longer has parameter resumeFrom + - Interface VirtualMachineInstancesUpdateOptionalParams no longer has parameter resumeFrom + - Interface VirtualMachineTemplatesCreateOrUpdateOptionalParams no longer has parameter resumeFrom + - Interface VirtualMachineTemplatesDeleteOptionalParams no longer has parameter resumeFrom + - Interface VirtualMachineTemplatesUpdateOptionalParams no longer has parameter resumeFrom + - Interface VirtualNetworksCreateOrUpdateOptionalParams no longer has parameter resumeFrom + - Interface VirtualNetworksDeleteOptionalParams no longer has parameter resumeFrom + - Interface VirtualNetworksUpdateOptionalParams no longer has parameter resumeFrom + - Interface VmmServersCreateOrUpdateOptionalParams no longer has parameter resumeFrom + - Interface VmmServersDeleteOptionalParams no longer has parameter resumeFrom + - Interface VmmServersUpdateOptionalParams no longer has parameter resumeFrom + - Type of parameter tags of interface AvailabilitySetTagsUpdate is changed from { + [propertyName: string]: string; + } to Record + - Type of parameter tags of interface CloudTagsUpdate is changed from { + [propertyName: string]: string; + } to Record + - Type of parameter info of interface ErrorAdditionalInfo is changed from Record to Record + - Type of parameter inventoryType of interface InventoryItemProperties is changed from "Cloud" | "VirtualMachine" | "VirtualMachineTemplate" | "VirtualNetwork" to InventoryType + - Type of parameter tags of interface TrackedResource is changed from { + [propertyName: string]: string; + } to Record + - Type of parameter tags of interface VirtualMachineTemplateTagsUpdate is changed from { + [propertyName: string]: string; + } to Record + - Type of parameter tags of interface VirtualNetworkTagsUpdate is changed from { + [propertyName: string]: string; + } to Record + - Type of parameter tags of interface VmmServerTagsUpdate is changed from { + [propertyName: string]: string; + } to Record + - Removed Enum KnownProvisioningState + - Enum KnownCreateDiffDisk no longer has value False + - Enum KnownCreateDiffDisk no longer has value True + - Enum KnownDeleteFromHost no longer has value False + - Enum KnownDeleteFromHost no longer has value True + - Enum KnownDynamicMemoryEnabled no longer has value False + - Enum KnownDynamicMemoryEnabled no longer has value True + - Enum KnownForceDelete no longer has value False + - Enum KnownForceDelete no longer has value True + - Enum KnownIsCustomizable no longer has value False + - Enum KnownIsCustomizable no longer has value True + - Enum KnownIsHighlyAvailable no longer has value False + - Enum KnownIsHighlyAvailable no longer has value True + - Enum KnownLimitCpuForMigration no longer has value False + - Enum KnownLimitCpuForMigration no longer has value True + - Enum KnownOrigin no longer has value System + - Enum KnownOrigin no longer has value User + - Enum KnownOrigin no longer has value UserSystem + - Enum KnownProvisioningAction no longer has value Install + - Enum KnownProvisioningAction no longer has value Repair + - Enum KnownProvisioningAction no longer has value Uninstall + - Enum KnownSkipShutdown no longer has value False + - Enum KnownSkipShutdown no longer has value True + - Removed function getContinuationToken + +# Release History + ## 1.0.0 (2024-06-25) ### Features Added diff --git a/sdk/scvmm/arm-scvmm/README.md b/sdk/scvmm/arm-scvmm/README.md index dcf00c85311a..1cc8f9dd4dc8 100644 --- a/sdk/scvmm/arm-scvmm/README.md +++ b/sdk/scvmm/arm-scvmm/README.md @@ -6,8 +6,8 @@ The Microsoft.ScVmm Rest API spec. [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/scvmm/arm-scvmm) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-scvmm) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-scvmm) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-scvmm?view=azure-node-preview) | +[Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/scvmm/arm-scvmm/samples) ## Getting started @@ -30,7 +30,7 @@ Install the Azure ScVmm client library for JavaScript with `npm`: npm install @azure/arm-scvmm ``` -### Create and authenticate a `ScVmm` +### Create and authenticate a `ScVmmClient` To create a client object to access the Azure ScVmm API, you will need the `endpoint` of your Azure ScVmm resource and a `credential`. The Azure ScVmm client can use Azure Active Directory credentials to authenticate. You can find the endpoint for your Azure ScVmm resource in the [Azure Portal][azure_portal]. @@ -49,19 +49,19 @@ Set the values of the client ID, tenant ID, and client secret of the AAD applica 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 { ScVmm } = require("@azure/arm-scvmm"); +const { ScVmmClient } = require("@azure/arm-scvmm"); 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 ScVmm(new DefaultAzureCredential(), subscriptionId); +const client = new ScVmmClient(new DefaultAzureCredential(), subscriptionId); // For client-side applications running in the browser, use this code instead: // const credential = new InteractiveBrowserCredential({ // tenantId: "", // clientId: "" // }); -// const client = new ScVmm(credential, subscriptionId); +// const client = new ScVmmClient(credential, subscriptionId); ``` @@ -70,9 +70,9 @@ To use this client library in the browser, first you need to use a bundler. For ## Key concepts -### ScVmm +### ScVmmClient -`ScVmm` is the primary interface for developers using the Azure ScVmm client library. Explore the methods on this client object to understand the different features of the Azure ScVmm service that you can access. +`ScVmmClient` is the primary interface for developers using the Azure ScVmm client library. Explore the methods on this client object to understand the different features of the Azure ScVmm service that you can access. ## Troubleshooting @@ -89,7 +89,7 @@ For more detailed instructions on how to enable logs, you can look at the [@azur ## 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. +Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/scvmm/arm-scvmm/samples) directory for detailed examples on how to use this library. ## Contributing @@ -99,10 +99,6 @@ If you'd like to contribute to this library, please read the [contributing guide - [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%2Fscvmm%2Farm-scvmm%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 diff --git a/sdk/scvmm/arm-scvmm/_meta.json b/sdk/scvmm/arm-scvmm/_meta.json deleted file mode 100644 index 79a83344421d..000000000000 --- a/sdk/scvmm/arm-scvmm/_meta.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "commit": "768c1f32bbfdcea80bdadf92dc2fba2c114c2dda", - "readme": "specification/scvmm/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.7 --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\\scvmm\\resource-manager\\readme.md --use=@autorest/typescript@6.0.23 --generate-sample=true", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.11", - "use": "@autorest/typescript@6.0.23" -} \ No newline at end of file diff --git a/sdk/scvmm/arm-scvmm/api-extractor.json b/sdk/scvmm/arm-scvmm/api-extractor.json index e3de4ed8b4cc..fc77c6905200 100644 --- a/sdk/scvmm/arm-scvmm/api-extractor.json +++ b/sdk/scvmm/arm-scvmm/api-extractor.json @@ -1,6 +1,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "mainEntryPointFilePath": "./dist/esm/index.d.ts", "docModel": { "enabled": true }, diff --git a/sdk/scvmm/arm-scvmm/assets.json b/sdk/scvmm/arm-scvmm/assets.json deleted file mode 100644 index 9a7b719e9037..000000000000 --- a/sdk/scvmm/arm-scvmm/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "js", - "TagPrefix": "js/scvmm/arm-scvmm", - "Tag": "js/scvmm/arm-scvmm_f8729cd47c" -} diff --git a/sdk/scvmm/arm-scvmm/package.json b/sdk/scvmm/arm-scvmm/package.json index 1fbbce97f73f..2146a0c4aab6 100644 --- a/sdk/scvmm/arm-scvmm/package.json +++ b/sdk/scvmm/arm-scvmm/package.json @@ -1,118 +1,187 @@ { "name": "@azure/arm-scvmm", - "sdk-type": "mgmt", - "author": "Microsoft Corporation", - "description": "A generated SDK for ScVmm.", - "version": "1.0.1", + "version": "1.0.0-beta.1", + "description": "A generated SDK for ScVmmClient.", "engines": { "node": ">=18.0.0" }, - "dependencies": { - "@azure/core-lro": "^2.5.4", - "@azure/abort-controller": "^1.0.0", - "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.7.0", - "@azure/core-auth": "^1.6.0", - "@azure/core-rest-pipeline": "^1.14.0", - "tslib": "^2.2.0" + "sideEffects": false, + "autoPublish": false, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts", + "./api": "./src/api/index.ts", + "./models": "./src/models/index.ts" + }, + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], + "selfLink": false }, + "type": "module", "keywords": [ "node", "azure", + "cloud", "typescript", "browser", "isomorphic" ], + "author": "Microsoft Corporation", "license": "MIT", - "main": "./dist/index.js", - "module": "./dist-esm/src/index.js", - "types": "./types/arm-scvmm.d.ts", - "devDependencies": { - "@microsoft/api-extractor": "^7.31.1", - "mkdirp": "^3.0.1", - "typescript": "~5.5.3", - "uglify-js": "^3.4.9", - "rimraf": "^5.0.0", - "dotenv": "^16.0.0", - "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.0.1", - "@azure-tools/test-recorder": "^3.0.0", - "@azure-tools/test-credential": "^1.1.0", - "mocha": "^10.0.0", - "@types/mocha": "^10.0.0", - "tsx": "^4.7.1", - "@types/chai": "^4.2.8", - "chai": "^4.2.0", - "cross-env": "^7.0.2", - "@types/node": "^18.0.0", - "ts-node": "^10.0.0" - }, - "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", + "dist", "README.md", "LICENSE", - "tsconfig.json", "review/*", - "CHANGELOG.md", - "types/*" + "CHANGELOG.md" ], - "scripts": { - "build": "npm run clean && tsc && dev-tool run bundle && 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": "dev-tool run extract-api", - "lint": "echo skipped", - "clean": "rimraf --glob 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" + "sdk-type": "mgmt", + "repository": "github:Azure/azure-sdk-for-js", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, - "sideEffects": false, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/scvmm/arm-scvmm/README.md", + "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", "//metadata": { "constantPaths": [ { - "path": "src/scVmm.ts", - "prefix": "packageDetails" + "path": "src/rest/scVmmClient.ts", + "prefix": "userAgentInfo" } ] }, - "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/scvmm/arm-scvmm", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-scvmm?view=azure-node-preview" - } -} + "dependencies": { + "@azure-rest/core-client": "^2.1.0", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.5.0", + "@azure/logger": "^1.0.0", + "tslib": "^2.6.2", + "@azure/core-lro": "^3.0.0", + "@azure/abort-controller": "^2.1.2", + "@azure/core-paging": "^1.5.0" + }, + "devDependencies": { + "dotenv": "^16.0.0", + "@microsoft/api-extractor": "^7.40.3", + "@types/node": "^18.0.0", + "eslint": "^8.55.0", + "prettier": "^3.2.5", + "rimraf": "^5.0.5", + "mkdirp": "^3.0.1", + "typescript": "~5.5.3", + "tshy": "^1.11.1", + "@azure/core-util": "^1.0.0", + "@azure/identity": "^4.2.1", + "@vitest/browser": "^1.3.1", + "@vitest/coverage-istanbul": "^1.3.1", + "playwright": "^1.41.2", + "vitest": "^1.3.1", + "@azure-tools/test-credential": "^2.0.0", + "@azure-tools/test-recorder": "^4.0.0", + "@azure/dev-tool": "^1.0.0", + "@azure/eslint-plugin-azure-sdk": "^3.0.0" + }, + "scripts": { + "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "extract-api": "rimraf review && mkdirp ./review && dev-tool run extract-api", + "pack": "npm pack 2>&1", + "lint": "eslint package.json api-extractor.json src test --ext .ts --ext .cts --ext .mts", + "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --ext .cts --ext .mts --fix --fix-type [problem,suggestion]", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:browser": "npm run build:test && dev-tool run test:vitest --browser", + "unit-test:node": "dev-tool run test:vitest", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:browser": "echo skipped", + "integration-test:node": "echo skipped", + "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit", + "build:samples": "echo skipped", + "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"", + "execute:samples": "echo skipped", + "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"", + "generate:client": "echo skipped", + "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "build:test": "npm run clean && tshy && dev-tool run build-test", + "build": "npm run clean && tshy && mkdirp ./review && dev-tool run extract-api", + "test:node": "npm run clean && tshy && npm run unit-test:node && npm run integration-test:node", + "test": "npm run clean && tshy && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test" + }, + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "source": "./src/index.ts", + "types": "./dist/browser/index.d.ts", + "default": "./dist/browser/index.js" + }, + "react-native": { + "source": "./src/index.ts", + "types": "./dist/react-native/index.d.ts", + "default": "./dist/react-native/index.js" + }, + "import": { + "source": "./src/index.ts", + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "source": "./src/index.ts", + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + }, + "./api": { + "browser": { + "source": "./src/api/index.ts", + "types": "./dist/browser/api/index.d.ts", + "default": "./dist/browser/api/index.js" + }, + "react-native": { + "source": "./src/api/index.ts", + "types": "./dist/react-native/api/index.d.ts", + "default": "./dist/react-native/api/index.js" + }, + "import": { + "source": "./src/api/index.ts", + "types": "./dist/esm/api/index.d.ts", + "default": "./dist/esm/api/index.js" + }, + "require": { + "source": "./src/api/index.ts", + "types": "./dist/commonjs/api/index.d.ts", + "default": "./dist/commonjs/api/index.js" + } + }, + "./models": { + "browser": { + "source": "./src/models/index.ts", + "types": "./dist/browser/models/index.d.ts", + "default": "./dist/browser/models/index.js" + }, + "react-native": { + "source": "./src/models/index.ts", + "types": "./dist/react-native/models/index.d.ts", + "default": "./dist/react-native/models/index.js" + }, + "import": { + "source": "./src/models/index.ts", + "types": "./dist/esm/models/index.d.ts", + "default": "./dist/esm/models/index.js" + }, + "require": { + "source": "./src/models/index.ts", + "types": "./dist/commonjs/models/index.d.ts", + "default": "./dist/commonjs/models/index.js" + } + } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts" +} \ No newline at end of file diff --git a/sdk/scvmm/arm-scvmm/review/arm-scvmm-api.api.md b/sdk/scvmm/arm-scvmm/review/arm-scvmm-api.api.md new file mode 100644 index 000000000000..310eb58621e5 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/review/arm-scvmm-api.api.md @@ -0,0 +1,190 @@ +## API Report File for "@azure/arm-scvmm" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { ClientOptions } from '@azure-rest/core-client'; +import { HttpResponse } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; +import { OperationState } from '@azure/core-lro'; +import { Paged } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { RawHttpHeaders } from '@azure/core-rest-pipeline'; +import { RequestParameters } from '@azure-rest/core-client'; +import { StreamableMethod } from '@azure-rest/core-client'; +import { TokenCredential } from '@azure/core-auth'; + +// @public +export function availabilitySetsCreateOrUpdate(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, availabilitySetResourceName: string, resource: AvailabilitySet_2, options?: AvailabilitySetsCreateOrUpdateOptionalParams): PollerLike, AvailabilitySet_2>; + +// @public +export function availabilitySetsDelete(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, availabilitySetResourceName: string, options?: AvailabilitySetsDeleteOptionalParams): PollerLike, void>; + +// @public +export function availabilitySetsGet(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, availabilitySetResourceName: string, options?: AvailabilitySetsGetOptionalParams): Promise; + +// @public +export function availabilitySetsListByResourceGroup(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, options?: AvailabilitySetsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export function availabilitySetsListBySubscription(context: ScVmmContext, subscriptionId: string, options?: AvailabilitySetsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + +// @public +export function availabilitySetsUpdate(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, availabilitySetResourceName: string, properties: AvailabilitySetTagsUpdate_2, options?: AvailabilitySetsUpdateOptionalParams): PollerLike, AvailabilitySet_2>; + +// @public +export function cloudsCreateOrUpdate(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, cloudResourceName: string, resource: Cloud_2, options?: CloudsCreateOrUpdateOptionalParams): PollerLike, Cloud_2>; + +// @public +export function cloudsDelete(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, cloudResourceName: string, options?: CloudsDeleteOptionalParams): PollerLike, void>; + +// @public +export function cloudsGet(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, cloudResourceName: string, options?: CloudsGetOptionalParams): Promise; + +// @public +export function cloudsListByResourceGroup(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, options?: CloudsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export function cloudsListBySubscription(context: ScVmmContext, subscriptionId: string, options?: CloudsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + +// @public +export function cloudsUpdate(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, cloudResourceName: string, properties: CloudTagsUpdate_2, options?: CloudsUpdateOptionalParams): PollerLike, Cloud_2>; + +// @public +export function createScVmm(credential: TokenCredential, options?: ScVmmClientOptionalParams): ScVmmContext; + +// @public +export function guestAgentsCreate(context: ScVmmContext, resourceUri: string, resource: GuestAgent_2, options?: GuestAgentsCreateOptionalParams): PollerLike, GuestAgent_2>; + +// @public +export function guestAgentsDelete(context: ScVmmContext, resourceUri: string, options?: GuestAgentsDeleteOptionalParams): Promise; + +// @public +export function guestAgentsGet(context: ScVmmContext, resourceUri: string, options?: GuestAgentsGetOptionalParams): Promise; + +// @public +export function guestAgentsListByVirtualMachineInstance(context: ScVmmContext, resourceUri: string, options?: GuestAgentsListByVirtualMachineInstanceOptionalParams): PagedAsyncIterableIterator; + +// @public +export function inventoryItemsCreate(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, vmmServerName: string, inventoryItemResourceName: string, resource: InventoryItem_2, options?: InventoryItemsCreateOptionalParams): Promise; + +// @public +export function inventoryItemsDelete(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, vmmServerName: string, inventoryItemResourceName: string, options?: InventoryItemsDeleteOptionalParams): Promise; + +// @public +export function inventoryItemsGet(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, vmmServerName: string, inventoryItemResourceName: string, options?: InventoryItemsGetOptionalParams): Promise; + +// @public +export function inventoryItemsListByVmmServer(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, vmmServerName: string, options?: InventoryItemsListByVmmServerOptionalParams): PagedAsyncIterableIterator; + +// @public +export function operationsList(context: ScVmmContext, options?: OperationsListOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface ScVmmClientOptionalParams extends ClientOptions { + apiVersion?: string; +} + +// @public (undocumented) +export type ScVmmContext = Client & { + path: Routes; +}; + +// @public +export function virtualMachineInstancesCreateCheckpoint(context: ScVmmContext, resourceUri: string, body: VirtualMachineCreateCheckpoint_2, options?: VirtualMachineInstancesCreateCheckpointOptionalParams): PollerLike, void>; + +// @public +export function virtualMachineInstancesCreateOrUpdate(context: ScVmmContext, resourceUri: string, resource: VirtualMachineInstance_2, options?: VirtualMachineInstancesCreateOrUpdateOptionalParams): PollerLike, VirtualMachineInstance_2>; + +// @public +export function virtualMachineInstancesDelete(context: ScVmmContext, resourceUri: string, options?: VirtualMachineInstancesDeleteOptionalParams): PollerLike, void>; + +// @public +export function virtualMachineInstancesDeleteCheckpoint(context: ScVmmContext, resourceUri: string, body: VirtualMachineDeleteCheckpoint_2, options?: VirtualMachineInstancesDeleteCheckpointOptionalParams): PollerLike, void>; + +// @public +export function virtualMachineInstancesGet(context: ScVmmContext, resourceUri: string, options?: VirtualMachineInstancesGetOptionalParams): Promise; + +// @public +export function virtualMachineInstancesList(context: ScVmmContext, resourceUri: string, options?: VirtualMachineInstancesListOptionalParams): PagedAsyncIterableIterator; + +// @public +export function virtualMachineInstancesRestart(context: ScVmmContext, resourceUri: string, options?: VirtualMachineInstancesRestartOptionalParams): PollerLike, void>; + +// @public +export function virtualMachineInstancesRestoreCheckpoint(context: ScVmmContext, resourceUri: string, body: VirtualMachineRestoreCheckpoint_2, options?: VirtualMachineInstancesRestoreCheckpointOptionalParams): PollerLike, void>; + +// @public +export function virtualMachineInstancesStart(context: ScVmmContext, resourceUri: string, options?: VirtualMachineInstancesStartOptionalParams): PollerLike, void>; + +// @public +export function virtualMachineInstancesStop(context: ScVmmContext, resourceUri: string, body: StopVirtualMachineOptions_2, options?: VirtualMachineInstancesStopOptionalParams): PollerLike, void>; + +// @public +export function virtualMachineInstancesUpdate(context: ScVmmContext, resourceUri: string, properties: VirtualMachineInstanceUpdate_2, options?: VirtualMachineInstancesUpdateOptionalParams): PollerLike, VirtualMachineInstance_2>; + +// @public +export function virtualMachineTemplatesCreateOrUpdate(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, virtualMachineTemplateName: string, resource: VirtualMachineTemplate_2, options?: VirtualMachineTemplatesCreateOrUpdateOptionalParams): PollerLike, VirtualMachineTemplate_2>; + +// @public +export function virtualMachineTemplatesDelete(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, virtualMachineTemplateName: string, options?: VirtualMachineTemplatesDeleteOptionalParams): PollerLike, void>; + +// @public +export function virtualMachineTemplatesGet(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, virtualMachineTemplateName: string, options?: VirtualMachineTemplatesGetOptionalParams): Promise; + +// @public +export function virtualMachineTemplatesListByResourceGroup(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, options?: VirtualMachineTemplatesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export function virtualMachineTemplatesListBySubscription(context: ScVmmContext, subscriptionId: string, options?: VirtualMachineTemplatesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + +// @public +export function virtualMachineTemplatesUpdate(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, virtualMachineTemplateName: string, properties: VirtualMachineTemplateTagsUpdate_2, options?: VirtualMachineTemplatesUpdateOptionalParams): PollerLike, VirtualMachineTemplate_2>; + +// @public +export function virtualNetworksCreateOrUpdate(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, virtualNetworkName: string, resource: VirtualNetwork_2, options?: VirtualNetworksCreateOrUpdateOptionalParams): PollerLike, VirtualNetwork_2>; + +// @public +export function virtualNetworksDelete(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, virtualNetworkName: string, options?: VirtualNetworksDeleteOptionalParams): PollerLike, void>; + +// @public +export function virtualNetworksGet(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, virtualNetworkName: string, options?: VirtualNetworksGetOptionalParams): Promise; + +// @public +export function virtualNetworksListByResourceGroup(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, options?: VirtualNetworksListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export function virtualNetworksListBySubscription(context: ScVmmContext, subscriptionId: string, options?: VirtualNetworksListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + +// @public +export function virtualNetworksUpdate(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, virtualNetworkName: string, properties: VirtualNetworkTagsUpdate_2, options?: VirtualNetworksUpdateOptionalParams): PollerLike, VirtualNetwork_2>; + +// @public +export function vmInstanceHybridIdentityMetadatasGet(context: ScVmmContext, resourceUri: string, options?: VmInstanceHybridIdentityMetadatasGetOptionalParams): Promise; + +// @public +export function vmInstanceHybridIdentityMetadatasListByVirtualMachineInstance(context: ScVmmContext, resourceUri: string, options?: VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceOptionalParams): PagedAsyncIterableIterator; + +// @public +export function vmmServersCreateOrUpdate(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, vmmServerName: string, resource: VmmServer_2, options?: VmmServersCreateOrUpdateOptionalParams): PollerLike, VmmServer_2>; + +// @public +export function vmmServersDelete(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, vmmServerName: string, options?: VmmServersDeleteOptionalParams): PollerLike, void>; + +// @public +export function vmmServersGet(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, vmmServerName: string, options?: VmmServersGetOptionalParams): Promise; + +// @public +export function vmmServersListByResourceGroup(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, options?: VmmServersListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export function vmmServersListBySubscription(context: ScVmmContext, subscriptionId: string, options?: VmmServersListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + +// @public +export function vmmServersUpdate(context: ScVmmContext, subscriptionId: string, resourceGroupName: string, vmmServerName: string, properties: VmmServerTagsUpdate_2, options?: VmmServersUpdateOptionalParams): PollerLike, VmmServer_2>; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/scvmm/arm-scvmm/review/arm-scvmm-models.api.md b/sdk/scvmm/arm-scvmm/review/arm-scvmm-models.api.md new file mode 100644 index 000000000000..ac4a49dbd8df --- /dev/null +++ b/sdk/scvmm/arm-scvmm/review/arm-scvmm-models.api.md @@ -0,0 +1,941 @@ +## API Report File for "@azure/arm-scvmm" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { OperationOptions } from '@azure-rest/core-client'; + +// @public +export type ActionType = string; + +// @public +export type AllocationMethod = string; + +// @public +export interface AvailabilitySet extends TrackedResource { + extendedLocation: ExtendedLocation; + properties?: AvailabilitySetProperties; +} + +// @public +export interface AvailabilitySetListItem { + id?: string; + name?: string; +} + +// @public +export interface AvailabilitySetProperties { + availabilitySetName?: string; + readonly provisioningState?: ProvisioningState; + vmmServerId?: string; +} + +// @public +export interface AvailabilitySetsCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface AvailabilitySetsDeleteOptionalParams extends OperationOptions { + force?: ForceDelete; + updateIntervalInMs?: number; +} + +// @public +export interface AvailabilitySetsGetOptionalParams extends OperationOptions { +} + +// @public +export interface AvailabilitySetsListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface AvailabilitySetsListBySubscriptionOptionalParams extends OperationOptions { +} + +// @public +export interface AvailabilitySetsUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface AvailabilitySetTagsUpdate { + tags?: Record; +} + +// @public +export interface Checkpoint { + checkpointId?: string; + description?: string; + name?: string; + parentCheckpointId?: string; +} + +// @public +export interface Cloud extends TrackedResource { + extendedLocation: ExtendedLocation; + properties?: CloudProperties; +} + +// @public +export interface CloudCapacity { + readonly cpuCount?: number; + readonly memoryMB?: number; + readonly vmCount?: number; +} + +// @public +export interface CloudInventoryItem extends InventoryItemProperties { + inventoryType: "Cloud"; +} + +// @public +export interface CloudProperties { + readonly cloudCapacity?: CloudCapacity; + readonly cloudName?: string; + inventoryItemId?: string; + readonly provisioningState?: ProvisioningState; + readonly storageQosPolicies?: StorageQosPolicy[]; + uuid?: string; + vmmServerId?: string; +} + +// @public +export interface CloudsCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface CloudsDeleteOptionalParams extends OperationOptions { + force?: ForceDelete; + updateIntervalInMs?: number; +} + +// @public +export interface CloudsGetOptionalParams extends OperationOptions { +} + +// @public +export interface CloudsListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface CloudsListBySubscriptionOptionalParams extends OperationOptions { +} + +// @public +export interface CloudsUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface CloudTagsUpdate { + tags?: Record; +} + +// @public +export type ContinuablePage = TPage & { + continuationToken?: string; +}; + +// @public +export type CreatedByType = string; + +// @public +export type CreateDiffDisk = string; + +// @public +export type DeleteFromHost = string; + +// @public +export type DynamicMemoryEnabled = string; + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export interface ExtendedLocation { + name?: string; + type?: string; +} + +// @public +export interface ExtensionResource extends Resource { +} + +// @public +export type ForceDelete = string; + +// @public +export interface GuestAgent extends ProxyResource { + properties?: GuestAgentProperties; +} + +// @public +export interface GuestAgentProperties { + credentials?: GuestCredential; + readonly customResourceName?: string; + httpProxyConfig?: HttpProxyConfiguration; + privateLinkScopeResourceId?: string; + provisioningAction?: ProvisioningAction; + readonly provisioningState?: ProvisioningState; + readonly status?: string; + readonly uuid?: string; +} + +// @public +export interface GuestAgentsCreateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface GuestAgentsDeleteOptionalParams extends OperationOptions { +} + +// @public +export interface GuestAgentsGetOptionalParams extends OperationOptions { +} + +// @public +export interface GuestAgentsListByVirtualMachineInstanceOptionalParams extends OperationOptions { +} + +// @public +export interface GuestCredential { + password: string; + username: string; +} + +// @public +export interface HardwareProfile { + cpuCount?: number; + dynamicMemoryEnabled?: DynamicMemoryEnabled; + dynamicMemoryMaxMB?: number; + dynamicMemoryMinMB?: number; + readonly isHighlyAvailable?: IsHighlyAvailable; + limitCpuForMigration?: LimitCpuForMigration; + memoryMB?: number; +} + +// @public +export interface HardwareProfileUpdate { + cpuCount?: number; + dynamicMemoryEnabled?: DynamicMemoryEnabled; + dynamicMemoryMaxMB?: number; + dynamicMemoryMinMB?: number; + limitCpuForMigration?: LimitCpuForMigration; + memoryMB?: number; +} + +// @public +export interface HttpProxyConfiguration { + httpsProxy?: string; +} + +// @public +export interface InfrastructureProfile { + biosGuid?: string; + readonly checkpoints?: Checkpoint[]; + checkpointType?: string; + cloudId?: string; + generation?: number; + inventoryItemId?: string; + readonly lastRestoredVmCheckpoint?: Checkpoint; + templateId?: string; + uuid?: string; + vmmServerId?: string; + vmName?: string; +} + +// @public +export interface InfrastructureProfileUpdate { + checkpointType?: string; +} + +// @public +export interface InventoryItem extends ProxyResource { + kind?: string; + properties?: InventoryItemPropertiesUnion; +} + +// @public +export interface InventoryItemDetails { + inventoryItemId?: string; + inventoryItemName?: string; +} + +// @public +export interface InventoryItemProperties { + readonly inventoryItemName?: string; + inventoryType: InventoryType; + readonly managedResourceId?: string; + readonly provisioningState?: ProvisioningState; + readonly uuid?: string; +} + +// @public +export type InventoryItemPropertiesUnion = CloudInventoryItem | VirtualNetworkInventoryItem | VirtualMachineTemplateInventoryItem | VirtualMachineInventoryItem | InventoryItemProperties; + +// @public +export interface InventoryItemsCreateOptionalParams extends OperationOptions { +} + +// @public +export interface InventoryItemsDeleteOptionalParams extends OperationOptions { +} + +// @public +export interface InventoryItemsGetOptionalParams extends OperationOptions { +} + +// @public +export interface InventoryItemsListByVmmServerOptionalParams extends OperationOptions { +} + +// @public +export type InventoryType = string; + +// @public +export type IsCustomizable = string; + +// @public +export type IsHighlyAvailable = string; + +// @public +export enum KnownActionType { + Internal = "Internal" +} + +// @public +export enum KnownAllocationMethod { + Dynamic = "Dynamic", + Static = "Static" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownCreateDiffDisk { + "false" = "false", + "true" = "true" +} + +// @public +export enum KnownDeleteFromHost { + "false" = "false", + "true" = "true" +} + +// @public +export enum KnownDynamicMemoryEnabled { + "false" = "false", + "true" = "true" +} + +// @public +export enum KnownForceDelete { + "false" = "false", + "true" = "true" +} + +// @public +export enum KnownInventoryType { + Cloud = "Cloud", + VirtualMachine = "VirtualMachine", + VirtualMachineTemplate = "VirtualMachineTemplate", + VirtualNetwork = "VirtualNetwork" +} + +// @public +export enum KnownIsCustomizable { + "false" = "false", + "true" = "true" +} + +// @public +export enum KnownIsHighlyAvailable { + "false" = "false", + "true" = "true" +} + +// @public +export enum KnownLimitCpuForMigration { + "false" = "false", + "true" = "true" +} + +// @public +export enum KnownOrigin { + "user,system" = "user,system", + system = "system", + user = "user" +} + +// @public +export enum KnownOsType { + Linux = "Linux", + Other = "Other", + Windows = "Windows" +} + +// @public +export enum KnownProvisioningAction { + install = "install", + repair = "repair", + uninstall = "uninstall" +} + +// @public +export enum KnownResourceProvisioningState { + Canceled = "Canceled", + Failed = "Failed", + Succeeded = "Succeeded" +} + +// @public +export enum KnownSkipShutdown { + "false" = "false", + "true" = "true" +} + +// @public +export type LimitCpuForMigration = string; + +// @public +export interface NetworkInterface { + readonly displayName?: string; + readonly ipv4Addresses?: string[]; + ipv4AddressType?: AllocationMethod; + readonly ipv6Addresses?: string[]; + ipv6AddressType?: AllocationMethod; + macAddress?: string; + macAddressType?: AllocationMethod; + name?: string; + readonly networkName?: string; + nicId?: string; + virtualNetworkId?: string; +} + +// @public +export interface NetworkInterfaceUpdate { + ipv4AddressType?: AllocationMethod; + ipv6AddressType?: AllocationMethod; + macAddress?: string; + macAddressType?: AllocationMethod; + name?: string; + nicId?: string; + virtualNetworkId?: string; +} + +// @public +export interface NetworkProfile { + networkInterfaces?: NetworkInterface[]; +} + +// @public +export interface NetworkProfileUpdate { + networkInterfaces?: NetworkInterfaceUpdate[]; +} + +// @public +export interface Operation { + actionType?: ActionType; + readonly display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationsListOptionalParams extends OperationOptions { +} + +// @public +export type Origin = string; + +// @public +export interface OsProfileForVmInstance { + adminPassword?: string; + computerName?: string; + domainName?: string; + domainPassword?: string; + domainUsername?: string; + readonly osSku?: string; + readonly osType?: OsType; + readonly osVersion?: string; + productKey?: string; + runOnceCommands?: string; + timezone?: number; + workgroup?: string; +} + +// @public +export type OsType = string; + +// @public +export interface PagedAsyncIterableIterator { + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; + next(): Promise>; +} + +// @public +export interface PageSettings { + continuationToken?: string; +} + +// @public +export type ProvisioningAction = string; + +// @public +export type ProvisioningState = string | ResourceProvisioningState | "Provisioning" | "Updating" | "Deleting" | "Accepted" | "Created"; + +// @public +export interface ProxyResource extends Resource { +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export type ResourceProvisioningState = string; + +// @public +export type SkipShutdown = string; + +// @public +export interface StopVirtualMachineOptions { + skipShutdown?: SkipShutdown; +} + +// @public +export interface StorageProfile { + disks?: VirtualDisk[]; +} + +// @public +export interface StorageProfileUpdate { + disks?: VirtualDiskUpdate[]; +} + +// @public +export interface StorageQosPolicy { + bandwidthLimit?: number; + id?: string; + iopsMaximum?: number; + iopsMinimum?: number; + name?: string; + policyId?: string; +} + +// @public +export interface StorageQosPolicyDetails { + id?: string; + name?: string; +} + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TrackedResource extends Resource { + location: string; + tags?: Record; +} + +// @public +export type Versions = "2023-10-07" | "2024-06-01"; + +// @public +export interface VirtualDisk { + bus?: number; + busType?: string; + createDiffDisk?: CreateDiffDisk; + diskId?: string; + diskSizeGB?: number; + readonly displayName?: string; + lun?: number; + readonly maxDiskSizeGB?: number; + name?: string; + storageQosPolicy?: StorageQosPolicyDetails; + templateDiskId?: string; + readonly vhdFormatType?: string; + vhdType?: string; + readonly volumeType?: string; +} + +// @public +export interface VirtualDiskUpdate { + bus?: number; + busType?: string; + diskId?: string; + diskSizeGB?: number; + lun?: number; + name?: string; + storageQosPolicy?: StorageQosPolicyDetails; + vhdType?: string; +} + +// @public +export interface VirtualMachineCreateCheckpoint { + description?: string; + name?: string; +} + +// @public +export interface VirtualMachineDeleteCheckpoint { + id?: string; +} + +// @public +export interface VirtualMachineInstance extends ExtensionResource { + extendedLocation: ExtendedLocation; + properties?: VirtualMachineInstanceProperties; +} + +// @public +export interface VirtualMachineInstanceProperties { + availabilitySets?: AvailabilitySetListItem[]; + hardwareProfile?: HardwareProfile; + infrastructureProfile?: InfrastructureProfile; + networkProfile?: NetworkProfile; + osProfile?: OsProfileForVmInstance; + readonly powerState?: string; + readonly provisioningState?: ProvisioningState; + storageProfile?: StorageProfile; +} + +// @public +export interface VirtualMachineInstancesCreateCheckpointOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineInstancesCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineInstancesDeleteCheckpointOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineInstancesDeleteOptionalParams extends OperationOptions { + deleteFromHost?: DeleteFromHost; + force?: ForceDelete; + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineInstancesGetOptionalParams extends OperationOptions { +} + +// @public +export interface VirtualMachineInstancesListOptionalParams extends OperationOptions { +} + +// @public +export interface VirtualMachineInstancesRestartOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineInstancesRestoreCheckpointOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineInstancesStartOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineInstancesStopOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineInstancesUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineInstanceUpdate { + properties?: VirtualMachineInstanceUpdateProperties; +} + +// @public +export interface VirtualMachineInstanceUpdateProperties { + availabilitySets?: AvailabilitySetListItem[]; + hardwareProfile?: HardwareProfileUpdate; + infrastructureProfile?: InfrastructureProfileUpdate; + networkProfile?: NetworkProfileUpdate; + storageProfile?: StorageProfileUpdate; +} + +// @public +export interface VirtualMachineInventoryItem extends InventoryItemProperties { + readonly biosGuid?: string; + cloud?: InventoryItemDetails; + inventoryType: "VirtualMachine"; + ipAddresses?: string[]; + readonly managedMachineResourceId?: string; + readonly osName?: string; + readonly osType?: OsType; + readonly osVersion?: string; + readonly powerState?: string; +} + +// @public +export interface VirtualMachineRestoreCheckpoint { + id?: string; +} + +// @public +export interface VirtualMachineTemplate extends TrackedResource { + extendedLocation: ExtendedLocation; + properties?: VirtualMachineTemplateProperties; +} + +// @public +export interface VirtualMachineTemplateInventoryItem extends InventoryItemProperties { + readonly cpuCount?: number; + inventoryType: "VirtualMachineTemplate"; + readonly memoryMB?: number; + readonly osName?: string; + readonly osType?: OsType; +} + +// @public +export interface VirtualMachineTemplateProperties { + readonly computerName?: string; + readonly cpuCount?: number; + readonly disks?: VirtualDisk[]; + readonly dynamicMemoryEnabled?: DynamicMemoryEnabled; + readonly dynamicMemoryMaxMB?: number; + readonly dynamicMemoryMinMB?: number; + readonly generation?: number; + inventoryItemId?: string; + readonly isCustomizable?: IsCustomizable; + readonly isHighlyAvailable?: IsHighlyAvailable; + readonly limitCpuForMigration?: LimitCpuForMigration; + readonly memoryMB?: number; + readonly networkInterfaces?: NetworkInterface[]; + readonly osName?: string; + readonly osType?: OsType; + readonly provisioningState?: ProvisioningState; + uuid?: string; + vmmServerId?: string; +} + +// @public +export interface VirtualMachineTemplatesCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineTemplatesDeleteOptionalParams extends OperationOptions { + force?: ForceDelete; + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineTemplatesGetOptionalParams extends OperationOptions { +} + +// @public +export interface VirtualMachineTemplatesListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface VirtualMachineTemplatesListBySubscriptionOptionalParams extends OperationOptions { +} + +// @public +export interface VirtualMachineTemplatesUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineTemplateTagsUpdate { + tags?: Record; +} + +// @public +export interface VirtualNetwork extends TrackedResource { + extendedLocation: ExtendedLocation; + properties?: VirtualNetworkProperties; +} + +// @public +export interface VirtualNetworkInventoryItem extends InventoryItemProperties { + inventoryType: "VirtualNetwork"; +} + +// @public +export interface VirtualNetworkProperties { + inventoryItemId?: string; + readonly networkName?: string; + readonly provisioningState?: ProvisioningState; + uuid?: string; + vmmServerId?: string; +} + +// @public +export interface VirtualNetworksCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualNetworksDeleteOptionalParams extends OperationOptions { + force?: ForceDelete; + updateIntervalInMs?: number; +} + +// @public +export interface VirtualNetworksGetOptionalParams extends OperationOptions { +} + +// @public +export interface VirtualNetworksListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface VirtualNetworksListBySubscriptionOptionalParams extends OperationOptions { +} + +// @public +export interface VirtualNetworksUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualNetworkTagsUpdate { + tags?: Record; +} + +// @public +export interface VmInstanceHybridIdentityMetadata extends ProxyResource { + properties?: VmInstanceHybridIdentityMetadataProperties; +} + +// @public +export interface VmInstanceHybridIdentityMetadataProperties { + readonly provisioningState?: ProvisioningState; + publicKey?: string; + resourceUid?: string; +} + +// @public +export interface VmInstanceHybridIdentityMetadatasGetOptionalParams extends OperationOptions { +} + +// @public +export interface VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceOptionalParams extends OperationOptions { +} + +// @public +export interface VmmCredential { + password?: string; + username?: string; +} + +// @public +export interface VmmServer extends TrackedResource { + extendedLocation: ExtendedLocation; + properties?: VmmServerProperties; +} + +// @public +export interface VmmServerProperties { + readonly connectionStatus?: string; + credentials?: VmmCredential; + readonly errorMessage?: string; + fqdn: string; + port?: number; + readonly provisioningState?: ProvisioningState; + readonly uuid?: string; + readonly version?: string; +} + +// @public +export interface VmmServersCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VmmServersDeleteOptionalParams extends OperationOptions { + force?: ForceDelete; + updateIntervalInMs?: number; +} + +// @public +export interface VmmServersGetOptionalParams extends OperationOptions { +} + +// @public +export interface VmmServersListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface VmmServersListBySubscriptionOptionalParams extends OperationOptions { +} + +// @public +export interface VmmServersUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VmmServerTagsUpdate { + tags?: Record; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/scvmm/arm-scvmm/review/arm-scvmm.api.md b/sdk/scvmm/arm-scvmm/review/arm-scvmm.api.md index e8c1fb3c5f77..d229bead1792 100644 --- a/sdk/scvmm/arm-scvmm/review/arm-scvmm.api.md +++ b/sdk/scvmm/arm-scvmm/review/arm-scvmm.api.md @@ -4,11 +4,14 @@ ```ts -import * as coreAuth from '@azure/core-auth'; -import * as coreClient from '@azure/core-client'; +import { AbortSignalLike } from '@azure/abort-controller'; +import { ClientOptions } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; import { OperationState } from '@azure/core-lro'; -import { PagedAsyncIterableIterator } from '@azure/core-paging'; -import { SimplePollerLike } from '@azure/core-lro'; +import { PathUncheckedResponse } from '@azure-rest/core-client'; +import { Pipeline } from '@azure/core-rest-pipeline'; +import { PollerLike } from '@azure/core-lro'; +import { TokenCredential } from '@azure/core-auth'; // @public export type ActionType = string; @@ -28,12 +31,6 @@ export interface AvailabilitySetListItem { name?: string; } -// @public -export interface AvailabilitySetListResult { - readonly nextLink?: string; - value: AvailabilitySet[]; -} - // @public export interface AvailabilitySetProperties { availabilitySetName?: string; @@ -42,105 +39,46 @@ export interface AvailabilitySetProperties { } // @public -export interface AvailabilitySets { - beginCreateOrUpdate(resourceGroupName: string, availabilitySetResourceName: string, resource: AvailabilitySet, options?: AvailabilitySetsCreateOrUpdateOptionalParams): Promise, AvailabilitySetsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, availabilitySetResourceName: string, resource: AvailabilitySet, options?: AvailabilitySetsCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, availabilitySetResourceName: string, options?: AvailabilitySetsDeleteOptionalParams): Promise, AvailabilitySetsDeleteResponse>>; - beginDeleteAndWait(resourceGroupName: string, availabilitySetResourceName: string, options?: AvailabilitySetsDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, availabilitySetResourceName: string, properties: AvailabilitySetTagsUpdate, options?: AvailabilitySetsUpdateOptionalParams): Promise, AvailabilitySetsUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, availabilitySetResourceName: string, properties: AvailabilitySetTagsUpdate, options?: AvailabilitySetsUpdateOptionalParams): Promise; - get(resourceGroupName: string, availabilitySetResourceName: string, options?: AvailabilitySetsGetOptionalParams): Promise; - listByResourceGroup(resourceGroupName: string, options?: AvailabilitySetsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - listBySubscription(options?: AvailabilitySetsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface AvailabilitySetsCreateOrUpdateHeaders { - azureAsyncOperation?: string; - retryAfter?: number; -} - -// @public -export interface AvailabilitySetsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface AvailabilitySetsCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type AvailabilitySetsCreateOrUpdateResponse = AvailabilitySet; - -// @public -export interface AvailabilitySetsDeleteHeaders { - azureAsyncOperation?: string; - location?: string; - retryAfter?: number; -} - -// @public -export interface AvailabilitySetsDeleteOptionalParams extends coreClient.OperationOptions { +export interface AvailabilitySetsDeleteOptionalParams extends OperationOptions { force?: ForceDelete; - resumeFrom?: string; updateIntervalInMs?: number; } // @public -export type AvailabilitySetsDeleteResponse = AvailabilitySetsDeleteHeaders; - -// @public -export interface AvailabilitySetsGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type AvailabilitySetsGetResponse = AvailabilitySet; - -// @public -export interface AvailabilitySetsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +export interface AvailabilitySetsGetOptionalParams extends OperationOptions { } // @public -export type AvailabilitySetsListByResourceGroupNextResponse = AvailabilitySetListResult; - -// @public -export interface AvailabilitySetsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +export interface AvailabilitySetsListByResourceGroupOptionalParams extends OperationOptions { } // @public -export type AvailabilitySetsListByResourceGroupResponse = AvailabilitySetListResult; - -// @public -export interface AvailabilitySetsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +export interface AvailabilitySetsListBySubscriptionOptionalParams extends OperationOptions { } // @public -export type AvailabilitySetsListBySubscriptionNextResponse = AvailabilitySetListResult; - -// @public -export interface AvailabilitySetsListBySubscriptionOptionalParams extends coreClient.OperationOptions { +export interface AvailabilitySetsOperations { + createOrUpdate: (resourceGroupName: string, availabilitySetResourceName: string, resource: AvailabilitySet, options?: AvailabilitySetsCreateOrUpdateOptionalParams) => PollerLike, AvailabilitySet>; + delete: (resourceGroupName: string, availabilitySetResourceName: string, options?: AvailabilitySetsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, availabilitySetResourceName: string, options?: AvailabilitySetsGetOptionalParams) => Promise; + listByResourceGroup: (resourceGroupName: string, options?: AvailabilitySetsListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listBySubscription: (options?: AvailabilitySetsListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, availabilitySetResourceName: string, properties: AvailabilitySetTagsUpdate, options?: AvailabilitySetsUpdateOptionalParams) => PollerLike, AvailabilitySet>; } // @public -export type AvailabilitySetsListBySubscriptionResponse = AvailabilitySetListResult; - -// @public -export interface AvailabilitySetsUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface AvailabilitySetsUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface AvailabilitySetsUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type AvailabilitySetsUpdateResponse = AvailabilitySet; - // @public export interface AvailabilitySetTagsUpdate { - tags?: { - [propertyName: string]: string; - }; + tags?: Record; } // @public @@ -169,12 +107,6 @@ export interface CloudInventoryItem extends InventoryItemProperties { inventoryType: "Cloud"; } -// @public -export interface CloudListResult { - readonly nextLink?: string; - value: Cloud[]; -} - // @public export interface CloudProperties { readonly cloudCapacity?: CloudCapacity; @@ -187,105 +119,53 @@ export interface CloudProperties { } // @public -export interface Clouds { - beginCreateOrUpdate(resourceGroupName: string, cloudResourceName: string, resource: Cloud, options?: CloudsCreateOrUpdateOptionalParams): Promise, CloudsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, cloudResourceName: string, resource: Cloud, options?: CloudsCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, cloudResourceName: string, options?: CloudsDeleteOptionalParams): Promise, CloudsDeleteResponse>>; - beginDeleteAndWait(resourceGroupName: string, cloudResourceName: string, options?: CloudsDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, cloudResourceName: string, properties: CloudTagsUpdate, options?: CloudsUpdateOptionalParams): Promise, CloudsUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, cloudResourceName: string, properties: CloudTagsUpdate, options?: CloudsUpdateOptionalParams): Promise; - get(resourceGroupName: string, cloudResourceName: string, options?: CloudsGetOptionalParams): Promise; - listByResourceGroup(resourceGroupName: string, options?: CloudsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - listBySubscription(options?: CloudsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface CloudsCreateOrUpdateHeaders { - retryAfter?: number; -} - -// @public -export interface CloudsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface CloudsCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type CloudsCreateOrUpdateResponse = Cloud; - -// @public -export interface CloudsDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface CloudsDeleteOptionalParams extends coreClient.OperationOptions { +export interface CloudsDeleteOptionalParams extends OperationOptions { force?: ForceDelete; - resumeFrom?: string; updateIntervalInMs?: number; } // @public -export type CloudsDeleteResponse = CloudsDeleteHeaders; - -// @public -export interface CloudsGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type CloudsGetResponse = Cloud; - -// @public -export interface CloudsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type CloudsListByResourceGroupNextResponse = CloudListResult; - -// @public -export interface CloudsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +export interface CloudsGetOptionalParams extends OperationOptions { } // @public -export type CloudsListByResourceGroupResponse = CloudListResult; - -// @public -export interface CloudsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +export interface CloudsListByResourceGroupOptionalParams extends OperationOptions { } // @public -export type CloudsListBySubscriptionNextResponse = CloudListResult; - -// @public -export interface CloudsListBySubscriptionOptionalParams extends coreClient.OperationOptions { +export interface CloudsListBySubscriptionOptionalParams extends OperationOptions { } // @public -export type CloudsListBySubscriptionResponse = CloudListResult; - -// @public -export interface CloudsUpdateHeaders { - location?: string; - retryAfter?: number; +export interface CloudsOperations { + createOrUpdate: (resourceGroupName: string, cloudResourceName: string, resource: Cloud, options?: CloudsCreateOrUpdateOptionalParams) => PollerLike, Cloud>; + delete: (resourceGroupName: string, cloudResourceName: string, options?: CloudsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, cloudResourceName: string, options?: CloudsGetOptionalParams) => Promise; + listByResourceGroup: (resourceGroupName: string, options?: CloudsListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listBySubscription: (options?: CloudsListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, cloudResourceName: string, properties: CloudTagsUpdate, options?: CloudsUpdateOptionalParams) => PollerLike, Cloud>; } // @public -export interface CloudsUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface CloudsUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type CloudsUpdateResponse = Cloud; - // @public export interface CloudTagsUpdate { - tags?: { - [propertyName: string]: string; - }; + tags?: Record; } +// @public +export type ContinuablePage = TPage & { + continuationToken?: string; +}; + // @public export type CreatedByType = string; @@ -300,7 +180,7 @@ export type DynamicMemoryEnabled = string; // @public export interface ErrorAdditionalInfo { - readonly info?: Record; + readonly info?: Record; readonly type?: string; } @@ -325,27 +205,23 @@ export interface ExtendedLocation { } // @public -export type ForceDelete = string; +export interface ExtensionResource extends Resource { +} // @public -export function getContinuationToken(page: unknown): string | undefined; +export type ForceDelete = string; // @public export interface GuestAgent extends ProxyResource { properties?: GuestAgentProperties; } -// @public -export interface GuestAgentListResult { - readonly nextLink?: string; - value: GuestAgent[]; -} - // @public export interface GuestAgentProperties { credentials?: GuestCredential; readonly customResourceName?: string; httpProxyConfig?: HttpProxyConfiguration; + privateLinkScopeResourceId?: string; provisioningAction?: ProvisioningAction; readonly provisioningState?: ProvisioningState; readonly status?: string; @@ -353,53 +229,30 @@ export interface GuestAgentProperties { } // @public -export interface GuestAgents { - beginCreate(resourceUri: string, resource: GuestAgent, options?: GuestAgentsCreateOptionalParams): Promise, GuestAgentsCreateResponse>>; - beginCreateAndWait(resourceUri: string, resource: GuestAgent, options?: GuestAgentsCreateOptionalParams): Promise; - delete(resourceUri: string, options?: GuestAgentsDeleteOptionalParams): Promise; - get(resourceUri: string, options?: GuestAgentsGetOptionalParams): Promise; - listByVirtualMachineInstance(resourceUri: string, options?: GuestAgentsListByVirtualMachineInstanceOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface GuestAgentsCreateHeaders { - retryAfter?: number; -} - -// @public -export interface GuestAgentsCreateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GuestAgentsCreateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type GuestAgentsCreateResponse = GuestAgent; - -// @public -export interface GuestAgentsDeleteOptionalParams extends coreClient.OperationOptions { +export interface GuestAgentsDeleteOptionalParams extends OperationOptions { } // @public -export interface GuestAgentsGetOptionalParams extends coreClient.OperationOptions { +export interface GuestAgentsGetOptionalParams extends OperationOptions { } // @public -export type GuestAgentsGetResponse = GuestAgent; - -// @public -export interface GuestAgentsListByVirtualMachineInstanceNextOptionalParams extends coreClient.OperationOptions { +export interface GuestAgentsListByVirtualMachineInstanceOptionalParams extends OperationOptions { } // @public -export type GuestAgentsListByVirtualMachineInstanceNextResponse = GuestAgentListResult; - -// @public -export interface GuestAgentsListByVirtualMachineInstanceOptionalParams extends coreClient.OperationOptions { +export interface GuestAgentsOperations { + create: (resourceUri: string, resource: GuestAgent, options?: GuestAgentsCreateOptionalParams) => PollerLike, GuestAgent>; + delete: (resourceUri: string, options?: GuestAgentsDeleteOptionalParams) => Promise; + get: (resourceUri: string, options?: GuestAgentsGetOptionalParams) => Promise; + listByVirtualMachineInstance: (resourceUri: string, options?: GuestAgentsListByVirtualMachineInstanceOptionalParams) => PagedAsyncIterableIterator; } -// @public -export type GuestAgentsListByVirtualMachineInstanceResponse = GuestAgentListResult; - // @public export interface GuestCredential { password: string; @@ -464,64 +317,42 @@ export interface InventoryItemDetails { inventoryItemName?: string; } -// @public -export interface InventoryItemListResult { - readonly nextLink?: string; - value: InventoryItem[]; -} - // @public export interface InventoryItemProperties { readonly inventoryItemName?: string; - inventoryType: "Cloud" | "VirtualMachine" | "VirtualMachineTemplate" | "VirtualNetwork"; + inventoryType: InventoryType; readonly managedResourceId?: string; readonly provisioningState?: ProvisioningState; readonly uuid?: string; } -// @public (undocumented) -export type InventoryItemPropertiesUnion = InventoryItemProperties | CloudInventoryItem | VirtualMachineInventoryItem | VirtualMachineTemplateInventoryItem | VirtualNetworkInventoryItem; - // @public -export interface InventoryItems { - create(resourceGroupName: string, vmmServerName: string, inventoryItemResourceName: string, resource: InventoryItem, options?: InventoryItemsCreateOptionalParams): Promise; - delete(resourceGroupName: string, vmmServerName: string, inventoryItemResourceName: string, options?: InventoryItemsDeleteOptionalParams): Promise; - get(resourceGroupName: string, vmmServerName: string, inventoryItemResourceName: string, options?: InventoryItemsGetOptionalParams): Promise; - listByVmmServer(resourceGroupName: string, vmmServerName: string, options?: InventoryItemsListByVmmServerOptionalParams): PagedAsyncIterableIterator; -} +export type InventoryItemPropertiesUnion = CloudInventoryItem | VirtualNetworkInventoryItem | VirtualMachineTemplateInventoryItem | VirtualMachineInventoryItem | InventoryItemProperties; // @public -export interface InventoryItemsCreateOptionalParams extends coreClient.OperationOptions { +export interface InventoryItemsCreateOptionalParams extends OperationOptions { } // @public -export type InventoryItemsCreateResponse = InventoryItem; - -// @public -export interface InventoryItemsDeleteOptionalParams extends coreClient.OperationOptions { +export interface InventoryItemsDeleteOptionalParams extends OperationOptions { } // @public -export interface InventoryItemsGetOptionalParams extends coreClient.OperationOptions { +export interface InventoryItemsGetOptionalParams extends OperationOptions { } // @public -export type InventoryItemsGetResponse = InventoryItem; - -// @public -export interface InventoryItemsListByVmmServerNextOptionalParams extends coreClient.OperationOptions { +export interface InventoryItemsListByVmmServerOptionalParams extends OperationOptions { } // @public -export type InventoryItemsListByVmmServerNextResponse = InventoryItemListResult; - -// @public -export interface InventoryItemsListByVmmServerOptionalParams extends coreClient.OperationOptions { +export interface InventoryItemsOperations { + create: (resourceGroupName: string, vmmServerName: string, inventoryItemResourceName: string, resource: InventoryItem, options?: InventoryItemsCreateOptionalParams) => Promise; + delete: (resourceGroupName: string, vmmServerName: string, inventoryItemResourceName: string, options?: InventoryItemsDeleteOptionalParams) => Promise; + get: (resourceGroupName: string, vmmServerName: string, inventoryItemResourceName: string, options?: InventoryItemsGetOptionalParams) => Promise; + listByVmmServer: (resourceGroupName: string, vmmServerName: string, options?: InventoryItemsListByVmmServerOptionalParams) => PagedAsyncIterableIterator; } -// @public -export type InventoryItemsListByVmmServerResponse = InventoryItemListResult; - // @public export type InventoryType = string; @@ -552,26 +383,26 @@ export enum KnownCreatedByType { // @public export enum KnownCreateDiffDisk { - False = "false", - True = "true" + "false" = "false", + "true" = "true" } // @public export enum KnownDeleteFromHost { - False = "false", - True = "true" + "false" = "false", + "true" = "true" } // @public export enum KnownDynamicMemoryEnabled { - False = "false", - True = "true" + "false" = "false", + "true" = "true" } // @public export enum KnownForceDelete { - False = "false", - True = "true" + "false" = "false", + "true" = "true" } // @public @@ -584,27 +415,27 @@ export enum KnownInventoryType { // @public export enum KnownIsCustomizable { - False = "false", - True = "true" + "false" = "false", + "true" = "true" } // @public export enum KnownIsHighlyAvailable { - False = "false", - True = "true" + "false" = "false", + "true" = "true" } // @public export enum KnownLimitCpuForMigration { - False = "false", - True = "true" + "false" = "false", + "true" = "true" } // @public export enum KnownOrigin { - System = "system", - User = "user", - UserSystem = "user,system" + "user,system" = "user,system", + system = "system", + user = "user" } // @public @@ -616,27 +447,22 @@ export enum KnownOsType { // @public export enum KnownProvisioningAction { - Install = "install", - Repair = "repair", - Uninstall = "uninstall" + install = "install", + repair = "repair", + uninstall = "uninstall" } // @public -export enum KnownProvisioningState { - Accepted = "Accepted", +export enum KnownResourceProvisioningState { Canceled = "Canceled", - Created = "Created", - Deleting = "Deleting", Failed = "Failed", - Provisioning = "Provisioning", - Succeeded = "Succeeded", - Updating = "Updating" + Succeeded = "Succeeded" } // @public export enum KnownSkipShutdown { - False = "false", - True = "true" + "false" = "false", + "true" = "true" } // @public @@ -680,8 +506,8 @@ export interface NetworkProfileUpdate { // @public export interface Operation { - readonly actionType?: ActionType; - display?: OperationDisplay; + actionType?: ActionType; + readonly display?: OperationDisplay; readonly isDataAction?: boolean; readonly name?: string; readonly origin?: Origin; @@ -696,30 +522,14 @@ export interface OperationDisplay { } // @public -export interface OperationListResult { - readonly nextLink?: string; - readonly value?: Operation[]; +export interface OperationsListOptionalParams extends OperationOptions { } // @public -export interface Operations { - list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +export interface OperationsOperations { + list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator; } -// @public -export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type OperationsListNextResponse = OperationListResult; - -// @public -export interface OperationsListOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type OperationsListResponse = OperationListResult; - // @public export type Origin = string; @@ -727,19 +537,38 @@ export type Origin = string; export interface OsProfileForVmInstance { adminPassword?: string; computerName?: string; + domainName?: string; + domainPassword?: string; + domainUsername?: string; readonly osSku?: string; readonly osType?: OsType; readonly osVersion?: string; + productKey?: string; + runOnceCommands?: string; + timezone?: number; + workgroup?: string; } // @public export type OsType = string; +// @public +export interface PagedAsyncIterableIterator { + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; + next(): Promise>; +} + +// @public +export interface PageSettings { + continuationToken?: string; +} + // @public export type ProvisioningAction = string; // @public -export type ProvisioningState = string; +export type ProvisioningState = string | ResourceProvisioningState | "Provisioning" | "Updating" | "Deleting" | "Accepted" | "Created"; // @public export interface ProxyResource extends Resource { @@ -753,43 +582,38 @@ export interface Resource { readonly type?: string; } +// @public +export type ResourceProvisioningState = string; + +// @public +export function restorePoller(client: ScVmmClient, serializedState: string, sourceOperation: (...args: any[]) => PollerLike, TResult>, options?: RestorePollerOptions): PollerLike, TResult>; + // @public (undocumented) -export class ScVmm extends coreClient.ServiceClient { - // (undocumented) - $host: string; - constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ScVmmOptionalParams); - constructor(credentials: coreAuth.TokenCredential, options?: ScVmmOptionalParams); - // (undocumented) - apiVersion: string; - // (undocumented) - availabilitySets: AvailabilitySets; - // (undocumented) - clouds: Clouds; - // (undocumented) - guestAgents: GuestAgents; - // (undocumented) - inventoryItems: InventoryItems; - // (undocumented) - operations: Operations; - // (undocumented) - subscriptionId?: string; - // (undocumented) - virtualMachineInstances: VirtualMachineInstances; - // (undocumented) - virtualMachineTemplates: VirtualMachineTemplates; - // (undocumented) - virtualNetworks: VirtualNetworks; - // (undocumented) - vmInstanceHybridIdentityMetadatas: VmInstanceHybridIdentityMetadatas; - // (undocumented) - vmmServers: VmmServers; -} - -// @public -export interface ScVmmOptionalParams extends coreClient.ServiceClientOptions { - $host?: string; +export interface RestorePollerOptions extends OperationOptions { + abortSignal?: AbortSignalLike; + processResponseBody?: (result: TResponse) => Promise; + updateIntervalInMs?: number; +} + +// @public (undocumented) +export class ScVmmClient { + constructor(credential: TokenCredential, subscriptionId: string, options?: ScVmmClientOptionalParams); + readonly availabilitySets: AvailabilitySetsOperations; + readonly clouds: CloudsOperations; + readonly guestAgents: GuestAgentsOperations; + readonly inventoryItems: InventoryItemsOperations; + readonly operations: OperationsOperations; + readonly pipeline: Pipeline; + readonly virtualMachineInstances: VirtualMachineInstancesOperations; + readonly virtualMachineTemplates: VirtualMachineTemplatesOperations; + readonly virtualNetworks: VirtualNetworksOperations; + readonly vmInstanceHybridIdentityMetadatas: VmInstanceHybridIdentityMetadatasOperations; + readonly vmmServers: VmmServersOperations; +} + +// @public +export interface ScVmmClientOptionalParams extends ClientOptions { apiVersion?: string; - endpoint?: string; } // @public @@ -839,11 +663,12 @@ export interface SystemData { // @public export interface TrackedResource extends Resource { location: string; - tags?: { - [propertyName: string]: string; - }; + tags?: Record; } +// @public +export type Versions = "2023-10-07" | "2024-06-01"; + // @public export interface VirtualDisk { bus?: number; @@ -886,17 +711,11 @@ export interface VirtualMachineDeleteCheckpoint { } // @public -export interface VirtualMachineInstance extends ProxyResource { +export interface VirtualMachineInstance extends ExtensionResource { extendedLocation: ExtendedLocation; properties?: VirtualMachineInstanceProperties; } -// @public -export interface VirtualMachineInstanceListResult { - readonly nextLink?: string; - value: VirtualMachineInstance[]; -} - // @public export interface VirtualMachineInstanceProperties { availabilitySets?: AvailabilitySetListItem[]; @@ -910,186 +729,75 @@ export interface VirtualMachineInstanceProperties { } // @public -export interface VirtualMachineInstances { - beginCreateCheckpoint(resourceUri: string, body: VirtualMachineCreateCheckpoint, options?: VirtualMachineInstancesCreateCheckpointOptionalParams): Promise, VirtualMachineInstancesCreateCheckpointResponse>>; - beginCreateCheckpointAndWait(resourceUri: string, body: VirtualMachineCreateCheckpoint, options?: VirtualMachineInstancesCreateCheckpointOptionalParams): Promise; - beginCreateOrUpdate(resourceUri: string, resource: VirtualMachineInstance, options?: VirtualMachineInstancesCreateOrUpdateOptionalParams): Promise, VirtualMachineInstancesCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceUri: string, resource: VirtualMachineInstance, options?: VirtualMachineInstancesCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceUri: string, options?: VirtualMachineInstancesDeleteOptionalParams): Promise, VirtualMachineInstancesDeleteResponse>>; - beginDeleteAndWait(resourceUri: string, options?: VirtualMachineInstancesDeleteOptionalParams): Promise; - beginDeleteCheckpoint(resourceUri: string, body: VirtualMachineDeleteCheckpoint, options?: VirtualMachineInstancesDeleteCheckpointOptionalParams): Promise, VirtualMachineInstancesDeleteCheckpointResponse>>; - beginDeleteCheckpointAndWait(resourceUri: string, body: VirtualMachineDeleteCheckpoint, options?: VirtualMachineInstancesDeleteCheckpointOptionalParams): Promise; - beginRestart(resourceUri: string, options?: VirtualMachineInstancesRestartOptionalParams): Promise, VirtualMachineInstancesRestartResponse>>; - beginRestartAndWait(resourceUri: string, options?: VirtualMachineInstancesRestartOptionalParams): Promise; - beginRestoreCheckpoint(resourceUri: string, body: VirtualMachineRestoreCheckpoint, options?: VirtualMachineInstancesRestoreCheckpointOptionalParams): Promise, VirtualMachineInstancesRestoreCheckpointResponse>>; - beginRestoreCheckpointAndWait(resourceUri: string, body: VirtualMachineRestoreCheckpoint, options?: VirtualMachineInstancesRestoreCheckpointOptionalParams): Promise; - beginStart(resourceUri: string, options?: VirtualMachineInstancesStartOptionalParams): Promise, VirtualMachineInstancesStartResponse>>; - beginStartAndWait(resourceUri: string, options?: VirtualMachineInstancesStartOptionalParams): Promise; - beginStop(resourceUri: string, body: StopVirtualMachineOptions, options?: VirtualMachineInstancesStopOptionalParams): Promise, VirtualMachineInstancesStopResponse>>; - beginStopAndWait(resourceUri: string, body: StopVirtualMachineOptions, options?: VirtualMachineInstancesStopOptionalParams): Promise; - beginUpdate(resourceUri: string, properties: VirtualMachineInstanceUpdate, options?: VirtualMachineInstancesUpdateOptionalParams): Promise, VirtualMachineInstancesUpdateResponse>>; - beginUpdateAndWait(resourceUri: string, properties: VirtualMachineInstanceUpdate, options?: VirtualMachineInstancesUpdateOptionalParams): Promise; - get(resourceUri: string, options?: VirtualMachineInstancesGetOptionalParams): Promise; - list(resourceUri: string, options?: VirtualMachineInstancesListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface VirtualMachineInstancesCreateCheckpointHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineInstancesCreateCheckpointOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineInstancesCreateCheckpointOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VirtualMachineInstancesCreateCheckpointResponse = VirtualMachineInstancesCreateCheckpointHeaders; - -// @public -export interface VirtualMachineInstancesCreateOrUpdateHeaders { - retryAfter?: number; -} - -// @public -export interface VirtualMachineInstancesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineInstancesCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VirtualMachineInstancesCreateOrUpdateResponse = VirtualMachineInstance; - -// @public -export interface VirtualMachineInstancesDeleteCheckpointHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineInstancesDeleteCheckpointOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineInstancesDeleteCheckpointOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VirtualMachineInstancesDeleteCheckpointResponse = VirtualMachineInstancesDeleteCheckpointHeaders; - -// @public -export interface VirtualMachineInstancesDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineInstancesDeleteOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineInstancesDeleteOptionalParams extends OperationOptions { deleteFromHost?: DeleteFromHost; force?: ForceDelete; - resumeFrom?: string; updateIntervalInMs?: number; } // @public -export type VirtualMachineInstancesDeleteResponse = VirtualMachineInstancesDeleteHeaders; - -// @public -export interface VirtualMachineInstancesGetOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineInstancesGetOptionalParams extends OperationOptions { } // @public -export type VirtualMachineInstancesGetResponse = VirtualMachineInstance; - -// @public -export interface VirtualMachineInstancesListNextOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineInstancesListOptionalParams extends OperationOptions { } // @public -export type VirtualMachineInstancesListNextResponse = VirtualMachineInstanceListResult; - -// @public -export interface VirtualMachineInstancesListOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineInstancesOperations { + createCheckpoint: (resourceUri: string, body: VirtualMachineCreateCheckpoint, options?: VirtualMachineInstancesCreateCheckpointOptionalParams) => PollerLike, void>; + createOrUpdate: (resourceUri: string, resource: VirtualMachineInstance, options?: VirtualMachineInstancesCreateOrUpdateOptionalParams) => PollerLike, VirtualMachineInstance>; + delete: (resourceUri: string, options?: VirtualMachineInstancesDeleteOptionalParams) => PollerLike, void>; + deleteCheckpoint: (resourceUri: string, body: VirtualMachineDeleteCheckpoint, options?: VirtualMachineInstancesDeleteCheckpointOptionalParams) => PollerLike, void>; + get: (resourceUri: string, options?: VirtualMachineInstancesGetOptionalParams) => Promise; + list: (resourceUri: string, options?: VirtualMachineInstancesListOptionalParams) => PagedAsyncIterableIterator; + restart: (resourceUri: string, options?: VirtualMachineInstancesRestartOptionalParams) => PollerLike, void>; + restoreCheckpoint: (resourceUri: string, body: VirtualMachineRestoreCheckpoint, options?: VirtualMachineInstancesRestoreCheckpointOptionalParams) => PollerLike, void>; + start: (resourceUri: string, options?: VirtualMachineInstancesStartOptionalParams) => PollerLike, void>; + stop: (resourceUri: string, body: StopVirtualMachineOptions, options?: VirtualMachineInstancesStopOptionalParams) => PollerLike, void>; + update: (resourceUri: string, properties: VirtualMachineInstanceUpdate, options?: VirtualMachineInstancesUpdateOptionalParams) => PollerLike, VirtualMachineInstance>; } // @public -export type VirtualMachineInstancesListResponse = VirtualMachineInstanceListResult; - -// @public -export interface VirtualMachineInstancesRestartHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineInstancesRestartOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineInstancesRestartOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VirtualMachineInstancesRestartResponse = VirtualMachineInstancesRestartHeaders; - -// @public -export interface VirtualMachineInstancesRestoreCheckpointHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineInstancesRestoreCheckpointOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineInstancesRestoreCheckpointOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VirtualMachineInstancesRestoreCheckpointResponse = VirtualMachineInstancesRestoreCheckpointHeaders; - -// @public -export interface VirtualMachineInstancesStartHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineInstancesStartOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineInstancesStartOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VirtualMachineInstancesStartResponse = VirtualMachineInstancesStartHeaders; - -// @public -export interface VirtualMachineInstancesStopHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineInstancesStopOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineInstancesStopOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VirtualMachineInstancesStopResponse = VirtualMachineInstancesStopHeaders; - -// @public -export interface VirtualMachineInstancesUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineInstancesUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineInstancesUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type VirtualMachineInstancesUpdateResponse = VirtualMachineInstance; - // @public export interface VirtualMachineInstanceUpdate { properties?: VirtualMachineInstanceUpdateProperties; @@ -1137,12 +845,6 @@ export interface VirtualMachineTemplateInventoryItem extends InventoryItemProper readonly osType?: OsType; } -// @public -export interface VirtualMachineTemplateListResult { - readonly nextLink?: string; - value: VirtualMachineTemplate[]; -} - // @public export interface VirtualMachineTemplateProperties { readonly computerName?: string; @@ -1166,103 +868,46 @@ export interface VirtualMachineTemplateProperties { } // @public -export interface VirtualMachineTemplates { - beginCreateOrUpdate(resourceGroupName: string, virtualMachineTemplateName: string, resource: VirtualMachineTemplate, options?: VirtualMachineTemplatesCreateOrUpdateOptionalParams): Promise, VirtualMachineTemplatesCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, virtualMachineTemplateName: string, resource: VirtualMachineTemplate, options?: VirtualMachineTemplatesCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, virtualMachineTemplateName: string, options?: VirtualMachineTemplatesDeleteOptionalParams): Promise, VirtualMachineTemplatesDeleteResponse>>; - beginDeleteAndWait(resourceGroupName: string, virtualMachineTemplateName: string, options?: VirtualMachineTemplatesDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, virtualMachineTemplateName: string, properties: VirtualMachineTemplateTagsUpdate, options?: VirtualMachineTemplatesUpdateOptionalParams): Promise, VirtualMachineTemplatesUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, virtualMachineTemplateName: string, properties: VirtualMachineTemplateTagsUpdate, options?: VirtualMachineTemplatesUpdateOptionalParams): Promise; - get(resourceGroupName: string, virtualMachineTemplateName: string, options?: VirtualMachineTemplatesGetOptionalParams): Promise; - listByResourceGroup(resourceGroupName: string, options?: VirtualMachineTemplatesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - listBySubscription(options?: VirtualMachineTemplatesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface VirtualMachineTemplatesCreateOrUpdateHeaders { - retryAfter?: number; -} - -// @public -export interface VirtualMachineTemplatesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineTemplatesCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VirtualMachineTemplatesCreateOrUpdateResponse = VirtualMachineTemplate; - -// @public -export interface VirtualMachineTemplatesDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineTemplatesDeleteOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineTemplatesDeleteOptionalParams extends OperationOptions { force?: ForceDelete; - resumeFrom?: string; updateIntervalInMs?: number; } // @public -export type VirtualMachineTemplatesDeleteResponse = VirtualMachineTemplatesDeleteHeaders; - -// @public -export interface VirtualMachineTemplatesGetOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineTemplatesGetOptionalParams extends OperationOptions { } // @public -export type VirtualMachineTemplatesGetResponse = VirtualMachineTemplate; - -// @public -export interface VirtualMachineTemplatesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineTemplatesListByResourceGroupOptionalParams extends OperationOptions { } // @public -export type VirtualMachineTemplatesListByResourceGroupNextResponse = VirtualMachineTemplateListResult; - -// @public -export interface VirtualMachineTemplatesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineTemplatesListBySubscriptionOptionalParams extends OperationOptions { } // @public -export type VirtualMachineTemplatesListByResourceGroupResponse = VirtualMachineTemplateListResult; - -// @public -export interface VirtualMachineTemplatesListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VirtualMachineTemplatesListBySubscriptionNextResponse = VirtualMachineTemplateListResult; - -// @public -export interface VirtualMachineTemplatesListBySubscriptionOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VirtualMachineTemplatesListBySubscriptionResponse = VirtualMachineTemplateListResult; - -// @public -export interface VirtualMachineTemplatesUpdateHeaders { - location?: string; - retryAfter?: number; +export interface VirtualMachineTemplatesOperations { + createOrUpdate: (resourceGroupName: string, virtualMachineTemplateName: string, resource: VirtualMachineTemplate, options?: VirtualMachineTemplatesCreateOrUpdateOptionalParams) => PollerLike, VirtualMachineTemplate>; + delete: (resourceGroupName: string, virtualMachineTemplateName: string, options?: VirtualMachineTemplatesDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, virtualMachineTemplateName: string, options?: VirtualMachineTemplatesGetOptionalParams) => Promise; + listByResourceGroup: (resourceGroupName: string, options?: VirtualMachineTemplatesListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listBySubscription: (options?: VirtualMachineTemplatesListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, virtualMachineTemplateName: string, properties: VirtualMachineTemplateTagsUpdate, options?: VirtualMachineTemplatesUpdateOptionalParams) => PollerLike, VirtualMachineTemplate>; } // @public -export interface VirtualMachineTemplatesUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineTemplatesUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type VirtualMachineTemplatesUpdateResponse = VirtualMachineTemplate; - // @public export interface VirtualMachineTemplateTagsUpdate { - tags?: { - [propertyName: string]: string; - }; + tags?: Record; } // @public @@ -1276,12 +921,6 @@ export interface VirtualNetworkInventoryItem extends InventoryItemProperties { inventoryType: "VirtualNetwork"; } -// @public -export interface VirtualNetworkListResult { - readonly nextLink?: string; - value: VirtualNetwork[]; -} - // @public export interface VirtualNetworkProperties { inventoryItemId?: string; @@ -1292,103 +931,46 @@ export interface VirtualNetworkProperties { } // @public -export interface VirtualNetworks { - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, resource: VirtualNetwork, options?: VirtualNetworksCreateOrUpdateOptionalParams): Promise, VirtualNetworksCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, virtualNetworkName: string, resource: VirtualNetwork, options?: VirtualNetworksCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, virtualNetworkName: string, options?: VirtualNetworksDeleteOptionalParams): Promise, VirtualNetworksDeleteResponse>>; - beginDeleteAndWait(resourceGroupName: string, virtualNetworkName: string, options?: VirtualNetworksDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, virtualNetworkName: string, properties: VirtualNetworkTagsUpdate, options?: VirtualNetworksUpdateOptionalParams): Promise, VirtualNetworksUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, virtualNetworkName: string, properties: VirtualNetworkTagsUpdate, options?: VirtualNetworksUpdateOptionalParams): Promise; - get(resourceGroupName: string, virtualNetworkName: string, options?: VirtualNetworksGetOptionalParams): Promise; - listByResourceGroup(resourceGroupName: string, options?: VirtualNetworksListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - listBySubscription(options?: VirtualNetworksListBySubscriptionOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface VirtualNetworksCreateOrUpdateHeaders { - retryAfter?: number; -} - -// @public -export interface VirtualNetworksCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualNetworksCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VirtualNetworksCreateOrUpdateResponse = VirtualNetwork; - -// @public -export interface VirtualNetworksDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualNetworksDeleteOptionalParams extends coreClient.OperationOptions { +export interface VirtualNetworksDeleteOptionalParams extends OperationOptions { force?: ForceDelete; - resumeFrom?: string; updateIntervalInMs?: number; } // @public -export type VirtualNetworksDeleteResponse = VirtualNetworksDeleteHeaders; - -// @public -export interface VirtualNetworksGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VirtualNetworksGetResponse = VirtualNetwork; - -// @public -export interface VirtualNetworksListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VirtualNetworksListByResourceGroupNextResponse = VirtualNetworkListResult; - -// @public -export interface VirtualNetworksListByResourceGroupOptionalParams extends coreClient.OperationOptions { +export interface VirtualNetworksGetOptionalParams extends OperationOptions { } // @public -export type VirtualNetworksListByResourceGroupResponse = VirtualNetworkListResult; - -// @public -export interface VirtualNetworksListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +export interface VirtualNetworksListByResourceGroupOptionalParams extends OperationOptions { } // @public -export type VirtualNetworksListBySubscriptionNextResponse = VirtualNetworkListResult; - -// @public -export interface VirtualNetworksListBySubscriptionOptionalParams extends coreClient.OperationOptions { +export interface VirtualNetworksListBySubscriptionOptionalParams extends OperationOptions { } // @public -export type VirtualNetworksListBySubscriptionResponse = VirtualNetworkListResult; - -// @public -export interface VirtualNetworksUpdateHeaders { - location?: string; - retryAfter?: number; +export interface VirtualNetworksOperations { + createOrUpdate: (resourceGroupName: string, virtualNetworkName: string, resource: VirtualNetwork, options?: VirtualNetworksCreateOrUpdateOptionalParams) => PollerLike, VirtualNetwork>; + delete: (resourceGroupName: string, virtualNetworkName: string, options?: VirtualNetworksDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, virtualNetworkName: string, options?: VirtualNetworksGetOptionalParams) => Promise; + listByResourceGroup: (resourceGroupName: string, options?: VirtualNetworksListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listBySubscription: (options?: VirtualNetworksListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, virtualNetworkName: string, properties: VirtualNetworkTagsUpdate, options?: VirtualNetworksUpdateOptionalParams) => PollerLike, VirtualNetwork>; } // @public -export interface VirtualNetworksUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualNetworksUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type VirtualNetworksUpdateResponse = VirtualNetwork; - // @public export interface VirtualNetworkTagsUpdate { - tags?: { - [propertyName: string]: string; - }; + tags?: Record; } // @public @@ -1396,12 +978,6 @@ export interface VmInstanceHybridIdentityMetadata extends ProxyResource { properties?: VmInstanceHybridIdentityMetadataProperties; } -// @public -export interface VmInstanceHybridIdentityMetadataListResult { - readonly nextLink?: string; - value: VmInstanceHybridIdentityMetadata[]; -} - // @public export interface VmInstanceHybridIdentityMetadataProperties { readonly provisioningState?: ProvisioningState; @@ -1410,32 +986,19 @@ export interface VmInstanceHybridIdentityMetadataProperties { } // @public -export interface VmInstanceHybridIdentityMetadatas { - get(resourceUri: string, options?: VmInstanceHybridIdentityMetadatasGetOptionalParams): Promise; - listByVirtualMachineInstance(resourceUri: string, options?: VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceOptionalParams): PagedAsyncIterableIterator; +export interface VmInstanceHybridIdentityMetadatasGetOptionalParams extends OperationOptions { } // @public -export interface VmInstanceHybridIdentityMetadatasGetOptionalParams extends coreClient.OperationOptions { +export interface VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceOptionalParams extends OperationOptions { } // @public -export type VmInstanceHybridIdentityMetadatasGetResponse = VmInstanceHybridIdentityMetadata; - -// @public -export interface VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceNextOptionalParams extends coreClient.OperationOptions { +export interface VmInstanceHybridIdentityMetadatasOperations { + get: (resourceUri: string, options?: VmInstanceHybridIdentityMetadatasGetOptionalParams) => Promise; + listByVirtualMachineInstance: (resourceUri: string, options?: VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceOptionalParams) => PagedAsyncIterableIterator; } -// @public -export type VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceNextResponse = VmInstanceHybridIdentityMetadataListResult; - -// @public -export interface VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceResponse = VmInstanceHybridIdentityMetadataListResult; - // @public export interface VmmCredential { password?: string; @@ -1448,12 +1011,6 @@ export interface VmmServer extends TrackedResource { properties?: VmmServerProperties; } -// @public -export interface VmmServerListResult { - readonly nextLink?: string; - value: VmmServer[]; -} - // @public export interface VmmServerProperties { readonly connectionStatus?: string; @@ -1467,103 +1024,46 @@ export interface VmmServerProperties { } // @public -export interface VmmServers { - beginCreateOrUpdate(resourceGroupName: string, vmmServerName: string, resource: VmmServer, options?: VmmServersCreateOrUpdateOptionalParams): Promise, VmmServersCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, vmmServerName: string, resource: VmmServer, options?: VmmServersCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, vmmServerName: string, options?: VmmServersDeleteOptionalParams): Promise, VmmServersDeleteResponse>>; - beginDeleteAndWait(resourceGroupName: string, vmmServerName: string, options?: VmmServersDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, vmmServerName: string, properties: VmmServerTagsUpdate, options?: VmmServersUpdateOptionalParams): Promise, VmmServersUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, vmmServerName: string, properties: VmmServerTagsUpdate, options?: VmmServersUpdateOptionalParams): Promise; - get(resourceGroupName: string, vmmServerName: string, options?: VmmServersGetOptionalParams): Promise; - listByResourceGroup(resourceGroupName: string, options?: VmmServersListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - listBySubscription(options?: VmmServersListBySubscriptionOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface VmmServersCreateOrUpdateHeaders { - retryAfter?: number; -} - -// @public -export interface VmmServersCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VmmServersCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VmmServersCreateOrUpdateResponse = VmmServer; - -// @public -export interface VmmServersDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VmmServersDeleteOptionalParams extends coreClient.OperationOptions { +export interface VmmServersDeleteOptionalParams extends OperationOptions { force?: ForceDelete; - resumeFrom?: string; updateIntervalInMs?: number; } // @public -export type VmmServersDeleteResponse = VmmServersDeleteHeaders; - -// @public -export interface VmmServersGetOptionalParams extends coreClient.OperationOptions { +export interface VmmServersGetOptionalParams extends OperationOptions { } // @public -export type VmmServersGetResponse = VmmServer; - -// @public -export interface VmmServersListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VmmServersListByResourceGroupNextResponse = VmmServerListResult; - -// @public -export interface VmmServersListByResourceGroupOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VmmServersListByResourceGroupResponse = VmmServerListResult; - -// @public -export interface VmmServersListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +export interface VmmServersListByResourceGroupOptionalParams extends OperationOptions { } // @public -export type VmmServersListBySubscriptionNextResponse = VmmServerListResult; - -// @public -export interface VmmServersListBySubscriptionOptionalParams extends coreClient.OperationOptions { +export interface VmmServersListBySubscriptionOptionalParams extends OperationOptions { } // @public -export type VmmServersListBySubscriptionResponse = VmmServerListResult; - -// @public -export interface VmmServersUpdateHeaders { - location?: string; - retryAfter?: number; +export interface VmmServersOperations { + createOrUpdate: (resourceGroupName: string, vmmServerName: string, resource: VmmServer, options?: VmmServersCreateOrUpdateOptionalParams) => PollerLike, VmmServer>; + delete: (resourceGroupName: string, vmmServerName: string, options?: VmmServersDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, vmmServerName: string, options?: VmmServersGetOptionalParams) => Promise; + listByResourceGroup: (resourceGroupName: string, options?: VmmServersListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listBySubscription: (options?: VmmServersListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, vmmServerName: string, properties: VmmServerTagsUpdate, options?: VmmServersUpdateOptionalParams) => PollerLike, VmmServer>; } // @public -export interface VmmServersUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VmmServersUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type VmmServersUpdateResponse = VmmServer; - // @public export interface VmmServerTagsUpdate { - tags?: { - [propertyName: string]: string; - }; + tags?: Record; } // (No @packageDocumentation comment for this package) diff --git a/sdk/scvmm/arm-scvmm/sample.env b/sdk/scvmm/arm-scvmm/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/scvmm/arm-scvmm/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# 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/scvmm/arm-scvmm/samples-dev/availabilitySetsCreateOrUpdateSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/availabilitySetsCreateOrUpdateSample.ts deleted file mode 100644 index f363a169869f..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/availabilitySetsCreateOrUpdateSample.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { AvailabilitySet, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Onboards the ScVmm availability set as an Azure resource. - * - * @summary Onboards the ScVmm availability set as an Azure resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_CreateOrUpdate_MaximumSet_Gen.json - */ -async function availabilitySetsCreateOrUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const availabilitySetResourceName = "-"; - const resource: AvailabilitySet = { - extendedLocation: { - name: "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName", - type: "customLocation", - }, - location: "jelevilan", - properties: { - availabilitySetName: "njrpftunzo", - vmmServerId: - "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName", - }, - tags: { key5701: "cldtxloqh" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.availabilitySets.beginCreateOrUpdateAndWait( - resourceGroupName, - availabilitySetResourceName, - resource, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Onboards the ScVmm availability set as an Azure resource. - * - * @summary Onboards the ScVmm availability set as an Azure resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_CreateOrUpdate_MinimumSet_Gen.json - */ -async function availabilitySetsCreateOrUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const availabilitySetResourceName = "_"; - const resource: AvailabilitySet = { - extendedLocation: {}, - location: "jelevilan", - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.availabilitySets.beginCreateOrUpdateAndWait( - resourceGroupName, - availabilitySetResourceName, - resource, - ); - console.log(result); -} - -async function main() { - availabilitySetsCreateOrUpdateMaximumSet(); - availabilitySetsCreateOrUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/availabilitySetsDeleteSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/availabilitySetsDeleteSample.ts deleted file mode 100644 index 8b703d87ce2d..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/availabilitySetsDeleteSample.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { AvailabilitySetsDeleteOptionalParams, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deregisters the ScVmm availability set from Azure. - * - * @summary Deregisters the ScVmm availability set from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Delete_MaximumSet_Gen.json - */ -async function availabilitySetsDeleteMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const force = "true"; - const availabilitySetResourceName = "_"; - const options: AvailabilitySetsDeleteOptionalParams = { force }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.availabilitySets.beginDeleteAndWait( - resourceGroupName, - availabilitySetResourceName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deregisters the ScVmm availability set from Azure. - * - * @summary Deregisters the ScVmm availability set from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Delete_MinimumSet_Gen.json - */ -async function availabilitySetsDeleteMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const availabilitySetResourceName = "6"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.availabilitySets.beginDeleteAndWait( - resourceGroupName, - availabilitySetResourceName, - ); - console.log(result); -} - -async function main() { - availabilitySetsDeleteMaximumSet(); - availabilitySetsDeleteMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/availabilitySetsGetSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/availabilitySetsGetSample.ts deleted file mode 100644 index 52e703776f9a..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/availabilitySetsGetSample.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Implements AvailabilitySet GET method. - * - * @summary Implements AvailabilitySet GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Get_MaximumSet_Gen.json - */ -async function availabilitySetsGetMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const availabilitySetResourceName = "-"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.availabilitySets.get( - resourceGroupName, - availabilitySetResourceName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Implements AvailabilitySet GET method. - * - * @summary Implements AvailabilitySet GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Get_MinimumSet_Gen.json - */ -async function availabilitySetsGetMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const availabilitySetResourceName = "V"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.availabilitySets.get( - resourceGroupName, - availabilitySetResourceName, - ); - console.log(result); -} - -async function main() { - availabilitySetsGetMaximumSet(); - availabilitySetsGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/availabilitySetsListByResourceGroupSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/availabilitySetsListByResourceGroupSample.ts deleted file mode 100644 index c2b35cc29ecb..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/availabilitySetsListByResourceGroupSample.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List of AvailabilitySets in a resource group. - * - * @summary List of AvailabilitySets in a resource group. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListByResourceGroup_MaximumSet_Gen.json - */ -async function availabilitySetsListByResourceGroupMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.availabilitySets.listByResourceGroup( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List of AvailabilitySets in a resource group. - * - * @summary List of AvailabilitySets in a resource group. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListByResourceGroup_MinimumSet_Gen.json - */ -async function availabilitySetsListByResourceGroupMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.availabilitySets.listByResourceGroup( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - availabilitySetsListByResourceGroupMaximumSet(); - availabilitySetsListByResourceGroupMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/availabilitySetsListBySubscriptionSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/availabilitySetsListBySubscriptionSample.ts deleted file mode 100644 index e66f6e5856fb..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/availabilitySetsListBySubscriptionSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List of AvailabilitySets in a subscription. - * - * @summary List of AvailabilitySets in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListBySubscription_MaximumSet_Gen.json - */ -async function availabilitySetsListBySubscriptionMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.availabilitySets.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List of AvailabilitySets in a subscription. - * - * @summary List of AvailabilitySets in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListBySubscription_MinimumSet_Gen.json - */ -async function availabilitySetsListBySubscriptionMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.availabilitySets.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - availabilitySetsListBySubscriptionMaximumSet(); - availabilitySetsListBySubscriptionMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/availabilitySetsUpdateSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/availabilitySetsUpdateSample.ts deleted file mode 100644 index da6cdc95765b..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/availabilitySetsUpdateSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { AvailabilitySetTagsUpdate, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates the AvailabilitySets resource. - * - * @summary Updates the AvailabilitySets resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Update_MaximumSet_Gen.json - */ -async function availabilitySetsUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const availabilitySetResourceName = "-"; - const properties: AvailabilitySetTagsUpdate = { - tags: { key1460: "vcbwibkvr" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.availabilitySets.beginUpdateAndWait( - resourceGroupName, - availabilitySetResourceName, - properties, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates the AvailabilitySets resource. - * - * @summary Updates the AvailabilitySets resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Update_MinimumSet_Gen.json - */ -async function availabilitySetsUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const availabilitySetResourceName = "1"; - const properties: AvailabilitySetTagsUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.availabilitySets.beginUpdateAndWait( - resourceGroupName, - availabilitySetResourceName, - properties, - ); - console.log(result); -} - -async function main() { - availabilitySetsUpdateMaximumSet(); - availabilitySetsUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/cloudsCreateOrUpdateSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/cloudsCreateOrUpdateSample.ts deleted file mode 100644 index 2fee70dc716f..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/cloudsCreateOrUpdateSample.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { Cloud, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Onboards the ScVmm fabric cloud as an Azure cloud resource. - * - * @summary Onboards the ScVmm fabric cloud as an Azure cloud resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_CreateOrUpdate_MaximumSet_Gen.json - */ -async function cloudsCreateOrUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const cloudResourceName = "2"; - const resource: Cloud = { - extendedLocation: { - name: "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName", - type: "customLocation", - }, - location: "khwsdmaxfhmbu", - properties: { - cloudCapacity: {}, - inventoryItemId: "qjd", - uuid: "12345678-1234-1234-1234-12345678abcd", - vmmServerId: - "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName", - }, - tags: { key4295: "wngosgcbdifaxdobufuuqxtho" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.clouds.beginCreateOrUpdateAndWait( - resourceGroupName, - cloudResourceName, - resource, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Onboards the ScVmm fabric cloud as an Azure cloud resource. - * - * @summary Onboards the ScVmm fabric cloud as an Azure cloud resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_CreateOrUpdate_MinimumSet_Gen.json - */ -async function cloudsCreateOrUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const cloudResourceName = "-"; - const resource: Cloud = { extendedLocation: {}, location: "khwsdmaxfhmbu" }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.clouds.beginCreateOrUpdateAndWait( - resourceGroupName, - cloudResourceName, - resource, - ); - console.log(result); -} - -async function main() { - cloudsCreateOrUpdateMaximumSet(); - cloudsCreateOrUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/cloudsDeleteSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/cloudsDeleteSample.ts deleted file mode 100644 index e9dfffe17abc..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/cloudsDeleteSample.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { CloudsDeleteOptionalParams, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deregisters the ScVmm fabric cloud from Azure. - * - * @summary Deregisters the ScVmm fabric cloud from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Delete_MaximumSet_Gen.json - */ -async function cloudsDeleteMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const force = "true"; - const cloudResourceName = "-"; - const options: CloudsDeleteOptionalParams = { force }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.clouds.beginDeleteAndWait( - resourceGroupName, - cloudResourceName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deregisters the ScVmm fabric cloud from Azure. - * - * @summary Deregisters the ScVmm fabric cloud from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Delete_MinimumSet_Gen.json - */ -async function cloudsDeleteMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const cloudResourceName = "1"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.clouds.beginDeleteAndWait( - resourceGroupName, - cloudResourceName, - ); - console.log(result); -} - -async function main() { - cloudsDeleteMaximumSet(); - cloudsDeleteMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/cloudsGetSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/cloudsGetSample.ts deleted file mode 100644 index 7982e24d3ab2..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/cloudsGetSample.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Implements Cloud GET method. - * - * @summary Implements Cloud GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Get_MaximumSet_Gen.json - */ -async function cloudsGetMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const cloudResourceName = "_"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.clouds.get(resourceGroupName, cloudResourceName); - console.log(result); -} - -/** - * This sample demonstrates how to Implements Cloud GET method. - * - * @summary Implements Cloud GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Get_MinimumSet_Gen.json - */ -async function cloudsGetMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const cloudResourceName = "i"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.clouds.get(resourceGroupName, cloudResourceName); - console.log(result); -} - -async function main() { - cloudsGetMaximumSet(); - cloudsGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/cloudsListByResourceGroupSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/cloudsListByResourceGroupSample.ts deleted file mode 100644 index 789a923c3673..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/cloudsListByResourceGroupSample.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List of Clouds in a resource group. - * - * @summary List of Clouds in a resource group. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListByResourceGroup_MaximumSet_Gen.json - */ -async function cloudsListByResourceGroupMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.clouds.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List of Clouds in a resource group. - * - * @summary List of Clouds in a resource group. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListByResourceGroup_MinimumSet_Gen.json - */ -async function cloudsListByResourceGroupMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.clouds.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - cloudsListByResourceGroupMaximumSet(); - cloudsListByResourceGroupMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/cloudsListBySubscriptionSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/cloudsListBySubscriptionSample.ts deleted file mode 100644 index d506c3b18926..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/cloudsListBySubscriptionSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List of Clouds in a subscription. - * - * @summary List of Clouds in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListBySubscription_MaximumSet_Gen.json - */ -async function cloudsListBySubscriptionMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.clouds.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List of Clouds in a subscription. - * - * @summary List of Clouds in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListBySubscription_MinimumSet_Gen.json - */ -async function cloudsListBySubscriptionMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.clouds.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - cloudsListBySubscriptionMaximumSet(); - cloudsListBySubscriptionMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/cloudsUpdateSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/cloudsUpdateSample.ts deleted file mode 100644 index ba9a79a60333..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/cloudsUpdateSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { CloudTagsUpdate, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates the Clouds resource. - * - * @summary Updates the Clouds resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Update_MaximumSet_Gen.json - */ -async function cloudsUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const cloudResourceName = "P"; - const properties: CloudTagsUpdate = { - tags: { key5266: "hjpcnwmpnixsolrxnbl" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.clouds.beginUpdateAndWait( - resourceGroupName, - cloudResourceName, - properties, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates the Clouds resource. - * - * @summary Updates the Clouds resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Update_MinimumSet_Gen.json - */ -async function cloudsUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const cloudResourceName = "_"; - const properties: CloudTagsUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.clouds.beginUpdateAndWait( - resourceGroupName, - cloudResourceName, - properties, - ); - console.log(result); -} - -async function main() { - cloudsUpdateMaximumSet(); - cloudsUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/guestAgentsCreateSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/guestAgentsCreateSample.ts deleted file mode 100644 index 423a5d0f91de..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/guestAgentsCreateSample.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create Or Update GuestAgent. - * - * @summary Create Or Update GuestAgent. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Create_MaximumSet_Gen.json - */ -async function guestAgentsCreateMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const resource: GuestAgent = { - properties: { - credentials: { - password: "SecretPlaceholder", - username: "jqxuwirrcpfv", - }, - httpProxyConfig: { httpsProxy: "uoyzyticmohohomlkwct" }, - provisioningAction: "install", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.guestAgents.beginCreateAndWait( - resourceUri, - resource, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create Or Update GuestAgent. - * - * @summary Create Or Update GuestAgent. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Create_MinimumSet_Gen.json - */ -async function guestAgentsCreateMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const resource: GuestAgent = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.guestAgents.beginCreateAndWait( - resourceUri, - resource, - ); - console.log(result); -} - -async function main() { - guestAgentsCreateMaximumSet(); - guestAgentsCreateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/guestAgentsDeleteSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/guestAgentsDeleteSample.ts deleted file mode 100644 index ffa1a27e1412..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/guestAgentsDeleteSample.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Implements GuestAgent DELETE method. - * - * @summary Implements GuestAgent DELETE method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Delete_MaximumSet_Gen.json - */ -async function guestAgentsDeleteMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.guestAgents.delete(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Implements GuestAgent DELETE method. - * - * @summary Implements GuestAgent DELETE method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Delete_MinimumSet_Gen.json - */ -async function guestAgentsDeleteMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.guestAgents.delete(resourceUri); - console.log(result); -} - -async function main() { - guestAgentsDeleteMaximumSet(); - guestAgentsDeleteMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/guestAgentsGetSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/guestAgentsGetSample.ts deleted file mode 100644 index 04b1abeba925..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/guestAgentsGetSample.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Implements GuestAgent GET method. - * - * @summary Implements GuestAgent GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Get_MaximumSet_Gen.json - */ -async function guestAgentsGetMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.guestAgents.get(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Implements GuestAgent GET method. - * - * @summary Implements GuestAgent GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Get_MinimumSet_Gen.json - */ -async function guestAgentsGetMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.guestAgents.get(resourceUri); - console.log(result); -} - -async function main() { - guestAgentsGetMaximumSet(); - guestAgentsGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/guestAgentsListByVirtualMachineInstanceSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/guestAgentsListByVirtualMachineInstanceSample.ts deleted file mode 100644 index 8894ec4ad475..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/guestAgentsListByVirtualMachineInstanceSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * 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/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_ListByVirtualMachineInstance_MaximumSet_Gen.json - */ -async function guestAgentsListByVirtualMachineInstanceMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const resArray = new Array(); - for await (let item of client.guestAgents.listByVirtualMachineInstance( - resourceUri, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * 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/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_ListByVirtualMachineInstance_MinimumSet_Gen.json - */ -async function guestAgentsListByVirtualMachineInstanceMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const resArray = new Array(); - for await (let item of client.guestAgents.listByVirtualMachineInstance( - resourceUri, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - guestAgentsListByVirtualMachineInstanceMaximumSet(); - guestAgentsListByVirtualMachineInstanceMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/inventoryItemsCreateSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/inventoryItemsCreateSample.ts deleted file mode 100644 index 428e9c53483f..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/inventoryItemsCreateSample.ts +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create Or Update InventoryItem. - * - * @summary Create Or Update InventoryItem. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Create_MaximumSet_Gen.json - */ -async function inventoryItemsCreateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "O"; - const inventoryItemResourceName = "1BdDc2Ab-bDd9-Ebd6-bfdb-C0dbbdB5DEDf"; - const resource: InventoryItem = { - kind: "M\\d_,V.", - properties: { inventoryType: "Cloud" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.inventoryItems.create( - resourceGroupName, - vmmServerName, - inventoryItemResourceName, - resource, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create Or Update InventoryItem. - * - * @summary Create Or Update InventoryItem. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Create_MinimumSet_Gen.json - */ -async function inventoryItemsCreateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "."; - const inventoryItemResourceName = "bbFb0cBb-50ce-4bfc-3eeD-bC26AbCC257a"; - const resource: InventoryItem = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.inventoryItems.create( - resourceGroupName, - vmmServerName, - inventoryItemResourceName, - resource, - ); - console.log(result); -} - -async function main() { - inventoryItemsCreateMaximumSet(); - inventoryItemsCreateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/inventoryItemsDeleteSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/inventoryItemsDeleteSample.ts deleted file mode 100644 index af70e0cea160..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/inventoryItemsDeleteSample.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes an inventoryItem. - * - * @summary Deletes an inventoryItem. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Delete_MaximumSet_Gen.json - */ -async function inventoryItemsDeleteMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "b"; - const inventoryItemResourceName = "EcECadfd-Eaaa-e5Ce-ebdA-badeEd3c6af1"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.inventoryItems.delete( - resourceGroupName, - vmmServerName, - inventoryItemResourceName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deletes an inventoryItem. - * - * @summary Deletes an inventoryItem. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Delete_MinimumSet_Gen.json - */ -async function inventoryItemsDeleteMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "_"; - const inventoryItemResourceName = "cDBcbae6-BC3d-52fe-CedC-7eFeaBFabb82"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.inventoryItems.delete( - resourceGroupName, - vmmServerName, - inventoryItemResourceName, - ); - console.log(result); -} - -async function main() { - inventoryItemsDeleteMaximumSet(); - inventoryItemsDeleteMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/inventoryItemsGetSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/inventoryItemsGetSample.ts deleted file mode 100644 index 391ba6b03e63..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/inventoryItemsGetSample.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Shows an inventory item. - * - * @summary Shows an inventory item. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Get_MaximumSet_Gen.json - */ -async function inventoryItemsGetMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "1"; - const inventoryItemResourceName = "2bFBede6-EEf8-becB-dBbd-B96DbBFdB3f3"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.inventoryItems.get( - resourceGroupName, - vmmServerName, - inventoryItemResourceName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Shows an inventory item. - * - * @summary Shows an inventory item. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Get_MinimumSet_Gen.json - */ -async function inventoryItemsGetMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "_"; - const inventoryItemResourceName = "cacb8Ceb-efAC-bebb-ae7C-dec8C5Bb7100"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.inventoryItems.get( - resourceGroupName, - vmmServerName, - inventoryItemResourceName, - ); - console.log(result); -} - -async function main() { - inventoryItemsGetMaximumSet(); - inventoryItemsGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/inventoryItemsListByVmmServerSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/inventoryItemsListByVmmServerSample.ts deleted file mode 100644 index 70790a76cd94..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/inventoryItemsListByVmmServerSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns the list of inventoryItems in the given VmmServer. - * - * @summary Returns the list of inventoryItems in the given VmmServer. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_ListByVmmServer_MaximumSet_Gen.json - */ -async function inventoryItemsListByVmmServerMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "X"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.inventoryItems.listByVmmServer( - resourceGroupName, - vmmServerName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Returns the list of inventoryItems in the given VmmServer. - * - * @summary Returns the list of inventoryItems in the given VmmServer. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_ListByVmmServer_MinimumSet_Gen.json - */ -async function inventoryItemsListByVmmServerMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "H"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.inventoryItems.listByVmmServer( - resourceGroupName, - vmmServerName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - inventoryItemsListByVmmServerMaximumSet(); - inventoryItemsListByVmmServerMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/operationsListSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/operationsListSample.ts deleted file mode 100644 index 956fbf324282..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/operationsListSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Operations_List_MaximumSet_Gen.json - */ -async function operationsListMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Operations_List_MinimumSet_Gen.json - */ -async function operationsListMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsListMaximumSet(); - operationsListMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesCreateCheckpointSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesCreateCheckpointSample.ts deleted file mode 100644 index b4db95544136..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesCreateCheckpointSample.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { VirtualMachineCreateCheckpoint, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates a checkpoint in virtual machine instance. - * - * @summary Creates a checkpoint in virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateCheckpoint_MaximumSet_Gen.json - */ -async function virtualMachineInstancesCreateCheckpointMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const body: VirtualMachineCreateCheckpoint = { - name: "ilvltf", - description: "zoozhfbepldrgpjqsbhpqebtodrhvy", - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.virtualMachineInstances.beginCreateCheckpointAndWait( - resourceUri, - body, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a checkpoint in virtual machine instance. - * - * @summary Creates a checkpoint in virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateCheckpoint_MinimumSet_Gen.json - */ -async function virtualMachineInstancesCreateCheckpointMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const body: VirtualMachineCreateCheckpoint = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.virtualMachineInstances.beginCreateCheckpointAndWait( - resourceUri, - body, - ); - console.log(result); -} - -async function main() { - virtualMachineInstancesCreateCheckpointMaximumSet(); - virtualMachineInstancesCreateCheckpointMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesCreateOrUpdateSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesCreateOrUpdateSample.ts deleted file mode 100644 index 125450f27168..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesCreateOrUpdateSample.ts +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { VirtualMachineInstance, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to The operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. - * - * @summary The operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateOrUpdate_MaximumSet_Gen.json - */ -async function virtualMachineInstancesCreateOrUpdateMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const resource: VirtualMachineInstance = { - extendedLocation: { - name: "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName", - type: "customLocation", - }, - properties: { - availabilitySets: [ - { - name: "lwbhaseo", - id: "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName", - }, - ], - hardwareProfile: { - cpuCount: 22, - dynamicMemoryEnabled: "true", - dynamicMemoryMaxMB: 2, - dynamicMemoryMinMB: 30, - isHighlyAvailable: "true", - limitCpuForMigration: "true", - memoryMB: 5, - }, - infrastructureProfile: { - biosGuid: "xixivxifyql", - checkpointType: "jkbpzjxpeegackhsvikrnlnwqz", - cloudId: - "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName", - generation: 28, - inventoryItemId: "ihkkqmg", - lastRestoredVmCheckpoint: { - name: "keqn", - description: "qurzfrgyflrh", - checkpointId: "wsqmrje", - parentCheckpointId: "hqhhzikoxunuqguouw", - }, - templateId: - "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName", - uuid: "hrpw", - vmName: "qovpayfydhcvfrhe", - vmmServerId: - "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName", - }, - networkProfile: { - networkInterfaces: [ - { - name: "kvofzqulbjlbtt", - ipv4AddressType: "Dynamic", - ipv6AddressType: "Dynamic", - macAddress: "oaeqqegt", - macAddressType: "Dynamic", - nicId: "roxpsvlo", - virtualNetworkId: - "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName", - }, - ], - }, - osProfile: { - adminPassword: "vavtppmmhlspydtkzxda", - computerName: "uuxpcxuxcufllc", - osType: "Windows", - }, - storageProfile: { - disks: [ - { - name: "fgnckfymwdsqnfxkdvexuaobe", - bus: 8, - busType: "zu", - createDiffDisk: "true", - diskId: "ltdrwcfjklpsimhzqyh", - diskSizeGB: 30, - lun: 10, - storageQosPolicy: { name: "ceiyfrflu", id: "o" }, - templateDiskId: "lcdwrokpyvekqccclf", - vhdType: "cnbeeeylrvopigdynvgpkfp", - }, - ], - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.virtualMachineInstances.beginCreateOrUpdateAndWait( - resourceUri, - resource, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. - * - * @summary The operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateOrUpdate_MinimumSet_Gen.json - */ -async function virtualMachineInstancesCreateOrUpdateMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const resource: VirtualMachineInstance = { extendedLocation: {} }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.virtualMachineInstances.beginCreateOrUpdateAndWait( - resourceUri, - resource, - ); - console.log(result); -} - -async function main() { - virtualMachineInstancesCreateOrUpdateMaximumSet(); - virtualMachineInstancesCreateOrUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesDeleteCheckpointSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesDeleteCheckpointSample.ts deleted file mode 100644 index 8a48b77f48ad..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesDeleteCheckpointSample.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { VirtualMachineDeleteCheckpoint, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a checkpoint in virtual machine instance. - * - * @summary Deletes a checkpoint in virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_DeleteCheckpoint_MaximumSet_Gen.json - */ -async function virtualMachineInstancesDeleteCheckpointMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const body: VirtualMachineDeleteCheckpoint = { - id: "eenfflimcbgqfsebdusophahjpk", - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.virtualMachineInstances.beginDeleteCheckpointAndWait( - resourceUri, - body, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deletes a checkpoint in virtual machine instance. - * - * @summary Deletes a checkpoint in virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_DeleteCheckpoint_MinimumSet_Gen.json - */ -async function virtualMachineInstancesDeleteCheckpointMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const body: VirtualMachineDeleteCheckpoint = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.virtualMachineInstances.beginDeleteCheckpointAndWait( - resourceUri, - body, - ); - console.log(result); -} - -async function main() { - virtualMachineInstancesDeleteCheckpointMaximumSet(); - virtualMachineInstancesDeleteCheckpointMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesDeleteSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesDeleteSample.ts deleted file mode 100644 index 777f447ad7cb..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesDeleteSample.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { - VirtualMachineInstancesDeleteOptionalParams, - ScVmm, -} from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to The operation to delete a virtual machine instance. - * - * @summary The operation to delete a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Delete_MaximumSet_Gen.json - */ -async function virtualMachineInstancesDeleteMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const force = "true"; - const deleteFromHost = "true"; - const options: VirtualMachineInstancesDeleteOptionalParams = { - force, - deleteFromHost, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginDeleteAndWait( - resourceUri, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to delete a virtual machine instance. - * - * @summary The operation to delete a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Delete_MinimumSet_Gen.json - */ -async function virtualMachineInstancesDeleteMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.virtualMachineInstances.beginDeleteAndWait(resourceUri); - console.log(result); -} - -async function main() { - virtualMachineInstancesDeleteMaximumSet(); - virtualMachineInstancesDeleteMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesGetSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesGetSample.ts deleted file mode 100644 index d6aa371ab1fb..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesGetSample.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieves information about a virtual machine instance. - * - * @summary Retrieves information about a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Get_MaximumSet_Gen.json - */ -async function virtualMachineInstancesGetMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.get(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about a virtual machine instance. - * - * @summary Retrieves information about a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Get_MinimumSet_Gen.json - */ -async function virtualMachineInstancesGetMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.get(resourceUri); - console.log(result); -} - -async function main() { - virtualMachineInstancesGetMaximumSet(); - virtualMachineInstancesGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesListSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesListSample.ts deleted file mode 100644 index a19ead0943b0..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesListSample.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all of the virtual machine instances within the specified parent resource. - * - * @summary Lists all of the virtual machine instances within the specified parent resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_List_MaximumSet_Gen.json - */ -async function virtualMachineInstancesListMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const resArray = new Array(); - for await (let item of client.virtualMachineInstances.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Lists all of the virtual machine instances within the specified parent resource. - * - * @summary Lists all of the virtual machine instances within the specified parent resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_List_MinimumSet_Gen.json - */ -async function virtualMachineInstancesListMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const resArray = new Array(); - for await (let item of client.virtualMachineInstances.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - virtualMachineInstancesListMaximumSet(); - virtualMachineInstancesListMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesRestartSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesRestartSample.ts deleted file mode 100644 index 4eb9bb8bd90c..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesRestartSample.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to The operation to restart a virtual machine instance. - * - * @summary The operation to restart a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Restart_MaximumSet_Gen.json - */ -async function virtualMachineInstancesRestartMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.virtualMachineInstances.beginRestartAndWait(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to restart a virtual machine instance. - * - * @summary The operation to restart a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Restart_MinimumSet_Gen.json - */ -async function virtualMachineInstancesRestartMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.virtualMachineInstances.beginRestartAndWait(resourceUri); - console.log(result); -} - -async function main() { - virtualMachineInstancesRestartMaximumSet(); - virtualMachineInstancesRestartMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesRestoreCheckpointSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesRestoreCheckpointSample.ts deleted file mode 100644 index b5fe7ce03807..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesRestoreCheckpointSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { VirtualMachineRestoreCheckpoint, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Restores to a checkpoint in virtual machine instance. - * - * @summary Restores to a checkpoint in virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_RestoreCheckpoint_MaximumSet_Gen.json - */ -async function virtualMachineInstancesRestoreCheckpointMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const body: VirtualMachineRestoreCheckpoint = { id: "rweqduwzsn" }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.virtualMachineInstances.beginRestoreCheckpointAndWait( - resourceUri, - body, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Restores to a checkpoint in virtual machine instance. - * - * @summary Restores to a checkpoint in virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_RestoreCheckpoint_MinimumSet_Gen.json - */ -async function virtualMachineInstancesRestoreCheckpointMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const body: VirtualMachineRestoreCheckpoint = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.virtualMachineInstances.beginRestoreCheckpointAndWait( - resourceUri, - body, - ); - console.log(result); -} - -async function main() { - virtualMachineInstancesRestoreCheckpointMaximumSet(); - virtualMachineInstancesRestoreCheckpointMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesStartSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesStartSample.ts deleted file mode 100644 index 6fac55f78b65..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesStartSample.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to The operation to start a virtual machine instance. - * - * @summary The operation to start a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Start_MaximumSet_Gen.json - */ -async function virtualMachineInstancesStartMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.virtualMachineInstances.beginStartAndWait(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to start a virtual machine instance. - * - * @summary The operation to start a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Start_MinimumSet_Gen.json - */ -async function virtualMachineInstancesStartMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.virtualMachineInstances.beginStartAndWait(resourceUri); - console.log(result); -} - -async function main() { - virtualMachineInstancesStartMaximumSet(); - virtualMachineInstancesStartMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesStopSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesStopSample.ts deleted file mode 100644 index 69119b673bd9..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesStopSample.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to The operation to power off (stop) a virtual machine instance. - * - * @summary The operation to power off (stop) a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Stop_MaximumSet_Gen.json - */ -async function virtualMachineInstancesStopMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const body: StopVirtualMachineOptions = { skipShutdown: "true" }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginStopAndWait( - resourceUri, - body, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to power off (stop) a virtual machine instance. - * - * @summary The operation to power off (stop) a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Stop_MinimumSet_Gen.json - */ -async function virtualMachineInstancesStopMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const body: StopVirtualMachineOptions = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginStopAndWait( - resourceUri, - body, - ); - console.log(result); -} - -async function main() { - virtualMachineInstancesStopMaximumSet(); - virtualMachineInstancesStopMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesUpdateSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesUpdateSample.ts deleted file mode 100644 index 2488f17f9741..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineInstancesUpdateSample.ts +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { VirtualMachineInstanceUpdate, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to The operation to update a virtual machine instance. - * - * @summary The operation to update a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Update_MaximumSet_Gen.json - */ -async function virtualMachineInstancesUpdateMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const properties: VirtualMachineInstanceUpdate = { - properties: { - availabilitySets: [ - { - name: "lwbhaseo", - id: "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName", - }, - ], - hardwareProfile: { - cpuCount: 22, - dynamicMemoryEnabled: "true", - dynamicMemoryMaxMB: 2, - dynamicMemoryMinMB: 30, - limitCpuForMigration: "true", - memoryMB: 5, - }, - infrastructureProfile: { checkpointType: "jkbpzjxpeegackhsvikrnlnwqz" }, - networkProfile: { - networkInterfaces: [ - { - name: "kvofzqulbjlbtt", - ipv4AddressType: "Dynamic", - ipv6AddressType: "Dynamic", - macAddress: "oaeqqegt", - macAddressType: "Dynamic", - nicId: "roxpsvlo", - virtualNetworkId: - "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName", - }, - ], - }, - storageProfile: { - disks: [ - { - name: "fgnckfymwdsqnfxkdvexuaobe", - bus: 8, - busType: "zu", - diskId: "ltdrwcfjklpsimhzqyh", - diskSizeGB: 30, - lun: 10, - storageQosPolicy: { name: "ceiyfrflu", id: "o" }, - vhdType: "cnbeeeylrvopigdynvgpkfp", - }, - ], - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginUpdateAndWait( - resourceUri, - properties, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to update a virtual machine instance. - * - * @summary The operation to update a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Update_MinimumSet_Gen.json - */ -async function virtualMachineInstancesUpdateMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const properties: VirtualMachineInstanceUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginUpdateAndWait( - resourceUri, - properties, - ); - console.log(result); -} - -async function main() { - virtualMachineInstancesUpdateMaximumSet(); - virtualMachineInstancesUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineTemplatesCreateOrUpdateSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineTemplatesCreateOrUpdateSample.ts deleted file mode 100644 index ce4522197930..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineTemplatesCreateOrUpdateSample.ts +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Onboards the ScVmm VM Template as an Azure VM Template resource. - * - * @summary Onboards the ScVmm VM Template as an Azure VM Template resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_CreateOrUpdate_MaximumSet_Gen.json - */ -async function virtualMachineTemplatesCreateOrUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualMachineTemplateName = "6"; - const resource: VirtualMachineTemplate = { - extendedLocation: { - name: "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName", - type: "customLocation", - }, - location: "ayxsyduviotylbojh", - properties: { - dynamicMemoryEnabled: "true", - inventoryItemId: "qjrykoogccwlgkd", - isCustomizable: "true", - isHighlyAvailable: "true", - limitCpuForMigration: "true", - osType: "Windows", - uuid: "12345678-1234-1234-1234-12345678abcd", - vmmServerId: - "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName", - }, - tags: { key9494: "kkbmfpwhmvlobm" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = - await client.virtualMachineTemplates.beginCreateOrUpdateAndWait( - resourceGroupName, - virtualMachineTemplateName, - resource, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Onboards the ScVmm VM Template as an Azure VM Template resource. - * - * @summary Onboards the ScVmm VM Template as an Azure VM Template resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_CreateOrUpdate_MinimumSet_Gen.json - */ -async function virtualMachineTemplatesCreateOrUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualMachineTemplateName = "P"; - const resource: VirtualMachineTemplate = { - extendedLocation: {}, - location: "ayxsyduviotylbojh", - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = - await client.virtualMachineTemplates.beginCreateOrUpdateAndWait( - resourceGroupName, - virtualMachineTemplateName, - resource, - ); - console.log(result); -} - -async function main() { - virtualMachineTemplatesCreateOrUpdateMaximumSet(); - virtualMachineTemplatesCreateOrUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineTemplatesDeleteSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineTemplatesDeleteSample.ts deleted file mode 100644 index 5a420f0c84ba..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineTemplatesDeleteSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { - VirtualMachineTemplatesDeleteOptionalParams, - ScVmm, -} from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deregisters the ScVmm VM Template from Azure. - * - * @summary Deregisters the ScVmm VM Template from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Delete_MaximumSet_Gen.json - */ -async function virtualMachineTemplatesDeleteMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const force = "true"; - const virtualMachineTemplateName = "6"; - const options: VirtualMachineTemplatesDeleteOptionalParams = { force }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualMachineTemplates.beginDeleteAndWait( - resourceGroupName, - virtualMachineTemplateName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deregisters the ScVmm VM Template from Azure. - * - * @summary Deregisters the ScVmm VM Template from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Delete_MinimumSet_Gen.json - */ -async function virtualMachineTemplatesDeleteMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualMachineTemplateName = "5"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualMachineTemplates.beginDeleteAndWait( - resourceGroupName, - virtualMachineTemplateName, - ); - console.log(result); -} - -async function main() { - virtualMachineTemplatesDeleteMaximumSet(); - virtualMachineTemplatesDeleteMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineTemplatesGetSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineTemplatesGetSample.ts deleted file mode 100644 index cdf0ab30ce78..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineTemplatesGetSample.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Implements VirtualMachineTemplate GET method. - * - * @summary Implements VirtualMachineTemplate GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Get_MaximumSet_Gen.json - */ -async function virtualMachineTemplatesGetMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualMachineTemplateName = "4"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualMachineTemplates.get( - resourceGroupName, - virtualMachineTemplateName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Implements VirtualMachineTemplate GET method. - * - * @summary Implements VirtualMachineTemplate GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Get_MinimumSet_Gen.json - */ -async function virtualMachineTemplatesGetMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualMachineTemplateName = "m"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualMachineTemplates.get( - resourceGroupName, - virtualMachineTemplateName, - ); - console.log(result); -} - -async function main() { - virtualMachineTemplatesGetMaximumSet(); - virtualMachineTemplatesGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineTemplatesListByResourceGroupSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineTemplatesListByResourceGroupSample.ts deleted file mode 100644 index 1caead73611e..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineTemplatesListByResourceGroupSample.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * 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/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListByResourceGroup_MaximumSet_Gen.json - */ -async function virtualMachineTemplatesListByResourceGroupMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.virtualMachineTemplates.listByResourceGroup( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * 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/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListByResourceGroup_MinimumSet_Gen.json - */ -async function virtualMachineTemplatesListByResourceGroupMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.virtualMachineTemplates.listByResourceGroup( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - virtualMachineTemplatesListByResourceGroupMaximumSet(); - virtualMachineTemplatesListByResourceGroupMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineTemplatesListBySubscriptionSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineTemplatesListBySubscriptionSample.ts deleted file mode 100644 index 1c9fcc9dca09..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineTemplatesListBySubscriptionSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List of VirtualMachineTemplates in a subscription. - * - * @summary List of VirtualMachineTemplates in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListBySubscription_MaximumSet_Gen.json - */ -async function virtualMachineTemplatesListBySubscriptionMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.virtualMachineTemplates.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List of VirtualMachineTemplates in a subscription. - * - * @summary List of VirtualMachineTemplates in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListBySubscription_MinimumSet_Gen.json - */ -async function virtualMachineTemplatesListBySubscriptionMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.virtualMachineTemplates.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - virtualMachineTemplatesListBySubscriptionMaximumSet(); - virtualMachineTemplatesListBySubscriptionMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineTemplatesUpdateSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineTemplatesUpdateSample.ts deleted file mode 100644 index 960664aec886..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/virtualMachineTemplatesUpdateSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { VirtualMachineTemplateTagsUpdate, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates the VirtualMachineTemplate resource. - * - * @summary Updates the VirtualMachineTemplate resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Update_MaximumSet_Gen.json - */ -async function virtualMachineTemplatesUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualMachineTemplateName = "g"; - const properties: VirtualMachineTemplateTagsUpdate = { - tags: { key6634: "wwfhrg" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualMachineTemplates.beginUpdateAndWait( - resourceGroupName, - virtualMachineTemplateName, - properties, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates the VirtualMachineTemplate resource. - * - * @summary Updates the VirtualMachineTemplate resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Update_MinimumSet_Gen.json - */ -async function virtualMachineTemplatesUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualMachineTemplateName = "-"; - const properties: VirtualMachineTemplateTagsUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualMachineTemplates.beginUpdateAndWait( - resourceGroupName, - virtualMachineTemplateName, - properties, - ); - console.log(result); -} - -async function main() { - virtualMachineTemplatesUpdateMaximumSet(); - virtualMachineTemplatesUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/virtualNetworksCreateOrUpdateSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/virtualNetworksCreateOrUpdateSample.ts deleted file mode 100644 index 9d2830eb7c3c..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/virtualNetworksCreateOrUpdateSample.ts +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Onboards the ScVmm virtual network as an Azure virtual network resource. - * - * @summary Onboards the ScVmm virtual network as an Azure virtual network resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_CreateOrUpdate_MaximumSet_Gen.json - */ -async function virtualNetworksCreateOrUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualNetworkName = "_"; - const resource: VirtualNetwork = { - extendedLocation: { - name: "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName", - type: "customLocation", - }, - location: "fky", - properties: { - inventoryItemId: "bxn", - uuid: "12345678-1234-1234-1234-12345678abcd", - vmmServerId: - "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName", - }, - tags: { key705: "apgplvjdyocx" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualNetworks.beginCreateOrUpdateAndWait( - resourceGroupName, - virtualNetworkName, - resource, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Onboards the ScVmm virtual network as an Azure virtual network resource. - * - * @summary Onboards the ScVmm virtual network as an Azure virtual network resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_CreateOrUpdate_MinimumSet_Gen.json - */ -async function virtualNetworksCreateOrUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualNetworkName = "-"; - const resource: VirtualNetwork = { extendedLocation: {}, location: "fky" }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualNetworks.beginCreateOrUpdateAndWait( - resourceGroupName, - virtualNetworkName, - resource, - ); - console.log(result); -} - -async function main() { - virtualNetworksCreateOrUpdateMaximumSet(); - virtualNetworksCreateOrUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/virtualNetworksDeleteSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/virtualNetworksDeleteSample.ts deleted file mode 100644 index 28f6b14b1037..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/virtualNetworksDeleteSample.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { VirtualNetworksDeleteOptionalParams, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deregisters the ScVmm virtual network from Azure. - * - * @summary Deregisters the ScVmm virtual network from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Delete_MaximumSet_Gen.json - */ -async function virtualNetworksDeleteMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const force = "true"; - const virtualNetworkName = "."; - const options: VirtualNetworksDeleteOptionalParams = { force }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualNetworks.beginDeleteAndWait( - resourceGroupName, - virtualNetworkName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deregisters the ScVmm virtual network from Azure. - * - * @summary Deregisters the ScVmm virtual network from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Delete_MinimumSet_Gen.json - */ -async function virtualNetworksDeleteMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualNetworkName = "1"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualNetworks.beginDeleteAndWait( - resourceGroupName, - virtualNetworkName, - ); - console.log(result); -} - -async function main() { - virtualNetworksDeleteMaximumSet(); - virtualNetworksDeleteMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/virtualNetworksGetSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/virtualNetworksGetSample.ts deleted file mode 100644 index b87dd1bfdc27..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/virtualNetworksGetSample.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Implements VirtualNetwork GET method. - * - * @summary Implements VirtualNetwork GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Get_MaximumSet_Gen.json - */ -async function virtualNetworksGetMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualNetworkName = "2"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualNetworks.get( - resourceGroupName, - virtualNetworkName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Implements VirtualNetwork GET method. - * - * @summary Implements VirtualNetwork GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Get_MinimumSet_Gen.json - */ -async function virtualNetworksGetMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualNetworkName = "-"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualNetworks.get( - resourceGroupName, - virtualNetworkName, - ); - console.log(result); -} - -async function main() { - virtualNetworksGetMaximumSet(); - virtualNetworksGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/virtualNetworksListByResourceGroupSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/virtualNetworksListByResourceGroupSample.ts deleted file mode 100644 index f72b7db5bd09..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/virtualNetworksListByResourceGroupSample.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * 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/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListByResourceGroup_MaximumSet_Gen.json - */ -async function virtualNetworksListByResourceGroupMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.virtualNetworks.listByResourceGroup( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * 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/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListByResourceGroup_MinimumSet_Gen.json - */ -async function virtualNetworksListByResourceGroupMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.virtualNetworks.listByResourceGroup( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - virtualNetworksListByResourceGroupMaximumSet(); - virtualNetworksListByResourceGroupMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/virtualNetworksListBySubscriptionSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/virtualNetworksListBySubscriptionSample.ts deleted file mode 100644 index 617071d3cc34..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/virtualNetworksListBySubscriptionSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List of VirtualNetworks in a subscription. - * - * @summary List of VirtualNetworks in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListBySubscription_MaximumSet_Gen.json - */ -async function virtualNetworksListBySubscriptionMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.virtualNetworks.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List of VirtualNetworks in a subscription. - * - * @summary List of VirtualNetworks in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListBySubscription_MinimumSet_Gen.json - */ -async function virtualNetworksListBySubscriptionMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.virtualNetworks.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - virtualNetworksListBySubscriptionMaximumSet(); - virtualNetworksListBySubscriptionMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/virtualNetworksUpdateSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/virtualNetworksUpdateSample.ts deleted file mode 100644 index 0e7c6e0d05a3..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/virtualNetworksUpdateSample.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { VirtualNetworkTagsUpdate, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates the VirtualNetworks resource. - * - * @summary Updates the VirtualNetworks resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Update_MaximumSet_Gen.json - */ -async function virtualNetworksUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualNetworkName = "S"; - const properties: VirtualNetworkTagsUpdate = { tags: { key9516: "oxduo" } }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualNetworks.beginUpdateAndWait( - resourceGroupName, - virtualNetworkName, - properties, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates the VirtualNetworks resource. - * - * @summary Updates the VirtualNetworks resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Update_MinimumSet_Gen.json - */ -async function virtualNetworksUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualNetworkName = "-"; - const properties: VirtualNetworkTagsUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualNetworks.beginUpdateAndWait( - resourceGroupName, - virtualNetworkName, - properties, - ); - console.log(result); -} - -async function main() { - virtualNetworksUpdateMaximumSet(); - virtualNetworksUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/vmInstanceHybridIdentityMetadatasGetSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/vmInstanceHybridIdentityMetadatasGetSample.ts deleted file mode 100644 index 666d57258e58..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/vmInstanceHybridIdentityMetadatasGetSample.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Implements HybridIdentityMetadata GET method. - * - * @summary Implements HybridIdentityMetadata GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_Get_MaximumSet_Gen.json - */ -async function vmInstanceHybridIdentityMetadatasGetMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.vmInstanceHybridIdentityMetadatas.get(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Implements HybridIdentityMetadata GET method. - * - * @summary Implements HybridIdentityMetadata GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_Get_MinimumSet_Gen.json - */ -async function vmInstanceHybridIdentityMetadatasGetMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.vmInstanceHybridIdentityMetadatas.get(resourceUri); - console.log(result); -} - -async function main() { - vmInstanceHybridIdentityMetadatasGetMaximumSet(); - vmInstanceHybridIdentityMetadatasGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceSample.ts deleted file mode 100644 index 47e02cd8ffc7..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * 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/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_ListByVirtualMachineInstance_MaximumSet_Gen.json - */ -async function vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const resArray = new Array(); - for await (let item of client.vmInstanceHybridIdentityMetadatas.listByVirtualMachineInstance( - resourceUri, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * 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/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_ListByVirtualMachineInstance_MinimumSet_Gen.json - */ -async function vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const resArray = new Array(); - for await (let item of client.vmInstanceHybridIdentityMetadatas.listByVirtualMachineInstance( - resourceUri, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceMaximumSet(); - vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/vmmServersCreateOrUpdateSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/vmmServersCreateOrUpdateSample.ts deleted file mode 100644 index 85538df69c1b..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/vmmServersCreateOrUpdateSample.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { VmmServer, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Onboards the SCVmm fabric as an Azure VmmServer resource. - * - * @summary Onboards the SCVmm fabric as an Azure VmmServer resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_CreateOrUpdate_MaximumSet_Gen.json - */ -async function vmmServersCreateOrUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "-"; - const resource: VmmServer = { - extendedLocation: { - name: "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName", - type: "customLocation", - }, - location: "hslxkyzktvwpqbypvs", - properties: { - credentials: { password: "SecretPlaceholder", username: "jbuoltypmrgqfi" }, - fqdn: "pvzcjaqrswbvptgx", - port: 4, - }, - tags: { key4834: "vycgfkzjcyyuotwwq" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.vmmServers.beginCreateOrUpdateAndWait( - resourceGroupName, - vmmServerName, - resource, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Onboards the SCVmm fabric as an Azure VmmServer resource. - * - * @summary Onboards the SCVmm fabric as an Azure VmmServer resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_CreateOrUpdate_MinimumSet_Gen.json - */ -async function vmmServersCreateOrUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "w"; - const resource: VmmServer = { - extendedLocation: {}, - location: "hslxkyzktvwpqbypvs", - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.vmmServers.beginCreateOrUpdateAndWait( - resourceGroupName, - vmmServerName, - resource, - ); - console.log(result); -} - -async function main() { - vmmServersCreateOrUpdateMaximumSet(); - vmmServersCreateOrUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/vmmServersDeleteSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/vmmServersDeleteSample.ts deleted file mode 100644 index 8e20b9d4de19..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/vmmServersDeleteSample.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { VmmServersDeleteOptionalParams, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Removes the SCVmm fabric from Azure. - * - * @summary Removes the SCVmm fabric from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Delete_MaximumSet_Gen.json - */ -async function vmmServersDeleteMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const force = "true"; - const vmmServerName = "."; - const options: VmmServersDeleteOptionalParams = { force }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.vmmServers.beginDeleteAndWait( - resourceGroupName, - vmmServerName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Removes the SCVmm fabric from Azure. - * - * @summary Removes the SCVmm fabric from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Delete_MinimumSet_Gen.json - */ -async function vmmServersDeleteMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "8"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.vmmServers.beginDeleteAndWait( - resourceGroupName, - vmmServerName, - ); - console.log(result); -} - -async function main() { - vmmServersDeleteMaximumSet(); - vmmServersDeleteMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/vmmServersGetSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/vmmServersGetSample.ts deleted file mode 100644 index 67cba045f728..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/vmmServersGetSample.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Implements VmmServer GET method. - * - * @summary Implements VmmServer GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Get_MaximumSet_Gen.json - */ -async function vmmServersGetMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "."; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.vmmServers.get(resourceGroupName, vmmServerName); - console.log(result); -} - -/** - * This sample demonstrates how to Implements VmmServer GET method. - * - * @summary Implements VmmServer GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Get_MinimumSet_Gen.json - */ -async function vmmServersGetMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "D"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.vmmServers.get(resourceGroupName, vmmServerName); - console.log(result); -} - -async function main() { - vmmServersGetMaximumSet(); - vmmServersGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/vmmServersListByResourceGroupSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/vmmServersListByResourceGroupSample.ts deleted file mode 100644 index a7b93c8c576f..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/vmmServersListByResourceGroupSample.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List of VmmServers in a resource group. - * - * @summary List of VmmServers in a resource group. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListByResourceGroup_MaximumSet_Gen.json - */ -async function vmmServersListByResourceGroupMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.vmmServers.listByResourceGroup( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List of VmmServers in a resource group. - * - * @summary List of VmmServers in a resource group. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListByResourceGroup_MinimumSet_Gen.json - */ -async function vmmServersListByResourceGroupMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.vmmServers.listByResourceGroup( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - vmmServersListByResourceGroupMaximumSet(); - vmmServersListByResourceGroupMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/vmmServersListBySubscriptionSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/vmmServersListBySubscriptionSample.ts deleted file mode 100644 index 52f0c2e8878a..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/vmmServersListBySubscriptionSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List of VmmServers in a subscription. - * - * @summary List of VmmServers in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListBySubscription_MaximumSet_Gen.json - */ -async function vmmServersListBySubscriptionMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.vmmServers.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List of VmmServers in a subscription. - * - * @summary List of VmmServers in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListBySubscription_MinimumSet_Gen.json - */ -async function vmmServersListBySubscriptionMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.vmmServers.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - vmmServersListBySubscriptionMaximumSet(); - vmmServersListBySubscriptionMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples-dev/vmmServersUpdateSample.ts b/sdk/scvmm/arm-scvmm/samples-dev/vmmServersUpdateSample.ts deleted file mode 100644 index ff36e01ae601..000000000000 --- a/sdk/scvmm/arm-scvmm/samples-dev/vmmServersUpdateSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { VmmServerTagsUpdate, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates the VmmServers resource. - * - * @summary Updates the VmmServers resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Update_MaximumSet_Gen.json - */ -async function vmmServersUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "Y"; - const properties: VmmServerTagsUpdate = { - tags: { key7187: "oktnfvklfchnquelzzdagtpwfskzc" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.vmmServers.beginUpdateAndWait( - resourceGroupName, - vmmServerName, - properties, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates the VmmServers resource. - * - * @summary Updates the VmmServers resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Update_MinimumSet_Gen.json - */ -async function vmmServersUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "_"; - const properties: VmmServerTagsUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.vmmServers.beginUpdateAndWait( - resourceGroupName, - vmmServerName, - properties, - ); - console.log(result); -} - -async function main() { - vmmServersUpdateMaximumSet(); - vmmServersUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/README.md b/sdk/scvmm/arm-scvmm/samples/v1/javascript/README.md deleted file mode 100644 index 422ba897d17e..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/README.md +++ /dev/null @@ -1,152 +0,0 @@ -# client library samples for JavaScript - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| --------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| [availabilitySetsCreateOrUpdateSample.js][availabilitysetscreateorupdatesample] | Onboards the ScVmm availability set as an Azure resource. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_CreateOrUpdate_MaximumSet_Gen.json | -| [availabilitySetsDeleteSample.js][availabilitysetsdeletesample] | Deregisters the ScVmm availability set from Azure. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Delete_MaximumSet_Gen.json | -| [availabilitySetsGetSample.js][availabilitysetsgetsample] | Implements AvailabilitySet GET method. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Get_MaximumSet_Gen.json | -| [availabilitySetsListByResourceGroupSample.js][availabilitysetslistbyresourcegroupsample] | List of AvailabilitySets in a resource group. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListByResourceGroup_MaximumSet_Gen.json | -| [availabilitySetsListBySubscriptionSample.js][availabilitysetslistbysubscriptionsample] | List of AvailabilitySets in a subscription. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListBySubscription_MaximumSet_Gen.json | -| [availabilitySetsUpdateSample.js][availabilitysetsupdatesample] | Updates the AvailabilitySets resource. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Update_MaximumSet_Gen.json | -| [cloudsCreateOrUpdateSample.js][cloudscreateorupdatesample] | Onboards the ScVmm fabric cloud as an Azure cloud resource. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_CreateOrUpdate_MaximumSet_Gen.json | -| [cloudsDeleteSample.js][cloudsdeletesample] | Deregisters the ScVmm fabric cloud from Azure. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Delete_MaximumSet_Gen.json | -| [cloudsGetSample.js][cloudsgetsample] | Implements Cloud GET method. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Get_MaximumSet_Gen.json | -| [cloudsListByResourceGroupSample.js][cloudslistbyresourcegroupsample] | List of Clouds in a resource group. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListByResourceGroup_MaximumSet_Gen.json | -| [cloudsListBySubscriptionSample.js][cloudslistbysubscriptionsample] | List of Clouds in a subscription. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListBySubscription_MaximumSet_Gen.json | -| [cloudsUpdateSample.js][cloudsupdatesample] | Updates the Clouds resource. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Update_MaximumSet_Gen.json | -| [guestAgentsCreateSample.js][guestagentscreatesample] | Create Or Update GuestAgent. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Create_MaximumSet_Gen.json | -| [guestAgentsDeleteSample.js][guestagentsdeletesample] | Implements GuestAgent DELETE method. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Delete_MaximumSet_Gen.json | -| [guestAgentsGetSample.js][guestagentsgetsample] | Implements GuestAgent GET method. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Get_MaximumSet_Gen.json | -| [guestAgentsListByVirtualMachineInstanceSample.js][guestagentslistbyvirtualmachineinstancesample] | Returns the list of GuestAgent of the given vm. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_ListByVirtualMachineInstance_MaximumSet_Gen.json | -| [inventoryItemsCreateSample.js][inventoryitemscreatesample] | Create Or Update InventoryItem. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Create_MaximumSet_Gen.json | -| [inventoryItemsDeleteSample.js][inventoryitemsdeletesample] | Deletes an inventoryItem. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Delete_MaximumSet_Gen.json | -| [inventoryItemsGetSample.js][inventoryitemsgetsample] | Shows an inventory item. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Get_MaximumSet_Gen.json | -| [inventoryItemsListByVmmServerSample.js][inventoryitemslistbyvmmserversample] | Returns the list of inventoryItems in the given VmmServer. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_ListByVmmServer_MaximumSet_Gen.json | -| [operationsListSample.js][operationslistsample] | List the operations for the provider x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Operations_List_MaximumSet_Gen.json | -| [virtualMachineInstancesCreateCheckpointSample.js][virtualmachineinstancescreatecheckpointsample] | Creates a checkpoint in virtual machine instance. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateCheckpoint_MaximumSet_Gen.json | -| [virtualMachineInstancesCreateOrUpdateSample.js][virtualmachineinstancescreateorupdatesample] | The operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateOrUpdate_MaximumSet_Gen.json | -| [virtualMachineInstancesDeleteCheckpointSample.js][virtualmachineinstancesdeletecheckpointsample] | Deletes a checkpoint in virtual machine instance. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_DeleteCheckpoint_MaximumSet_Gen.json | -| [virtualMachineInstancesDeleteSample.js][virtualmachineinstancesdeletesample] | The operation to delete a virtual machine instance. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Delete_MaximumSet_Gen.json | -| [virtualMachineInstancesGetSample.js][virtualmachineinstancesgetsample] | Retrieves information about a virtual machine instance. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Get_MaximumSet_Gen.json | -| [virtualMachineInstancesListSample.js][virtualmachineinstanceslistsample] | Lists all of the virtual machine instances within the specified parent resource. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_List_MaximumSet_Gen.json | -| [virtualMachineInstancesRestartSample.js][virtualmachineinstancesrestartsample] | The operation to restart a virtual machine instance. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Restart_MaximumSet_Gen.json | -| [virtualMachineInstancesRestoreCheckpointSample.js][virtualmachineinstancesrestorecheckpointsample] | Restores to a checkpoint in virtual machine instance. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_RestoreCheckpoint_MaximumSet_Gen.json | -| [virtualMachineInstancesStartSample.js][virtualmachineinstancesstartsample] | The operation to start a virtual machine instance. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Start_MaximumSet_Gen.json | -| [virtualMachineInstancesStopSample.js][virtualmachineinstancesstopsample] | The operation to power off (stop) a virtual machine instance. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Stop_MaximumSet_Gen.json | -| [virtualMachineInstancesUpdateSample.js][virtualmachineinstancesupdatesample] | The operation to update a virtual machine instance. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Update_MaximumSet_Gen.json | -| [virtualMachineTemplatesCreateOrUpdateSample.js][virtualmachinetemplatescreateorupdatesample] | Onboards the ScVmm VM Template as an Azure VM Template resource. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_CreateOrUpdate_MaximumSet_Gen.json | -| [virtualMachineTemplatesDeleteSample.js][virtualmachinetemplatesdeletesample] | Deregisters the ScVmm VM Template from Azure. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Delete_MaximumSet_Gen.json | -| [virtualMachineTemplatesGetSample.js][virtualmachinetemplatesgetsample] | Implements VirtualMachineTemplate GET method. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Get_MaximumSet_Gen.json | -| [virtualMachineTemplatesListByResourceGroupSample.js][virtualmachinetemplateslistbyresourcegroupsample] | List of VirtualMachineTemplates in a resource group. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListByResourceGroup_MaximumSet_Gen.json | -| [virtualMachineTemplatesListBySubscriptionSample.js][virtualmachinetemplateslistbysubscriptionsample] | List of VirtualMachineTemplates in a subscription. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListBySubscription_MaximumSet_Gen.json | -| [virtualMachineTemplatesUpdateSample.js][virtualmachinetemplatesupdatesample] | Updates the VirtualMachineTemplate resource. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Update_MaximumSet_Gen.json | -| [virtualNetworksCreateOrUpdateSample.js][virtualnetworkscreateorupdatesample] | Onboards the ScVmm virtual network as an Azure virtual network resource. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_CreateOrUpdate_MaximumSet_Gen.json | -| [virtualNetworksDeleteSample.js][virtualnetworksdeletesample] | Deregisters the ScVmm virtual network from Azure. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Delete_MaximumSet_Gen.json | -| [virtualNetworksGetSample.js][virtualnetworksgetsample] | Implements VirtualNetwork GET method. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Get_MaximumSet_Gen.json | -| [virtualNetworksListByResourceGroupSample.js][virtualnetworkslistbyresourcegroupsample] | List of VirtualNetworks in a resource group. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListByResourceGroup_MaximumSet_Gen.json | -| [virtualNetworksListBySubscriptionSample.js][virtualnetworkslistbysubscriptionsample] | List of VirtualNetworks in a subscription. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListBySubscription_MaximumSet_Gen.json | -| [virtualNetworksUpdateSample.js][virtualnetworksupdatesample] | Updates the VirtualNetworks resource. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Update_MaximumSet_Gen.json | -| [vmInstanceHybridIdentityMetadatasGetSample.js][vminstancehybrididentitymetadatasgetsample] | Implements HybridIdentityMetadata GET method. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_Get_MaximumSet_Gen.json | -| [vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceSample.js][vminstancehybrididentitymetadataslistbyvirtualmachineinstancesample] | Returns the list of HybridIdentityMetadata of the given VM. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_ListByVirtualMachineInstance_MaximumSet_Gen.json | -| [vmmServersCreateOrUpdateSample.js][vmmserverscreateorupdatesample] | Onboards the SCVmm fabric as an Azure VmmServer resource. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_CreateOrUpdate_MaximumSet_Gen.json | -| [vmmServersDeleteSample.js][vmmserversdeletesample] | Removes the SCVmm fabric from Azure. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Delete_MaximumSet_Gen.json | -| [vmmServersGetSample.js][vmmserversgetsample] | Implements VmmServer GET method. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Get_MaximumSet_Gen.json | -| [vmmServersListByResourceGroupSample.js][vmmserverslistbyresourcegroupsample] | List of VmmServers in a resource group. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListByResourceGroup_MaximumSet_Gen.json | -| [vmmServersListBySubscriptionSample.js][vmmserverslistbysubscriptionsample] | List of VmmServers in a subscription. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListBySubscription_MaximumSet_Gen.json | -| [vmmServersUpdateSample.js][vmmserversupdatesample] | Updates the VmmServers resource. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Update_MaximumSet_Gen.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -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 availabilitySetsCreateOrUpdateSample.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 SCVMM_SUBSCRIPTION_ID="" SCVMM_RESOURCE_GROUP="" node availabilitySetsCreateOrUpdateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[availabilitysetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/availabilitySetsCreateOrUpdateSample.js -[availabilitysetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/availabilitySetsDeleteSample.js -[availabilitysetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/availabilitySetsGetSample.js -[availabilitysetslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/availabilitySetsListByResourceGroupSample.js -[availabilitysetslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/availabilitySetsListBySubscriptionSample.js -[availabilitysetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/availabilitySetsUpdateSample.js -[cloudscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/cloudsCreateOrUpdateSample.js -[cloudsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/cloudsDeleteSample.js -[cloudsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/cloudsGetSample.js -[cloudslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/cloudsListByResourceGroupSample.js -[cloudslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/cloudsListBySubscriptionSample.js -[cloudsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/cloudsUpdateSample.js -[guestagentscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/guestAgentsCreateSample.js -[guestagentsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/guestAgentsDeleteSample.js -[guestagentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/guestAgentsGetSample.js -[guestagentslistbyvirtualmachineinstancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/guestAgentsListByVirtualMachineInstanceSample.js -[inventoryitemscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/inventoryItemsCreateSample.js -[inventoryitemsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/inventoryItemsDeleteSample.js -[inventoryitemsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/inventoryItemsGetSample.js -[inventoryitemslistbyvmmserversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/inventoryItemsListByVmmServerSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/operationsListSample.js -[virtualmachineinstancescreatecheckpointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesCreateCheckpointSample.js -[virtualmachineinstancescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesCreateOrUpdateSample.js -[virtualmachineinstancesdeletecheckpointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesDeleteCheckpointSample.js -[virtualmachineinstancesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesDeleteSample.js -[virtualmachineinstancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesGetSample.js -[virtualmachineinstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesListSample.js -[virtualmachineinstancesrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesRestartSample.js -[virtualmachineinstancesrestorecheckpointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesRestoreCheckpointSample.js -[virtualmachineinstancesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesStartSample.js -[virtualmachineinstancesstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesStopSample.js -[virtualmachineinstancesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesUpdateSample.js -[virtualmachinetemplatescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineTemplatesCreateOrUpdateSample.js -[virtualmachinetemplatesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineTemplatesDeleteSample.js -[virtualmachinetemplatesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineTemplatesGetSample.js -[virtualmachinetemplateslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineTemplatesListByResourceGroupSample.js -[virtualmachinetemplateslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineTemplatesListBySubscriptionSample.js -[virtualmachinetemplatesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineTemplatesUpdateSample.js -[virtualnetworkscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualNetworksCreateOrUpdateSample.js -[virtualnetworksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualNetworksDeleteSample.js -[virtualnetworksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualNetworksGetSample.js -[virtualnetworkslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualNetworksListByResourceGroupSample.js -[virtualnetworkslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualNetworksListBySubscriptionSample.js -[virtualnetworksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualNetworksUpdateSample.js -[vminstancehybrididentitymetadatasgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmInstanceHybridIdentityMetadatasGetSample.js -[vminstancehybrididentitymetadataslistbyvirtualmachineinstancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceSample.js -[vmmserverscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmmServersCreateOrUpdateSample.js -[vmmserversdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmmServersDeleteSample.js -[vmmserversgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmmServersGetSample.js -[vmmserverslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmmServersListByResourceGroupSample.js -[vmmserverslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmmServersListBySubscriptionSample.js -[vmmserversupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmmServersUpdateSample.js -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-scvmm?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/scvmm/arm-scvmm/README.md diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/availabilitySetsCreateOrUpdateSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/availabilitySetsCreateOrUpdateSample.js deleted file mode 100644 index 218675a65f8f..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/availabilitySetsCreateOrUpdateSample.js +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Onboards the ScVmm availability set as an Azure resource. - * - * @summary Onboards the ScVmm availability set as an Azure resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_CreateOrUpdate_MaximumSet_Gen.json - */ -async function availabilitySetsCreateOrUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const availabilitySetResourceName = "-"; - const resource = { - extendedLocation: { - name: "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName", - type: "customLocation", - }, - location: "jelevilan", - properties: { - availabilitySetName: "njrpftunzo", - vmmServerId: - "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName", - }, - tags: { key5701: "cldtxloqh" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.availabilitySets.beginCreateOrUpdateAndWait( - resourceGroupName, - availabilitySetResourceName, - resource, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Onboards the ScVmm availability set as an Azure resource. - * - * @summary Onboards the ScVmm availability set as an Azure resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_CreateOrUpdate_MinimumSet_Gen.json - */ -async function availabilitySetsCreateOrUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const availabilitySetResourceName = "_"; - const resource = { - extendedLocation: {}, - location: "jelevilan", - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.availabilitySets.beginCreateOrUpdateAndWait( - resourceGroupName, - availabilitySetResourceName, - resource, - ); - console.log(result); -} - -async function main() { - availabilitySetsCreateOrUpdateMaximumSet(); - availabilitySetsCreateOrUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/availabilitySetsDeleteSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/availabilitySetsDeleteSample.js deleted file mode 100644 index 550a5a5b4f06..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/availabilitySetsDeleteSample.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deregisters the ScVmm availability set from Azure. - * - * @summary Deregisters the ScVmm availability set from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Delete_MaximumSet_Gen.json - */ -async function availabilitySetsDeleteMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const force = "true"; - const availabilitySetResourceName = "_"; - const options = { force }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.availabilitySets.beginDeleteAndWait( - resourceGroupName, - availabilitySetResourceName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deregisters the ScVmm availability set from Azure. - * - * @summary Deregisters the ScVmm availability set from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Delete_MinimumSet_Gen.json - */ -async function availabilitySetsDeleteMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const availabilitySetResourceName = "6"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.availabilitySets.beginDeleteAndWait( - resourceGroupName, - availabilitySetResourceName, - ); - console.log(result); -} - -async function main() { - availabilitySetsDeleteMaximumSet(); - availabilitySetsDeleteMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/availabilitySetsGetSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/availabilitySetsGetSample.js deleted file mode 100644 index 3fa190351368..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/availabilitySetsGetSample.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Implements AvailabilitySet GET method. - * - * @summary Implements AvailabilitySet GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Get_MaximumSet_Gen.json - */ -async function availabilitySetsGetMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const availabilitySetResourceName = "-"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.availabilitySets.get(resourceGroupName, availabilitySetResourceName); - console.log(result); -} - -/** - * This sample demonstrates how to Implements AvailabilitySet GET method. - * - * @summary Implements AvailabilitySet GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Get_MinimumSet_Gen.json - */ -async function availabilitySetsGetMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const availabilitySetResourceName = "V"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.availabilitySets.get(resourceGroupName, availabilitySetResourceName); - console.log(result); -} - -async function main() { - availabilitySetsGetMaximumSet(); - availabilitySetsGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/availabilitySetsListByResourceGroupSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/availabilitySetsListByResourceGroupSample.js deleted file mode 100644 index c7afb199c406..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/availabilitySetsListByResourceGroupSample.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List of AvailabilitySets in a resource group. - * - * @summary List of AvailabilitySets in a resource group. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListByResourceGroup_MaximumSet_Gen.json - */ -async function availabilitySetsListByResourceGroupMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.availabilitySets.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List of AvailabilitySets in a resource group. - * - * @summary List of AvailabilitySets in a resource group. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListByResourceGroup_MinimumSet_Gen.json - */ -async function availabilitySetsListByResourceGroupMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.availabilitySets.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - availabilitySetsListByResourceGroupMaximumSet(); - availabilitySetsListByResourceGroupMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/availabilitySetsListBySubscriptionSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/availabilitySetsListBySubscriptionSample.js deleted file mode 100644 index f783a6d45e62..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/availabilitySetsListBySubscriptionSample.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List of AvailabilitySets in a subscription. - * - * @summary List of AvailabilitySets in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListBySubscription_MaximumSet_Gen.json - */ -async function availabilitySetsListBySubscriptionMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.availabilitySets.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List of AvailabilitySets in a subscription. - * - * @summary List of AvailabilitySets in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListBySubscription_MinimumSet_Gen.json - */ -async function availabilitySetsListBySubscriptionMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.availabilitySets.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - availabilitySetsListBySubscriptionMaximumSet(); - availabilitySetsListBySubscriptionMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/availabilitySetsUpdateSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/availabilitySetsUpdateSample.js deleted file mode 100644 index 30bce88791ce..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/availabilitySetsUpdateSample.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates the AvailabilitySets resource. - * - * @summary Updates the AvailabilitySets resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Update_MaximumSet_Gen.json - */ -async function availabilitySetsUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const availabilitySetResourceName = "-"; - const properties = { - tags: { key1460: "vcbwibkvr" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.availabilitySets.beginUpdateAndWait( - resourceGroupName, - availabilitySetResourceName, - properties, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates the AvailabilitySets resource. - * - * @summary Updates the AvailabilitySets resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Update_MinimumSet_Gen.json - */ -async function availabilitySetsUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const availabilitySetResourceName = "1"; - const properties = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.availabilitySets.beginUpdateAndWait( - resourceGroupName, - availabilitySetResourceName, - properties, - ); - console.log(result); -} - -async function main() { - availabilitySetsUpdateMaximumSet(); - availabilitySetsUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/cloudsCreateOrUpdateSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/cloudsCreateOrUpdateSample.js deleted file mode 100644 index 1af414e9bd03..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/cloudsCreateOrUpdateSample.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Onboards the ScVmm fabric cloud as an Azure cloud resource. - * - * @summary Onboards the ScVmm fabric cloud as an Azure cloud resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_CreateOrUpdate_MaximumSet_Gen.json - */ -async function cloudsCreateOrUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const cloudResourceName = "2"; - const resource = { - extendedLocation: { - name: "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName", - type: "customLocation", - }, - location: "khwsdmaxfhmbu", - properties: { - cloudCapacity: {}, - inventoryItemId: "qjd", - uuid: "12345678-1234-1234-1234-12345678abcd", - vmmServerId: - "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName", - }, - tags: { key4295: "wngosgcbdifaxdobufuuqxtho" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.clouds.beginCreateOrUpdateAndWait( - resourceGroupName, - cloudResourceName, - resource, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Onboards the ScVmm fabric cloud as an Azure cloud resource. - * - * @summary Onboards the ScVmm fabric cloud as an Azure cloud resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_CreateOrUpdate_MinimumSet_Gen.json - */ -async function cloudsCreateOrUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const cloudResourceName = "-"; - const resource = { extendedLocation: {}, location: "khwsdmaxfhmbu" }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.clouds.beginCreateOrUpdateAndWait( - resourceGroupName, - cloudResourceName, - resource, - ); - console.log(result); -} - -async function main() { - cloudsCreateOrUpdateMaximumSet(); - cloudsCreateOrUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/cloudsDeleteSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/cloudsDeleteSample.js deleted file mode 100644 index 60980b4f6a90..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/cloudsDeleteSample.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deregisters the ScVmm fabric cloud from Azure. - * - * @summary Deregisters the ScVmm fabric cloud from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Delete_MaximumSet_Gen.json - */ -async function cloudsDeleteMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const force = "true"; - const cloudResourceName = "-"; - const options = { force }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.clouds.beginDeleteAndWait( - resourceGroupName, - cloudResourceName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deregisters the ScVmm fabric cloud from Azure. - * - * @summary Deregisters the ScVmm fabric cloud from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Delete_MinimumSet_Gen.json - */ -async function cloudsDeleteMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const cloudResourceName = "1"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.clouds.beginDeleteAndWait(resourceGroupName, cloudResourceName); - console.log(result); -} - -async function main() { - cloudsDeleteMaximumSet(); - cloudsDeleteMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/cloudsGetSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/cloudsGetSample.js deleted file mode 100644 index 993b25d21552..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/cloudsGetSample.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Implements Cloud GET method. - * - * @summary Implements Cloud GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Get_MaximumSet_Gen.json - */ -async function cloudsGetMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const cloudResourceName = "_"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.clouds.get(resourceGroupName, cloudResourceName); - console.log(result); -} - -/** - * This sample demonstrates how to Implements Cloud GET method. - * - * @summary Implements Cloud GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Get_MinimumSet_Gen.json - */ -async function cloudsGetMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const cloudResourceName = "i"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.clouds.get(resourceGroupName, cloudResourceName); - console.log(result); -} - -async function main() { - cloudsGetMaximumSet(); - cloudsGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/cloudsListByResourceGroupSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/cloudsListByResourceGroupSample.js deleted file mode 100644 index 9172ede63b52..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/cloudsListByResourceGroupSample.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List of Clouds in a resource group. - * - * @summary List of Clouds in a resource group. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListByResourceGroup_MaximumSet_Gen.json - */ -async function cloudsListByResourceGroupMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.clouds.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List of Clouds in a resource group. - * - * @summary List of Clouds in a resource group. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListByResourceGroup_MinimumSet_Gen.json - */ -async function cloudsListByResourceGroupMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.clouds.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - cloudsListByResourceGroupMaximumSet(); - cloudsListByResourceGroupMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/cloudsListBySubscriptionSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/cloudsListBySubscriptionSample.js deleted file mode 100644 index 2abf7fe31be3..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/cloudsListBySubscriptionSample.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List of Clouds in a subscription. - * - * @summary List of Clouds in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListBySubscription_MaximumSet_Gen.json - */ -async function cloudsListBySubscriptionMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.clouds.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List of Clouds in a subscription. - * - * @summary List of Clouds in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListBySubscription_MinimumSet_Gen.json - */ -async function cloudsListBySubscriptionMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.clouds.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - cloudsListBySubscriptionMaximumSet(); - cloudsListBySubscriptionMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/cloudsUpdateSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/cloudsUpdateSample.js deleted file mode 100644 index c320964b1dfc..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/cloudsUpdateSample.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates the Clouds resource. - * - * @summary Updates the Clouds resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Update_MaximumSet_Gen.json - */ -async function cloudsUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const cloudResourceName = "P"; - const properties = { - tags: { key5266: "hjpcnwmpnixsolrxnbl" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.clouds.beginUpdateAndWait( - resourceGroupName, - cloudResourceName, - properties, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates the Clouds resource. - * - * @summary Updates the Clouds resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Update_MinimumSet_Gen.json - */ -async function cloudsUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const cloudResourceName = "_"; - const properties = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.clouds.beginUpdateAndWait( - resourceGroupName, - cloudResourceName, - properties, - ); - console.log(result); -} - -async function main() { - cloudsUpdateMaximumSet(); - cloudsUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/guestAgentsCreateSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/guestAgentsCreateSample.js deleted file mode 100644 index dcad0bbd0290..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/guestAgentsCreateSample.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create Or Update GuestAgent. - * - * @summary Create Or Update GuestAgent. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Create_MaximumSet_Gen.json - */ -async function guestAgentsCreateMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const resource = { - properties: { - credentials: { - password: "SecretPlaceholder", - username: "jqxuwirrcpfv", - }, - httpProxyConfig: { httpsProxy: "uoyzyticmohohomlkwct" }, - provisioningAction: "install", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.guestAgents.beginCreateAndWait(resourceUri, resource); - console.log(result); -} - -/** - * This sample demonstrates how to Create Or Update GuestAgent. - * - * @summary Create Or Update GuestAgent. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Create_MinimumSet_Gen.json - */ -async function guestAgentsCreateMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const resource = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.guestAgents.beginCreateAndWait(resourceUri, resource); - console.log(result); -} - -async function main() { - guestAgentsCreateMaximumSet(); - guestAgentsCreateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/guestAgentsDeleteSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/guestAgentsDeleteSample.js deleted file mode 100644 index 29622352e698..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/guestAgentsDeleteSample.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Implements GuestAgent DELETE method. - * - * @summary Implements GuestAgent DELETE method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Delete_MaximumSet_Gen.json - */ -async function guestAgentsDeleteMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.guestAgents.delete(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Implements GuestAgent DELETE method. - * - * @summary Implements GuestAgent DELETE method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Delete_MinimumSet_Gen.json - */ -async function guestAgentsDeleteMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.guestAgents.delete(resourceUri); - console.log(result); -} - -async function main() { - guestAgentsDeleteMaximumSet(); - guestAgentsDeleteMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/guestAgentsGetSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/guestAgentsGetSample.js deleted file mode 100644 index 1f7dcb8f1455..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/guestAgentsGetSample.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Implements GuestAgent GET method. - * - * @summary Implements GuestAgent GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Get_MaximumSet_Gen.json - */ -async function guestAgentsGetMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.guestAgents.get(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Implements GuestAgent GET method. - * - * @summary Implements GuestAgent GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Get_MinimumSet_Gen.json - */ -async function guestAgentsGetMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.guestAgents.get(resourceUri); - console.log(result); -} - -async function main() { - guestAgentsGetMaximumSet(); - guestAgentsGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/guestAgentsListByVirtualMachineInstanceSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/guestAgentsListByVirtualMachineInstanceSample.js deleted file mode 100644 index 493e70c93e7d..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/guestAgentsListByVirtualMachineInstanceSample.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * 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/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_ListByVirtualMachineInstance_MaximumSet_Gen.json - */ -async function guestAgentsListByVirtualMachineInstanceMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const resArray = new Array(); - for await (let item of client.guestAgents.listByVirtualMachineInstance(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * 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/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_ListByVirtualMachineInstance_MinimumSet_Gen.json - */ -async function guestAgentsListByVirtualMachineInstanceMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const resArray = new Array(); - for await (let item of client.guestAgents.listByVirtualMachineInstance(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - guestAgentsListByVirtualMachineInstanceMaximumSet(); - guestAgentsListByVirtualMachineInstanceMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/inventoryItemsCreateSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/inventoryItemsCreateSample.js deleted file mode 100644 index 2962931beb80..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/inventoryItemsCreateSample.js +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create Or Update InventoryItem. - * - * @summary Create Or Update InventoryItem. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Create_MaximumSet_Gen.json - */ -async function inventoryItemsCreateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "O"; - const inventoryItemResourceName = "1BdDc2Ab-bDd9-Ebd6-bfdb-C0dbbdB5DEDf"; - const resource = { - kind: "M\\d_,V.", - properties: { inventoryType: "Cloud" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.inventoryItems.create( - resourceGroupName, - vmmServerName, - inventoryItemResourceName, - resource, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create Or Update InventoryItem. - * - * @summary Create Or Update InventoryItem. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Create_MinimumSet_Gen.json - */ -async function inventoryItemsCreateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "."; - const inventoryItemResourceName = "bbFb0cBb-50ce-4bfc-3eeD-bC26AbCC257a"; - const resource = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.inventoryItems.create( - resourceGroupName, - vmmServerName, - inventoryItemResourceName, - resource, - ); - console.log(result); -} - -async function main() { - inventoryItemsCreateMaximumSet(); - inventoryItemsCreateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/inventoryItemsDeleteSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/inventoryItemsDeleteSample.js deleted file mode 100644 index d2c702651fb8..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/inventoryItemsDeleteSample.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes an inventoryItem. - * - * @summary Deletes an inventoryItem. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Delete_MaximumSet_Gen.json - */ -async function inventoryItemsDeleteMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "b"; - const inventoryItemResourceName = "EcECadfd-Eaaa-e5Ce-ebdA-badeEd3c6af1"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.inventoryItems.delete( - resourceGroupName, - vmmServerName, - inventoryItemResourceName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deletes an inventoryItem. - * - * @summary Deletes an inventoryItem. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Delete_MinimumSet_Gen.json - */ -async function inventoryItemsDeleteMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "_"; - const inventoryItemResourceName = "cDBcbae6-BC3d-52fe-CedC-7eFeaBFabb82"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.inventoryItems.delete( - resourceGroupName, - vmmServerName, - inventoryItemResourceName, - ); - console.log(result); -} - -async function main() { - inventoryItemsDeleteMaximumSet(); - inventoryItemsDeleteMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/inventoryItemsGetSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/inventoryItemsGetSample.js deleted file mode 100644 index 562b709ed197..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/inventoryItemsGetSample.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Shows an inventory item. - * - * @summary Shows an inventory item. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Get_MaximumSet_Gen.json - */ -async function inventoryItemsGetMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "1"; - const inventoryItemResourceName = "2bFBede6-EEf8-becB-dBbd-B96DbBFdB3f3"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.inventoryItems.get( - resourceGroupName, - vmmServerName, - inventoryItemResourceName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Shows an inventory item. - * - * @summary Shows an inventory item. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Get_MinimumSet_Gen.json - */ -async function inventoryItemsGetMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "_"; - const inventoryItemResourceName = "cacb8Ceb-efAC-bebb-ae7C-dec8C5Bb7100"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.inventoryItems.get( - resourceGroupName, - vmmServerName, - inventoryItemResourceName, - ); - console.log(result); -} - -async function main() { - inventoryItemsGetMaximumSet(); - inventoryItemsGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/inventoryItemsListByVmmServerSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/inventoryItemsListByVmmServerSample.js deleted file mode 100644 index 38369c113a00..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/inventoryItemsListByVmmServerSample.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Returns the list of inventoryItems in the given VmmServer. - * - * @summary Returns the list of inventoryItems in the given VmmServer. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_ListByVmmServer_MaximumSet_Gen.json - */ -async function inventoryItemsListByVmmServerMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "X"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.inventoryItems.listByVmmServer(resourceGroupName, vmmServerName)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Returns the list of inventoryItems in the given VmmServer. - * - * @summary Returns the list of inventoryItems in the given VmmServer. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_ListByVmmServer_MinimumSet_Gen.json - */ -async function inventoryItemsListByVmmServerMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "H"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.inventoryItems.listByVmmServer(resourceGroupName, vmmServerName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - inventoryItemsListByVmmServerMaximumSet(); - inventoryItemsListByVmmServerMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/operationsListSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/operationsListSample.js deleted file mode 100644 index 0c7d6c31b123..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/operationsListSample.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Operations_List_MaximumSet_Gen.json - */ -async function operationsListMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Operations_List_MinimumSet_Gen.json - */ -async function operationsListMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsListMaximumSet(); - operationsListMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/package.json b/sdk/scvmm/arm-scvmm/samples/v1/javascript/package.json deleted file mode 100644 index 62e92a311e9f..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@azure-samples/arm-scvmm-js", - "private": true, - "version": "1.0.0", - "description": " client library samples for JavaScript", - "engines": { - "node": ">=18.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/scvmm/arm-scvmm" - }, - "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/scvmm/arm-scvmm", - "dependencies": { - "@azure/arm-scvmm": "latest", - "dotenv": "latest", - "@azure/identity": "^4.2.1" - } -} diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/sample.env b/sdk/scvmm/arm-scvmm/samples/v1/javascript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# 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/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesCreateCheckpointSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesCreateCheckpointSample.js deleted file mode 100644 index b6c3f0f354d4..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesCreateCheckpointSample.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates a checkpoint in virtual machine instance. - * - * @summary Creates a checkpoint in virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateCheckpoint_MaximumSet_Gen.json - */ -async function virtualMachineInstancesCreateCheckpointMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const body = { - name: "ilvltf", - description: "zoozhfbepldrgpjqsbhpqebtodrhvy", - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginCreateCheckpointAndWait( - resourceUri, - body, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a checkpoint in virtual machine instance. - * - * @summary Creates a checkpoint in virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateCheckpoint_MinimumSet_Gen.json - */ -async function virtualMachineInstancesCreateCheckpointMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const body = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginCreateCheckpointAndWait( - resourceUri, - body, - ); - console.log(result); -} - -async function main() { - virtualMachineInstancesCreateCheckpointMaximumSet(); - virtualMachineInstancesCreateCheckpointMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesCreateOrUpdateSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesCreateOrUpdateSample.js deleted file mode 100644 index dce98856da91..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesCreateOrUpdateSample.js +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to The operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. - * - * @summary The operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateOrUpdate_MaximumSet_Gen.json - */ -async function virtualMachineInstancesCreateOrUpdateMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const resource = { - extendedLocation: { - name: "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName", - type: "customLocation", - }, - properties: { - availabilitySets: [ - { - name: "lwbhaseo", - id: "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName", - }, - ], - hardwareProfile: { - cpuCount: 22, - dynamicMemoryEnabled: "true", - dynamicMemoryMaxMB: 2, - dynamicMemoryMinMB: 30, - isHighlyAvailable: "true", - limitCpuForMigration: "true", - memoryMB: 5, - }, - infrastructureProfile: { - biosGuid: "xixivxifyql", - checkpointType: "jkbpzjxpeegackhsvikrnlnwqz", - cloudId: - "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName", - generation: 28, - inventoryItemId: "ihkkqmg", - lastRestoredVmCheckpoint: { - name: "keqn", - description: "qurzfrgyflrh", - checkpointId: "wsqmrje", - parentCheckpointId: "hqhhzikoxunuqguouw", - }, - templateId: - "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName", - uuid: "hrpw", - vmName: "qovpayfydhcvfrhe", - vmmServerId: - "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName", - }, - networkProfile: { - networkInterfaces: [ - { - name: "kvofzqulbjlbtt", - ipv4AddressType: "Dynamic", - ipv6AddressType: "Dynamic", - macAddress: "oaeqqegt", - macAddressType: "Dynamic", - nicId: "roxpsvlo", - virtualNetworkId: - "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName", - }, - ], - }, - osProfile: { - adminPassword: "vavtppmmhlspydtkzxda", - computerName: "uuxpcxuxcufllc", - osType: "Windows", - }, - storageProfile: { - disks: [ - { - name: "fgnckfymwdsqnfxkdvexuaobe", - bus: 8, - busType: "zu", - createDiffDisk: "true", - diskId: "ltdrwcfjklpsimhzqyh", - diskSizeGB: 30, - lun: 10, - storageQosPolicy: { name: "ceiyfrflu", id: "o" }, - templateDiskId: "lcdwrokpyvekqccclf", - vhdType: "cnbeeeylrvopigdynvgpkfp", - }, - ], - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginCreateOrUpdateAndWait( - resourceUri, - resource, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. - * - * @summary The operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateOrUpdate_MinimumSet_Gen.json - */ -async function virtualMachineInstancesCreateOrUpdateMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const resource = { extendedLocation: {} }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginCreateOrUpdateAndWait( - resourceUri, - resource, - ); - console.log(result); -} - -async function main() { - virtualMachineInstancesCreateOrUpdateMaximumSet(); - virtualMachineInstancesCreateOrUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesDeleteCheckpointSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesDeleteCheckpointSample.js deleted file mode 100644 index fe2d03dc4819..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesDeleteCheckpointSample.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a checkpoint in virtual machine instance. - * - * @summary Deletes a checkpoint in virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_DeleteCheckpoint_MaximumSet_Gen.json - */ -async function virtualMachineInstancesDeleteCheckpointMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const body = { - id: "eenfflimcbgqfsebdusophahjpk", - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginDeleteCheckpointAndWait( - resourceUri, - body, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deletes a checkpoint in virtual machine instance. - * - * @summary Deletes a checkpoint in virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_DeleteCheckpoint_MinimumSet_Gen.json - */ -async function virtualMachineInstancesDeleteCheckpointMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const body = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginDeleteCheckpointAndWait( - resourceUri, - body, - ); - console.log(result); -} - -async function main() { - virtualMachineInstancesDeleteCheckpointMaximumSet(); - virtualMachineInstancesDeleteCheckpointMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesDeleteSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesDeleteSample.js deleted file mode 100644 index 3f8914312da5..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesDeleteSample.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to The operation to delete a virtual machine instance. - * - * @summary The operation to delete a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Delete_MaximumSet_Gen.json - */ -async function virtualMachineInstancesDeleteMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const force = "true"; - const deleteFromHost = "true"; - const options = { - force, - deleteFromHost, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginDeleteAndWait(resourceUri, options); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to delete a virtual machine instance. - * - * @summary The operation to delete a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Delete_MinimumSet_Gen.json - */ -async function virtualMachineInstancesDeleteMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginDeleteAndWait(resourceUri); - console.log(result); -} - -async function main() { - virtualMachineInstancesDeleteMaximumSet(); - virtualMachineInstancesDeleteMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesGetSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesGetSample.js deleted file mode 100644 index 09e47fdbae37..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesGetSample.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Retrieves information about a virtual machine instance. - * - * @summary Retrieves information about a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Get_MaximumSet_Gen.json - */ -async function virtualMachineInstancesGetMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.get(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about a virtual machine instance. - * - * @summary Retrieves information about a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Get_MinimumSet_Gen.json - */ -async function virtualMachineInstancesGetMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.get(resourceUri); - console.log(result); -} - -async function main() { - virtualMachineInstancesGetMaximumSet(); - virtualMachineInstancesGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesListSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesListSample.js deleted file mode 100644 index b81ec63b0df8..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesListSample.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all of the virtual machine instances within the specified parent resource. - * - * @summary Lists all of the virtual machine instances within the specified parent resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_List_MaximumSet_Gen.json - */ -async function virtualMachineInstancesListMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const resArray = new Array(); - for await (let item of client.virtualMachineInstances.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Lists all of the virtual machine instances within the specified parent resource. - * - * @summary Lists all of the virtual machine instances within the specified parent resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_List_MinimumSet_Gen.json - */ -async function virtualMachineInstancesListMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const resArray = new Array(); - for await (let item of client.virtualMachineInstances.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - virtualMachineInstancesListMaximumSet(); - virtualMachineInstancesListMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesRestartSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesRestartSample.js deleted file mode 100644 index 29e0e95bb513..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesRestartSample.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to The operation to restart a virtual machine instance. - * - * @summary The operation to restart a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Restart_MaximumSet_Gen.json - */ -async function virtualMachineInstancesRestartMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginRestartAndWait(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to restart a virtual machine instance. - * - * @summary The operation to restart a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Restart_MinimumSet_Gen.json - */ -async function virtualMachineInstancesRestartMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginRestartAndWait(resourceUri); - console.log(result); -} - -async function main() { - virtualMachineInstancesRestartMaximumSet(); - virtualMachineInstancesRestartMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesRestoreCheckpointSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesRestoreCheckpointSample.js deleted file mode 100644 index 721eaebcb7fc..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesRestoreCheckpointSample.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Restores to a checkpoint in virtual machine instance. - * - * @summary Restores to a checkpoint in virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_RestoreCheckpoint_MaximumSet_Gen.json - */ -async function virtualMachineInstancesRestoreCheckpointMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const body = { id: "rweqduwzsn" }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginRestoreCheckpointAndWait( - resourceUri, - body, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Restores to a checkpoint in virtual machine instance. - * - * @summary Restores to a checkpoint in virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_RestoreCheckpoint_MinimumSet_Gen.json - */ -async function virtualMachineInstancesRestoreCheckpointMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const body = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginRestoreCheckpointAndWait( - resourceUri, - body, - ); - console.log(result); -} - -async function main() { - virtualMachineInstancesRestoreCheckpointMaximumSet(); - virtualMachineInstancesRestoreCheckpointMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesStartSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesStartSample.js deleted file mode 100644 index 9f67b92c7f56..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesStartSample.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to The operation to start a virtual machine instance. - * - * @summary The operation to start a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Start_MaximumSet_Gen.json - */ -async function virtualMachineInstancesStartMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginStartAndWait(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to start a virtual machine instance. - * - * @summary The operation to start a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Start_MinimumSet_Gen.json - */ -async function virtualMachineInstancesStartMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginStartAndWait(resourceUri); - console.log(result); -} - -async function main() { - virtualMachineInstancesStartMaximumSet(); - virtualMachineInstancesStartMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesStopSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesStopSample.js deleted file mode 100644 index 058fccde193d..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesStopSample.js +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to The operation to power off (stop) a virtual machine instance. - * - * @summary The operation to power off (stop) a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Stop_MaximumSet_Gen.json - */ -async function virtualMachineInstancesStopMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const body = { skipShutdown: "true" }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginStopAndWait(resourceUri, body); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to power off (stop) a virtual machine instance. - * - * @summary The operation to power off (stop) a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Stop_MinimumSet_Gen.json - */ -async function virtualMachineInstancesStopMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const body = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginStopAndWait(resourceUri, body); - console.log(result); -} - -async function main() { - virtualMachineInstancesStopMaximumSet(); - virtualMachineInstancesStopMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesUpdateSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesUpdateSample.js deleted file mode 100644 index 3a502f946ae4..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineInstancesUpdateSample.js +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to The operation to update a virtual machine instance. - * - * @summary The operation to update a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Update_MaximumSet_Gen.json - */ -async function virtualMachineInstancesUpdateMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const properties = { - properties: { - availabilitySets: [ - { - name: "lwbhaseo", - id: "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName", - }, - ], - hardwareProfile: { - cpuCount: 22, - dynamicMemoryEnabled: "true", - dynamicMemoryMaxMB: 2, - dynamicMemoryMinMB: 30, - limitCpuForMigration: "true", - memoryMB: 5, - }, - infrastructureProfile: { checkpointType: "jkbpzjxpeegackhsvikrnlnwqz" }, - networkProfile: { - networkInterfaces: [ - { - name: "kvofzqulbjlbtt", - ipv4AddressType: "Dynamic", - ipv6AddressType: "Dynamic", - macAddress: "oaeqqegt", - macAddressType: "Dynamic", - nicId: "roxpsvlo", - virtualNetworkId: - "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName", - }, - ], - }, - storageProfile: { - disks: [ - { - name: "fgnckfymwdsqnfxkdvexuaobe", - bus: 8, - busType: "zu", - diskId: "ltdrwcfjklpsimhzqyh", - diskSizeGB: 30, - lun: 10, - storageQosPolicy: { name: "ceiyfrflu", id: "o" }, - vhdType: "cnbeeeylrvopigdynvgpkfp", - }, - ], - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginUpdateAndWait(resourceUri, properties); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to update a virtual machine instance. - * - * @summary The operation to update a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Update_MinimumSet_Gen.json - */ -async function virtualMachineInstancesUpdateMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const properties = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginUpdateAndWait(resourceUri, properties); - console.log(result); -} - -async function main() { - virtualMachineInstancesUpdateMaximumSet(); - virtualMachineInstancesUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineTemplatesCreateOrUpdateSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineTemplatesCreateOrUpdateSample.js deleted file mode 100644 index 28de8981dcc2..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineTemplatesCreateOrUpdateSample.js +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Onboards the ScVmm VM Template as an Azure VM Template resource. - * - * @summary Onboards the ScVmm VM Template as an Azure VM Template resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_CreateOrUpdate_MaximumSet_Gen.json - */ -async function virtualMachineTemplatesCreateOrUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualMachineTemplateName = "6"; - const resource = { - extendedLocation: { - name: "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName", - type: "customLocation", - }, - location: "ayxsyduviotylbojh", - properties: { - dynamicMemoryEnabled: "true", - inventoryItemId: "qjrykoogccwlgkd", - isCustomizable: "true", - isHighlyAvailable: "true", - limitCpuForMigration: "true", - osType: "Windows", - uuid: "12345678-1234-1234-1234-12345678abcd", - vmmServerId: - "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName", - }, - tags: { key9494: "kkbmfpwhmvlobm" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualMachineTemplates.beginCreateOrUpdateAndWait( - resourceGroupName, - virtualMachineTemplateName, - resource, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Onboards the ScVmm VM Template as an Azure VM Template resource. - * - * @summary Onboards the ScVmm VM Template as an Azure VM Template resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_CreateOrUpdate_MinimumSet_Gen.json - */ -async function virtualMachineTemplatesCreateOrUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualMachineTemplateName = "P"; - const resource = { - extendedLocation: {}, - location: "ayxsyduviotylbojh", - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualMachineTemplates.beginCreateOrUpdateAndWait( - resourceGroupName, - virtualMachineTemplateName, - resource, - ); - console.log(result); -} - -async function main() { - virtualMachineTemplatesCreateOrUpdateMaximumSet(); - virtualMachineTemplatesCreateOrUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineTemplatesDeleteSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineTemplatesDeleteSample.js deleted file mode 100644 index 2bf2dd217740..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineTemplatesDeleteSample.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deregisters the ScVmm VM Template from Azure. - * - * @summary Deregisters the ScVmm VM Template from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Delete_MaximumSet_Gen.json - */ -async function virtualMachineTemplatesDeleteMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const force = "true"; - const virtualMachineTemplateName = "6"; - const options = { force }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualMachineTemplates.beginDeleteAndWait( - resourceGroupName, - virtualMachineTemplateName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deregisters the ScVmm VM Template from Azure. - * - * @summary Deregisters the ScVmm VM Template from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Delete_MinimumSet_Gen.json - */ -async function virtualMachineTemplatesDeleteMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualMachineTemplateName = "5"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualMachineTemplates.beginDeleteAndWait( - resourceGroupName, - virtualMachineTemplateName, - ); - console.log(result); -} - -async function main() { - virtualMachineTemplatesDeleteMaximumSet(); - virtualMachineTemplatesDeleteMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineTemplatesGetSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineTemplatesGetSample.js deleted file mode 100644 index 895974f36b75..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineTemplatesGetSample.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Implements VirtualMachineTemplate GET method. - * - * @summary Implements VirtualMachineTemplate GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Get_MaximumSet_Gen.json - */ -async function virtualMachineTemplatesGetMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualMachineTemplateName = "4"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualMachineTemplates.get( - resourceGroupName, - virtualMachineTemplateName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Implements VirtualMachineTemplate GET method. - * - * @summary Implements VirtualMachineTemplate GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Get_MinimumSet_Gen.json - */ -async function virtualMachineTemplatesGetMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualMachineTemplateName = "m"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualMachineTemplates.get( - resourceGroupName, - virtualMachineTemplateName, - ); - console.log(result); -} - -async function main() { - virtualMachineTemplatesGetMaximumSet(); - virtualMachineTemplatesGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineTemplatesListByResourceGroupSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineTemplatesListByResourceGroupSample.js deleted file mode 100644 index 628615eea65e..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineTemplatesListByResourceGroupSample.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * 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/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListByResourceGroup_MaximumSet_Gen.json - */ -async function virtualMachineTemplatesListByResourceGroupMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.virtualMachineTemplates.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * 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/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListByResourceGroup_MinimumSet_Gen.json - */ -async function virtualMachineTemplatesListByResourceGroupMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.virtualMachineTemplates.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - virtualMachineTemplatesListByResourceGroupMaximumSet(); - virtualMachineTemplatesListByResourceGroupMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineTemplatesListBySubscriptionSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineTemplatesListBySubscriptionSample.js deleted file mode 100644 index bae5dd168669..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineTemplatesListBySubscriptionSample.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List of VirtualMachineTemplates in a subscription. - * - * @summary List of VirtualMachineTemplates in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListBySubscription_MaximumSet_Gen.json - */ -async function virtualMachineTemplatesListBySubscriptionMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.virtualMachineTemplates.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List of VirtualMachineTemplates in a subscription. - * - * @summary List of VirtualMachineTemplates in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListBySubscription_MinimumSet_Gen.json - */ -async function virtualMachineTemplatesListBySubscriptionMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.virtualMachineTemplates.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - virtualMachineTemplatesListBySubscriptionMaximumSet(); - virtualMachineTemplatesListBySubscriptionMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineTemplatesUpdateSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineTemplatesUpdateSample.js deleted file mode 100644 index 20928c61d1c6..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualMachineTemplatesUpdateSample.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates the VirtualMachineTemplate resource. - * - * @summary Updates the VirtualMachineTemplate resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Update_MaximumSet_Gen.json - */ -async function virtualMachineTemplatesUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualMachineTemplateName = "g"; - const properties = { - tags: { key6634: "wwfhrg" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualMachineTemplates.beginUpdateAndWait( - resourceGroupName, - virtualMachineTemplateName, - properties, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates the VirtualMachineTemplate resource. - * - * @summary Updates the VirtualMachineTemplate resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Update_MinimumSet_Gen.json - */ -async function virtualMachineTemplatesUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualMachineTemplateName = "-"; - const properties = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualMachineTemplates.beginUpdateAndWait( - resourceGroupName, - virtualMachineTemplateName, - properties, - ); - console.log(result); -} - -async function main() { - virtualMachineTemplatesUpdateMaximumSet(); - virtualMachineTemplatesUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualNetworksCreateOrUpdateSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualNetworksCreateOrUpdateSample.js deleted file mode 100644 index b4f665636e20..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualNetworksCreateOrUpdateSample.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Onboards the ScVmm virtual network as an Azure virtual network resource. - * - * @summary Onboards the ScVmm virtual network as an Azure virtual network resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_CreateOrUpdate_MaximumSet_Gen.json - */ -async function virtualNetworksCreateOrUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualNetworkName = "_"; - const resource = { - extendedLocation: { - name: "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName", - type: "customLocation", - }, - location: "fky", - properties: { - inventoryItemId: "bxn", - uuid: "12345678-1234-1234-1234-12345678abcd", - vmmServerId: - "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName", - }, - tags: { key705: "apgplvjdyocx" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualNetworks.beginCreateOrUpdateAndWait( - resourceGroupName, - virtualNetworkName, - resource, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Onboards the ScVmm virtual network as an Azure virtual network resource. - * - * @summary Onboards the ScVmm virtual network as an Azure virtual network resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_CreateOrUpdate_MinimumSet_Gen.json - */ -async function virtualNetworksCreateOrUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualNetworkName = "-"; - const resource = { extendedLocation: {}, location: "fky" }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualNetworks.beginCreateOrUpdateAndWait( - resourceGroupName, - virtualNetworkName, - resource, - ); - console.log(result); -} - -async function main() { - virtualNetworksCreateOrUpdateMaximumSet(); - virtualNetworksCreateOrUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualNetworksDeleteSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualNetworksDeleteSample.js deleted file mode 100644 index 2b689b5d25dc..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualNetworksDeleteSample.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deregisters the ScVmm virtual network from Azure. - * - * @summary Deregisters the ScVmm virtual network from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Delete_MaximumSet_Gen.json - */ -async function virtualNetworksDeleteMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const force = "true"; - const virtualNetworkName = "."; - const options = { force }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualNetworks.beginDeleteAndWait( - resourceGroupName, - virtualNetworkName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deregisters the ScVmm virtual network from Azure. - * - * @summary Deregisters the ScVmm virtual network from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Delete_MinimumSet_Gen.json - */ -async function virtualNetworksDeleteMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualNetworkName = "1"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualNetworks.beginDeleteAndWait( - resourceGroupName, - virtualNetworkName, - ); - console.log(result); -} - -async function main() { - virtualNetworksDeleteMaximumSet(); - virtualNetworksDeleteMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualNetworksGetSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualNetworksGetSample.js deleted file mode 100644 index bb9b0ed77d27..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualNetworksGetSample.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Implements VirtualNetwork GET method. - * - * @summary Implements VirtualNetwork GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Get_MaximumSet_Gen.json - */ -async function virtualNetworksGetMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualNetworkName = "2"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualNetworks.get(resourceGroupName, virtualNetworkName); - console.log(result); -} - -/** - * This sample demonstrates how to Implements VirtualNetwork GET method. - * - * @summary Implements VirtualNetwork GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Get_MinimumSet_Gen.json - */ -async function virtualNetworksGetMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualNetworkName = "-"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualNetworks.get(resourceGroupName, virtualNetworkName); - console.log(result); -} - -async function main() { - virtualNetworksGetMaximumSet(); - virtualNetworksGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualNetworksListByResourceGroupSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualNetworksListByResourceGroupSample.js deleted file mode 100644 index 6de4aa548b81..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualNetworksListByResourceGroupSample.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * 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/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListByResourceGroup_MaximumSet_Gen.json - */ -async function virtualNetworksListByResourceGroupMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.virtualNetworks.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * 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/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListByResourceGroup_MinimumSet_Gen.json - */ -async function virtualNetworksListByResourceGroupMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.virtualNetworks.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - virtualNetworksListByResourceGroupMaximumSet(); - virtualNetworksListByResourceGroupMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualNetworksListBySubscriptionSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualNetworksListBySubscriptionSample.js deleted file mode 100644 index ed348d77ea28..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualNetworksListBySubscriptionSample.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List of VirtualNetworks in a subscription. - * - * @summary List of VirtualNetworks in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListBySubscription_MaximumSet_Gen.json - */ -async function virtualNetworksListBySubscriptionMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.virtualNetworks.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List of VirtualNetworks in a subscription. - * - * @summary List of VirtualNetworks in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListBySubscription_MinimumSet_Gen.json - */ -async function virtualNetworksListBySubscriptionMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.virtualNetworks.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - virtualNetworksListBySubscriptionMaximumSet(); - virtualNetworksListBySubscriptionMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualNetworksUpdateSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualNetworksUpdateSample.js deleted file mode 100644 index 8a41cf106179..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/virtualNetworksUpdateSample.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates the VirtualNetworks resource. - * - * @summary Updates the VirtualNetworks resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Update_MaximumSet_Gen.json - */ -async function virtualNetworksUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualNetworkName = "S"; - const properties = { tags: { key9516: "oxduo" } }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualNetworks.beginUpdateAndWait( - resourceGroupName, - virtualNetworkName, - properties, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates the VirtualNetworks resource. - * - * @summary Updates the VirtualNetworks resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Update_MinimumSet_Gen.json - */ -async function virtualNetworksUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualNetworkName = "-"; - const properties = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualNetworks.beginUpdateAndWait( - resourceGroupName, - virtualNetworkName, - properties, - ); - console.log(result); -} - -async function main() { - virtualNetworksUpdateMaximumSet(); - virtualNetworksUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmInstanceHybridIdentityMetadatasGetSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmInstanceHybridIdentityMetadatasGetSample.js deleted file mode 100644 index 0a958c0713e0..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmInstanceHybridIdentityMetadatasGetSample.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Implements HybridIdentityMetadata GET method. - * - * @summary Implements HybridIdentityMetadata GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_Get_MaximumSet_Gen.json - */ -async function vmInstanceHybridIdentityMetadatasGetMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.vmInstanceHybridIdentityMetadatas.get(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Implements HybridIdentityMetadata GET method. - * - * @summary Implements HybridIdentityMetadata GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_Get_MinimumSet_Gen.json - */ -async function vmInstanceHybridIdentityMetadatasGetMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.vmInstanceHybridIdentityMetadatas.get(resourceUri); - console.log(result); -} - -async function main() { - vmInstanceHybridIdentityMetadatasGetMaximumSet(); - vmInstanceHybridIdentityMetadatasGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceSample.js deleted file mode 100644 index 2a36abffb63a..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceSample.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * 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/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_ListByVirtualMachineInstance_MaximumSet_Gen.json - */ -async function vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const resArray = new Array(); - for await (let item of client.vmInstanceHybridIdentityMetadatas.listByVirtualMachineInstance( - resourceUri, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * 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/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_ListByVirtualMachineInstance_MinimumSet_Gen.json - */ -async function vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const resArray = new Array(); - for await (let item of client.vmInstanceHybridIdentityMetadatas.listByVirtualMachineInstance( - resourceUri, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceMaximumSet(); - vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmmServersCreateOrUpdateSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmmServersCreateOrUpdateSample.js deleted file mode 100644 index c0f14f07e2d5..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmmServersCreateOrUpdateSample.js +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Onboards the SCVmm fabric as an Azure VmmServer resource. - * - * @summary Onboards the SCVmm fabric as an Azure VmmServer resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_CreateOrUpdate_MaximumSet_Gen.json - */ -async function vmmServersCreateOrUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "-"; - const resource = { - extendedLocation: { - name: "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName", - type: "customLocation", - }, - location: "hslxkyzktvwpqbypvs", - properties: { - credentials: { password: "SecretPlaceholder", username: "jbuoltypmrgqfi" }, - fqdn: "pvzcjaqrswbvptgx", - port: 4, - }, - tags: { key4834: "vycgfkzjcyyuotwwq" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.vmmServers.beginCreateOrUpdateAndWait( - resourceGroupName, - vmmServerName, - resource, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Onboards the SCVmm fabric as an Azure VmmServer resource. - * - * @summary Onboards the SCVmm fabric as an Azure VmmServer resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_CreateOrUpdate_MinimumSet_Gen.json - */ -async function vmmServersCreateOrUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "w"; - const resource = { - extendedLocation: {}, - location: "hslxkyzktvwpqbypvs", - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.vmmServers.beginCreateOrUpdateAndWait( - resourceGroupName, - vmmServerName, - resource, - ); - console.log(result); -} - -async function main() { - vmmServersCreateOrUpdateMaximumSet(); - vmmServersCreateOrUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmmServersDeleteSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmmServersDeleteSample.js deleted file mode 100644 index d40f733e2203..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmmServersDeleteSample.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Removes the SCVmm fabric from Azure. - * - * @summary Removes the SCVmm fabric from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Delete_MaximumSet_Gen.json - */ -async function vmmServersDeleteMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const force = "true"; - const vmmServerName = "."; - const options = { force }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.vmmServers.beginDeleteAndWait( - resourceGroupName, - vmmServerName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Removes the SCVmm fabric from Azure. - * - * @summary Removes the SCVmm fabric from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Delete_MinimumSet_Gen.json - */ -async function vmmServersDeleteMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "8"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.vmmServers.beginDeleteAndWait(resourceGroupName, vmmServerName); - console.log(result); -} - -async function main() { - vmmServersDeleteMaximumSet(); - vmmServersDeleteMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmmServersGetSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmmServersGetSample.js deleted file mode 100644 index e08615ab695e..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmmServersGetSample.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Implements VmmServer GET method. - * - * @summary Implements VmmServer GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Get_MaximumSet_Gen.json - */ -async function vmmServersGetMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "."; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.vmmServers.get(resourceGroupName, vmmServerName); - console.log(result); -} - -/** - * This sample demonstrates how to Implements VmmServer GET method. - * - * @summary Implements VmmServer GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Get_MinimumSet_Gen.json - */ -async function vmmServersGetMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "D"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.vmmServers.get(resourceGroupName, vmmServerName); - console.log(result); -} - -async function main() { - vmmServersGetMaximumSet(); - vmmServersGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmmServersListByResourceGroupSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmmServersListByResourceGroupSample.js deleted file mode 100644 index b8494efb6ca8..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmmServersListByResourceGroupSample.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List of VmmServers in a resource group. - * - * @summary List of VmmServers in a resource group. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListByResourceGroup_MaximumSet_Gen.json - */ -async function vmmServersListByResourceGroupMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.vmmServers.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List of VmmServers in a resource group. - * - * @summary List of VmmServers in a resource group. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListByResourceGroup_MinimumSet_Gen.json - */ -async function vmmServersListByResourceGroupMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.vmmServers.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - vmmServersListByResourceGroupMaximumSet(); - vmmServersListByResourceGroupMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmmServersListBySubscriptionSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmmServersListBySubscriptionSample.js deleted file mode 100644 index 6a6a516c8df0..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmmServersListBySubscriptionSample.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List of VmmServers in a subscription. - * - * @summary List of VmmServers in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListBySubscription_MaximumSet_Gen.json - */ -async function vmmServersListBySubscriptionMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.vmmServers.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List of VmmServers in a subscription. - * - * @summary List of VmmServers in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListBySubscription_MinimumSet_Gen.json - */ -async function vmmServersListBySubscriptionMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.vmmServers.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - vmmServersListBySubscriptionMaximumSet(); - vmmServersListBySubscriptionMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmmServersUpdateSample.js b/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmmServersUpdateSample.js deleted file mode 100644 index d501e61561d0..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/javascript/vmmServersUpdateSample.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } = require("@azure/arm-scvmm"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates the VmmServers resource. - * - * @summary Updates the VmmServers resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Update_MaximumSet_Gen.json - */ -async function vmmServersUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "Y"; - const properties = { - tags: { key7187: "oktnfvklfchnquelzzdagtpwfskzc" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.vmmServers.beginUpdateAndWait( - resourceGroupName, - vmmServerName, - properties, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates the VmmServers resource. - * - * @summary Updates the VmmServers resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Update_MinimumSet_Gen.json - */ -async function vmmServersUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "_"; - const properties = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.vmmServers.beginUpdateAndWait( - resourceGroupName, - vmmServerName, - properties, - ); - console.log(result); -} - -async function main() { - vmmServersUpdateMaximumSet(); - vmmServersUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/README.md b/sdk/scvmm/arm-scvmm/samples/v1/typescript/README.md deleted file mode 100644 index e21c6252a045..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/README.md +++ /dev/null @@ -1,165 +0,0 @@ -# client library samples for TypeScript - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| --------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| [availabilitySetsCreateOrUpdateSample.ts][availabilitysetscreateorupdatesample] | Onboards the ScVmm availability set as an Azure resource. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_CreateOrUpdate_MaximumSet_Gen.json | -| [availabilitySetsDeleteSample.ts][availabilitysetsdeletesample] | Deregisters the ScVmm availability set from Azure. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Delete_MaximumSet_Gen.json | -| [availabilitySetsGetSample.ts][availabilitysetsgetsample] | Implements AvailabilitySet GET method. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Get_MaximumSet_Gen.json | -| [availabilitySetsListByResourceGroupSample.ts][availabilitysetslistbyresourcegroupsample] | List of AvailabilitySets in a resource group. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListByResourceGroup_MaximumSet_Gen.json | -| [availabilitySetsListBySubscriptionSample.ts][availabilitysetslistbysubscriptionsample] | List of AvailabilitySets in a subscription. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListBySubscription_MaximumSet_Gen.json | -| [availabilitySetsUpdateSample.ts][availabilitysetsupdatesample] | Updates the AvailabilitySets resource. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Update_MaximumSet_Gen.json | -| [cloudsCreateOrUpdateSample.ts][cloudscreateorupdatesample] | Onboards the ScVmm fabric cloud as an Azure cloud resource. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_CreateOrUpdate_MaximumSet_Gen.json | -| [cloudsDeleteSample.ts][cloudsdeletesample] | Deregisters the ScVmm fabric cloud from Azure. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Delete_MaximumSet_Gen.json | -| [cloudsGetSample.ts][cloudsgetsample] | Implements Cloud GET method. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Get_MaximumSet_Gen.json | -| [cloudsListByResourceGroupSample.ts][cloudslistbyresourcegroupsample] | List of Clouds in a resource group. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListByResourceGroup_MaximumSet_Gen.json | -| [cloudsListBySubscriptionSample.ts][cloudslistbysubscriptionsample] | List of Clouds in a subscription. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListBySubscription_MaximumSet_Gen.json | -| [cloudsUpdateSample.ts][cloudsupdatesample] | Updates the Clouds resource. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Update_MaximumSet_Gen.json | -| [guestAgentsCreateSample.ts][guestagentscreatesample] | Create Or Update GuestAgent. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Create_MaximumSet_Gen.json | -| [guestAgentsDeleteSample.ts][guestagentsdeletesample] | Implements GuestAgent DELETE method. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Delete_MaximumSet_Gen.json | -| [guestAgentsGetSample.ts][guestagentsgetsample] | Implements GuestAgent GET method. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Get_MaximumSet_Gen.json | -| [guestAgentsListByVirtualMachineInstanceSample.ts][guestagentslistbyvirtualmachineinstancesample] | Returns the list of GuestAgent of the given vm. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_ListByVirtualMachineInstance_MaximumSet_Gen.json | -| [inventoryItemsCreateSample.ts][inventoryitemscreatesample] | Create Or Update InventoryItem. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Create_MaximumSet_Gen.json | -| [inventoryItemsDeleteSample.ts][inventoryitemsdeletesample] | Deletes an inventoryItem. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Delete_MaximumSet_Gen.json | -| [inventoryItemsGetSample.ts][inventoryitemsgetsample] | Shows an inventory item. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Get_MaximumSet_Gen.json | -| [inventoryItemsListByVmmServerSample.ts][inventoryitemslistbyvmmserversample] | Returns the list of inventoryItems in the given VmmServer. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_ListByVmmServer_MaximumSet_Gen.json | -| [operationsListSample.ts][operationslistsample] | List the operations for the provider x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Operations_List_MaximumSet_Gen.json | -| [virtualMachineInstancesCreateCheckpointSample.ts][virtualmachineinstancescreatecheckpointsample] | Creates a checkpoint in virtual machine instance. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateCheckpoint_MaximumSet_Gen.json | -| [virtualMachineInstancesCreateOrUpdateSample.ts][virtualmachineinstancescreateorupdatesample] | The operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateOrUpdate_MaximumSet_Gen.json | -| [virtualMachineInstancesDeleteCheckpointSample.ts][virtualmachineinstancesdeletecheckpointsample] | Deletes a checkpoint in virtual machine instance. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_DeleteCheckpoint_MaximumSet_Gen.json | -| [virtualMachineInstancesDeleteSample.ts][virtualmachineinstancesdeletesample] | The operation to delete a virtual machine instance. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Delete_MaximumSet_Gen.json | -| [virtualMachineInstancesGetSample.ts][virtualmachineinstancesgetsample] | Retrieves information about a virtual machine instance. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Get_MaximumSet_Gen.json | -| [virtualMachineInstancesListSample.ts][virtualmachineinstanceslistsample] | Lists all of the virtual machine instances within the specified parent resource. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_List_MaximumSet_Gen.json | -| [virtualMachineInstancesRestartSample.ts][virtualmachineinstancesrestartsample] | The operation to restart a virtual machine instance. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Restart_MaximumSet_Gen.json | -| [virtualMachineInstancesRestoreCheckpointSample.ts][virtualmachineinstancesrestorecheckpointsample] | Restores to a checkpoint in virtual machine instance. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_RestoreCheckpoint_MaximumSet_Gen.json | -| [virtualMachineInstancesStartSample.ts][virtualmachineinstancesstartsample] | The operation to start a virtual machine instance. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Start_MaximumSet_Gen.json | -| [virtualMachineInstancesStopSample.ts][virtualmachineinstancesstopsample] | The operation to power off (stop) a virtual machine instance. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Stop_MaximumSet_Gen.json | -| [virtualMachineInstancesUpdateSample.ts][virtualmachineinstancesupdatesample] | The operation to update a virtual machine instance. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Update_MaximumSet_Gen.json | -| [virtualMachineTemplatesCreateOrUpdateSample.ts][virtualmachinetemplatescreateorupdatesample] | Onboards the ScVmm VM Template as an Azure VM Template resource. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_CreateOrUpdate_MaximumSet_Gen.json | -| [virtualMachineTemplatesDeleteSample.ts][virtualmachinetemplatesdeletesample] | Deregisters the ScVmm VM Template from Azure. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Delete_MaximumSet_Gen.json | -| [virtualMachineTemplatesGetSample.ts][virtualmachinetemplatesgetsample] | Implements VirtualMachineTemplate GET method. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Get_MaximumSet_Gen.json | -| [virtualMachineTemplatesListByResourceGroupSample.ts][virtualmachinetemplateslistbyresourcegroupsample] | List of VirtualMachineTemplates in a resource group. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListByResourceGroup_MaximumSet_Gen.json | -| [virtualMachineTemplatesListBySubscriptionSample.ts][virtualmachinetemplateslistbysubscriptionsample] | List of VirtualMachineTemplates in a subscription. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListBySubscription_MaximumSet_Gen.json | -| [virtualMachineTemplatesUpdateSample.ts][virtualmachinetemplatesupdatesample] | Updates the VirtualMachineTemplate resource. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Update_MaximumSet_Gen.json | -| [virtualNetworksCreateOrUpdateSample.ts][virtualnetworkscreateorupdatesample] | Onboards the ScVmm virtual network as an Azure virtual network resource. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_CreateOrUpdate_MaximumSet_Gen.json | -| [virtualNetworksDeleteSample.ts][virtualnetworksdeletesample] | Deregisters the ScVmm virtual network from Azure. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Delete_MaximumSet_Gen.json | -| [virtualNetworksGetSample.ts][virtualnetworksgetsample] | Implements VirtualNetwork GET method. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Get_MaximumSet_Gen.json | -| [virtualNetworksListByResourceGroupSample.ts][virtualnetworkslistbyresourcegroupsample] | List of VirtualNetworks in a resource group. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListByResourceGroup_MaximumSet_Gen.json | -| [virtualNetworksListBySubscriptionSample.ts][virtualnetworkslistbysubscriptionsample] | List of VirtualNetworks in a subscription. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListBySubscription_MaximumSet_Gen.json | -| [virtualNetworksUpdateSample.ts][virtualnetworksupdatesample] | Updates the VirtualNetworks resource. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Update_MaximumSet_Gen.json | -| [vmInstanceHybridIdentityMetadatasGetSample.ts][vminstancehybrididentitymetadatasgetsample] | Implements HybridIdentityMetadata GET method. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_Get_MaximumSet_Gen.json | -| [vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceSample.ts][vminstancehybrididentitymetadataslistbyvirtualmachineinstancesample] | Returns the list of HybridIdentityMetadata of the given VM. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_ListByVirtualMachineInstance_MaximumSet_Gen.json | -| [vmmServersCreateOrUpdateSample.ts][vmmserverscreateorupdatesample] | Onboards the SCVmm fabric as an Azure VmmServer resource. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_CreateOrUpdate_MaximumSet_Gen.json | -| [vmmServersDeleteSample.ts][vmmserversdeletesample] | Removes the SCVmm fabric from Azure. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Delete_MaximumSet_Gen.json | -| [vmmServersGetSample.ts][vmmserversgetsample] | Implements VmmServer GET method. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Get_MaximumSet_Gen.json | -| [vmmServersListByResourceGroupSample.ts][vmmserverslistbyresourcegroupsample] | List of VmmServers in a resource group. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListByResourceGroup_MaximumSet_Gen.json | -| [vmmServersListBySubscriptionSample.ts][vmmserverslistbysubscriptionsample] | List of VmmServers in a subscription. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListBySubscription_MaximumSet_Gen.json | -| [vmmServersUpdateSample.ts][vmmserversupdatesample] | Updates the VmmServers resource. x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Update_MaximumSet_Gen.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -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/availabilitySetsCreateOrUpdateSample.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 SCVMM_SUBSCRIPTION_ID="" SCVMM_RESOURCE_GROUP="" node dist/availabilitySetsCreateOrUpdateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[availabilitysetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/availabilitySetsCreateOrUpdateSample.ts -[availabilitysetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/availabilitySetsDeleteSample.ts -[availabilitysetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/availabilitySetsGetSample.ts -[availabilitysetslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/availabilitySetsListByResourceGroupSample.ts -[availabilitysetslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/availabilitySetsListBySubscriptionSample.ts -[availabilitysetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/availabilitySetsUpdateSample.ts -[cloudscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/cloudsCreateOrUpdateSample.ts -[cloudsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/cloudsDeleteSample.ts -[cloudsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/cloudsGetSample.ts -[cloudslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/cloudsListByResourceGroupSample.ts -[cloudslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/cloudsListBySubscriptionSample.ts -[cloudsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/cloudsUpdateSample.ts -[guestagentscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/guestAgentsCreateSample.ts -[guestagentsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/guestAgentsDeleteSample.ts -[guestagentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/guestAgentsGetSample.ts -[guestagentslistbyvirtualmachineinstancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/guestAgentsListByVirtualMachineInstanceSample.ts -[inventoryitemscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/inventoryItemsCreateSample.ts -[inventoryitemsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/inventoryItemsDeleteSample.ts -[inventoryitemsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/inventoryItemsGetSample.ts -[inventoryitemslistbyvmmserversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/inventoryItemsListByVmmServerSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/operationsListSample.ts -[virtualmachineinstancescreatecheckpointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesCreateCheckpointSample.ts -[virtualmachineinstancescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesCreateOrUpdateSample.ts -[virtualmachineinstancesdeletecheckpointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesDeleteCheckpointSample.ts -[virtualmachineinstancesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesDeleteSample.ts -[virtualmachineinstancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesGetSample.ts -[virtualmachineinstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesListSample.ts -[virtualmachineinstancesrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesRestartSample.ts -[virtualmachineinstancesrestorecheckpointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesRestoreCheckpointSample.ts -[virtualmachineinstancesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesStartSample.ts -[virtualmachineinstancesstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesStopSample.ts -[virtualmachineinstancesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesUpdateSample.ts -[virtualmachinetemplatescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineTemplatesCreateOrUpdateSample.ts -[virtualmachinetemplatesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineTemplatesDeleteSample.ts -[virtualmachinetemplatesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineTemplatesGetSample.ts -[virtualmachinetemplateslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineTemplatesListByResourceGroupSample.ts -[virtualmachinetemplateslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineTemplatesListBySubscriptionSample.ts -[virtualmachinetemplatesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineTemplatesUpdateSample.ts -[virtualnetworkscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualNetworksCreateOrUpdateSample.ts -[virtualnetworksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualNetworksDeleteSample.ts -[virtualnetworksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualNetworksGetSample.ts -[virtualnetworkslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualNetworksListByResourceGroupSample.ts -[virtualnetworkslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualNetworksListBySubscriptionSample.ts -[virtualnetworksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualNetworksUpdateSample.ts -[vminstancehybrididentitymetadatasgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmInstanceHybridIdentityMetadatasGetSample.ts -[vminstancehybrididentitymetadataslistbyvirtualmachineinstancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceSample.ts -[vmmserverscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmmServersCreateOrUpdateSample.ts -[vmmserversdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmmServersDeleteSample.ts -[vmmserversgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmmServersGetSample.ts -[vmmserverslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmmServersListByResourceGroupSample.ts -[vmmserverslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmmServersListBySubscriptionSample.ts -[vmmserversupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmmServersUpdateSample.ts -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-scvmm?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/scvmm/arm-scvmm/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/package.json b/sdk/scvmm/arm-scvmm/samples/v1/typescript/package.json deleted file mode 100644 index 72d88f93c324..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@azure-samples/arm-scvmm-ts", - "private": true, - "version": "1.0.0", - "description": " client library samples for TypeScript", - "engines": { - "node": ">=18.0.0" - }, - "scripts": { - "build": "tsc", - "prebuild": "rimraf dist/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/scvmm/arm-scvmm" - }, - "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/scvmm/arm-scvmm", - "dependencies": { - "@azure/arm-scvmm": "latest", - "dotenv": "latest", - "@azure/identity": "^4.2.1" - }, - "devDependencies": { - "@types/node": "^18.0.0", - "typescript": "~5.5.3", - "rimraf": "latest" - } -} diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/sample.env b/sdk/scvmm/arm-scvmm/samples/v1/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# 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/scvmm/arm-scvmm/samples/v1/typescript/src/availabilitySetsCreateOrUpdateSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/availabilitySetsCreateOrUpdateSample.ts deleted file mode 100644 index f363a169869f..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/availabilitySetsCreateOrUpdateSample.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { AvailabilitySet, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Onboards the ScVmm availability set as an Azure resource. - * - * @summary Onboards the ScVmm availability set as an Azure resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_CreateOrUpdate_MaximumSet_Gen.json - */ -async function availabilitySetsCreateOrUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const availabilitySetResourceName = "-"; - const resource: AvailabilitySet = { - extendedLocation: { - name: "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName", - type: "customLocation", - }, - location: "jelevilan", - properties: { - availabilitySetName: "njrpftunzo", - vmmServerId: - "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName", - }, - tags: { key5701: "cldtxloqh" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.availabilitySets.beginCreateOrUpdateAndWait( - resourceGroupName, - availabilitySetResourceName, - resource, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Onboards the ScVmm availability set as an Azure resource. - * - * @summary Onboards the ScVmm availability set as an Azure resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_CreateOrUpdate_MinimumSet_Gen.json - */ -async function availabilitySetsCreateOrUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const availabilitySetResourceName = "_"; - const resource: AvailabilitySet = { - extendedLocation: {}, - location: "jelevilan", - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.availabilitySets.beginCreateOrUpdateAndWait( - resourceGroupName, - availabilitySetResourceName, - resource, - ); - console.log(result); -} - -async function main() { - availabilitySetsCreateOrUpdateMaximumSet(); - availabilitySetsCreateOrUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/availabilitySetsDeleteSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/availabilitySetsDeleteSample.ts deleted file mode 100644 index 8b703d87ce2d..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/availabilitySetsDeleteSample.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { AvailabilitySetsDeleteOptionalParams, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deregisters the ScVmm availability set from Azure. - * - * @summary Deregisters the ScVmm availability set from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Delete_MaximumSet_Gen.json - */ -async function availabilitySetsDeleteMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const force = "true"; - const availabilitySetResourceName = "_"; - const options: AvailabilitySetsDeleteOptionalParams = { force }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.availabilitySets.beginDeleteAndWait( - resourceGroupName, - availabilitySetResourceName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deregisters the ScVmm availability set from Azure. - * - * @summary Deregisters the ScVmm availability set from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Delete_MinimumSet_Gen.json - */ -async function availabilitySetsDeleteMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const availabilitySetResourceName = "6"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.availabilitySets.beginDeleteAndWait( - resourceGroupName, - availabilitySetResourceName, - ); - console.log(result); -} - -async function main() { - availabilitySetsDeleteMaximumSet(); - availabilitySetsDeleteMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/availabilitySetsGetSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/availabilitySetsGetSample.ts deleted file mode 100644 index 52e703776f9a..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/availabilitySetsGetSample.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Implements AvailabilitySet GET method. - * - * @summary Implements AvailabilitySet GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Get_MaximumSet_Gen.json - */ -async function availabilitySetsGetMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const availabilitySetResourceName = "-"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.availabilitySets.get( - resourceGroupName, - availabilitySetResourceName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Implements AvailabilitySet GET method. - * - * @summary Implements AvailabilitySet GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Get_MinimumSet_Gen.json - */ -async function availabilitySetsGetMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const availabilitySetResourceName = "V"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.availabilitySets.get( - resourceGroupName, - availabilitySetResourceName, - ); - console.log(result); -} - -async function main() { - availabilitySetsGetMaximumSet(); - availabilitySetsGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/availabilitySetsListByResourceGroupSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/availabilitySetsListByResourceGroupSample.ts deleted file mode 100644 index c2b35cc29ecb..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/availabilitySetsListByResourceGroupSample.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List of AvailabilitySets in a resource group. - * - * @summary List of AvailabilitySets in a resource group. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListByResourceGroup_MaximumSet_Gen.json - */ -async function availabilitySetsListByResourceGroupMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.availabilitySets.listByResourceGroup( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List of AvailabilitySets in a resource group. - * - * @summary List of AvailabilitySets in a resource group. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListByResourceGroup_MinimumSet_Gen.json - */ -async function availabilitySetsListByResourceGroupMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.availabilitySets.listByResourceGroup( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - availabilitySetsListByResourceGroupMaximumSet(); - availabilitySetsListByResourceGroupMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/availabilitySetsListBySubscriptionSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/availabilitySetsListBySubscriptionSample.ts deleted file mode 100644 index e66f6e5856fb..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/availabilitySetsListBySubscriptionSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List of AvailabilitySets in a subscription. - * - * @summary List of AvailabilitySets in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListBySubscription_MaximumSet_Gen.json - */ -async function availabilitySetsListBySubscriptionMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.availabilitySets.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List of AvailabilitySets in a subscription. - * - * @summary List of AvailabilitySets in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListBySubscription_MinimumSet_Gen.json - */ -async function availabilitySetsListBySubscriptionMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.availabilitySets.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - availabilitySetsListBySubscriptionMaximumSet(); - availabilitySetsListBySubscriptionMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/availabilitySetsUpdateSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/availabilitySetsUpdateSample.ts deleted file mode 100644 index da6cdc95765b..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/availabilitySetsUpdateSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { AvailabilitySetTagsUpdate, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates the AvailabilitySets resource. - * - * @summary Updates the AvailabilitySets resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Update_MaximumSet_Gen.json - */ -async function availabilitySetsUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const availabilitySetResourceName = "-"; - const properties: AvailabilitySetTagsUpdate = { - tags: { key1460: "vcbwibkvr" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.availabilitySets.beginUpdateAndWait( - resourceGroupName, - availabilitySetResourceName, - properties, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates the AvailabilitySets resource. - * - * @summary Updates the AvailabilitySets resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Update_MinimumSet_Gen.json - */ -async function availabilitySetsUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const availabilitySetResourceName = "1"; - const properties: AvailabilitySetTagsUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.availabilitySets.beginUpdateAndWait( - resourceGroupName, - availabilitySetResourceName, - properties, - ); - console.log(result); -} - -async function main() { - availabilitySetsUpdateMaximumSet(); - availabilitySetsUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/cloudsCreateOrUpdateSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/cloudsCreateOrUpdateSample.ts deleted file mode 100644 index 2fee70dc716f..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/cloudsCreateOrUpdateSample.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { Cloud, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Onboards the ScVmm fabric cloud as an Azure cloud resource. - * - * @summary Onboards the ScVmm fabric cloud as an Azure cloud resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_CreateOrUpdate_MaximumSet_Gen.json - */ -async function cloudsCreateOrUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const cloudResourceName = "2"; - const resource: Cloud = { - extendedLocation: { - name: "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName", - type: "customLocation", - }, - location: "khwsdmaxfhmbu", - properties: { - cloudCapacity: {}, - inventoryItemId: "qjd", - uuid: "12345678-1234-1234-1234-12345678abcd", - vmmServerId: - "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName", - }, - tags: { key4295: "wngosgcbdifaxdobufuuqxtho" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.clouds.beginCreateOrUpdateAndWait( - resourceGroupName, - cloudResourceName, - resource, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Onboards the ScVmm fabric cloud as an Azure cloud resource. - * - * @summary Onboards the ScVmm fabric cloud as an Azure cloud resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_CreateOrUpdate_MinimumSet_Gen.json - */ -async function cloudsCreateOrUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const cloudResourceName = "-"; - const resource: Cloud = { extendedLocation: {}, location: "khwsdmaxfhmbu" }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.clouds.beginCreateOrUpdateAndWait( - resourceGroupName, - cloudResourceName, - resource, - ); - console.log(result); -} - -async function main() { - cloudsCreateOrUpdateMaximumSet(); - cloudsCreateOrUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/cloudsDeleteSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/cloudsDeleteSample.ts deleted file mode 100644 index e9dfffe17abc..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/cloudsDeleteSample.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { CloudsDeleteOptionalParams, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deregisters the ScVmm fabric cloud from Azure. - * - * @summary Deregisters the ScVmm fabric cloud from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Delete_MaximumSet_Gen.json - */ -async function cloudsDeleteMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const force = "true"; - const cloudResourceName = "-"; - const options: CloudsDeleteOptionalParams = { force }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.clouds.beginDeleteAndWait( - resourceGroupName, - cloudResourceName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deregisters the ScVmm fabric cloud from Azure. - * - * @summary Deregisters the ScVmm fabric cloud from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Delete_MinimumSet_Gen.json - */ -async function cloudsDeleteMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const cloudResourceName = "1"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.clouds.beginDeleteAndWait( - resourceGroupName, - cloudResourceName, - ); - console.log(result); -} - -async function main() { - cloudsDeleteMaximumSet(); - cloudsDeleteMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/cloudsGetSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/cloudsGetSample.ts deleted file mode 100644 index 7982e24d3ab2..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/cloudsGetSample.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Implements Cloud GET method. - * - * @summary Implements Cloud GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Get_MaximumSet_Gen.json - */ -async function cloudsGetMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const cloudResourceName = "_"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.clouds.get(resourceGroupName, cloudResourceName); - console.log(result); -} - -/** - * This sample demonstrates how to Implements Cloud GET method. - * - * @summary Implements Cloud GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Get_MinimumSet_Gen.json - */ -async function cloudsGetMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const cloudResourceName = "i"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.clouds.get(resourceGroupName, cloudResourceName); - console.log(result); -} - -async function main() { - cloudsGetMaximumSet(); - cloudsGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/cloudsListByResourceGroupSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/cloudsListByResourceGroupSample.ts deleted file mode 100644 index 789a923c3673..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/cloudsListByResourceGroupSample.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List of Clouds in a resource group. - * - * @summary List of Clouds in a resource group. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListByResourceGroup_MaximumSet_Gen.json - */ -async function cloudsListByResourceGroupMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.clouds.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List of Clouds in a resource group. - * - * @summary List of Clouds in a resource group. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListByResourceGroup_MinimumSet_Gen.json - */ -async function cloudsListByResourceGroupMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.clouds.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - cloudsListByResourceGroupMaximumSet(); - cloudsListByResourceGroupMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/cloudsListBySubscriptionSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/cloudsListBySubscriptionSample.ts deleted file mode 100644 index d506c3b18926..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/cloudsListBySubscriptionSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List of Clouds in a subscription. - * - * @summary List of Clouds in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListBySubscription_MaximumSet_Gen.json - */ -async function cloudsListBySubscriptionMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.clouds.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List of Clouds in a subscription. - * - * @summary List of Clouds in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListBySubscription_MinimumSet_Gen.json - */ -async function cloudsListBySubscriptionMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.clouds.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - cloudsListBySubscriptionMaximumSet(); - cloudsListBySubscriptionMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/cloudsUpdateSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/cloudsUpdateSample.ts deleted file mode 100644 index ba9a79a60333..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/cloudsUpdateSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { CloudTagsUpdate, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates the Clouds resource. - * - * @summary Updates the Clouds resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Update_MaximumSet_Gen.json - */ -async function cloudsUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const cloudResourceName = "P"; - const properties: CloudTagsUpdate = { - tags: { key5266: "hjpcnwmpnixsolrxnbl" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.clouds.beginUpdateAndWait( - resourceGroupName, - cloudResourceName, - properties, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates the Clouds resource. - * - * @summary Updates the Clouds resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Update_MinimumSet_Gen.json - */ -async function cloudsUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const cloudResourceName = "_"; - const properties: CloudTagsUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.clouds.beginUpdateAndWait( - resourceGroupName, - cloudResourceName, - properties, - ); - console.log(result); -} - -async function main() { - cloudsUpdateMaximumSet(); - cloudsUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/guestAgentsCreateSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/guestAgentsCreateSample.ts deleted file mode 100644 index 423a5d0f91de..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/guestAgentsCreateSample.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create Or Update GuestAgent. - * - * @summary Create Or Update GuestAgent. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Create_MaximumSet_Gen.json - */ -async function guestAgentsCreateMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const resource: GuestAgent = { - properties: { - credentials: { - password: "SecretPlaceholder", - username: "jqxuwirrcpfv", - }, - httpProxyConfig: { httpsProxy: "uoyzyticmohohomlkwct" }, - provisioningAction: "install", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.guestAgents.beginCreateAndWait( - resourceUri, - resource, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create Or Update GuestAgent. - * - * @summary Create Or Update GuestAgent. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Create_MinimumSet_Gen.json - */ -async function guestAgentsCreateMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const resource: GuestAgent = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.guestAgents.beginCreateAndWait( - resourceUri, - resource, - ); - console.log(result); -} - -async function main() { - guestAgentsCreateMaximumSet(); - guestAgentsCreateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/guestAgentsDeleteSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/guestAgentsDeleteSample.ts deleted file mode 100644 index ffa1a27e1412..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/guestAgentsDeleteSample.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Implements GuestAgent DELETE method. - * - * @summary Implements GuestAgent DELETE method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Delete_MaximumSet_Gen.json - */ -async function guestAgentsDeleteMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.guestAgents.delete(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Implements GuestAgent DELETE method. - * - * @summary Implements GuestAgent DELETE method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Delete_MinimumSet_Gen.json - */ -async function guestAgentsDeleteMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.guestAgents.delete(resourceUri); - console.log(result); -} - -async function main() { - guestAgentsDeleteMaximumSet(); - guestAgentsDeleteMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/guestAgentsGetSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/guestAgentsGetSample.ts deleted file mode 100644 index 04b1abeba925..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/guestAgentsGetSample.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Implements GuestAgent GET method. - * - * @summary Implements GuestAgent GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Get_MaximumSet_Gen.json - */ -async function guestAgentsGetMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.guestAgents.get(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Implements GuestAgent GET method. - * - * @summary Implements GuestAgent GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Get_MinimumSet_Gen.json - */ -async function guestAgentsGetMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.guestAgents.get(resourceUri); - console.log(result); -} - -async function main() { - guestAgentsGetMaximumSet(); - guestAgentsGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/guestAgentsListByVirtualMachineInstanceSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/guestAgentsListByVirtualMachineInstanceSample.ts deleted file mode 100644 index 8894ec4ad475..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/guestAgentsListByVirtualMachineInstanceSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * 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/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_ListByVirtualMachineInstance_MaximumSet_Gen.json - */ -async function guestAgentsListByVirtualMachineInstanceMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const resArray = new Array(); - for await (let item of client.guestAgents.listByVirtualMachineInstance( - resourceUri, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * 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/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_ListByVirtualMachineInstance_MinimumSet_Gen.json - */ -async function guestAgentsListByVirtualMachineInstanceMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const resArray = new Array(); - for await (let item of client.guestAgents.listByVirtualMachineInstance( - resourceUri, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - guestAgentsListByVirtualMachineInstanceMaximumSet(); - guestAgentsListByVirtualMachineInstanceMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/inventoryItemsCreateSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/inventoryItemsCreateSample.ts deleted file mode 100644 index 428e9c53483f..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/inventoryItemsCreateSample.ts +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create Or Update InventoryItem. - * - * @summary Create Or Update InventoryItem. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Create_MaximumSet_Gen.json - */ -async function inventoryItemsCreateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "O"; - const inventoryItemResourceName = "1BdDc2Ab-bDd9-Ebd6-bfdb-C0dbbdB5DEDf"; - const resource: InventoryItem = { - kind: "M\\d_,V.", - properties: { inventoryType: "Cloud" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.inventoryItems.create( - resourceGroupName, - vmmServerName, - inventoryItemResourceName, - resource, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create Or Update InventoryItem. - * - * @summary Create Or Update InventoryItem. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Create_MinimumSet_Gen.json - */ -async function inventoryItemsCreateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "."; - const inventoryItemResourceName = "bbFb0cBb-50ce-4bfc-3eeD-bC26AbCC257a"; - const resource: InventoryItem = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.inventoryItems.create( - resourceGroupName, - vmmServerName, - inventoryItemResourceName, - resource, - ); - console.log(result); -} - -async function main() { - inventoryItemsCreateMaximumSet(); - inventoryItemsCreateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/inventoryItemsDeleteSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/inventoryItemsDeleteSample.ts deleted file mode 100644 index af70e0cea160..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/inventoryItemsDeleteSample.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes an inventoryItem. - * - * @summary Deletes an inventoryItem. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Delete_MaximumSet_Gen.json - */ -async function inventoryItemsDeleteMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "b"; - const inventoryItemResourceName = "EcECadfd-Eaaa-e5Ce-ebdA-badeEd3c6af1"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.inventoryItems.delete( - resourceGroupName, - vmmServerName, - inventoryItemResourceName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deletes an inventoryItem. - * - * @summary Deletes an inventoryItem. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Delete_MinimumSet_Gen.json - */ -async function inventoryItemsDeleteMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "_"; - const inventoryItemResourceName = "cDBcbae6-BC3d-52fe-CedC-7eFeaBFabb82"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.inventoryItems.delete( - resourceGroupName, - vmmServerName, - inventoryItemResourceName, - ); - console.log(result); -} - -async function main() { - inventoryItemsDeleteMaximumSet(); - inventoryItemsDeleteMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/inventoryItemsGetSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/inventoryItemsGetSample.ts deleted file mode 100644 index 391ba6b03e63..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/inventoryItemsGetSample.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Shows an inventory item. - * - * @summary Shows an inventory item. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Get_MaximumSet_Gen.json - */ -async function inventoryItemsGetMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "1"; - const inventoryItemResourceName = "2bFBede6-EEf8-becB-dBbd-B96DbBFdB3f3"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.inventoryItems.get( - resourceGroupName, - vmmServerName, - inventoryItemResourceName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Shows an inventory item. - * - * @summary Shows an inventory item. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Get_MinimumSet_Gen.json - */ -async function inventoryItemsGetMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "_"; - const inventoryItemResourceName = "cacb8Ceb-efAC-bebb-ae7C-dec8C5Bb7100"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.inventoryItems.get( - resourceGroupName, - vmmServerName, - inventoryItemResourceName, - ); - console.log(result); -} - -async function main() { - inventoryItemsGetMaximumSet(); - inventoryItemsGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/inventoryItemsListByVmmServerSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/inventoryItemsListByVmmServerSample.ts deleted file mode 100644 index 70790a76cd94..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/inventoryItemsListByVmmServerSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns the list of inventoryItems in the given VmmServer. - * - * @summary Returns the list of inventoryItems in the given VmmServer. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_ListByVmmServer_MaximumSet_Gen.json - */ -async function inventoryItemsListByVmmServerMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "X"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.inventoryItems.listByVmmServer( - resourceGroupName, - vmmServerName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Returns the list of inventoryItems in the given VmmServer. - * - * @summary Returns the list of inventoryItems in the given VmmServer. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_ListByVmmServer_MinimumSet_Gen.json - */ -async function inventoryItemsListByVmmServerMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "H"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.inventoryItems.listByVmmServer( - resourceGroupName, - vmmServerName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - inventoryItemsListByVmmServerMaximumSet(); - inventoryItemsListByVmmServerMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/operationsListSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/operationsListSample.ts deleted file mode 100644 index 956fbf324282..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Operations_List_MaximumSet_Gen.json - */ -async function operationsListMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Operations_List_MinimumSet_Gen.json - */ -async function operationsListMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsListMaximumSet(); - operationsListMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesCreateCheckpointSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesCreateCheckpointSample.ts deleted file mode 100644 index b4db95544136..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesCreateCheckpointSample.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { VirtualMachineCreateCheckpoint, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates a checkpoint in virtual machine instance. - * - * @summary Creates a checkpoint in virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateCheckpoint_MaximumSet_Gen.json - */ -async function virtualMachineInstancesCreateCheckpointMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const body: VirtualMachineCreateCheckpoint = { - name: "ilvltf", - description: "zoozhfbepldrgpjqsbhpqebtodrhvy", - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.virtualMachineInstances.beginCreateCheckpointAndWait( - resourceUri, - body, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a checkpoint in virtual machine instance. - * - * @summary Creates a checkpoint in virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateCheckpoint_MinimumSet_Gen.json - */ -async function virtualMachineInstancesCreateCheckpointMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const body: VirtualMachineCreateCheckpoint = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.virtualMachineInstances.beginCreateCheckpointAndWait( - resourceUri, - body, - ); - console.log(result); -} - -async function main() { - virtualMachineInstancesCreateCheckpointMaximumSet(); - virtualMachineInstancesCreateCheckpointMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesCreateOrUpdateSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesCreateOrUpdateSample.ts deleted file mode 100644 index 125450f27168..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesCreateOrUpdateSample.ts +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { VirtualMachineInstance, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to The operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. - * - * @summary The operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateOrUpdate_MaximumSet_Gen.json - */ -async function virtualMachineInstancesCreateOrUpdateMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const resource: VirtualMachineInstance = { - extendedLocation: { - name: "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName", - type: "customLocation", - }, - properties: { - availabilitySets: [ - { - name: "lwbhaseo", - id: "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName", - }, - ], - hardwareProfile: { - cpuCount: 22, - dynamicMemoryEnabled: "true", - dynamicMemoryMaxMB: 2, - dynamicMemoryMinMB: 30, - isHighlyAvailable: "true", - limitCpuForMigration: "true", - memoryMB: 5, - }, - infrastructureProfile: { - biosGuid: "xixivxifyql", - checkpointType: "jkbpzjxpeegackhsvikrnlnwqz", - cloudId: - "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName", - generation: 28, - inventoryItemId: "ihkkqmg", - lastRestoredVmCheckpoint: { - name: "keqn", - description: "qurzfrgyflrh", - checkpointId: "wsqmrje", - parentCheckpointId: "hqhhzikoxunuqguouw", - }, - templateId: - "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName", - uuid: "hrpw", - vmName: "qovpayfydhcvfrhe", - vmmServerId: - "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName", - }, - networkProfile: { - networkInterfaces: [ - { - name: "kvofzqulbjlbtt", - ipv4AddressType: "Dynamic", - ipv6AddressType: "Dynamic", - macAddress: "oaeqqegt", - macAddressType: "Dynamic", - nicId: "roxpsvlo", - virtualNetworkId: - "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName", - }, - ], - }, - osProfile: { - adminPassword: "vavtppmmhlspydtkzxda", - computerName: "uuxpcxuxcufllc", - osType: "Windows", - }, - storageProfile: { - disks: [ - { - name: "fgnckfymwdsqnfxkdvexuaobe", - bus: 8, - busType: "zu", - createDiffDisk: "true", - diskId: "ltdrwcfjklpsimhzqyh", - diskSizeGB: 30, - lun: 10, - storageQosPolicy: { name: "ceiyfrflu", id: "o" }, - templateDiskId: "lcdwrokpyvekqccclf", - vhdType: "cnbeeeylrvopigdynvgpkfp", - }, - ], - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.virtualMachineInstances.beginCreateOrUpdateAndWait( - resourceUri, - resource, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. - * - * @summary The operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateOrUpdate_MinimumSet_Gen.json - */ -async function virtualMachineInstancesCreateOrUpdateMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const resource: VirtualMachineInstance = { extendedLocation: {} }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.virtualMachineInstances.beginCreateOrUpdateAndWait( - resourceUri, - resource, - ); - console.log(result); -} - -async function main() { - virtualMachineInstancesCreateOrUpdateMaximumSet(); - virtualMachineInstancesCreateOrUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesDeleteCheckpointSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesDeleteCheckpointSample.ts deleted file mode 100644 index 8a48b77f48ad..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesDeleteCheckpointSample.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { VirtualMachineDeleteCheckpoint, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a checkpoint in virtual machine instance. - * - * @summary Deletes a checkpoint in virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_DeleteCheckpoint_MaximumSet_Gen.json - */ -async function virtualMachineInstancesDeleteCheckpointMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const body: VirtualMachineDeleteCheckpoint = { - id: "eenfflimcbgqfsebdusophahjpk", - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.virtualMachineInstances.beginDeleteCheckpointAndWait( - resourceUri, - body, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deletes a checkpoint in virtual machine instance. - * - * @summary Deletes a checkpoint in virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_DeleteCheckpoint_MinimumSet_Gen.json - */ -async function virtualMachineInstancesDeleteCheckpointMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const body: VirtualMachineDeleteCheckpoint = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.virtualMachineInstances.beginDeleteCheckpointAndWait( - resourceUri, - body, - ); - console.log(result); -} - -async function main() { - virtualMachineInstancesDeleteCheckpointMaximumSet(); - virtualMachineInstancesDeleteCheckpointMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesDeleteSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesDeleteSample.ts deleted file mode 100644 index 777f447ad7cb..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesDeleteSample.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { - VirtualMachineInstancesDeleteOptionalParams, - ScVmm, -} from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to The operation to delete a virtual machine instance. - * - * @summary The operation to delete a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Delete_MaximumSet_Gen.json - */ -async function virtualMachineInstancesDeleteMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const force = "true"; - const deleteFromHost = "true"; - const options: VirtualMachineInstancesDeleteOptionalParams = { - force, - deleteFromHost, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginDeleteAndWait( - resourceUri, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to delete a virtual machine instance. - * - * @summary The operation to delete a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Delete_MinimumSet_Gen.json - */ -async function virtualMachineInstancesDeleteMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.virtualMachineInstances.beginDeleteAndWait(resourceUri); - console.log(result); -} - -async function main() { - virtualMachineInstancesDeleteMaximumSet(); - virtualMachineInstancesDeleteMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesGetSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesGetSample.ts deleted file mode 100644 index d6aa371ab1fb..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesGetSample.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieves information about a virtual machine instance. - * - * @summary Retrieves information about a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Get_MaximumSet_Gen.json - */ -async function virtualMachineInstancesGetMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.get(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about a virtual machine instance. - * - * @summary Retrieves information about a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Get_MinimumSet_Gen.json - */ -async function virtualMachineInstancesGetMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.get(resourceUri); - console.log(result); -} - -async function main() { - virtualMachineInstancesGetMaximumSet(); - virtualMachineInstancesGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesListSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesListSample.ts deleted file mode 100644 index a19ead0943b0..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesListSample.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all of the virtual machine instances within the specified parent resource. - * - * @summary Lists all of the virtual machine instances within the specified parent resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_List_MaximumSet_Gen.json - */ -async function virtualMachineInstancesListMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const resArray = new Array(); - for await (let item of client.virtualMachineInstances.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Lists all of the virtual machine instances within the specified parent resource. - * - * @summary Lists all of the virtual machine instances within the specified parent resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_List_MinimumSet_Gen.json - */ -async function virtualMachineInstancesListMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const resArray = new Array(); - for await (let item of client.virtualMachineInstances.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - virtualMachineInstancesListMaximumSet(); - virtualMachineInstancesListMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesRestartSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesRestartSample.ts deleted file mode 100644 index 4eb9bb8bd90c..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesRestartSample.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to The operation to restart a virtual machine instance. - * - * @summary The operation to restart a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Restart_MaximumSet_Gen.json - */ -async function virtualMachineInstancesRestartMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.virtualMachineInstances.beginRestartAndWait(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to restart a virtual machine instance. - * - * @summary The operation to restart a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Restart_MinimumSet_Gen.json - */ -async function virtualMachineInstancesRestartMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.virtualMachineInstances.beginRestartAndWait(resourceUri); - console.log(result); -} - -async function main() { - virtualMachineInstancesRestartMaximumSet(); - virtualMachineInstancesRestartMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesRestoreCheckpointSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesRestoreCheckpointSample.ts deleted file mode 100644 index b5fe7ce03807..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesRestoreCheckpointSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { VirtualMachineRestoreCheckpoint, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Restores to a checkpoint in virtual machine instance. - * - * @summary Restores to a checkpoint in virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_RestoreCheckpoint_MaximumSet_Gen.json - */ -async function virtualMachineInstancesRestoreCheckpointMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const body: VirtualMachineRestoreCheckpoint = { id: "rweqduwzsn" }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.virtualMachineInstances.beginRestoreCheckpointAndWait( - resourceUri, - body, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Restores to a checkpoint in virtual machine instance. - * - * @summary Restores to a checkpoint in virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_RestoreCheckpoint_MinimumSet_Gen.json - */ -async function virtualMachineInstancesRestoreCheckpointMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const body: VirtualMachineRestoreCheckpoint = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.virtualMachineInstances.beginRestoreCheckpointAndWait( - resourceUri, - body, - ); - console.log(result); -} - -async function main() { - virtualMachineInstancesRestoreCheckpointMaximumSet(); - virtualMachineInstancesRestoreCheckpointMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesStartSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesStartSample.ts deleted file mode 100644 index 6fac55f78b65..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesStartSample.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to The operation to start a virtual machine instance. - * - * @summary The operation to start a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Start_MaximumSet_Gen.json - */ -async function virtualMachineInstancesStartMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.virtualMachineInstances.beginStartAndWait(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to start a virtual machine instance. - * - * @summary The operation to start a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Start_MinimumSet_Gen.json - */ -async function virtualMachineInstancesStartMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.virtualMachineInstances.beginStartAndWait(resourceUri); - console.log(result); -} - -async function main() { - virtualMachineInstancesStartMaximumSet(); - virtualMachineInstancesStartMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesStopSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesStopSample.ts deleted file mode 100644 index 69119b673bd9..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesStopSample.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to The operation to power off (stop) a virtual machine instance. - * - * @summary The operation to power off (stop) a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Stop_MaximumSet_Gen.json - */ -async function virtualMachineInstancesStopMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const body: StopVirtualMachineOptions = { skipShutdown: "true" }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginStopAndWait( - resourceUri, - body, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to power off (stop) a virtual machine instance. - * - * @summary The operation to power off (stop) a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Stop_MinimumSet_Gen.json - */ -async function virtualMachineInstancesStopMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const body: StopVirtualMachineOptions = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginStopAndWait( - resourceUri, - body, - ); - console.log(result); -} - -async function main() { - virtualMachineInstancesStopMaximumSet(); - virtualMachineInstancesStopMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesUpdateSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesUpdateSample.ts deleted file mode 100644 index 2488f17f9741..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineInstancesUpdateSample.ts +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { VirtualMachineInstanceUpdate, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to The operation to update a virtual machine instance. - * - * @summary The operation to update a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Update_MaximumSet_Gen.json - */ -async function virtualMachineInstancesUpdateMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const properties: VirtualMachineInstanceUpdate = { - properties: { - availabilitySets: [ - { - name: "lwbhaseo", - id: "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName", - }, - ], - hardwareProfile: { - cpuCount: 22, - dynamicMemoryEnabled: "true", - dynamicMemoryMaxMB: 2, - dynamicMemoryMinMB: 30, - limitCpuForMigration: "true", - memoryMB: 5, - }, - infrastructureProfile: { checkpointType: "jkbpzjxpeegackhsvikrnlnwqz" }, - networkProfile: { - networkInterfaces: [ - { - name: "kvofzqulbjlbtt", - ipv4AddressType: "Dynamic", - ipv6AddressType: "Dynamic", - macAddress: "oaeqqegt", - macAddressType: "Dynamic", - nicId: "roxpsvlo", - virtualNetworkId: - "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName", - }, - ], - }, - storageProfile: { - disks: [ - { - name: "fgnckfymwdsqnfxkdvexuaobe", - bus: 8, - busType: "zu", - diskId: "ltdrwcfjklpsimhzqyh", - diskSizeGB: 30, - lun: 10, - storageQosPolicy: { name: "ceiyfrflu", id: "o" }, - vhdType: "cnbeeeylrvopigdynvgpkfp", - }, - ], - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginUpdateAndWait( - resourceUri, - properties, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to update a virtual machine instance. - * - * @summary The operation to update a virtual machine instance. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Update_MinimumSet_Gen.json - */ -async function virtualMachineInstancesUpdateMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const properties: VirtualMachineInstanceUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = await client.virtualMachineInstances.beginUpdateAndWait( - resourceUri, - properties, - ); - console.log(result); -} - -async function main() { - virtualMachineInstancesUpdateMaximumSet(); - virtualMachineInstancesUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineTemplatesCreateOrUpdateSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineTemplatesCreateOrUpdateSample.ts deleted file mode 100644 index ce4522197930..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineTemplatesCreateOrUpdateSample.ts +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Onboards the ScVmm VM Template as an Azure VM Template resource. - * - * @summary Onboards the ScVmm VM Template as an Azure VM Template resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_CreateOrUpdate_MaximumSet_Gen.json - */ -async function virtualMachineTemplatesCreateOrUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualMachineTemplateName = "6"; - const resource: VirtualMachineTemplate = { - extendedLocation: { - name: "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName", - type: "customLocation", - }, - location: "ayxsyduviotylbojh", - properties: { - dynamicMemoryEnabled: "true", - inventoryItemId: "qjrykoogccwlgkd", - isCustomizable: "true", - isHighlyAvailable: "true", - limitCpuForMigration: "true", - osType: "Windows", - uuid: "12345678-1234-1234-1234-12345678abcd", - vmmServerId: - "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName", - }, - tags: { key9494: "kkbmfpwhmvlobm" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = - await client.virtualMachineTemplates.beginCreateOrUpdateAndWait( - resourceGroupName, - virtualMachineTemplateName, - resource, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Onboards the ScVmm VM Template as an Azure VM Template resource. - * - * @summary Onboards the ScVmm VM Template as an Azure VM Template resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_CreateOrUpdate_MinimumSet_Gen.json - */ -async function virtualMachineTemplatesCreateOrUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualMachineTemplateName = "P"; - const resource: VirtualMachineTemplate = { - extendedLocation: {}, - location: "ayxsyduviotylbojh", - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = - await client.virtualMachineTemplates.beginCreateOrUpdateAndWait( - resourceGroupName, - virtualMachineTemplateName, - resource, - ); - console.log(result); -} - -async function main() { - virtualMachineTemplatesCreateOrUpdateMaximumSet(); - virtualMachineTemplatesCreateOrUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineTemplatesDeleteSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineTemplatesDeleteSample.ts deleted file mode 100644 index 5a420f0c84ba..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineTemplatesDeleteSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { - VirtualMachineTemplatesDeleteOptionalParams, - ScVmm, -} from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deregisters the ScVmm VM Template from Azure. - * - * @summary Deregisters the ScVmm VM Template from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Delete_MaximumSet_Gen.json - */ -async function virtualMachineTemplatesDeleteMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const force = "true"; - const virtualMachineTemplateName = "6"; - const options: VirtualMachineTemplatesDeleteOptionalParams = { force }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualMachineTemplates.beginDeleteAndWait( - resourceGroupName, - virtualMachineTemplateName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deregisters the ScVmm VM Template from Azure. - * - * @summary Deregisters the ScVmm VM Template from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Delete_MinimumSet_Gen.json - */ -async function virtualMachineTemplatesDeleteMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualMachineTemplateName = "5"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualMachineTemplates.beginDeleteAndWait( - resourceGroupName, - virtualMachineTemplateName, - ); - console.log(result); -} - -async function main() { - virtualMachineTemplatesDeleteMaximumSet(); - virtualMachineTemplatesDeleteMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineTemplatesGetSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineTemplatesGetSample.ts deleted file mode 100644 index cdf0ab30ce78..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineTemplatesGetSample.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Implements VirtualMachineTemplate GET method. - * - * @summary Implements VirtualMachineTemplate GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Get_MaximumSet_Gen.json - */ -async function virtualMachineTemplatesGetMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualMachineTemplateName = "4"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualMachineTemplates.get( - resourceGroupName, - virtualMachineTemplateName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Implements VirtualMachineTemplate GET method. - * - * @summary Implements VirtualMachineTemplate GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Get_MinimumSet_Gen.json - */ -async function virtualMachineTemplatesGetMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualMachineTemplateName = "m"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualMachineTemplates.get( - resourceGroupName, - virtualMachineTemplateName, - ); - console.log(result); -} - -async function main() { - virtualMachineTemplatesGetMaximumSet(); - virtualMachineTemplatesGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineTemplatesListByResourceGroupSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineTemplatesListByResourceGroupSample.ts deleted file mode 100644 index 1caead73611e..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineTemplatesListByResourceGroupSample.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * 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/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListByResourceGroup_MaximumSet_Gen.json - */ -async function virtualMachineTemplatesListByResourceGroupMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.virtualMachineTemplates.listByResourceGroup( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * 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/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListByResourceGroup_MinimumSet_Gen.json - */ -async function virtualMachineTemplatesListByResourceGroupMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.virtualMachineTemplates.listByResourceGroup( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - virtualMachineTemplatesListByResourceGroupMaximumSet(); - virtualMachineTemplatesListByResourceGroupMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineTemplatesListBySubscriptionSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineTemplatesListBySubscriptionSample.ts deleted file mode 100644 index 1c9fcc9dca09..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineTemplatesListBySubscriptionSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List of VirtualMachineTemplates in a subscription. - * - * @summary List of VirtualMachineTemplates in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListBySubscription_MaximumSet_Gen.json - */ -async function virtualMachineTemplatesListBySubscriptionMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.virtualMachineTemplates.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List of VirtualMachineTemplates in a subscription. - * - * @summary List of VirtualMachineTemplates in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListBySubscription_MinimumSet_Gen.json - */ -async function virtualMachineTemplatesListBySubscriptionMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.virtualMachineTemplates.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - virtualMachineTemplatesListBySubscriptionMaximumSet(); - virtualMachineTemplatesListBySubscriptionMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineTemplatesUpdateSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineTemplatesUpdateSample.ts deleted file mode 100644 index 960664aec886..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualMachineTemplatesUpdateSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { VirtualMachineTemplateTagsUpdate, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates the VirtualMachineTemplate resource. - * - * @summary Updates the VirtualMachineTemplate resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Update_MaximumSet_Gen.json - */ -async function virtualMachineTemplatesUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualMachineTemplateName = "g"; - const properties: VirtualMachineTemplateTagsUpdate = { - tags: { key6634: "wwfhrg" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualMachineTemplates.beginUpdateAndWait( - resourceGroupName, - virtualMachineTemplateName, - properties, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates the VirtualMachineTemplate resource. - * - * @summary Updates the VirtualMachineTemplate resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Update_MinimumSet_Gen.json - */ -async function virtualMachineTemplatesUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualMachineTemplateName = "-"; - const properties: VirtualMachineTemplateTagsUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualMachineTemplates.beginUpdateAndWait( - resourceGroupName, - virtualMachineTemplateName, - properties, - ); - console.log(result); -} - -async function main() { - virtualMachineTemplatesUpdateMaximumSet(); - virtualMachineTemplatesUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualNetworksCreateOrUpdateSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualNetworksCreateOrUpdateSample.ts deleted file mode 100644 index 9d2830eb7c3c..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualNetworksCreateOrUpdateSample.ts +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Onboards the ScVmm virtual network as an Azure virtual network resource. - * - * @summary Onboards the ScVmm virtual network as an Azure virtual network resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_CreateOrUpdate_MaximumSet_Gen.json - */ -async function virtualNetworksCreateOrUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualNetworkName = "_"; - const resource: VirtualNetwork = { - extendedLocation: { - name: "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName", - type: "customLocation", - }, - location: "fky", - properties: { - inventoryItemId: "bxn", - uuid: "12345678-1234-1234-1234-12345678abcd", - vmmServerId: - "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName", - }, - tags: { key705: "apgplvjdyocx" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualNetworks.beginCreateOrUpdateAndWait( - resourceGroupName, - virtualNetworkName, - resource, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Onboards the ScVmm virtual network as an Azure virtual network resource. - * - * @summary Onboards the ScVmm virtual network as an Azure virtual network resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_CreateOrUpdate_MinimumSet_Gen.json - */ -async function virtualNetworksCreateOrUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualNetworkName = "-"; - const resource: VirtualNetwork = { extendedLocation: {}, location: "fky" }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualNetworks.beginCreateOrUpdateAndWait( - resourceGroupName, - virtualNetworkName, - resource, - ); - console.log(result); -} - -async function main() { - virtualNetworksCreateOrUpdateMaximumSet(); - virtualNetworksCreateOrUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualNetworksDeleteSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualNetworksDeleteSample.ts deleted file mode 100644 index 28f6b14b1037..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualNetworksDeleteSample.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { VirtualNetworksDeleteOptionalParams, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deregisters the ScVmm virtual network from Azure. - * - * @summary Deregisters the ScVmm virtual network from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Delete_MaximumSet_Gen.json - */ -async function virtualNetworksDeleteMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const force = "true"; - const virtualNetworkName = "."; - const options: VirtualNetworksDeleteOptionalParams = { force }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualNetworks.beginDeleteAndWait( - resourceGroupName, - virtualNetworkName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deregisters the ScVmm virtual network from Azure. - * - * @summary Deregisters the ScVmm virtual network from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Delete_MinimumSet_Gen.json - */ -async function virtualNetworksDeleteMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualNetworkName = "1"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualNetworks.beginDeleteAndWait( - resourceGroupName, - virtualNetworkName, - ); - console.log(result); -} - -async function main() { - virtualNetworksDeleteMaximumSet(); - virtualNetworksDeleteMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualNetworksGetSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualNetworksGetSample.ts deleted file mode 100644 index b87dd1bfdc27..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualNetworksGetSample.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Implements VirtualNetwork GET method. - * - * @summary Implements VirtualNetwork GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Get_MaximumSet_Gen.json - */ -async function virtualNetworksGetMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualNetworkName = "2"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualNetworks.get( - resourceGroupName, - virtualNetworkName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Implements VirtualNetwork GET method. - * - * @summary Implements VirtualNetwork GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Get_MinimumSet_Gen.json - */ -async function virtualNetworksGetMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualNetworkName = "-"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualNetworks.get( - resourceGroupName, - virtualNetworkName, - ); - console.log(result); -} - -async function main() { - virtualNetworksGetMaximumSet(); - virtualNetworksGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualNetworksListByResourceGroupSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualNetworksListByResourceGroupSample.ts deleted file mode 100644 index f72b7db5bd09..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualNetworksListByResourceGroupSample.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * 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/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListByResourceGroup_MaximumSet_Gen.json - */ -async function virtualNetworksListByResourceGroupMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.virtualNetworks.listByResourceGroup( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * 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/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListByResourceGroup_MinimumSet_Gen.json - */ -async function virtualNetworksListByResourceGroupMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.virtualNetworks.listByResourceGroup( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - virtualNetworksListByResourceGroupMaximumSet(); - virtualNetworksListByResourceGroupMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualNetworksListBySubscriptionSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualNetworksListBySubscriptionSample.ts deleted file mode 100644 index 617071d3cc34..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualNetworksListBySubscriptionSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List of VirtualNetworks in a subscription. - * - * @summary List of VirtualNetworks in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListBySubscription_MaximumSet_Gen.json - */ -async function virtualNetworksListBySubscriptionMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.virtualNetworks.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List of VirtualNetworks in a subscription. - * - * @summary List of VirtualNetworks in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListBySubscription_MinimumSet_Gen.json - */ -async function virtualNetworksListBySubscriptionMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.virtualNetworks.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - virtualNetworksListBySubscriptionMaximumSet(); - virtualNetworksListBySubscriptionMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualNetworksUpdateSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualNetworksUpdateSample.ts deleted file mode 100644 index 0e7c6e0d05a3..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/virtualNetworksUpdateSample.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { VirtualNetworkTagsUpdate, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates the VirtualNetworks resource. - * - * @summary Updates the VirtualNetworks resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Update_MaximumSet_Gen.json - */ -async function virtualNetworksUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualNetworkName = "S"; - const properties: VirtualNetworkTagsUpdate = { tags: { key9516: "oxduo" } }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualNetworks.beginUpdateAndWait( - resourceGroupName, - virtualNetworkName, - properties, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates the VirtualNetworks resource. - * - * @summary Updates the VirtualNetworks resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Update_MinimumSet_Gen.json - */ -async function virtualNetworksUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const virtualNetworkName = "-"; - const properties: VirtualNetworkTagsUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.virtualNetworks.beginUpdateAndWait( - resourceGroupName, - virtualNetworkName, - properties, - ); - console.log(result); -} - -async function main() { - virtualNetworksUpdateMaximumSet(); - virtualNetworksUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmInstanceHybridIdentityMetadatasGetSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmInstanceHybridIdentityMetadatasGetSample.ts deleted file mode 100644 index 666d57258e58..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmInstanceHybridIdentityMetadatasGetSample.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Implements HybridIdentityMetadata GET method. - * - * @summary Implements HybridIdentityMetadata GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_Get_MaximumSet_Gen.json - */ -async function vmInstanceHybridIdentityMetadatasGetMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.vmInstanceHybridIdentityMetadatas.get(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Implements HybridIdentityMetadata GET method. - * - * @summary Implements HybridIdentityMetadata GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_Get_MinimumSet_Gen.json - */ -async function vmInstanceHybridIdentityMetadatasGetMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const result = - await client.vmInstanceHybridIdentityMetadatas.get(resourceUri); - console.log(result); -} - -async function main() { - vmInstanceHybridIdentityMetadatasGetMaximumSet(); - vmInstanceHybridIdentityMetadatasGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceSample.ts deleted file mode 100644 index 47e02cd8ffc7..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * 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/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_ListByVirtualMachineInstance_MaximumSet_Gen.json - */ -async function vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceMaximumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const resArray = new Array(); - for await (let item of client.vmInstanceHybridIdentityMetadatas.listByVirtualMachineInstance( - resourceUri, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * 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/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_ListByVirtualMachineInstance_MinimumSet_Gen.json - */ -async function vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceMinimumSet() { - const resourceUri = "gtgclehcbsyave"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential); - const resArray = new Array(); - for await (let item of client.vmInstanceHybridIdentityMetadatas.listByVirtualMachineInstance( - resourceUri, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceMaximumSet(); - vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmmServersCreateOrUpdateSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmmServersCreateOrUpdateSample.ts deleted file mode 100644 index 85538df69c1b..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmmServersCreateOrUpdateSample.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { VmmServer, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Onboards the SCVmm fabric as an Azure VmmServer resource. - * - * @summary Onboards the SCVmm fabric as an Azure VmmServer resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_CreateOrUpdate_MaximumSet_Gen.json - */ -async function vmmServersCreateOrUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "-"; - const resource: VmmServer = { - extendedLocation: { - name: "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName", - type: "customLocation", - }, - location: "hslxkyzktvwpqbypvs", - properties: { - credentials: { password: "SecretPlaceholder", username: "jbuoltypmrgqfi" }, - fqdn: "pvzcjaqrswbvptgx", - port: 4, - }, - tags: { key4834: "vycgfkzjcyyuotwwq" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.vmmServers.beginCreateOrUpdateAndWait( - resourceGroupName, - vmmServerName, - resource, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Onboards the SCVmm fabric as an Azure VmmServer resource. - * - * @summary Onboards the SCVmm fabric as an Azure VmmServer resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_CreateOrUpdate_MinimumSet_Gen.json - */ -async function vmmServersCreateOrUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "w"; - const resource: VmmServer = { - extendedLocation: {}, - location: "hslxkyzktvwpqbypvs", - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.vmmServers.beginCreateOrUpdateAndWait( - resourceGroupName, - vmmServerName, - resource, - ); - console.log(result); -} - -async function main() { - vmmServersCreateOrUpdateMaximumSet(); - vmmServersCreateOrUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmmServersDeleteSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmmServersDeleteSample.ts deleted file mode 100644 index 8e20b9d4de19..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmmServersDeleteSample.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { VmmServersDeleteOptionalParams, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Removes the SCVmm fabric from Azure. - * - * @summary Removes the SCVmm fabric from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Delete_MaximumSet_Gen.json - */ -async function vmmServersDeleteMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const force = "true"; - const vmmServerName = "."; - const options: VmmServersDeleteOptionalParams = { force }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.vmmServers.beginDeleteAndWait( - resourceGroupName, - vmmServerName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Removes the SCVmm fabric from Azure. - * - * @summary Removes the SCVmm fabric from Azure. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Delete_MinimumSet_Gen.json - */ -async function vmmServersDeleteMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "8"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.vmmServers.beginDeleteAndWait( - resourceGroupName, - vmmServerName, - ); - console.log(result); -} - -async function main() { - vmmServersDeleteMaximumSet(); - vmmServersDeleteMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmmServersGetSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmmServersGetSample.ts deleted file mode 100644 index 67cba045f728..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmmServersGetSample.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Implements VmmServer GET method. - * - * @summary Implements VmmServer GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Get_MaximumSet_Gen.json - */ -async function vmmServersGetMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "."; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.vmmServers.get(resourceGroupName, vmmServerName); - console.log(result); -} - -/** - * This sample demonstrates how to Implements VmmServer GET method. - * - * @summary Implements VmmServer GET method. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Get_MinimumSet_Gen.json - */ -async function vmmServersGetMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "D"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.vmmServers.get(resourceGroupName, vmmServerName); - console.log(result); -} - -async function main() { - vmmServersGetMaximumSet(); - vmmServersGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmmServersListByResourceGroupSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmmServersListByResourceGroupSample.ts deleted file mode 100644 index a7b93c8c576f..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmmServersListByResourceGroupSample.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List of VmmServers in a resource group. - * - * @summary List of VmmServers in a resource group. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListByResourceGroup_MaximumSet_Gen.json - */ -async function vmmServersListByResourceGroupMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.vmmServers.listByResourceGroup( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List of VmmServers in a resource group. - * - * @summary List of VmmServers in a resource group. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListByResourceGroup_MinimumSet_Gen.json - */ -async function vmmServersListByResourceGroupMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.vmmServers.listByResourceGroup( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - vmmServersListByResourceGroupMaximumSet(); - vmmServersListByResourceGroupMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmmServersListBySubscriptionSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmmServersListBySubscriptionSample.ts deleted file mode 100644 index 52f0c2e8878a..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmmServersListBySubscriptionSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List of VmmServers in a subscription. - * - * @summary List of VmmServers in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListBySubscription_MaximumSet_Gen.json - */ -async function vmmServersListBySubscriptionMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.vmmServers.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List of VmmServers in a subscription. - * - * @summary List of VmmServers in a subscription. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListBySubscription_MinimumSet_Gen.json - */ -async function vmmServersListBySubscriptionMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.vmmServers.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - vmmServersListBySubscriptionMaximumSet(); - vmmServersListBySubscriptionMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmmServersUpdateSample.ts b/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmmServersUpdateSample.ts deleted file mode 100644 index ff36e01ae601..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/src/vmmServersUpdateSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { VmmServerTagsUpdate, ScVmm } from "@azure/arm-scvmm"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates the VmmServers resource. - * - * @summary Updates the VmmServers resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Update_MaximumSet_Gen.json - */ -async function vmmServersUpdateMaximumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "Y"; - const properties: VmmServerTagsUpdate = { - tags: { key7187: "oktnfvklfchnquelzzdagtpwfskzc" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.vmmServers.beginUpdateAndWait( - resourceGroupName, - vmmServerName, - properties, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates the VmmServers resource. - * - * @summary Updates the VmmServers resource. - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Update_MinimumSet_Gen.json - */ -async function vmmServersUpdateMinimumSet() { - const subscriptionId = - process.env["SCVMM_SUBSCRIPTION_ID"] || - "79332E5A-630B-480F-A266-A941C015AB19"; - const resourceGroupName = process.env["SCVMM_RESOURCE_GROUP"] || "rgscvmm"; - const vmmServerName = "_"; - const properties: VmmServerTagsUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ScVmm(credential, subscriptionId); - const result = await client.vmmServers.beginUpdateAndWait( - resourceGroupName, - vmmServerName, - properties, - ); - console.log(result); -} - -async function main() { - vmmServersUpdateMaximumSet(); - vmmServersUpdateMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/scvmm/arm-scvmm/samples/v1/typescript/tsconfig.json b/sdk/scvmm/arm-scvmm/samples/v1/typescript/tsconfig.json deleted file mode 100644 index 984eed535aa8..000000000000 --- a/sdk/scvmm/arm-scvmm/samples/v1/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020", - "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/scvmm/arm-scvmm/src/api/availabilitySets/index.ts b/sdk/scvmm/arm-scvmm/src/api/availabilitySets/index.ts new file mode 100644 index 000000000000..8d676f4af998 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/api/availabilitySets/index.ts @@ -0,0 +1,587 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { getLongRunningPoller } from "../pollingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; +import { + extendedLocationSerializer, + availabilitySetPropertiesSerializer, + AvailabilitySet, + AvailabilitySetTagsUpdate, + _AvailabilitySetListResult, +} from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../models/pagingTypes.js"; +import { buildPagedAsyncIterator } from "../pagingHelpers.js"; +import { + AvailabilitySetsCreateOrUpdate200Response, + AvailabilitySetsCreateOrUpdate201Response, + AvailabilitySetsCreateOrUpdateDefaultResponse, + AvailabilitySetsCreateOrUpdateLogicalResponse, + AvailabilitySetsDelete202Response, + AvailabilitySetsDelete204Response, + AvailabilitySetsDeleteDefaultResponse, + AvailabilitySetsDeleteLogicalResponse, + AvailabilitySetsGet200Response, + AvailabilitySetsGetDefaultResponse, + AvailabilitySetsListByResourceGroup200Response, + AvailabilitySetsListByResourceGroupDefaultResponse, + AvailabilitySetsListBySubscription200Response, + AvailabilitySetsListBySubscriptionDefaultResponse, + AvailabilitySetsUpdate200Response, + AvailabilitySetsUpdate202Response, + AvailabilitySetsUpdateDefaultResponse, + AvailabilitySetsUpdateLogicalResponse, + isUnexpected, + ScVmmContext as Client, +} from "../../rest/index.js"; +import { + StreamableMethod, + operationOptionsToRequestParameters, + createRestError, +} from "@azure-rest/core-client"; +import { serializeRecord } from "../../helpers/serializerHelpers.js"; +import { + AvailabilitySetsGetOptionalParams, + AvailabilitySetsCreateOrUpdateOptionalParams, + AvailabilitySetsUpdateOptionalParams, + AvailabilitySetsDeleteOptionalParams, + AvailabilitySetsListByResourceGroupOptionalParams, + AvailabilitySetsListBySubscriptionOptionalParams, +} from "../../models/options.js"; + +export function _availabilitySetsGetSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + availabilitySetResourceName: string, + options: AvailabilitySetsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod< + AvailabilitySetsGet200Response | AvailabilitySetsGetDefaultResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets/{availabilitySetResourceName}", + subscriptionId, + resourceGroupName, + availabilitySetResourceName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _availabilitySetsGetDeserialize( + result: AvailabilitySetsGet200Response | AvailabilitySetsGetDefaultResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return { + tags: result.body["tags"], + location: result.body["location"], + id: result.body["id"], + name: result.body["name"], + type: result.body["type"], + systemData: !result.body.systemData + ? undefined + : { + createdBy: result.body.systemData?.["createdBy"], + createdByType: result.body.systemData?.["createdByType"], + createdAt: + result.body.systemData?.["createdAt"] !== undefined + ? new Date(result.body.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: result.body.systemData?.["lastModifiedBy"], + lastModifiedByType: result.body.systemData?.["lastModifiedByType"], + lastModifiedAt: + result.body.systemData?.["lastModifiedAt"] !== undefined + ? new Date(result.body.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !result.body.properties + ? undefined + : { + availabilitySetName: result.body.properties?.["availabilitySetName"], + vmmServerId: result.body.properties?.["vmmServerId"], + provisioningState: result.body.properties?.["provisioningState"], + }, + extendedLocation: { + type: result.body.extendedLocation["type"], + name: result.body.extendedLocation["name"], + }, + }; +} + +/** Implements AvailabilitySet GET method. */ +export async function availabilitySetsGet( + context: Client, + subscriptionId: string, + resourceGroupName: string, + availabilitySetResourceName: string, + options: AvailabilitySetsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _availabilitySetsGetSend( + context, + subscriptionId, + resourceGroupName, + availabilitySetResourceName, + options, + ); + return _availabilitySetsGetDeserialize(result); +} + +export function _availabilitySetsCreateOrUpdateSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + availabilitySetResourceName: string, + resource: AvailabilitySet, + options: AvailabilitySetsCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod< + | AvailabilitySetsCreateOrUpdate200Response + | AvailabilitySetsCreateOrUpdate201Response + | AvailabilitySetsCreateOrUpdateDefaultResponse + | AvailabilitySetsCreateOrUpdateLogicalResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets/{availabilitySetResourceName}", + subscriptionId, + resourceGroupName, + availabilitySetResourceName, + ) + .put({ + ...operationOptionsToRequestParameters(options), + body: { + tags: !resource.tags + ? resource.tags + : (serializeRecord(resource.tags as any) as any), + location: resource["location"], + properties: !resource.properties + ? resource.properties + : availabilitySetPropertiesSerializer(resource.properties), + extendedLocation: extendedLocationSerializer(resource.extendedLocation), + }, + }); +} + +export async function _availabilitySetsCreateOrUpdateDeserialize( + result: + | AvailabilitySetsCreateOrUpdate200Response + | AvailabilitySetsCreateOrUpdate201Response + | AvailabilitySetsCreateOrUpdateDefaultResponse + | AvailabilitySetsCreateOrUpdateLogicalResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + const res = + result as unknown as AvailabilitySetsCreateOrUpdateLogicalResponse; + return { + tags: res.body["tags"], + location: res.body["location"], + id: res.body["id"], + name: res.body["name"], + type: res.body["type"], + systemData: !res.body.systemData + ? undefined + : { + createdBy: res.body.systemData?.["createdBy"], + createdByType: res.body.systemData?.["createdByType"], + createdAt: + res.body.systemData?.["createdAt"] !== undefined + ? new Date(res.body.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: res.body.systemData?.["lastModifiedBy"], + lastModifiedByType: res.body.systemData?.["lastModifiedByType"], + lastModifiedAt: + res.body.systemData?.["lastModifiedAt"] !== undefined + ? new Date(res.body.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !res.body.properties + ? undefined + : { + availabilitySetName: res.body.properties?.["availabilitySetName"], + vmmServerId: res.body.properties?.["vmmServerId"], + provisioningState: res.body.properties?.["provisioningState"], + }, + extendedLocation: { + type: res.body.extendedLocation["type"], + name: res.body.extendedLocation["name"], + }, + }; +} + +/** Onboards the ScVmm availability set as an Azure resource. */ +export function availabilitySetsCreateOrUpdate( + context: Client, + subscriptionId: string, + resourceGroupName: string, + availabilitySetResourceName: string, + resource: AvailabilitySet, + options: AvailabilitySetsCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): PollerLike, AvailabilitySet> { + return getLongRunningPoller( + context, + _availabilitySetsCreateOrUpdateDeserialize, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _availabilitySetsCreateOrUpdateSend( + context, + subscriptionId, + resourceGroupName, + availabilitySetResourceName, + resource, + options, + ), + }, + ) as PollerLike, AvailabilitySet>; +} + +export function _availabilitySetsUpdateSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + availabilitySetResourceName: string, + properties: AvailabilitySetTagsUpdate, + options: AvailabilitySetsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | AvailabilitySetsUpdate200Response + | AvailabilitySetsUpdate202Response + | AvailabilitySetsUpdateDefaultResponse + | AvailabilitySetsUpdateLogicalResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets/{availabilitySetResourceName}", + subscriptionId, + resourceGroupName, + availabilitySetResourceName, + ) + .patch({ + ...operationOptionsToRequestParameters(options), + body: { + tags: !properties.tags + ? properties.tags + : (serializeRecord(properties.tags as any) as any), + }, + }); +} + +export async function _availabilitySetsUpdateDeserialize( + result: + | AvailabilitySetsUpdate200Response + | AvailabilitySetsUpdate202Response + | AvailabilitySetsUpdateDefaultResponse + | AvailabilitySetsUpdateLogicalResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + const res = result as unknown as AvailabilitySetsUpdateLogicalResponse; + return { + tags: res.body["tags"], + location: res.body["location"], + id: res.body["id"], + name: res.body["name"], + type: res.body["type"], + systemData: !res.body.systemData + ? undefined + : { + createdBy: res.body.systemData?.["createdBy"], + createdByType: res.body.systemData?.["createdByType"], + createdAt: + res.body.systemData?.["createdAt"] !== undefined + ? new Date(res.body.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: res.body.systemData?.["lastModifiedBy"], + lastModifiedByType: res.body.systemData?.["lastModifiedByType"], + lastModifiedAt: + res.body.systemData?.["lastModifiedAt"] !== undefined + ? new Date(res.body.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !res.body.properties + ? undefined + : { + availabilitySetName: res.body.properties?.["availabilitySetName"], + vmmServerId: res.body.properties?.["vmmServerId"], + provisioningState: res.body.properties?.["provisioningState"], + }, + extendedLocation: { + type: res.body.extendedLocation["type"], + name: res.body.extendedLocation["name"], + }, + }; +} + +/** Updates the AvailabilitySets resource. */ +export function availabilitySetsUpdate( + context: Client, + subscriptionId: string, + resourceGroupName: string, + availabilitySetResourceName: string, + properties: AvailabilitySetTagsUpdate, + options: AvailabilitySetsUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, AvailabilitySet> { + return getLongRunningPoller(context, _availabilitySetsUpdateDeserialize, { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _availabilitySetsUpdateSend( + context, + subscriptionId, + resourceGroupName, + availabilitySetResourceName, + properties, + options, + ), + }) as PollerLike, AvailabilitySet>; +} + +export function _availabilitySetsDeleteSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + availabilitySetResourceName: string, + options: AvailabilitySetsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | AvailabilitySetsDelete202Response + | AvailabilitySetsDelete204Response + | AvailabilitySetsDeleteDefaultResponse + | AvailabilitySetsDeleteLogicalResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets/{availabilitySetResourceName}", + subscriptionId, + resourceGroupName, + availabilitySetResourceName, + ) + .delete({ + ...operationOptionsToRequestParameters(options), + queryParameters: { force: options?.force }, + }); +} + +export async function _availabilitySetsDeleteDeserialize( + result: + | AvailabilitySetsDelete202Response + | AvailabilitySetsDelete204Response + | AvailabilitySetsDeleteDefaultResponse + | AvailabilitySetsDeleteLogicalResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return; +} + +/** Deregisters the ScVmm availability set from Azure. */ +export function availabilitySetsDelete( + context: Client, + subscriptionId: string, + resourceGroupName: string, + availabilitySetResourceName: string, + options: AvailabilitySetsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _availabilitySetsDeleteDeserialize, { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _availabilitySetsDeleteSend( + context, + subscriptionId, + resourceGroupName, + availabilitySetResourceName, + options, + ), + }) as PollerLike, void>; +} + +export function _availabilitySetsListByResourceGroupSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + options: AvailabilitySetsListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod< + | AvailabilitySetsListByResourceGroup200Response + | AvailabilitySetsListByResourceGroupDefaultResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets", + subscriptionId, + resourceGroupName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _availabilitySetsListByResourceGroupDeserialize( + result: + | AvailabilitySetsListByResourceGroup200Response + | AvailabilitySetsListByResourceGroupDefaultResponse, +): Promise<_AvailabilitySetListResult> { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return { + value: result.body["value"].map((p) => { + return { + tags: p["tags"], + location: p["location"], + id: p["id"], + name: p["name"], + type: p["type"], + systemData: !p.systemData + ? undefined + : { + createdBy: p.systemData?.["createdBy"], + createdByType: p.systemData?.["createdByType"], + createdAt: + p.systemData?.["createdAt"] !== undefined + ? new Date(p.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: p.systemData?.["lastModifiedBy"], + lastModifiedByType: p.systemData?.["lastModifiedByType"], + lastModifiedAt: + p.systemData?.["lastModifiedAt"] !== undefined + ? new Date(p.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !p.properties + ? undefined + : { + availabilitySetName: p.properties?.["availabilitySetName"], + vmmServerId: p.properties?.["vmmServerId"], + provisioningState: p.properties?.["provisioningState"], + }, + extendedLocation: { + type: p.extendedLocation["type"], + name: p.extendedLocation["name"], + }, + }; + }), + nextLink: result.body["nextLink"], + }; +} + +/** List of AvailabilitySets in a resource group. */ +export function availabilitySetsListByResourceGroup( + context: Client, + subscriptionId: string, + resourceGroupName: string, + options: AvailabilitySetsListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _availabilitySetsListByResourceGroupSend( + context, + subscriptionId, + resourceGroupName, + options, + ), + _availabilitySetsListByResourceGroupDeserialize, + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _availabilitySetsListBySubscriptionSend( + context: Client, + subscriptionId: string, + options: AvailabilitySetsListBySubscriptionOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod< + | AvailabilitySetsListBySubscription200Response + | AvailabilitySetsListBySubscriptionDefaultResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/availabilitySets", + subscriptionId, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _availabilitySetsListBySubscriptionDeserialize( + result: + | AvailabilitySetsListBySubscription200Response + | AvailabilitySetsListBySubscriptionDefaultResponse, +): Promise<_AvailabilitySetListResult> { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return { + value: result.body["value"].map((p) => { + return { + tags: p["tags"], + location: p["location"], + id: p["id"], + name: p["name"], + type: p["type"], + systemData: !p.systemData + ? undefined + : { + createdBy: p.systemData?.["createdBy"], + createdByType: p.systemData?.["createdByType"], + createdAt: + p.systemData?.["createdAt"] !== undefined + ? new Date(p.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: p.systemData?.["lastModifiedBy"], + lastModifiedByType: p.systemData?.["lastModifiedByType"], + lastModifiedAt: + p.systemData?.["lastModifiedAt"] !== undefined + ? new Date(p.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !p.properties + ? undefined + : { + availabilitySetName: p.properties?.["availabilitySetName"], + vmmServerId: p.properties?.["vmmServerId"], + provisioningState: p.properties?.["provisioningState"], + }, + extendedLocation: { + type: p.extendedLocation["type"], + name: p.extendedLocation["name"], + }, + }; + }), + nextLink: result.body["nextLink"], + }; +} + +/** List of AvailabilitySets in a subscription. */ +export function availabilitySetsListBySubscription( + context: Client, + subscriptionId: string, + options: AvailabilitySetsListBySubscriptionOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _availabilitySetsListBySubscriptionSend(context, subscriptionId, options), + _availabilitySetsListBySubscriptionDeserialize, + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/scvmm/arm-scvmm/src/api/clouds/index.ts b/sdk/scvmm/arm-scvmm/src/api/clouds/index.ts new file mode 100644 index 000000000000..733d5bea5233 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/api/clouds/index.ts @@ -0,0 +1,676 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { getLongRunningPoller } from "../pollingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; +import { + extendedLocationSerializer, + cloudPropertiesSerializer, + Cloud, + CloudTagsUpdate, + _CloudListResult, +} from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../models/pagingTypes.js"; +import { buildPagedAsyncIterator } from "../pagingHelpers.js"; +import { + CloudsCreateOrUpdate200Response, + CloudsCreateOrUpdate201Response, + CloudsCreateOrUpdateDefaultResponse, + CloudsCreateOrUpdateLogicalResponse, + CloudsDelete202Response, + CloudsDelete204Response, + CloudsDeleteDefaultResponse, + CloudsDeleteLogicalResponse, + CloudsGet200Response, + CloudsGetDefaultResponse, + CloudsListByResourceGroup200Response, + CloudsListByResourceGroupDefaultResponse, + CloudsListBySubscription200Response, + CloudsListBySubscriptionDefaultResponse, + CloudsUpdate200Response, + CloudsUpdate202Response, + CloudsUpdateDefaultResponse, + CloudsUpdateLogicalResponse, + isUnexpected, + ScVmmContext as Client, +} from "../../rest/index.js"; +import { + StreamableMethod, + operationOptionsToRequestParameters, + createRestError, +} from "@azure-rest/core-client"; +import { serializeRecord } from "../../helpers/serializerHelpers.js"; +import { + CloudsGetOptionalParams, + CloudsCreateOrUpdateOptionalParams, + CloudsUpdateOptionalParams, + CloudsDeleteOptionalParams, + CloudsListByResourceGroupOptionalParams, + CloudsListBySubscriptionOptionalParams, +} from "../../models/options.js"; + +export function _cloudsGetSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + cloudResourceName: string, + options: CloudsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds/{cloudResourceName}", + subscriptionId, + resourceGroupName, + cloudResourceName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _cloudsGetDeserialize( + result: CloudsGet200Response | CloudsGetDefaultResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return { + tags: result.body["tags"], + location: result.body["location"], + id: result.body["id"], + name: result.body["name"], + type: result.body["type"], + systemData: !result.body.systemData + ? undefined + : { + createdBy: result.body.systemData?.["createdBy"], + createdByType: result.body.systemData?.["createdByType"], + createdAt: + result.body.systemData?.["createdAt"] !== undefined + ? new Date(result.body.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: result.body.systemData?.["lastModifiedBy"], + lastModifiedByType: result.body.systemData?.["lastModifiedByType"], + lastModifiedAt: + result.body.systemData?.["lastModifiedAt"] !== undefined + ? new Date(result.body.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !result.body.properties + ? undefined + : { + inventoryItemId: result.body.properties?.["inventoryItemId"], + uuid: result.body.properties?.["uuid"], + vmmServerId: result.body.properties?.["vmmServerId"], + cloudName: result.body.properties?.["cloudName"], + cloudCapacity: !result.body.properties?.cloudCapacity + ? undefined + : { + cpuCount: result.body.properties?.cloudCapacity?.["cpuCount"], + memoryMB: result.body.properties?.cloudCapacity?.["memoryMB"], + vmCount: result.body.properties?.cloudCapacity?.["vmCount"], + }, + storageQosPolicies: + result.body.properties?.["storageQoSPolicies"] === undefined + ? result.body.properties?.["storageQoSPolicies"] + : result.body.properties?.["storageQoSPolicies"].map((p) => { + return { + name: p["name"], + id: p["id"], + iopsMaximum: p["iopsMaximum"], + iopsMinimum: p["iopsMinimum"], + bandwidthLimit: p["bandwidthLimit"], + policyId: p["policyId"], + }; + }), + provisioningState: result.body.properties?.["provisioningState"], + }, + extendedLocation: { + type: result.body.extendedLocation["type"], + name: result.body.extendedLocation["name"], + }, + }; +} + +/** Implements Cloud GET method. */ +export async function cloudsGet( + context: Client, + subscriptionId: string, + resourceGroupName: string, + cloudResourceName: string, + options: CloudsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _cloudsGetSend( + context, + subscriptionId, + resourceGroupName, + cloudResourceName, + options, + ); + return _cloudsGetDeserialize(result); +} + +export function _cloudsCreateOrUpdateSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + cloudResourceName: string, + resource: Cloud, + options: CloudsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | CloudsCreateOrUpdate200Response + | CloudsCreateOrUpdate201Response + | CloudsCreateOrUpdateDefaultResponse + | CloudsCreateOrUpdateLogicalResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds/{cloudResourceName}", + subscriptionId, + resourceGroupName, + cloudResourceName, + ) + .put({ + ...operationOptionsToRequestParameters(options), + body: { + tags: !resource.tags + ? resource.tags + : (serializeRecord(resource.tags as any) as any), + location: resource["location"], + properties: !resource.properties + ? resource.properties + : cloudPropertiesSerializer(resource.properties), + extendedLocation: extendedLocationSerializer(resource.extendedLocation), + }, + }); +} + +export async function _cloudsCreateOrUpdateDeserialize( + result: + | CloudsCreateOrUpdate200Response + | CloudsCreateOrUpdate201Response + | CloudsCreateOrUpdateDefaultResponse + | CloudsCreateOrUpdateLogicalResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + const res = result as unknown as CloudsCreateOrUpdateLogicalResponse; + return { + tags: res.body["tags"], + location: res.body["location"], + id: res.body["id"], + name: res.body["name"], + type: res.body["type"], + systemData: !res.body.systemData + ? undefined + : { + createdBy: res.body.systemData?.["createdBy"], + createdByType: res.body.systemData?.["createdByType"], + createdAt: + res.body.systemData?.["createdAt"] !== undefined + ? new Date(res.body.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: res.body.systemData?.["lastModifiedBy"], + lastModifiedByType: res.body.systemData?.["lastModifiedByType"], + lastModifiedAt: + res.body.systemData?.["lastModifiedAt"] !== undefined + ? new Date(res.body.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !res.body.properties + ? undefined + : { + inventoryItemId: res.body.properties?.["inventoryItemId"], + uuid: res.body.properties?.["uuid"], + vmmServerId: res.body.properties?.["vmmServerId"], + cloudName: res.body.properties?.["cloudName"], + cloudCapacity: !res.body.properties?.cloudCapacity + ? undefined + : { + cpuCount: res.body.properties?.cloudCapacity?.["cpuCount"], + memoryMB: res.body.properties?.cloudCapacity?.["memoryMB"], + vmCount: res.body.properties?.cloudCapacity?.["vmCount"], + }, + storageQosPolicies: + res.body.properties?.["storageQoSPolicies"] === undefined + ? res.body.properties?.["storageQoSPolicies"] + : res.body.properties?.["storageQoSPolicies"].map((p) => { + return { + name: p["name"], + id: p["id"], + iopsMaximum: p["iopsMaximum"], + iopsMinimum: p["iopsMinimum"], + bandwidthLimit: p["bandwidthLimit"], + policyId: p["policyId"], + }; + }), + provisioningState: res.body.properties?.["provisioningState"], + }, + extendedLocation: { + type: res.body.extendedLocation["type"], + name: res.body.extendedLocation["name"], + }, + }; +} + +/** Onboards the ScVmm fabric cloud as an Azure cloud resource. */ +export function cloudsCreateOrUpdate( + context: Client, + subscriptionId: string, + resourceGroupName: string, + cloudResourceName: string, + resource: Cloud, + options: CloudsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, Cloud> { + return getLongRunningPoller(context, _cloudsCreateOrUpdateDeserialize, { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _cloudsCreateOrUpdateSend( + context, + subscriptionId, + resourceGroupName, + cloudResourceName, + resource, + options, + ), + }) as PollerLike, Cloud>; +} + +export function _cloudsUpdateSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + cloudResourceName: string, + properties: CloudTagsUpdate, + options: CloudsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | CloudsUpdate200Response + | CloudsUpdate202Response + | CloudsUpdateDefaultResponse + | CloudsUpdateLogicalResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds/{cloudResourceName}", + subscriptionId, + resourceGroupName, + cloudResourceName, + ) + .patch({ + ...operationOptionsToRequestParameters(options), + body: { + tags: !properties.tags + ? properties.tags + : (serializeRecord(properties.tags as any) as any), + }, + }); +} + +export async function _cloudsUpdateDeserialize( + result: + | CloudsUpdate200Response + | CloudsUpdate202Response + | CloudsUpdateDefaultResponse + | CloudsUpdateLogicalResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + const res = result as unknown as CloudsUpdateLogicalResponse; + return { + tags: res.body["tags"], + location: res.body["location"], + id: res.body["id"], + name: res.body["name"], + type: res.body["type"], + systemData: !res.body.systemData + ? undefined + : { + createdBy: res.body.systemData?.["createdBy"], + createdByType: res.body.systemData?.["createdByType"], + createdAt: + res.body.systemData?.["createdAt"] !== undefined + ? new Date(res.body.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: res.body.systemData?.["lastModifiedBy"], + lastModifiedByType: res.body.systemData?.["lastModifiedByType"], + lastModifiedAt: + res.body.systemData?.["lastModifiedAt"] !== undefined + ? new Date(res.body.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !res.body.properties + ? undefined + : { + inventoryItemId: res.body.properties?.["inventoryItemId"], + uuid: res.body.properties?.["uuid"], + vmmServerId: res.body.properties?.["vmmServerId"], + cloudName: res.body.properties?.["cloudName"], + cloudCapacity: !res.body.properties?.cloudCapacity + ? undefined + : { + cpuCount: res.body.properties?.cloudCapacity?.["cpuCount"], + memoryMB: res.body.properties?.cloudCapacity?.["memoryMB"], + vmCount: res.body.properties?.cloudCapacity?.["vmCount"], + }, + storageQosPolicies: + res.body.properties?.["storageQoSPolicies"] === undefined + ? res.body.properties?.["storageQoSPolicies"] + : res.body.properties?.["storageQoSPolicies"].map((p) => { + return { + name: p["name"], + id: p["id"], + iopsMaximum: p["iopsMaximum"], + iopsMinimum: p["iopsMinimum"], + bandwidthLimit: p["bandwidthLimit"], + policyId: p["policyId"], + }; + }), + provisioningState: res.body.properties?.["provisioningState"], + }, + extendedLocation: { + type: res.body.extendedLocation["type"], + name: res.body.extendedLocation["name"], + }, + }; +} + +/** Updates the Clouds resource. */ +export function cloudsUpdate( + context: Client, + subscriptionId: string, + resourceGroupName: string, + cloudResourceName: string, + properties: CloudTagsUpdate, + options: CloudsUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, Cloud> { + return getLongRunningPoller(context, _cloudsUpdateDeserialize, { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _cloudsUpdateSend( + context, + subscriptionId, + resourceGroupName, + cloudResourceName, + properties, + options, + ), + }) as PollerLike, Cloud>; +} + +export function _cloudsDeleteSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + cloudResourceName: string, + options: CloudsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | CloudsDelete202Response + | CloudsDelete204Response + | CloudsDeleteDefaultResponse + | CloudsDeleteLogicalResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds/{cloudResourceName}", + subscriptionId, + resourceGroupName, + cloudResourceName, + ) + .delete({ + ...operationOptionsToRequestParameters(options), + queryParameters: { force: options?.force }, + }); +} + +export async function _cloudsDeleteDeserialize( + result: + | CloudsDelete202Response + | CloudsDelete204Response + | CloudsDeleteDefaultResponse + | CloudsDeleteLogicalResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return; +} + +/** Deregisters the ScVmm fabric cloud from Azure. */ +export function cloudsDelete( + context: Client, + subscriptionId: string, + resourceGroupName: string, + cloudResourceName: string, + options: CloudsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _cloudsDeleteDeserialize, { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _cloudsDeleteSend( + context, + subscriptionId, + resourceGroupName, + cloudResourceName, + options, + ), + }) as PollerLike, void>; +} + +export function _cloudsListByResourceGroupSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + options: CloudsListByResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | CloudsListByResourceGroup200Response + | CloudsListByResourceGroupDefaultResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds", + subscriptionId, + resourceGroupName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _cloudsListByResourceGroupDeserialize( + result: + | CloudsListByResourceGroup200Response + | CloudsListByResourceGroupDefaultResponse, +): Promise<_CloudListResult> { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return { + value: result.body["value"].map((p) => { + return { + tags: p["tags"], + location: p["location"], + id: p["id"], + name: p["name"], + type: p["type"], + systemData: !p.systemData + ? undefined + : { + createdBy: p.systemData?.["createdBy"], + createdByType: p.systemData?.["createdByType"], + createdAt: + p.systemData?.["createdAt"] !== undefined + ? new Date(p.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: p.systemData?.["lastModifiedBy"], + lastModifiedByType: p.systemData?.["lastModifiedByType"], + lastModifiedAt: + p.systemData?.["lastModifiedAt"] !== undefined + ? new Date(p.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !p.properties + ? undefined + : { + inventoryItemId: p.properties?.["inventoryItemId"], + uuid: p.properties?.["uuid"], + vmmServerId: p.properties?.["vmmServerId"], + cloudName: p.properties?.["cloudName"], + cloudCapacity: !p.properties?.cloudCapacity + ? undefined + : { + cpuCount: p.properties?.cloudCapacity?.["cpuCount"], + memoryMB: p.properties?.cloudCapacity?.["memoryMB"], + vmCount: p.properties?.cloudCapacity?.["vmCount"], + }, + storageQosPolicies: + p.properties?.["storageQoSPolicies"] === undefined + ? p.properties?.["storageQoSPolicies"] + : p.properties?.["storageQoSPolicies"].map((p) => { + return { + name: p["name"], + id: p["id"], + iopsMaximum: p["iopsMaximum"], + iopsMinimum: p["iopsMinimum"], + bandwidthLimit: p["bandwidthLimit"], + policyId: p["policyId"], + }; + }), + provisioningState: p.properties?.["provisioningState"], + }, + extendedLocation: { + type: p.extendedLocation["type"], + name: p.extendedLocation["name"], + }, + }; + }), + nextLink: result.body["nextLink"], + }; +} + +/** List of Clouds in a resource group. */ +export function cloudsListByResourceGroup( + context: Client, + subscriptionId: string, + resourceGroupName: string, + options: CloudsListByResourceGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _cloudsListByResourceGroupSend( + context, + subscriptionId, + resourceGroupName, + options, + ), + _cloudsListByResourceGroupDeserialize, + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _cloudsListBySubscriptionSend( + context: Client, + subscriptionId: string, + options: CloudsListBySubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod< + CloudsListBySubscription200Response | CloudsListBySubscriptionDefaultResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/clouds", + subscriptionId, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _cloudsListBySubscriptionDeserialize( + result: + | CloudsListBySubscription200Response + | CloudsListBySubscriptionDefaultResponse, +): Promise<_CloudListResult> { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return { + value: result.body["value"].map((p) => { + return { + tags: p["tags"], + location: p["location"], + id: p["id"], + name: p["name"], + type: p["type"], + systemData: !p.systemData + ? undefined + : { + createdBy: p.systemData?.["createdBy"], + createdByType: p.systemData?.["createdByType"], + createdAt: + p.systemData?.["createdAt"] !== undefined + ? new Date(p.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: p.systemData?.["lastModifiedBy"], + lastModifiedByType: p.systemData?.["lastModifiedByType"], + lastModifiedAt: + p.systemData?.["lastModifiedAt"] !== undefined + ? new Date(p.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !p.properties + ? undefined + : { + inventoryItemId: p.properties?.["inventoryItemId"], + uuid: p.properties?.["uuid"], + vmmServerId: p.properties?.["vmmServerId"], + cloudName: p.properties?.["cloudName"], + cloudCapacity: !p.properties?.cloudCapacity + ? undefined + : { + cpuCount: p.properties?.cloudCapacity?.["cpuCount"], + memoryMB: p.properties?.cloudCapacity?.["memoryMB"], + vmCount: p.properties?.cloudCapacity?.["vmCount"], + }, + storageQosPolicies: + p.properties?.["storageQoSPolicies"] === undefined + ? p.properties?.["storageQoSPolicies"] + : p.properties?.["storageQoSPolicies"].map((p) => { + return { + name: p["name"], + id: p["id"], + iopsMaximum: p["iopsMaximum"], + iopsMinimum: p["iopsMinimum"], + bandwidthLimit: p["bandwidthLimit"], + policyId: p["policyId"], + }; + }), + provisioningState: p.properties?.["provisioningState"], + }, + extendedLocation: { + type: p.extendedLocation["type"], + name: p.extendedLocation["name"], + }, + }; + }), + nextLink: result.body["nextLink"], + }; +} + +/** List of Clouds in a subscription. */ +export function cloudsListBySubscription( + context: Client, + subscriptionId: string, + options: CloudsListBySubscriptionOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _cloudsListBySubscriptionSend(context, subscriptionId, options), + _cloudsListBySubscriptionDeserialize, + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/scvmm/arm-scvmm/src/api/guestAgents/index.ts b/sdk/scvmm/arm-scvmm/src/api/guestAgents/index.ts new file mode 100644 index 000000000000..41c27d283d10 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/api/guestAgents/index.ts @@ -0,0 +1,349 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { getLongRunningPoller } from "../pollingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; +import { + guestAgentPropertiesSerializer, + GuestAgent, + _GuestAgentListResult, +} from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../models/pagingTypes.js"; +import { buildPagedAsyncIterator } from "../pagingHelpers.js"; +import { + GuestAgentsCreate200Response, + GuestAgentsCreate201Response, + GuestAgentsCreateDefaultResponse, + GuestAgentsCreateLogicalResponse, + GuestAgentsDelete200Response, + GuestAgentsDelete204Response, + GuestAgentsDeleteDefaultResponse, + GuestAgentsGet200Response, + GuestAgentsGetDefaultResponse, + GuestAgentsListByVirtualMachineInstance200Response, + GuestAgentsListByVirtualMachineInstanceDefaultResponse, + isUnexpected, + ScVmmContext as Client, +} from "../../rest/index.js"; +import { + StreamableMethod, + operationOptionsToRequestParameters, + createRestError, +} from "@azure-rest/core-client"; +import { + GuestAgentsGetOptionalParams, + GuestAgentsCreateOptionalParams, + GuestAgentsDeleteOptionalParams, + GuestAgentsListByVirtualMachineInstanceOptionalParams, +} from "../../models/options.js"; + +export function _guestAgentsGetSend( + context: Client, + resourceUri: string, + options: GuestAgentsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default", + resourceUri, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _guestAgentsGetDeserialize( + result: GuestAgentsGet200Response | GuestAgentsGetDefaultResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return { + id: result.body["id"], + name: result.body["name"], + type: result.body["type"], + systemData: !result.body.systemData + ? undefined + : { + createdBy: result.body.systemData?.["createdBy"], + createdByType: result.body.systemData?.["createdByType"], + createdAt: + result.body.systemData?.["createdAt"] !== undefined + ? new Date(result.body.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: result.body.systemData?.["lastModifiedBy"], + lastModifiedByType: result.body.systemData?.["lastModifiedByType"], + lastModifiedAt: + result.body.systemData?.["lastModifiedAt"] !== undefined + ? new Date(result.body.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !result.body.properties + ? undefined + : { + uuid: result.body.properties?.["uuid"], + credentials: !result.body.properties?.credentials + ? undefined + : { + username: result.body.properties?.credentials?.["username"], + password: result.body.properties?.credentials?.["password"], + }, + httpProxyConfig: !result.body.properties?.httpProxyConfig + ? undefined + : { + httpsProxy: + result.body.properties?.httpProxyConfig?.["httpsProxy"], + }, + provisioningAction: result.body.properties?.["provisioningAction"], + status: result.body.properties?.["status"], + customResourceName: result.body.properties?.["customResourceName"], + provisioningState: result.body.properties?.["provisioningState"], + privateLinkScopeResourceId: + result.body.properties?.["privateLinkScopeResourceId"], + }, + }; +} + +/** Implements GuestAgent GET method. */ +export async function guestAgentsGet( + context: Client, + resourceUri: string, + options: GuestAgentsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _guestAgentsGetSend(context, resourceUri, options); + return _guestAgentsGetDeserialize(result); +} + +export function _guestAgentsCreateSend( + context: Client, + resourceUri: string, + resource: GuestAgent, + options: GuestAgentsCreateOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | GuestAgentsCreate200Response + | GuestAgentsCreate201Response + | GuestAgentsCreateDefaultResponse + | GuestAgentsCreateLogicalResponse +> { + return context + .path( + "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default", + resourceUri, + ) + .put({ + ...operationOptionsToRequestParameters(options), + body: { + properties: !resource.properties + ? resource.properties + : guestAgentPropertiesSerializer(resource.properties), + }, + }); +} + +export async function _guestAgentsCreateDeserialize( + result: + | GuestAgentsCreate200Response + | GuestAgentsCreate201Response + | GuestAgentsCreateDefaultResponse + | GuestAgentsCreateLogicalResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + const res = result as unknown as GuestAgentsCreateLogicalResponse; + return { + id: res.body["id"], + name: res.body["name"], + type: res.body["type"], + systemData: !res.body.systemData + ? undefined + : { + createdBy: res.body.systemData?.["createdBy"], + createdByType: res.body.systemData?.["createdByType"], + createdAt: + res.body.systemData?.["createdAt"] !== undefined + ? new Date(res.body.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: res.body.systemData?.["lastModifiedBy"], + lastModifiedByType: res.body.systemData?.["lastModifiedByType"], + lastModifiedAt: + res.body.systemData?.["lastModifiedAt"] !== undefined + ? new Date(res.body.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !res.body.properties + ? undefined + : { + uuid: res.body.properties?.["uuid"], + credentials: !res.body.properties?.credentials + ? undefined + : { + username: res.body.properties?.credentials?.["username"], + password: res.body.properties?.credentials?.["password"], + }, + httpProxyConfig: !res.body.properties?.httpProxyConfig + ? undefined + : { + httpsProxy: + res.body.properties?.httpProxyConfig?.["httpsProxy"], + }, + provisioningAction: res.body.properties?.["provisioningAction"], + status: res.body.properties?.["status"], + customResourceName: res.body.properties?.["customResourceName"], + provisioningState: res.body.properties?.["provisioningState"], + privateLinkScopeResourceId: + res.body.properties?.["privateLinkScopeResourceId"], + }, + }; +} + +/** Create Or Update GuestAgent. */ +export function guestAgentsCreate( + context: Client, + resourceUri: string, + resource: GuestAgent, + options: GuestAgentsCreateOptionalParams = { requestOptions: {} }, +): PollerLike, GuestAgent> { + return getLongRunningPoller(context, _guestAgentsCreateDeserialize, { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _guestAgentsCreateSend(context, resourceUri, resource, options), + }) as PollerLike, GuestAgent>; +} + +export function _guestAgentsDeleteSend( + context: Client, + resourceUri: string, + options: GuestAgentsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | GuestAgentsDelete200Response + | GuestAgentsDelete204Response + | GuestAgentsDeleteDefaultResponse +> { + return context + .path( + "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default", + resourceUri, + ) + .delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _guestAgentsDeleteDeserialize( + result: + | GuestAgentsDelete200Response + | GuestAgentsDelete204Response + | GuestAgentsDeleteDefaultResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return; +} + +/** Implements GuestAgent DELETE method. */ +export async function guestAgentsDelete( + context: Client, + resourceUri: string, + options: GuestAgentsDeleteOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _guestAgentsDeleteSend(context, resourceUri, options); + return _guestAgentsDeleteDeserialize(result); +} + +export function _guestAgentsListByVirtualMachineInstanceSend( + context: Client, + resourceUri: string, + options: GuestAgentsListByVirtualMachineInstanceOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod< + | GuestAgentsListByVirtualMachineInstance200Response + | GuestAgentsListByVirtualMachineInstanceDefaultResponse +> { + return context + .path( + "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents", + resourceUri, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _guestAgentsListByVirtualMachineInstanceDeserialize( + result: + | GuestAgentsListByVirtualMachineInstance200Response + | GuestAgentsListByVirtualMachineInstanceDefaultResponse, +): Promise<_GuestAgentListResult> { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return { + value: result.body["value"].map((p) => { + return { + id: p["id"], + name: p["name"], + type: p["type"], + systemData: !p.systemData + ? undefined + : { + createdBy: p.systemData?.["createdBy"], + createdByType: p.systemData?.["createdByType"], + createdAt: + p.systemData?.["createdAt"] !== undefined + ? new Date(p.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: p.systemData?.["lastModifiedBy"], + lastModifiedByType: p.systemData?.["lastModifiedByType"], + lastModifiedAt: + p.systemData?.["lastModifiedAt"] !== undefined + ? new Date(p.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !p.properties + ? undefined + : { + uuid: p.properties?.["uuid"], + credentials: !p.properties?.credentials + ? undefined + : { + username: p.properties?.credentials?.["username"], + password: p.properties?.credentials?.["password"], + }, + httpProxyConfig: !p.properties?.httpProxyConfig + ? undefined + : { httpsProxy: p.properties?.httpProxyConfig?.["httpsProxy"] }, + provisioningAction: p.properties?.["provisioningAction"], + status: p.properties?.["status"], + customResourceName: p.properties?.["customResourceName"], + provisioningState: p.properties?.["provisioningState"], + privateLinkScopeResourceId: + p.properties?.["privateLinkScopeResourceId"], + }, + }; + }), + nextLink: result.body["nextLink"], + }; +} + +/** Returns the list of GuestAgent of the given vm. */ +export function guestAgentsListByVirtualMachineInstance( + context: Client, + resourceUri: string, + options: GuestAgentsListByVirtualMachineInstanceOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _guestAgentsListByVirtualMachineInstanceSend( + context, + resourceUri, + options, + ), + _guestAgentsListByVirtualMachineInstanceDeserialize, + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/scvmm/arm-scvmm/src/api/index.ts b/sdk/scvmm/arm-scvmm/src/api/index.ts new file mode 100644 index 000000000000..9741a396fa04 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/api/index.ts @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +export { + createScVmm, + ScVmmClientOptionalParams, + ScVmmContext, +} from "./scVmmContext.js"; +export { + availabilitySetsGet, + availabilitySetsCreateOrUpdate, + availabilitySetsUpdate, + availabilitySetsDelete, + availabilitySetsListByResourceGroup, + availabilitySetsListBySubscription, +} from "./availabilitySets/index.js"; +export { + cloudsGet, + cloudsCreateOrUpdate, + cloudsUpdate, + cloudsDelete, + cloudsListByResourceGroup, + cloudsListBySubscription, +} from "./clouds/index.js"; +export { + guestAgentsGet, + guestAgentsCreate, + guestAgentsDelete, + guestAgentsListByVirtualMachineInstance, +} from "./guestAgents/index.js"; +export { + inventoryItemsGet, + inventoryItemsCreate, + inventoryItemsDelete, + inventoryItemsListByVmmServer, +} from "./inventoryItems/index.js"; +export { operationsList } from "./operations/index.js"; +export { + virtualMachineInstancesGet, + virtualMachineInstancesCreateOrUpdate, + virtualMachineInstancesUpdate, + virtualMachineInstancesDelete, + virtualMachineInstancesList, + virtualMachineInstancesStop, + virtualMachineInstancesStart, + virtualMachineInstancesRestart, + virtualMachineInstancesCreateCheckpoint, + virtualMachineInstancesDeleteCheckpoint, + virtualMachineInstancesRestoreCheckpoint, +} from "./virtualMachineInstances/index.js"; +export { + virtualMachineTemplatesGet, + virtualMachineTemplatesCreateOrUpdate, + virtualMachineTemplatesUpdate, + virtualMachineTemplatesDelete, + virtualMachineTemplatesListByResourceGroup, + virtualMachineTemplatesListBySubscription, +} from "./virtualMachineTemplates/index.js"; +export { + virtualNetworksGet, + virtualNetworksCreateOrUpdate, + virtualNetworksUpdate, + virtualNetworksDelete, + virtualNetworksListByResourceGroup, + virtualNetworksListBySubscription, +} from "./virtualNetworks/index.js"; +export { + vmInstanceHybridIdentityMetadatasGet, + vmInstanceHybridIdentityMetadatasListByVirtualMachineInstance, +} from "./vmInstanceHybridIdentityMetadatas/index.js"; +export { + vmmServersGet, + vmmServersCreateOrUpdate, + vmmServersUpdate, + vmmServersDelete, + vmmServersListByResourceGroup, + vmmServersListBySubscription, +} from "./vmmServers/index.js"; diff --git a/sdk/scvmm/arm-scvmm/src/api/inventoryItems/index.ts b/sdk/scvmm/arm-scvmm/src/api/inventoryItems/index.ts new file mode 100644 index 000000000000..6031295f72da --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/api/inventoryItems/index.ts @@ -0,0 +1,359 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { + inventoryItemPropertiesUnionSerializer, + InventoryItem, + _InventoryItemListResult, +} from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../models/pagingTypes.js"; +import { buildPagedAsyncIterator } from "../pagingHelpers.js"; +import { + InventoryItemsCreate200Response, + InventoryItemsCreate201Response, + InventoryItemsCreateDefaultResponse, + InventoryItemsDelete200Response, + InventoryItemsDelete204Response, + InventoryItemsDeleteDefaultResponse, + InventoryItemsGet200Response, + InventoryItemsGetDefaultResponse, + InventoryItemsListByVmmServer200Response, + InventoryItemsListByVmmServerDefaultResponse, + isUnexpected, + ScVmmContext as Client, +} from "../../rest/index.js"; +import { + StreamableMethod, + operationOptionsToRequestParameters, + createRestError, +} from "@azure-rest/core-client"; +import { + InventoryItemsGetOptionalParams, + InventoryItemsCreateOptionalParams, + InventoryItemsDeleteOptionalParams, + InventoryItemsListByVmmServerOptionalParams, +} from "../../models/options.js"; + +export function _inventoryItemsGetSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + vmmServerName: string, + inventoryItemResourceName: string, + options: InventoryItemsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod< + InventoryItemsGet200Response | InventoryItemsGetDefaultResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/{inventoryItemResourceName}", + subscriptionId, + resourceGroupName, + vmmServerName, + inventoryItemResourceName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _inventoryItemsGetDeserialize( + result: InventoryItemsGet200Response | InventoryItemsGetDefaultResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return { + id: result.body["id"], + name: result.body["name"], + type: result.body["type"], + systemData: !result.body.systemData + ? undefined + : { + createdBy: result.body.systemData?.["createdBy"], + createdByType: result.body.systemData?.["createdByType"], + createdAt: + result.body.systemData?.["createdAt"] !== undefined + ? new Date(result.body.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: result.body.systemData?.["lastModifiedBy"], + lastModifiedByType: result.body.systemData?.["lastModifiedByType"], + lastModifiedAt: + result.body.systemData?.["lastModifiedAt"] !== undefined + ? new Date(result.body.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !result.body.properties + ? undefined + : { + inventoryType: result.body.properties?.["inventoryType"], + managedResourceId: result.body.properties?.["managedResourceId"], + uuid: result.body.properties?.["uuid"], + inventoryItemName: result.body.properties?.["inventoryItemName"], + provisioningState: result.body.properties?.["provisioningState"], + }, + kind: result.body["kind"], + }; +} + +/** Shows an inventory item. */ +export async function inventoryItemsGet( + context: Client, + subscriptionId: string, + resourceGroupName: string, + vmmServerName: string, + inventoryItemResourceName: string, + options: InventoryItemsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _inventoryItemsGetSend( + context, + subscriptionId, + resourceGroupName, + vmmServerName, + inventoryItemResourceName, + options, + ); + return _inventoryItemsGetDeserialize(result); +} + +export function _inventoryItemsCreateSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + vmmServerName: string, + inventoryItemResourceName: string, + resource: InventoryItem, + options: InventoryItemsCreateOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | InventoryItemsCreate200Response + | InventoryItemsCreate201Response + | InventoryItemsCreateDefaultResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/{inventoryItemResourceName}", + subscriptionId, + resourceGroupName, + vmmServerName, + inventoryItemResourceName, + ) + .put({ + ...operationOptionsToRequestParameters(options), + body: { + properties: !resource.properties + ? resource.properties + : inventoryItemPropertiesUnionSerializer(resource.properties), + kind: resource["kind"], + }, + }); +} + +export async function _inventoryItemsCreateDeserialize( + result: + | InventoryItemsCreate200Response + | InventoryItemsCreate201Response + | InventoryItemsCreateDefaultResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return { + id: result.body["id"], + name: result.body["name"], + type: result.body["type"], + systemData: !result.body.systemData + ? undefined + : { + createdBy: result.body.systemData?.["createdBy"], + createdByType: result.body.systemData?.["createdByType"], + createdAt: + result.body.systemData?.["createdAt"] !== undefined + ? new Date(result.body.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: result.body.systemData?.["lastModifiedBy"], + lastModifiedByType: result.body.systemData?.["lastModifiedByType"], + lastModifiedAt: + result.body.systemData?.["lastModifiedAt"] !== undefined + ? new Date(result.body.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !result.body.properties + ? undefined + : { + inventoryType: result.body.properties?.["inventoryType"], + managedResourceId: result.body.properties?.["managedResourceId"], + uuid: result.body.properties?.["uuid"], + inventoryItemName: result.body.properties?.["inventoryItemName"], + provisioningState: result.body.properties?.["provisioningState"], + }, + kind: result.body["kind"], + }; +} + +/** Create Or Update InventoryItem. */ +export async function inventoryItemsCreate( + context: Client, + subscriptionId: string, + resourceGroupName: string, + vmmServerName: string, + inventoryItemResourceName: string, + resource: InventoryItem, + options: InventoryItemsCreateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _inventoryItemsCreateSend( + context, + subscriptionId, + resourceGroupName, + vmmServerName, + inventoryItemResourceName, + resource, + options, + ); + return _inventoryItemsCreateDeserialize(result); +} + +export function _inventoryItemsDeleteSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + vmmServerName: string, + inventoryItemResourceName: string, + options: InventoryItemsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | InventoryItemsDelete200Response + | InventoryItemsDelete204Response + | InventoryItemsDeleteDefaultResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/{inventoryItemResourceName}", + subscriptionId, + resourceGroupName, + vmmServerName, + inventoryItemResourceName, + ) + .delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _inventoryItemsDeleteDeserialize( + result: + | InventoryItemsDelete200Response + | InventoryItemsDelete204Response + | InventoryItemsDeleteDefaultResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return; +} + +/** Deletes an inventoryItem. */ +export async function inventoryItemsDelete( + context: Client, + subscriptionId: string, + resourceGroupName: string, + vmmServerName: string, + inventoryItemResourceName: string, + options: InventoryItemsDeleteOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _inventoryItemsDeleteSend( + context, + subscriptionId, + resourceGroupName, + vmmServerName, + inventoryItemResourceName, + options, + ); + return _inventoryItemsDeleteDeserialize(result); +} + +export function _inventoryItemsListByVmmServerSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + vmmServerName: string, + options: InventoryItemsListByVmmServerOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | InventoryItemsListByVmmServer200Response + | InventoryItemsListByVmmServerDefaultResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems", + subscriptionId, + resourceGroupName, + vmmServerName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _inventoryItemsListByVmmServerDeserialize( + result: + | InventoryItemsListByVmmServer200Response + | InventoryItemsListByVmmServerDefaultResponse, +): Promise<_InventoryItemListResult> { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return { + value: result.body["value"].map((p) => { + return { + id: p["id"], + name: p["name"], + type: p["type"], + systemData: !p.systemData + ? undefined + : { + createdBy: p.systemData?.["createdBy"], + createdByType: p.systemData?.["createdByType"], + createdAt: + p.systemData?.["createdAt"] !== undefined + ? new Date(p.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: p.systemData?.["lastModifiedBy"], + lastModifiedByType: p.systemData?.["lastModifiedByType"], + lastModifiedAt: + p.systemData?.["lastModifiedAt"] !== undefined + ? new Date(p.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !p.properties + ? undefined + : { + inventoryType: p.properties?.["inventoryType"], + managedResourceId: p.properties?.["managedResourceId"], + uuid: p.properties?.["uuid"], + inventoryItemName: p.properties?.["inventoryItemName"], + provisioningState: p.properties?.["provisioningState"], + }, + kind: p["kind"], + }; + }), + nextLink: result.body["nextLink"], + }; +} + +/** Returns the list of inventoryItems in the given VmmServer. */ +export function inventoryItemsListByVmmServer( + context: Client, + subscriptionId: string, + resourceGroupName: string, + vmmServerName: string, + options: InventoryItemsListByVmmServerOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _inventoryItemsListByVmmServerSend( + context, + subscriptionId, + resourceGroupName, + vmmServerName, + options, + ), + _inventoryItemsListByVmmServerDeserialize, + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/scvmm/arm-scvmm/src/api/operations/index.ts b/sdk/scvmm/arm-scvmm/src/api/operations/index.ts new file mode 100644 index 000000000000..ed47cf50ca68 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/api/operations/index.ts @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { Operation, _OperationListResult } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../models/pagingTypes.js"; +import { buildPagedAsyncIterator } from "../pagingHelpers.js"; +import { + isUnexpected, + OperationsList200Response, + OperationsListDefaultResponse, + ScVmmContext as Client, +} from "../../rest/index.js"; +import { + StreamableMethod, + operationOptionsToRequestParameters, + createRestError, +} from "@azure-rest/core-client"; +import { OperationsListOptionalParams } from "../../models/options.js"; + +export function _operationsListSend( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path("/providers/Microsoft.ScVmm/operations") + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _operationsListDeserialize( + result: OperationsList200Response | OperationsListDefaultResponse, +): Promise<_OperationListResult> { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return { + value: result.body["value"].map((p) => { + return { + name: p["name"], + isDataAction: p["isDataAction"], + display: !p.display + ? undefined + : { + provider: p.display?.["provider"], + resource: p.display?.["resource"], + operation: p.display?.["operation"], + description: p.display?.["description"], + }, + origin: p["origin"], + actionType: p["actionType"], + }; + }), + nextLink: result.body["nextLink"], + }; +} + +/** List the operations for the provider */ +export function operationsList( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _operationsListSend(context, options), + _operationsListDeserialize, + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/scvmm/arm-scvmm/src/api/pagingHelpers.ts b/sdk/scvmm/arm-scvmm/src/api/pagingHelpers.ts new file mode 100644 index 000000000000..9780e76e04a6 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/api/pagingHelpers.ts @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { + Client, + createRestError, + PathUncheckedResponse, +} from "@azure-rest/core-client"; +import { RestError } from "@azure/core-rest-pipeline"; +import { + BuildPagedAsyncIteratorOptions, + ContinuablePage, + PageSettings, + PagedAsyncIterableIterator, + PagedResult, +} from "../models/pagingTypes.js"; +import { isUnexpected } from "../rest/index.js"; + +/** + * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator + */ +export function buildPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +>( + client: Client, + getInitialResponse: () => PromiseLike, + processResponseBody: (result: TResponse) => PromiseLike, + options: BuildPagedAsyncIteratorOptions = {}, +): PagedAsyncIterableIterator { + const itemName = options.itemName ?? "value"; + const nextLinkName = options.nextLinkName ?? "nextLink"; + const pagedResult: PagedResult = { + getPage: async (pageLink?: string) => { + const result = + pageLink === undefined + ? await getInitialResponse() + : await client.pathUnchecked(pageLink).get(); + checkPagingRequest(result); + const results = await processResponseBody(result as TResponse); + const nextLink = getNextLink(results, nextLinkName); + const values = getElements(results, itemName) as TPage; + return { + page: values, + nextPageLink: nextLink, + }; + }, + byPage: (settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }, + }; + return getPagedAsyncIterator(pagedResult); +} + +/** + * returns an async iterator that iterates over results. It also has a `byPage` + * method that returns pages of items at once. + * + * @param pagedResult - an object that specifies how to get pages. + * @returns a paged async iterator that iterates over results. + */ + +function getPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +>( + pagedResult: PagedResult, +): PagedAsyncIterableIterator { + const iter = getItemAsyncIterator( + pagedResult, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: + pagedResult?.byPage ?? + ((settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }), + }; +} + +async function* getItemAsyncIterator< + TElement, + TPage, + TPageSettings extends PageSettings, +>( + pagedResult: PagedResult, +): AsyncIterableIterator { + const pages = getPageAsyncIterator(pagedResult); + for await (const page of pages) { + yield* page as unknown as TElement[]; + } +} + +async function* getPageAsyncIterator< + TElement, + TPage, + TPageSettings extends PageSettings, +>( + pagedResult: PagedResult, + options: { + pageLink?: string; + } = {}, +): AsyncIterableIterator> { + const { pageLink } = options; + let response = await pagedResult.getPage( + pageLink ?? pagedResult.firstPageLink, + ); + if (!response) { + return; + } + let result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + while (response.nextPageLink) { + response = await pagedResult.getPage(response.nextPageLink); + if (!response) { + return; + } + result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + } +} + +/** + * Gets for the value of nextLink in the body + */ +function getNextLink(body: unknown, nextLinkName?: string): string | undefined { + if (!nextLinkName) { + return undefined; + } + + const nextLink = (body as Record)[nextLinkName]; + + if ( + typeof nextLink !== "string" && + typeof nextLink !== "undefined" && + nextLink !== null + ) { + throw new RestError( + `Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`, + ); + } + + if (nextLink === null) { + return undefined; + } + + return nextLink; +} + +/** + * Gets the elements of the current request in the body. + */ +function getElements(body: unknown, itemName: string): T[] { + const value = (body as Record)[itemName] as T[]; + if (!Array.isArray(value)) { + throw new RestError( + `Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`, + ); + } + + return value ?? []; +} + +/** + * Checks if a request failed + */ +function checkPagingRequest(response: PathUncheckedResponse): void { + if (isUnexpected(response)) { + throw createRestError( + `Pagination failed with unexpected statusCode ${response.status}`, + response, + ); + } +} diff --git a/sdk/scvmm/arm-scvmm/src/api/pollingHelpers.ts b/sdk/scvmm/arm-scvmm/src/api/pollingHelpers.ts new file mode 100644 index 000000000000..f3bd59e41b4f --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/api/pollingHelpers.ts @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { + PollerLike, + OperationState, + ResourceLocationConfig, + RunningOperation, + createHttpPoller, + OperationResponse, +} from "@azure/core-lro"; + +import { + Client, + PathUncheckedResponse, + createRestError, +} from "@azure-rest/core-client"; +import { AbortSignalLike } from "@azure/abort-controller"; +import { isUnexpected } from "../rest/index.js"; + +export interface GetLongRunningPollerOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** + * The potential location of the result of the LRO if specified by the LRO extension in the swagger. + */ + resourceLocationConfig?: ResourceLocationConfig; + /** + * The original url of the LRO + * Should not be null when restoreFrom is set + */ + initialRequestUrl?: string; + /** + * A serialized poller which can be used to resume an existing paused Long-Running-Operation. + */ + restoreFrom?: string; + /** + * The function to get the initial response + */ + getInitialResponse?: () => PromiseLike; +} +export function getLongRunningPoller< + TResponse extends PathUncheckedResponse, + TResult = void, +>( + client: Client, + processResponseBody: (result: TResponse) => Promise, + options: GetLongRunningPollerOptions, +): PollerLike, TResult> { + const { restoreFrom, getInitialResponse } = options; + if (!restoreFrom && !getInitialResponse) { + throw new Error( + "Either restoreFrom or getInitialResponse must be specified", + ); + } + let initialResponse: TResponse | undefined = undefined; + const pollAbortController = new AbortController(); + const poller: RunningOperation = { + sendInitialRequest: async () => { + if (!getInitialResponse) { + throw new Error( + "getInitialResponse is required when initializing a new poller", + ); + } + initialResponse = await getInitialResponse(); + return getLroResponse(initialResponse); + }, + sendPollRequest: async ( + path: string, + pollOptions?: { + abortSignal?: AbortSignalLike; + }, + ) => { + // The poll request would both listen to the user provided abort signal and the poller's own abort signal + function abortListener(): void { + pollAbortController.abort(); + } + const abortSignal = pollAbortController.signal; + if (options.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (pollOptions?.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (!abortSignal.aborted) { + options.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + pollOptions?.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + } + let response; + try { + response = await client.pathUnchecked(path).get({ abortSignal }); + } finally { + options.abortSignal?.removeEventListener("abort", abortListener); + pollOptions?.abortSignal?.removeEventListener("abort", abortListener); + } + if (options.initialRequestUrl || initialResponse) { + response.headers["x-ms-original-url"] = + options.initialRequestUrl ?? initialResponse!.request.url; + } + + return getLroResponse(response as TResponse); + }, + }; + return createHttpPoller(poller, { + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: options?.resourceLocationConfig, + restoreFrom: options?.restoreFrom, + processResult: (result: unknown) => { + return processResponseBody(result as TResponse); + }, + }); +} +/** + * Converts a Rest Client response to a response that the LRO implementation understands + * @param response - a rest client http response + * @param deserializeFn - deserialize function to convert Rest response to modular output + * @returns - An LRO response that the LRO implementation understands + */ +function getLroResponse( + response: TResponse, +): OperationResponse { + if (isUnexpected(response as PathUncheckedResponse)) { + throw createRestError(response); + } + return { + flatResponse: response, + rawResponse: { + ...response, + statusCode: Number.parseInt(response.status), + body: response.body, + }, + }; +} diff --git a/sdk/scvmm/arm-scvmm/src/api/scVmmContext.ts b/sdk/scvmm/arm-scvmm/src/api/scVmmContext.ts new file mode 100644 index 000000000000..23d6ed51b1dc --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/api/scVmmContext.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { TokenCredential } from "@azure/core-auth"; +import { ClientOptions } from "@azure-rest/core-client"; +import { ScVmmContext } from "../rest/index.js"; +import getClient from "../rest/index.js"; + +/** Optional parameters for the client. */ +export interface ScVmmClientOptionalParams extends ClientOptions { + /** The API version to use for this operation. */ + apiVersion?: string; +} + +export { ScVmmContext } from "../rest/index.js"; + +/** The Microsoft.ScVmm Rest API spec. */ +export function createScVmm( + credential: TokenCredential, + options: ScVmmClientOptionalParams = {}, +): ScVmmContext { + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-api` + : "azsdk-js-api"; + + const clientContext = getClient(credential, { + ...options, + userAgentOptions: { userAgentPrefix }, + }); + return clientContext; +} diff --git a/sdk/scvmm/arm-scvmm/src/api/virtualMachineInstances/index.ts b/sdk/scvmm/arm-scvmm/src/api/virtualMachineInstances/index.ts new file mode 100644 index 000000000000..dba6a12f373e --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/api/virtualMachineInstances/index.ts @@ -0,0 +1,1461 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { getLongRunningPoller } from "../pollingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; +import { + virtualMachineInstancePropertiesSerializer, + extendedLocationSerializer, + virtualMachineInstanceUpdatePropertiesSerializer, + VirtualMachineInstance, + VirtualMachineInstanceUpdate, + StopVirtualMachineOptions, + VirtualMachineCreateCheckpoint, + VirtualMachineDeleteCheckpoint, + VirtualMachineRestoreCheckpoint, + _VirtualMachineInstanceListResult, +} from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../models/pagingTypes.js"; +import { buildPagedAsyncIterator } from "../pagingHelpers.js"; +import { + isUnexpected, + ScVmmContext as Client, + VirtualMachineInstancesCreateCheckpoint202Response, + VirtualMachineInstancesCreateCheckpointDefaultResponse, + VirtualMachineInstancesCreateCheckpointLogicalResponse, + VirtualMachineInstancesCreateOrUpdate200Response, + VirtualMachineInstancesCreateOrUpdate201Response, + VirtualMachineInstancesCreateOrUpdateDefaultResponse, + VirtualMachineInstancesCreateOrUpdateLogicalResponse, + VirtualMachineInstancesDelete202Response, + VirtualMachineInstancesDelete204Response, + VirtualMachineInstancesDeleteCheckpoint202Response, + VirtualMachineInstancesDeleteCheckpointDefaultResponse, + VirtualMachineInstancesDeleteCheckpointLogicalResponse, + VirtualMachineInstancesDeleteDefaultResponse, + VirtualMachineInstancesDeleteLogicalResponse, + VirtualMachineInstancesGet200Response, + VirtualMachineInstancesGetDefaultResponse, + VirtualMachineInstancesList200Response, + VirtualMachineInstancesListDefaultResponse, + VirtualMachineInstancesRestart202Response, + VirtualMachineInstancesRestartDefaultResponse, + VirtualMachineInstancesRestartLogicalResponse, + VirtualMachineInstancesRestoreCheckpoint202Response, + VirtualMachineInstancesRestoreCheckpointDefaultResponse, + VirtualMachineInstancesRestoreCheckpointLogicalResponse, + VirtualMachineInstancesStart202Response, + VirtualMachineInstancesStartDefaultResponse, + VirtualMachineInstancesStartLogicalResponse, + VirtualMachineInstancesStop202Response, + VirtualMachineInstancesStopDefaultResponse, + VirtualMachineInstancesStopLogicalResponse, + VirtualMachineInstancesUpdate200Response, + VirtualMachineInstancesUpdate202Response, + VirtualMachineInstancesUpdateDefaultResponse, + VirtualMachineInstancesUpdateLogicalResponse, +} from "../../rest/index.js"; +import { + StreamableMethod, + operationOptionsToRequestParameters, + createRestError, +} from "@azure-rest/core-client"; +import { + VirtualMachineInstancesGetOptionalParams, + VirtualMachineInstancesCreateOrUpdateOptionalParams, + VirtualMachineInstancesUpdateOptionalParams, + VirtualMachineInstancesDeleteOptionalParams, + VirtualMachineInstancesListOptionalParams, + VirtualMachineInstancesStopOptionalParams, + VirtualMachineInstancesStartOptionalParams, + VirtualMachineInstancesRestartOptionalParams, + VirtualMachineInstancesCreateCheckpointOptionalParams, + VirtualMachineInstancesDeleteCheckpointOptionalParams, + VirtualMachineInstancesRestoreCheckpointOptionalParams, +} from "../../models/options.js"; + +export function _virtualMachineInstancesGetSend( + context: Client, + resourceUri: string, + options: VirtualMachineInstancesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | VirtualMachineInstancesGet200Response + | VirtualMachineInstancesGetDefaultResponse +> { + return context + .path( + "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default", + resourceUri, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _virtualMachineInstancesGetDeserialize( + result: + | VirtualMachineInstancesGet200Response + | VirtualMachineInstancesGetDefaultResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return { + id: result.body["id"], + name: result.body["name"], + type: result.body["type"], + systemData: !result.body.systemData + ? undefined + : { + createdBy: result.body.systemData?.["createdBy"], + createdByType: result.body.systemData?.["createdByType"], + createdAt: + result.body.systemData?.["createdAt"] !== undefined + ? new Date(result.body.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: result.body.systemData?.["lastModifiedBy"], + lastModifiedByType: result.body.systemData?.["lastModifiedByType"], + lastModifiedAt: + result.body.systemData?.["lastModifiedAt"] !== undefined + ? new Date(result.body.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !result.body.properties + ? undefined + : { + availabilitySets: + result.body.properties?.["availabilitySets"] === undefined + ? result.body.properties?.["availabilitySets"] + : result.body.properties?.["availabilitySets"].map((p) => { + return { id: p["id"], name: p["name"] }; + }), + osProfile: !result.body.properties?.osProfile + ? undefined + : { + adminPassword: + result.body.properties?.osProfile?.["adminPassword"], + computerName: + result.body.properties?.osProfile?.["computerName"], + osType: result.body.properties?.osProfile?.["osType"], + osSku: result.body.properties?.osProfile?.["osSku"], + osVersion: result.body.properties?.osProfile?.["osVersion"], + domainName: result.body.properties?.osProfile?.["domainName"], + domainUsername: + result.body.properties?.osProfile?.["domainUsername"], + domainPassword: + result.body.properties?.osProfile?.["domainPassword"], + workgroup: result.body.properties?.osProfile?.["workgroup"], + productKey: result.body.properties?.osProfile?.["productKey"], + timezone: result.body.properties?.osProfile?.["timezone"], + runOnceCommands: + result.body.properties?.osProfile?.["runOnceCommands"], + }, + hardwareProfile: !result.body.properties?.hardwareProfile + ? undefined + : { + memoryMB: result.body.properties?.hardwareProfile?.["memoryMB"], + cpuCount: result.body.properties?.hardwareProfile?.["cpuCount"], + limitCpuForMigration: + result.body.properties?.hardwareProfile?.[ + "limitCpuForMigration" + ], + dynamicMemoryEnabled: + result.body.properties?.hardwareProfile?.[ + "dynamicMemoryEnabled" + ], + dynamicMemoryMaxMB: + result.body.properties?.hardwareProfile?.[ + "dynamicMemoryMaxMB" + ], + dynamicMemoryMinMB: + result.body.properties?.hardwareProfile?.[ + "dynamicMemoryMinMB" + ], + isHighlyAvailable: + result.body.properties?.hardwareProfile?.[ + "isHighlyAvailable" + ], + }, + networkProfile: !result.body.properties?.networkProfile + ? undefined + : { + networkInterfaces: + result.body.properties?.networkProfile?.[ + "networkInterfaces" + ] === undefined + ? result.body.properties?.networkProfile?.[ + "networkInterfaces" + ] + : result.body.properties?.networkProfile?.[ + "networkInterfaces" + ].map((p) => { + return { + name: p["name"], + displayName: p["displayName"], + ipv4Addresses: p["ipv4Addresses"], + ipv6Addresses: p["ipv6Addresses"], + macAddress: p["macAddress"], + virtualNetworkId: p["virtualNetworkId"], + networkName: p["networkName"], + ipv4AddressType: p["ipv4AddressType"], + ipv6AddressType: p["ipv6AddressType"], + macAddressType: p["macAddressType"], + nicId: p["nicId"], + }; + }), + }, + storageProfile: !result.body.properties?.storageProfile + ? undefined + : { + disks: + result.body.properties?.storageProfile?.["disks"] === + undefined + ? result.body.properties?.storageProfile?.["disks"] + : result.body.properties?.storageProfile?.["disks"].map( + (p) => { + return { + name: p["name"], + displayName: p["displayName"], + diskId: p["diskId"], + diskSizeGB: p["diskSizeGB"], + maxDiskSizeGB: p["maxDiskSizeGB"], + bus: p["bus"], + lun: p["lun"], + busType: p["busType"], + vhdType: p["vhdType"], + volumeType: p["volumeType"], + vhdFormatType: p["vhdFormatType"], + templateDiskId: p["templateDiskId"], + storageQosPolicy: !p.storageQoSPolicy + ? undefined + : { + name: p.storageQoSPolicy?.["name"], + id: p.storageQoSPolicy?.["id"], + }, + createDiffDisk: p["createDiffDisk"], + }; + }, + ), + }, + infrastructureProfile: !result.body.properties?.infrastructureProfile + ? undefined + : { + inventoryItemId: + result.body.properties?.infrastructureProfile?.[ + "inventoryItemId" + ], + vmmServerId: + result.body.properties?.infrastructureProfile?.[ + "vmmServerId" + ], + cloudId: + result.body.properties?.infrastructureProfile?.["cloudId"], + templateId: + result.body.properties?.infrastructureProfile?.["templateId"], + vmName: + result.body.properties?.infrastructureProfile?.["vmName"], + uuid: result.body.properties?.infrastructureProfile?.["uuid"], + lastRestoredVmCheckpoint: !result.body.properties + ?.infrastructureProfile?.lastRestoredVMCheckpoint + ? undefined + : { + parentCheckpointId: + result.body.properties?.infrastructureProfile + ?.lastRestoredVMCheckpoint?.["parentCheckpointID"], + checkpointId: + result.body.properties?.infrastructureProfile + ?.lastRestoredVMCheckpoint?.["checkpointID"], + name: result.body.properties?.infrastructureProfile + ?.lastRestoredVMCheckpoint?.["name"], + description: + result.body.properties?.infrastructureProfile + ?.lastRestoredVMCheckpoint?.["description"], + }, + checkpoints: + result.body.properties?.infrastructureProfile?.[ + "checkpoints" + ] === undefined + ? result.body.properties?.infrastructureProfile?.[ + "checkpoints" + ] + : result.body.properties?.infrastructureProfile?.[ + "checkpoints" + ].map((p) => { + return { + parentCheckpointId: p["parentCheckpointID"], + checkpointId: p["checkpointID"], + name: p["name"], + description: p["description"], + }; + }), + checkpointType: + result.body.properties?.infrastructureProfile?.[ + "checkpointType" + ], + generation: + result.body.properties?.infrastructureProfile?.["generation"], + biosGuid: + result.body.properties?.infrastructureProfile?.["biosGuid"], + }, + powerState: result.body.properties?.["powerState"], + provisioningState: result.body.properties?.["provisioningState"], + }, + extendedLocation: { + type: result.body.extendedLocation["type"], + name: result.body.extendedLocation["name"], + }, + }; +} + +/** Retrieves information about a virtual machine instance. */ +export async function virtualMachineInstancesGet( + context: Client, + resourceUri: string, + options: VirtualMachineInstancesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _virtualMachineInstancesGetSend( + context, + resourceUri, + options, + ); + return _virtualMachineInstancesGetDeserialize(result); +} + +export function _virtualMachineInstancesCreateOrUpdateSend( + context: Client, + resourceUri: string, + resource: VirtualMachineInstance, + options: VirtualMachineInstancesCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod< + | VirtualMachineInstancesCreateOrUpdate200Response + | VirtualMachineInstancesCreateOrUpdate201Response + | VirtualMachineInstancesCreateOrUpdateDefaultResponse + | VirtualMachineInstancesCreateOrUpdateLogicalResponse +> { + return context + .path( + "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default", + resourceUri, + ) + .put({ + ...operationOptionsToRequestParameters(options), + body: { + properties: !resource.properties + ? resource.properties + : virtualMachineInstancePropertiesSerializer(resource.properties), + extendedLocation: extendedLocationSerializer(resource.extendedLocation), + }, + }); +} + +export async function _virtualMachineInstancesCreateOrUpdateDeserialize( + result: + | VirtualMachineInstancesCreateOrUpdate200Response + | VirtualMachineInstancesCreateOrUpdate201Response + | VirtualMachineInstancesCreateOrUpdateDefaultResponse + | VirtualMachineInstancesCreateOrUpdateLogicalResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + const res = + result as unknown as VirtualMachineInstancesCreateOrUpdateLogicalResponse; + return { + id: res.body["id"], + name: res.body["name"], + type: res.body["type"], + systemData: !res.body.systemData + ? undefined + : { + createdBy: res.body.systemData?.["createdBy"], + createdByType: res.body.systemData?.["createdByType"], + createdAt: + res.body.systemData?.["createdAt"] !== undefined + ? new Date(res.body.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: res.body.systemData?.["lastModifiedBy"], + lastModifiedByType: res.body.systemData?.["lastModifiedByType"], + lastModifiedAt: + res.body.systemData?.["lastModifiedAt"] !== undefined + ? new Date(res.body.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !res.body.properties + ? undefined + : { + availabilitySets: + res.body.properties?.["availabilitySets"] === undefined + ? res.body.properties?.["availabilitySets"] + : res.body.properties?.["availabilitySets"].map((p) => { + return { id: p["id"], name: p["name"] }; + }), + osProfile: !res.body.properties?.osProfile + ? undefined + : { + adminPassword: + res.body.properties?.osProfile?.["adminPassword"], + computerName: res.body.properties?.osProfile?.["computerName"], + osType: res.body.properties?.osProfile?.["osType"], + osSku: res.body.properties?.osProfile?.["osSku"], + osVersion: res.body.properties?.osProfile?.["osVersion"], + domainName: res.body.properties?.osProfile?.["domainName"], + domainUsername: + res.body.properties?.osProfile?.["domainUsername"], + domainPassword: + res.body.properties?.osProfile?.["domainPassword"], + workgroup: res.body.properties?.osProfile?.["workgroup"], + productKey: res.body.properties?.osProfile?.["productKey"], + timezone: res.body.properties?.osProfile?.["timezone"], + runOnceCommands: + res.body.properties?.osProfile?.["runOnceCommands"], + }, + hardwareProfile: !res.body.properties?.hardwareProfile + ? undefined + : { + memoryMB: res.body.properties?.hardwareProfile?.["memoryMB"], + cpuCount: res.body.properties?.hardwareProfile?.["cpuCount"], + limitCpuForMigration: + res.body.properties?.hardwareProfile?.[ + "limitCpuForMigration" + ], + dynamicMemoryEnabled: + res.body.properties?.hardwareProfile?.[ + "dynamicMemoryEnabled" + ], + dynamicMemoryMaxMB: + res.body.properties?.hardwareProfile?.["dynamicMemoryMaxMB"], + dynamicMemoryMinMB: + res.body.properties?.hardwareProfile?.["dynamicMemoryMinMB"], + isHighlyAvailable: + res.body.properties?.hardwareProfile?.["isHighlyAvailable"], + }, + networkProfile: !res.body.properties?.networkProfile + ? undefined + : { + networkInterfaces: + res.body.properties?.networkProfile?.["networkInterfaces"] === + undefined + ? res.body.properties?.networkProfile?.["networkInterfaces"] + : res.body.properties?.networkProfile?.[ + "networkInterfaces" + ].map((p) => { + return { + name: p["name"], + displayName: p["displayName"], + ipv4Addresses: p["ipv4Addresses"], + ipv6Addresses: p["ipv6Addresses"], + macAddress: p["macAddress"], + virtualNetworkId: p["virtualNetworkId"], + networkName: p["networkName"], + ipv4AddressType: p["ipv4AddressType"], + ipv6AddressType: p["ipv6AddressType"], + macAddressType: p["macAddressType"], + nicId: p["nicId"], + }; + }), + }, + storageProfile: !res.body.properties?.storageProfile + ? undefined + : { + disks: + res.body.properties?.storageProfile?.["disks"] === undefined + ? res.body.properties?.storageProfile?.["disks"] + : res.body.properties?.storageProfile?.["disks"].map( + (p) => { + return { + name: p["name"], + displayName: p["displayName"], + diskId: p["diskId"], + diskSizeGB: p["diskSizeGB"], + maxDiskSizeGB: p["maxDiskSizeGB"], + bus: p["bus"], + lun: p["lun"], + busType: p["busType"], + vhdType: p["vhdType"], + volumeType: p["volumeType"], + vhdFormatType: p["vhdFormatType"], + templateDiskId: p["templateDiskId"], + storageQosPolicy: !p.storageQoSPolicy + ? undefined + : { + name: p.storageQoSPolicy?.["name"], + id: p.storageQoSPolicy?.["id"], + }, + createDiffDisk: p["createDiffDisk"], + }; + }, + ), + }, + infrastructureProfile: !res.body.properties?.infrastructureProfile + ? undefined + : { + inventoryItemId: + res.body.properties?.infrastructureProfile?.[ + "inventoryItemId" + ], + vmmServerId: + res.body.properties?.infrastructureProfile?.["vmmServerId"], + cloudId: + res.body.properties?.infrastructureProfile?.["cloudId"], + templateId: + res.body.properties?.infrastructureProfile?.["templateId"], + vmName: res.body.properties?.infrastructureProfile?.["vmName"], + uuid: res.body.properties?.infrastructureProfile?.["uuid"], + lastRestoredVmCheckpoint: !res.body.properties + ?.infrastructureProfile?.lastRestoredVMCheckpoint + ? undefined + : { + parentCheckpointId: + res.body.properties?.infrastructureProfile + ?.lastRestoredVMCheckpoint?.["parentCheckpointID"], + checkpointId: + res.body.properties?.infrastructureProfile + ?.lastRestoredVMCheckpoint?.["checkpointID"], + name: res.body.properties?.infrastructureProfile + ?.lastRestoredVMCheckpoint?.["name"], + description: + res.body.properties?.infrastructureProfile + ?.lastRestoredVMCheckpoint?.["description"], + }, + checkpoints: + res.body.properties?.infrastructureProfile?.[ + "checkpoints" + ] === undefined + ? res.body.properties?.infrastructureProfile?.[ + "checkpoints" + ] + : res.body.properties?.infrastructureProfile?.[ + "checkpoints" + ].map((p) => { + return { + parentCheckpointId: p["parentCheckpointID"], + checkpointId: p["checkpointID"], + name: p["name"], + description: p["description"], + }; + }), + checkpointType: + res.body.properties?.infrastructureProfile?.[ + "checkpointType" + ], + generation: + res.body.properties?.infrastructureProfile?.["generation"], + biosGuid: + res.body.properties?.infrastructureProfile?.["biosGuid"], + }, + powerState: res.body.properties?.["powerState"], + provisioningState: res.body.properties?.["provisioningState"], + }, + extendedLocation: { + type: res.body.extendedLocation["type"], + name: res.body.extendedLocation["name"], + }, + }; +} + +/** The operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. */ +export function virtualMachineInstancesCreateOrUpdate( + context: Client, + resourceUri: string, + resource: VirtualMachineInstance, + options: VirtualMachineInstancesCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): PollerLike, VirtualMachineInstance> { + return getLongRunningPoller( + context, + _virtualMachineInstancesCreateOrUpdateDeserialize, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _virtualMachineInstancesCreateOrUpdateSend( + context, + resourceUri, + resource, + options, + ), + }, + ) as PollerLike< + OperationState, + VirtualMachineInstance + >; +} + +export function _virtualMachineInstancesUpdateSend( + context: Client, + resourceUri: string, + properties: VirtualMachineInstanceUpdate, + options: VirtualMachineInstancesUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | VirtualMachineInstancesUpdate200Response + | VirtualMachineInstancesUpdate202Response + | VirtualMachineInstancesUpdateDefaultResponse + | VirtualMachineInstancesUpdateLogicalResponse +> { + return context + .path( + "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default", + resourceUri, + ) + .patch({ + ...operationOptionsToRequestParameters(options), + body: { + properties: !properties.properties + ? properties.properties + : virtualMachineInstanceUpdatePropertiesSerializer( + properties.properties, + ), + }, + }); +} + +export async function _virtualMachineInstancesUpdateDeserialize( + result: + | VirtualMachineInstancesUpdate200Response + | VirtualMachineInstancesUpdate202Response + | VirtualMachineInstancesUpdateDefaultResponse + | VirtualMachineInstancesUpdateLogicalResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + const res = result as unknown as VirtualMachineInstancesUpdateLogicalResponse; + return { + id: res.body["id"], + name: res.body["name"], + type: res.body["type"], + systemData: !res.body.systemData + ? undefined + : { + createdBy: res.body.systemData?.["createdBy"], + createdByType: res.body.systemData?.["createdByType"], + createdAt: + res.body.systemData?.["createdAt"] !== undefined + ? new Date(res.body.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: res.body.systemData?.["lastModifiedBy"], + lastModifiedByType: res.body.systemData?.["lastModifiedByType"], + lastModifiedAt: + res.body.systemData?.["lastModifiedAt"] !== undefined + ? new Date(res.body.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !res.body.properties + ? undefined + : { + availabilitySets: + res.body.properties?.["availabilitySets"] === undefined + ? res.body.properties?.["availabilitySets"] + : res.body.properties?.["availabilitySets"].map((p) => { + return { id: p["id"], name: p["name"] }; + }), + osProfile: !res.body.properties?.osProfile + ? undefined + : { + adminPassword: + res.body.properties?.osProfile?.["adminPassword"], + computerName: res.body.properties?.osProfile?.["computerName"], + osType: res.body.properties?.osProfile?.["osType"], + osSku: res.body.properties?.osProfile?.["osSku"], + osVersion: res.body.properties?.osProfile?.["osVersion"], + domainName: res.body.properties?.osProfile?.["domainName"], + domainUsername: + res.body.properties?.osProfile?.["domainUsername"], + domainPassword: + res.body.properties?.osProfile?.["domainPassword"], + workgroup: res.body.properties?.osProfile?.["workgroup"], + productKey: res.body.properties?.osProfile?.["productKey"], + timezone: res.body.properties?.osProfile?.["timezone"], + runOnceCommands: + res.body.properties?.osProfile?.["runOnceCommands"], + }, + hardwareProfile: !res.body.properties?.hardwareProfile + ? undefined + : { + memoryMB: res.body.properties?.hardwareProfile?.["memoryMB"], + cpuCount: res.body.properties?.hardwareProfile?.["cpuCount"], + limitCpuForMigration: + res.body.properties?.hardwareProfile?.[ + "limitCpuForMigration" + ], + dynamicMemoryEnabled: + res.body.properties?.hardwareProfile?.[ + "dynamicMemoryEnabled" + ], + dynamicMemoryMaxMB: + res.body.properties?.hardwareProfile?.["dynamicMemoryMaxMB"], + dynamicMemoryMinMB: + res.body.properties?.hardwareProfile?.["dynamicMemoryMinMB"], + isHighlyAvailable: + res.body.properties?.hardwareProfile?.["isHighlyAvailable"], + }, + networkProfile: !res.body.properties?.networkProfile + ? undefined + : { + networkInterfaces: + res.body.properties?.networkProfile?.["networkInterfaces"] === + undefined + ? res.body.properties?.networkProfile?.["networkInterfaces"] + : res.body.properties?.networkProfile?.[ + "networkInterfaces" + ].map((p) => { + return { + name: p["name"], + displayName: p["displayName"], + ipv4Addresses: p["ipv4Addresses"], + ipv6Addresses: p["ipv6Addresses"], + macAddress: p["macAddress"], + virtualNetworkId: p["virtualNetworkId"], + networkName: p["networkName"], + ipv4AddressType: p["ipv4AddressType"], + ipv6AddressType: p["ipv6AddressType"], + macAddressType: p["macAddressType"], + nicId: p["nicId"], + }; + }), + }, + storageProfile: !res.body.properties?.storageProfile + ? undefined + : { + disks: + res.body.properties?.storageProfile?.["disks"] === undefined + ? res.body.properties?.storageProfile?.["disks"] + : res.body.properties?.storageProfile?.["disks"].map( + (p) => { + return { + name: p["name"], + displayName: p["displayName"], + diskId: p["diskId"], + diskSizeGB: p["diskSizeGB"], + maxDiskSizeGB: p["maxDiskSizeGB"], + bus: p["bus"], + lun: p["lun"], + busType: p["busType"], + vhdType: p["vhdType"], + volumeType: p["volumeType"], + vhdFormatType: p["vhdFormatType"], + templateDiskId: p["templateDiskId"], + storageQosPolicy: !p.storageQoSPolicy + ? undefined + : { + name: p.storageQoSPolicy?.["name"], + id: p.storageQoSPolicy?.["id"], + }, + createDiffDisk: p["createDiffDisk"], + }; + }, + ), + }, + infrastructureProfile: !res.body.properties?.infrastructureProfile + ? undefined + : { + inventoryItemId: + res.body.properties?.infrastructureProfile?.[ + "inventoryItemId" + ], + vmmServerId: + res.body.properties?.infrastructureProfile?.["vmmServerId"], + cloudId: + res.body.properties?.infrastructureProfile?.["cloudId"], + templateId: + res.body.properties?.infrastructureProfile?.["templateId"], + vmName: res.body.properties?.infrastructureProfile?.["vmName"], + uuid: res.body.properties?.infrastructureProfile?.["uuid"], + lastRestoredVmCheckpoint: !res.body.properties + ?.infrastructureProfile?.lastRestoredVMCheckpoint + ? undefined + : { + parentCheckpointId: + res.body.properties?.infrastructureProfile + ?.lastRestoredVMCheckpoint?.["parentCheckpointID"], + checkpointId: + res.body.properties?.infrastructureProfile + ?.lastRestoredVMCheckpoint?.["checkpointID"], + name: res.body.properties?.infrastructureProfile + ?.lastRestoredVMCheckpoint?.["name"], + description: + res.body.properties?.infrastructureProfile + ?.lastRestoredVMCheckpoint?.["description"], + }, + checkpoints: + res.body.properties?.infrastructureProfile?.[ + "checkpoints" + ] === undefined + ? res.body.properties?.infrastructureProfile?.[ + "checkpoints" + ] + : res.body.properties?.infrastructureProfile?.[ + "checkpoints" + ].map((p) => { + return { + parentCheckpointId: p["parentCheckpointID"], + checkpointId: p["checkpointID"], + name: p["name"], + description: p["description"], + }; + }), + checkpointType: + res.body.properties?.infrastructureProfile?.[ + "checkpointType" + ], + generation: + res.body.properties?.infrastructureProfile?.["generation"], + biosGuid: + res.body.properties?.infrastructureProfile?.["biosGuid"], + }, + powerState: res.body.properties?.["powerState"], + provisioningState: res.body.properties?.["provisioningState"], + }, + extendedLocation: { + type: res.body.extendedLocation["type"], + name: res.body.extendedLocation["name"], + }, + }; +} + +/** The operation to update a virtual machine instance. */ +export function virtualMachineInstancesUpdate( + context: Client, + resourceUri: string, + properties: VirtualMachineInstanceUpdate, + options: VirtualMachineInstancesUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, VirtualMachineInstance> { + return getLongRunningPoller( + context, + _virtualMachineInstancesUpdateDeserialize, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _virtualMachineInstancesUpdateSend( + context, + resourceUri, + properties, + options, + ), + }, + ) as PollerLike< + OperationState, + VirtualMachineInstance + >; +} + +export function _virtualMachineInstancesDeleteSend( + context: Client, + resourceUri: string, + options: VirtualMachineInstancesDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | VirtualMachineInstancesDelete202Response + | VirtualMachineInstancesDelete204Response + | VirtualMachineInstancesDeleteDefaultResponse + | VirtualMachineInstancesDeleteLogicalResponse +> { + return context + .path( + "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default", + resourceUri, + ) + .delete({ + ...operationOptionsToRequestParameters(options), + queryParameters: { + force: options?.force, + deleteFromHost: options?.deleteFromHost, + }, + }); +} + +export async function _virtualMachineInstancesDeleteDeserialize( + result: + | VirtualMachineInstancesDelete202Response + | VirtualMachineInstancesDelete204Response + | VirtualMachineInstancesDeleteDefaultResponse + | VirtualMachineInstancesDeleteLogicalResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return; +} + +/** The operation to delete a virtual machine instance. */ +export function virtualMachineInstancesDelete( + context: Client, + resourceUri: string, + options: VirtualMachineInstancesDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller( + context, + _virtualMachineInstancesDeleteDeserialize, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _virtualMachineInstancesDeleteSend(context, resourceUri, options), + }, + ) as PollerLike, void>; +} + +export function _virtualMachineInstancesListSend( + context: Client, + resourceUri: string, + options: VirtualMachineInstancesListOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | VirtualMachineInstancesList200Response + | VirtualMachineInstancesListDefaultResponse +> { + return context + .path( + "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances", + resourceUri, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _virtualMachineInstancesListDeserialize( + result: + | VirtualMachineInstancesList200Response + | VirtualMachineInstancesListDefaultResponse, +): Promise<_VirtualMachineInstanceListResult> { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return { + value: result.body["value"].map((p) => { + return { + id: p["id"], + name: p["name"], + type: p["type"], + systemData: !p.systemData + ? undefined + : { + createdBy: p.systemData?.["createdBy"], + createdByType: p.systemData?.["createdByType"], + createdAt: + p.systemData?.["createdAt"] !== undefined + ? new Date(p.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: p.systemData?.["lastModifiedBy"], + lastModifiedByType: p.systemData?.["lastModifiedByType"], + lastModifiedAt: + p.systemData?.["lastModifiedAt"] !== undefined + ? new Date(p.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !p.properties + ? undefined + : { + availabilitySets: + p.properties?.["availabilitySets"] === undefined + ? p.properties?.["availabilitySets"] + : p.properties?.["availabilitySets"].map((p) => { + return { id: p["id"], name: p["name"] }; + }), + osProfile: !p.properties?.osProfile + ? undefined + : { + adminPassword: p.properties?.osProfile?.["adminPassword"], + computerName: p.properties?.osProfile?.["computerName"], + osType: p.properties?.osProfile?.["osType"], + osSku: p.properties?.osProfile?.["osSku"], + osVersion: p.properties?.osProfile?.["osVersion"], + domainName: p.properties?.osProfile?.["domainName"], + domainUsername: p.properties?.osProfile?.["domainUsername"], + domainPassword: p.properties?.osProfile?.["domainPassword"], + workgroup: p.properties?.osProfile?.["workgroup"], + productKey: p.properties?.osProfile?.["productKey"], + timezone: p.properties?.osProfile?.["timezone"], + runOnceCommands: + p.properties?.osProfile?.["runOnceCommands"], + }, + hardwareProfile: !p.properties?.hardwareProfile + ? undefined + : { + memoryMB: p.properties?.hardwareProfile?.["memoryMB"], + cpuCount: p.properties?.hardwareProfile?.["cpuCount"], + limitCpuForMigration: + p.properties?.hardwareProfile?.["limitCpuForMigration"], + dynamicMemoryEnabled: + p.properties?.hardwareProfile?.["dynamicMemoryEnabled"], + dynamicMemoryMaxMB: + p.properties?.hardwareProfile?.["dynamicMemoryMaxMB"], + dynamicMemoryMinMB: + p.properties?.hardwareProfile?.["dynamicMemoryMinMB"], + isHighlyAvailable: + p.properties?.hardwareProfile?.["isHighlyAvailable"], + }, + networkProfile: !p.properties?.networkProfile + ? undefined + : { + networkInterfaces: + p.properties?.networkProfile?.["networkInterfaces"] === + undefined + ? p.properties?.networkProfile?.["networkInterfaces"] + : p.properties?.networkProfile?.[ + "networkInterfaces" + ].map((p) => { + return { + name: p["name"], + displayName: p["displayName"], + ipv4Addresses: p["ipv4Addresses"], + ipv6Addresses: p["ipv6Addresses"], + macAddress: p["macAddress"], + virtualNetworkId: p["virtualNetworkId"], + networkName: p["networkName"], + ipv4AddressType: p["ipv4AddressType"], + ipv6AddressType: p["ipv6AddressType"], + macAddressType: p["macAddressType"], + nicId: p["nicId"], + }; + }), + }, + storageProfile: !p.properties?.storageProfile + ? undefined + : { + disks: + p.properties?.storageProfile?.["disks"] === undefined + ? p.properties?.storageProfile?.["disks"] + : p.properties?.storageProfile?.["disks"].map((p) => { + return { + name: p["name"], + displayName: p["displayName"], + diskId: p["diskId"], + diskSizeGB: p["diskSizeGB"], + maxDiskSizeGB: p["maxDiskSizeGB"], + bus: p["bus"], + lun: p["lun"], + busType: p["busType"], + vhdType: p["vhdType"], + volumeType: p["volumeType"], + vhdFormatType: p["vhdFormatType"], + templateDiskId: p["templateDiskId"], + storageQosPolicy: !p.storageQoSPolicy + ? undefined + : { + name: p.storageQoSPolicy?.["name"], + id: p.storageQoSPolicy?.["id"], + }, + createDiffDisk: p["createDiffDisk"], + }; + }), + }, + infrastructureProfile: !p.properties?.infrastructureProfile + ? undefined + : { + inventoryItemId: + p.properties?.infrastructureProfile?.["inventoryItemId"], + vmmServerId: + p.properties?.infrastructureProfile?.["vmmServerId"], + cloudId: p.properties?.infrastructureProfile?.["cloudId"], + templateId: + p.properties?.infrastructureProfile?.["templateId"], + vmName: p.properties?.infrastructureProfile?.["vmName"], + uuid: p.properties?.infrastructureProfile?.["uuid"], + lastRestoredVmCheckpoint: !p.properties + ?.infrastructureProfile?.lastRestoredVMCheckpoint + ? undefined + : { + parentCheckpointId: + p.properties?.infrastructureProfile + ?.lastRestoredVMCheckpoint?.[ + "parentCheckpointID" + ], + checkpointId: + p.properties?.infrastructureProfile + ?.lastRestoredVMCheckpoint?.["checkpointID"], + name: p.properties?.infrastructureProfile + ?.lastRestoredVMCheckpoint?.["name"], + description: + p.properties?.infrastructureProfile + ?.lastRestoredVMCheckpoint?.["description"], + }, + checkpoints: + p.properties?.infrastructureProfile?.["checkpoints"] === + undefined + ? p.properties?.infrastructureProfile?.["checkpoints"] + : p.properties?.infrastructureProfile?.[ + "checkpoints" + ].map((p) => { + return { + parentCheckpointId: p["parentCheckpointID"], + checkpointId: p["checkpointID"], + name: p["name"], + description: p["description"], + }; + }), + checkpointType: + p.properties?.infrastructureProfile?.["checkpointType"], + generation: + p.properties?.infrastructureProfile?.["generation"], + biosGuid: p.properties?.infrastructureProfile?.["biosGuid"], + }, + powerState: p.properties?.["powerState"], + provisioningState: p.properties?.["provisioningState"], + }, + extendedLocation: { + type: p.extendedLocation["type"], + name: p.extendedLocation["name"], + }, + }; + }), + nextLink: result.body["nextLink"], + }; +} + +/** Lists all of the virtual machine instances within the specified parent resource. */ +export function virtualMachineInstancesList( + context: Client, + resourceUri: string, + options: VirtualMachineInstancesListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _virtualMachineInstancesListSend(context, resourceUri, options), + _virtualMachineInstancesListDeserialize, + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _virtualMachineInstancesStopSend( + context: Client, + resourceUri: string, + body: StopVirtualMachineOptions, + options: VirtualMachineInstancesStopOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | VirtualMachineInstancesStop202Response + | VirtualMachineInstancesStopDefaultResponse + | VirtualMachineInstancesStopLogicalResponse +> { + return context + .path( + "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/stop", + resourceUri, + ) + .post({ + ...operationOptionsToRequestParameters(options), + body: { skipShutdown: body["skipShutdown"] }, + }); +} + +export async function _virtualMachineInstancesStopDeserialize( + result: + | VirtualMachineInstancesStop202Response + | VirtualMachineInstancesStopDefaultResponse + | VirtualMachineInstancesStopLogicalResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return; +} + +/** The operation to power off (stop) a virtual machine instance. */ +export function virtualMachineInstancesStop( + context: Client, + resourceUri: string, + body: StopVirtualMachineOptions, + options: VirtualMachineInstancesStopOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller( + context, + _virtualMachineInstancesStopDeserialize, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _virtualMachineInstancesStopSend(context, resourceUri, body, options), + }, + ) as PollerLike, void>; +} + +export function _virtualMachineInstancesStartSend( + context: Client, + resourceUri: string, + options: VirtualMachineInstancesStartOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | VirtualMachineInstancesStart202Response + | VirtualMachineInstancesStartDefaultResponse + | VirtualMachineInstancesStartLogicalResponse +> { + return context + .path( + "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/start", + resourceUri, + ) + .post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _virtualMachineInstancesStartDeserialize( + result: + | VirtualMachineInstancesStart202Response + | VirtualMachineInstancesStartDefaultResponse + | VirtualMachineInstancesStartLogicalResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return; +} + +/** The operation to start a virtual machine instance. */ +export function virtualMachineInstancesStart( + context: Client, + resourceUri: string, + options: VirtualMachineInstancesStartOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller( + context, + _virtualMachineInstancesStartDeserialize, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _virtualMachineInstancesStartSend(context, resourceUri, options), + }, + ) as PollerLike, void>; +} + +export function _virtualMachineInstancesRestartSend( + context: Client, + resourceUri: string, + options: VirtualMachineInstancesRestartOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod< + | VirtualMachineInstancesRestart202Response + | VirtualMachineInstancesRestartDefaultResponse + | VirtualMachineInstancesRestartLogicalResponse +> { + return context + .path( + "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/restart", + resourceUri, + ) + .post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _virtualMachineInstancesRestartDeserialize( + result: + | VirtualMachineInstancesRestart202Response + | VirtualMachineInstancesRestartDefaultResponse + | VirtualMachineInstancesRestartLogicalResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return; +} + +/** The operation to restart a virtual machine instance. */ +export function virtualMachineInstancesRestart( + context: Client, + resourceUri: string, + options: VirtualMachineInstancesRestartOptionalParams = { + requestOptions: {}, + }, +): PollerLike, void> { + return getLongRunningPoller( + context, + _virtualMachineInstancesRestartDeserialize, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _virtualMachineInstancesRestartSend(context, resourceUri, options), + }, + ) as PollerLike, void>; +} + +export function _virtualMachineInstancesCreateCheckpointSend( + context: Client, + resourceUri: string, + body: VirtualMachineCreateCheckpoint, + options: VirtualMachineInstancesCreateCheckpointOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod< + | VirtualMachineInstancesCreateCheckpoint202Response + | VirtualMachineInstancesCreateCheckpointDefaultResponse + | VirtualMachineInstancesCreateCheckpointLogicalResponse +> { + return context + .path( + "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/createCheckpoint", + resourceUri, + ) + .post({ + ...operationOptionsToRequestParameters(options), + body: { name: body["name"], description: body["description"] }, + }); +} + +export async function _virtualMachineInstancesCreateCheckpointDeserialize( + result: + | VirtualMachineInstancesCreateCheckpoint202Response + | VirtualMachineInstancesCreateCheckpointDefaultResponse + | VirtualMachineInstancesCreateCheckpointLogicalResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return; +} + +/** Creates a checkpoint in virtual machine instance. */ +export function virtualMachineInstancesCreateCheckpoint( + context: Client, + resourceUri: string, + body: VirtualMachineCreateCheckpoint, + options: VirtualMachineInstancesCreateCheckpointOptionalParams = { + requestOptions: {}, + }, +): PollerLike, void> { + return getLongRunningPoller( + context, + _virtualMachineInstancesCreateCheckpointDeserialize, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _virtualMachineInstancesCreateCheckpointSend( + context, + resourceUri, + body, + options, + ), + }, + ) as PollerLike, void>; +} + +export function _virtualMachineInstancesDeleteCheckpointSend( + context: Client, + resourceUri: string, + body: VirtualMachineDeleteCheckpoint, + options: VirtualMachineInstancesDeleteCheckpointOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod< + | VirtualMachineInstancesDeleteCheckpoint202Response + | VirtualMachineInstancesDeleteCheckpointDefaultResponse + | VirtualMachineInstancesDeleteCheckpointLogicalResponse +> { + return context + .path( + "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/deleteCheckpoint", + resourceUri, + ) + .post({ + ...operationOptionsToRequestParameters(options), + body: { id: body["id"] }, + }); +} + +export async function _virtualMachineInstancesDeleteCheckpointDeserialize( + result: + | VirtualMachineInstancesDeleteCheckpoint202Response + | VirtualMachineInstancesDeleteCheckpointDefaultResponse + | VirtualMachineInstancesDeleteCheckpointLogicalResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return; +} + +/** Deletes a checkpoint in virtual machine instance. */ +export function virtualMachineInstancesDeleteCheckpoint( + context: Client, + resourceUri: string, + body: VirtualMachineDeleteCheckpoint, + options: VirtualMachineInstancesDeleteCheckpointOptionalParams = { + requestOptions: {}, + }, +): PollerLike, void> { + return getLongRunningPoller( + context, + _virtualMachineInstancesDeleteCheckpointDeserialize, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _virtualMachineInstancesDeleteCheckpointSend( + context, + resourceUri, + body, + options, + ), + }, + ) as PollerLike, void>; +} + +export function _virtualMachineInstancesRestoreCheckpointSend( + context: Client, + resourceUri: string, + body: VirtualMachineRestoreCheckpoint, + options: VirtualMachineInstancesRestoreCheckpointOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod< + | VirtualMachineInstancesRestoreCheckpoint202Response + | VirtualMachineInstancesRestoreCheckpointDefaultResponse + | VirtualMachineInstancesRestoreCheckpointLogicalResponse +> { + return context + .path( + "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/restoreCheckpoint", + resourceUri, + ) + .post({ + ...operationOptionsToRequestParameters(options), + body: { id: body["id"] }, + }); +} + +export async function _virtualMachineInstancesRestoreCheckpointDeserialize( + result: + | VirtualMachineInstancesRestoreCheckpoint202Response + | VirtualMachineInstancesRestoreCheckpointDefaultResponse + | VirtualMachineInstancesRestoreCheckpointLogicalResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return; +} + +/** Restores to a checkpoint in virtual machine instance. */ +export function virtualMachineInstancesRestoreCheckpoint( + context: Client, + resourceUri: string, + body: VirtualMachineRestoreCheckpoint, + options: VirtualMachineInstancesRestoreCheckpointOptionalParams = { + requestOptions: {}, + }, +): PollerLike, void> { + return getLongRunningPoller( + context, + _virtualMachineInstancesRestoreCheckpointDeserialize, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _virtualMachineInstancesRestoreCheckpointSend( + context, + resourceUri, + body, + options, + ), + }, + ) as PollerLike, void>; +} diff --git a/sdk/scvmm/arm-scvmm/src/api/virtualMachineTemplates/index.ts b/sdk/scvmm/arm-scvmm/src/api/virtualMachineTemplates/index.ts new file mode 100644 index 000000000000..bfa4450edd51 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/api/virtualMachineTemplates/index.ts @@ -0,0 +1,895 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { getLongRunningPoller } from "../pollingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; +import { + extendedLocationSerializer, + virtualMachineTemplatePropertiesSerializer, + VirtualMachineTemplate, + VirtualMachineTemplateTagsUpdate, + _VirtualMachineTemplateListResult, +} from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../models/pagingTypes.js"; +import { buildPagedAsyncIterator } from "../pagingHelpers.js"; +import { + isUnexpected, + ScVmmContext as Client, + VirtualMachineTemplatesCreateOrUpdate200Response, + VirtualMachineTemplatesCreateOrUpdate201Response, + VirtualMachineTemplatesCreateOrUpdateDefaultResponse, + VirtualMachineTemplatesCreateOrUpdateLogicalResponse, + VirtualMachineTemplatesDelete202Response, + VirtualMachineTemplatesDelete204Response, + VirtualMachineTemplatesDeleteDefaultResponse, + VirtualMachineTemplatesDeleteLogicalResponse, + VirtualMachineTemplatesGet200Response, + VirtualMachineTemplatesGetDefaultResponse, + VirtualMachineTemplatesListByResourceGroup200Response, + VirtualMachineTemplatesListByResourceGroupDefaultResponse, + VirtualMachineTemplatesListBySubscription200Response, + VirtualMachineTemplatesListBySubscriptionDefaultResponse, + VirtualMachineTemplatesUpdate200Response, + VirtualMachineTemplatesUpdate202Response, + VirtualMachineTemplatesUpdateDefaultResponse, + VirtualMachineTemplatesUpdateLogicalResponse, +} from "../../rest/index.js"; +import { + StreamableMethod, + operationOptionsToRequestParameters, + createRestError, +} from "@azure-rest/core-client"; +import { serializeRecord } from "../../helpers/serializerHelpers.js"; +import { + VirtualMachineTemplatesGetOptionalParams, + VirtualMachineTemplatesCreateOrUpdateOptionalParams, + VirtualMachineTemplatesUpdateOptionalParams, + VirtualMachineTemplatesDeleteOptionalParams, + VirtualMachineTemplatesListByResourceGroupOptionalParams, + VirtualMachineTemplatesListBySubscriptionOptionalParams, +} from "../../models/options.js"; + +export function _virtualMachineTemplatesGetSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + virtualMachineTemplateName: string, + options: VirtualMachineTemplatesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | VirtualMachineTemplatesGet200Response + | VirtualMachineTemplatesGetDefaultResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachineTemplates/{virtualMachineTemplateName}", + subscriptionId, + resourceGroupName, + virtualMachineTemplateName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _virtualMachineTemplatesGetDeserialize( + result: + | VirtualMachineTemplatesGet200Response + | VirtualMachineTemplatesGetDefaultResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return { + tags: result.body["tags"], + location: result.body["location"], + id: result.body["id"], + name: result.body["name"], + type: result.body["type"], + systemData: !result.body.systemData + ? undefined + : { + createdBy: result.body.systemData?.["createdBy"], + createdByType: result.body.systemData?.["createdByType"], + createdAt: + result.body.systemData?.["createdAt"] !== undefined + ? new Date(result.body.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: result.body.systemData?.["lastModifiedBy"], + lastModifiedByType: result.body.systemData?.["lastModifiedByType"], + lastModifiedAt: + result.body.systemData?.["lastModifiedAt"] !== undefined + ? new Date(result.body.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !result.body.properties + ? undefined + : { + inventoryItemId: result.body.properties?.["inventoryItemId"], + uuid: result.body.properties?.["uuid"], + vmmServerId: result.body.properties?.["vmmServerId"], + osType: result.body.properties?.["osType"], + osName: result.body.properties?.["osName"], + computerName: result.body.properties?.["computerName"], + memoryMB: result.body.properties?.["memoryMB"], + cpuCount: result.body.properties?.["cpuCount"], + limitCpuForMigration: + result.body.properties?.["limitCpuForMigration"], + dynamicMemoryEnabled: + result.body.properties?.["dynamicMemoryEnabled"], + isCustomizable: result.body.properties?.["isCustomizable"], + dynamicMemoryMaxMB: result.body.properties?.["dynamicMemoryMaxMB"], + dynamicMemoryMinMB: result.body.properties?.["dynamicMemoryMinMB"], + isHighlyAvailable: result.body.properties?.["isHighlyAvailable"], + generation: result.body.properties?.["generation"], + networkInterfaces: + result.body.properties?.["networkInterfaces"] === undefined + ? result.body.properties?.["networkInterfaces"] + : result.body.properties?.["networkInterfaces"].map((p) => { + return { + name: p["name"], + displayName: p["displayName"], + ipv4Addresses: p["ipv4Addresses"], + ipv6Addresses: p["ipv6Addresses"], + macAddress: p["macAddress"], + virtualNetworkId: p["virtualNetworkId"], + networkName: p["networkName"], + ipv4AddressType: p["ipv4AddressType"], + ipv6AddressType: p["ipv6AddressType"], + macAddressType: p["macAddressType"], + nicId: p["nicId"], + }; + }), + disks: + result.body.properties?.["disks"] === undefined + ? result.body.properties?.["disks"] + : result.body.properties?.["disks"].map((p) => { + return { + name: p["name"], + displayName: p["displayName"], + diskId: p["diskId"], + diskSizeGB: p["diskSizeGB"], + maxDiskSizeGB: p["maxDiskSizeGB"], + bus: p["bus"], + lun: p["lun"], + busType: p["busType"], + vhdType: p["vhdType"], + volumeType: p["volumeType"], + vhdFormatType: p["vhdFormatType"], + templateDiskId: p["templateDiskId"], + storageQosPolicy: !p.storageQoSPolicy + ? undefined + : { + name: p.storageQoSPolicy?.["name"], + id: p.storageQoSPolicy?.["id"], + }, + createDiffDisk: p["createDiffDisk"], + }; + }), + provisioningState: result.body.properties?.["provisioningState"], + }, + extendedLocation: { + type: result.body.extendedLocation["type"], + name: result.body.extendedLocation["name"], + }, + }; +} + +/** Implements VirtualMachineTemplate GET method. */ +export async function virtualMachineTemplatesGet( + context: Client, + subscriptionId: string, + resourceGroupName: string, + virtualMachineTemplateName: string, + options: VirtualMachineTemplatesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _virtualMachineTemplatesGetSend( + context, + subscriptionId, + resourceGroupName, + virtualMachineTemplateName, + options, + ); + return _virtualMachineTemplatesGetDeserialize(result); +} + +export function _virtualMachineTemplatesCreateOrUpdateSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + virtualMachineTemplateName: string, + resource: VirtualMachineTemplate, + options: VirtualMachineTemplatesCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod< + | VirtualMachineTemplatesCreateOrUpdate200Response + | VirtualMachineTemplatesCreateOrUpdate201Response + | VirtualMachineTemplatesCreateOrUpdateDefaultResponse + | VirtualMachineTemplatesCreateOrUpdateLogicalResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachineTemplates/{virtualMachineTemplateName}", + subscriptionId, + resourceGroupName, + virtualMachineTemplateName, + ) + .put({ + ...operationOptionsToRequestParameters(options), + body: { + tags: !resource.tags + ? resource.tags + : (serializeRecord(resource.tags as any) as any), + location: resource["location"], + properties: !resource.properties + ? resource.properties + : virtualMachineTemplatePropertiesSerializer(resource.properties), + extendedLocation: extendedLocationSerializer(resource.extendedLocation), + }, + }); +} + +export async function _virtualMachineTemplatesCreateOrUpdateDeserialize( + result: + | VirtualMachineTemplatesCreateOrUpdate200Response + | VirtualMachineTemplatesCreateOrUpdate201Response + | VirtualMachineTemplatesCreateOrUpdateDefaultResponse + | VirtualMachineTemplatesCreateOrUpdateLogicalResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + const res = + result as unknown as VirtualMachineTemplatesCreateOrUpdateLogicalResponse; + return { + tags: res.body["tags"], + location: res.body["location"], + id: res.body["id"], + name: res.body["name"], + type: res.body["type"], + systemData: !res.body.systemData + ? undefined + : { + createdBy: res.body.systemData?.["createdBy"], + createdByType: res.body.systemData?.["createdByType"], + createdAt: + res.body.systemData?.["createdAt"] !== undefined + ? new Date(res.body.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: res.body.systemData?.["lastModifiedBy"], + lastModifiedByType: res.body.systemData?.["lastModifiedByType"], + lastModifiedAt: + res.body.systemData?.["lastModifiedAt"] !== undefined + ? new Date(res.body.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !res.body.properties + ? undefined + : { + inventoryItemId: res.body.properties?.["inventoryItemId"], + uuid: res.body.properties?.["uuid"], + vmmServerId: res.body.properties?.["vmmServerId"], + osType: res.body.properties?.["osType"], + osName: res.body.properties?.["osName"], + computerName: res.body.properties?.["computerName"], + memoryMB: res.body.properties?.["memoryMB"], + cpuCount: res.body.properties?.["cpuCount"], + limitCpuForMigration: res.body.properties?.["limitCpuForMigration"], + dynamicMemoryEnabled: res.body.properties?.["dynamicMemoryEnabled"], + isCustomizable: res.body.properties?.["isCustomizable"], + dynamicMemoryMaxMB: res.body.properties?.["dynamicMemoryMaxMB"], + dynamicMemoryMinMB: res.body.properties?.["dynamicMemoryMinMB"], + isHighlyAvailable: res.body.properties?.["isHighlyAvailable"], + generation: res.body.properties?.["generation"], + networkInterfaces: + res.body.properties?.["networkInterfaces"] === undefined + ? res.body.properties?.["networkInterfaces"] + : res.body.properties?.["networkInterfaces"].map((p) => { + return { + name: p["name"], + displayName: p["displayName"], + ipv4Addresses: p["ipv4Addresses"], + ipv6Addresses: p["ipv6Addresses"], + macAddress: p["macAddress"], + virtualNetworkId: p["virtualNetworkId"], + networkName: p["networkName"], + ipv4AddressType: p["ipv4AddressType"], + ipv6AddressType: p["ipv6AddressType"], + macAddressType: p["macAddressType"], + nicId: p["nicId"], + }; + }), + disks: + res.body.properties?.["disks"] === undefined + ? res.body.properties?.["disks"] + : res.body.properties?.["disks"].map((p) => { + return { + name: p["name"], + displayName: p["displayName"], + diskId: p["diskId"], + diskSizeGB: p["diskSizeGB"], + maxDiskSizeGB: p["maxDiskSizeGB"], + bus: p["bus"], + lun: p["lun"], + busType: p["busType"], + vhdType: p["vhdType"], + volumeType: p["volumeType"], + vhdFormatType: p["vhdFormatType"], + templateDiskId: p["templateDiskId"], + storageQosPolicy: !p.storageQoSPolicy + ? undefined + : { + name: p.storageQoSPolicy?.["name"], + id: p.storageQoSPolicy?.["id"], + }, + createDiffDisk: p["createDiffDisk"], + }; + }), + provisioningState: res.body.properties?.["provisioningState"], + }, + extendedLocation: { + type: res.body.extendedLocation["type"], + name: res.body.extendedLocation["name"], + }, + }; +} + +/** Onboards the ScVmm VM Template as an Azure VM Template resource. */ +export function virtualMachineTemplatesCreateOrUpdate( + context: Client, + subscriptionId: string, + resourceGroupName: string, + virtualMachineTemplateName: string, + resource: VirtualMachineTemplate, + options: VirtualMachineTemplatesCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): PollerLike, VirtualMachineTemplate> { + return getLongRunningPoller( + context, + _virtualMachineTemplatesCreateOrUpdateDeserialize, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _virtualMachineTemplatesCreateOrUpdateSend( + context, + subscriptionId, + resourceGroupName, + virtualMachineTemplateName, + resource, + options, + ), + }, + ) as PollerLike< + OperationState, + VirtualMachineTemplate + >; +} + +export function _virtualMachineTemplatesUpdateSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + virtualMachineTemplateName: string, + properties: VirtualMachineTemplateTagsUpdate, + options: VirtualMachineTemplatesUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | VirtualMachineTemplatesUpdate200Response + | VirtualMachineTemplatesUpdate202Response + | VirtualMachineTemplatesUpdateDefaultResponse + | VirtualMachineTemplatesUpdateLogicalResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachineTemplates/{virtualMachineTemplateName}", + subscriptionId, + resourceGroupName, + virtualMachineTemplateName, + ) + .patch({ + ...operationOptionsToRequestParameters(options), + body: { + tags: !properties.tags + ? properties.tags + : (serializeRecord(properties.tags as any) as any), + }, + }); +} + +export async function _virtualMachineTemplatesUpdateDeserialize( + result: + | VirtualMachineTemplatesUpdate200Response + | VirtualMachineTemplatesUpdate202Response + | VirtualMachineTemplatesUpdateDefaultResponse + | VirtualMachineTemplatesUpdateLogicalResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + const res = result as unknown as VirtualMachineTemplatesUpdateLogicalResponse; + return { + tags: res.body["tags"], + location: res.body["location"], + id: res.body["id"], + name: res.body["name"], + type: res.body["type"], + systemData: !res.body.systemData + ? undefined + : { + createdBy: res.body.systemData?.["createdBy"], + createdByType: res.body.systemData?.["createdByType"], + createdAt: + res.body.systemData?.["createdAt"] !== undefined + ? new Date(res.body.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: res.body.systemData?.["lastModifiedBy"], + lastModifiedByType: res.body.systemData?.["lastModifiedByType"], + lastModifiedAt: + res.body.systemData?.["lastModifiedAt"] !== undefined + ? new Date(res.body.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !res.body.properties + ? undefined + : { + inventoryItemId: res.body.properties?.["inventoryItemId"], + uuid: res.body.properties?.["uuid"], + vmmServerId: res.body.properties?.["vmmServerId"], + osType: res.body.properties?.["osType"], + osName: res.body.properties?.["osName"], + computerName: res.body.properties?.["computerName"], + memoryMB: res.body.properties?.["memoryMB"], + cpuCount: res.body.properties?.["cpuCount"], + limitCpuForMigration: res.body.properties?.["limitCpuForMigration"], + dynamicMemoryEnabled: res.body.properties?.["dynamicMemoryEnabled"], + isCustomizable: res.body.properties?.["isCustomizable"], + dynamicMemoryMaxMB: res.body.properties?.["dynamicMemoryMaxMB"], + dynamicMemoryMinMB: res.body.properties?.["dynamicMemoryMinMB"], + isHighlyAvailable: res.body.properties?.["isHighlyAvailable"], + generation: res.body.properties?.["generation"], + networkInterfaces: + res.body.properties?.["networkInterfaces"] === undefined + ? res.body.properties?.["networkInterfaces"] + : res.body.properties?.["networkInterfaces"].map((p) => { + return { + name: p["name"], + displayName: p["displayName"], + ipv4Addresses: p["ipv4Addresses"], + ipv6Addresses: p["ipv6Addresses"], + macAddress: p["macAddress"], + virtualNetworkId: p["virtualNetworkId"], + networkName: p["networkName"], + ipv4AddressType: p["ipv4AddressType"], + ipv6AddressType: p["ipv6AddressType"], + macAddressType: p["macAddressType"], + nicId: p["nicId"], + }; + }), + disks: + res.body.properties?.["disks"] === undefined + ? res.body.properties?.["disks"] + : res.body.properties?.["disks"].map((p) => { + return { + name: p["name"], + displayName: p["displayName"], + diskId: p["diskId"], + diskSizeGB: p["diskSizeGB"], + maxDiskSizeGB: p["maxDiskSizeGB"], + bus: p["bus"], + lun: p["lun"], + busType: p["busType"], + vhdType: p["vhdType"], + volumeType: p["volumeType"], + vhdFormatType: p["vhdFormatType"], + templateDiskId: p["templateDiskId"], + storageQosPolicy: !p.storageQoSPolicy + ? undefined + : { + name: p.storageQoSPolicy?.["name"], + id: p.storageQoSPolicy?.["id"], + }, + createDiffDisk: p["createDiffDisk"], + }; + }), + provisioningState: res.body.properties?.["provisioningState"], + }, + extendedLocation: { + type: res.body.extendedLocation["type"], + name: res.body.extendedLocation["name"], + }, + }; +} + +/** Updates the VirtualMachineTemplate resource. */ +export function virtualMachineTemplatesUpdate( + context: Client, + subscriptionId: string, + resourceGroupName: string, + virtualMachineTemplateName: string, + properties: VirtualMachineTemplateTagsUpdate, + options: VirtualMachineTemplatesUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, VirtualMachineTemplate> { + return getLongRunningPoller( + context, + _virtualMachineTemplatesUpdateDeserialize, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _virtualMachineTemplatesUpdateSend( + context, + subscriptionId, + resourceGroupName, + virtualMachineTemplateName, + properties, + options, + ), + }, + ) as PollerLike< + OperationState, + VirtualMachineTemplate + >; +} + +export function _virtualMachineTemplatesDeleteSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + virtualMachineTemplateName: string, + options: VirtualMachineTemplatesDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | VirtualMachineTemplatesDelete202Response + | VirtualMachineTemplatesDelete204Response + | VirtualMachineTemplatesDeleteDefaultResponse + | VirtualMachineTemplatesDeleteLogicalResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachineTemplates/{virtualMachineTemplateName}", + subscriptionId, + resourceGroupName, + virtualMachineTemplateName, + ) + .delete({ + ...operationOptionsToRequestParameters(options), + queryParameters: { force: options?.force }, + }); +} + +export async function _virtualMachineTemplatesDeleteDeserialize( + result: + | VirtualMachineTemplatesDelete202Response + | VirtualMachineTemplatesDelete204Response + | VirtualMachineTemplatesDeleteDefaultResponse + | VirtualMachineTemplatesDeleteLogicalResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return; +} + +/** Deregisters the ScVmm VM Template from Azure. */ +export function virtualMachineTemplatesDelete( + context: Client, + subscriptionId: string, + resourceGroupName: string, + virtualMachineTemplateName: string, + options: VirtualMachineTemplatesDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller( + context, + _virtualMachineTemplatesDeleteDeserialize, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _virtualMachineTemplatesDeleteSend( + context, + subscriptionId, + resourceGroupName, + virtualMachineTemplateName, + options, + ), + }, + ) as PollerLike, void>; +} + +export function _virtualMachineTemplatesListByResourceGroupSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + options: VirtualMachineTemplatesListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod< + | VirtualMachineTemplatesListByResourceGroup200Response + | VirtualMachineTemplatesListByResourceGroupDefaultResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachineTemplates", + subscriptionId, + resourceGroupName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _virtualMachineTemplatesListByResourceGroupDeserialize( + result: + | VirtualMachineTemplatesListByResourceGroup200Response + | VirtualMachineTemplatesListByResourceGroupDefaultResponse, +): Promise<_VirtualMachineTemplateListResult> { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return { + value: result.body["value"].map((p) => { + return { + tags: p["tags"], + location: p["location"], + id: p["id"], + name: p["name"], + type: p["type"], + systemData: !p.systemData + ? undefined + : { + createdBy: p.systemData?.["createdBy"], + createdByType: p.systemData?.["createdByType"], + createdAt: + p.systemData?.["createdAt"] !== undefined + ? new Date(p.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: p.systemData?.["lastModifiedBy"], + lastModifiedByType: p.systemData?.["lastModifiedByType"], + lastModifiedAt: + p.systemData?.["lastModifiedAt"] !== undefined + ? new Date(p.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !p.properties + ? undefined + : { + inventoryItemId: p.properties?.["inventoryItemId"], + uuid: p.properties?.["uuid"], + vmmServerId: p.properties?.["vmmServerId"], + osType: p.properties?.["osType"], + osName: p.properties?.["osName"], + computerName: p.properties?.["computerName"], + memoryMB: p.properties?.["memoryMB"], + cpuCount: p.properties?.["cpuCount"], + limitCpuForMigration: p.properties?.["limitCpuForMigration"], + dynamicMemoryEnabled: p.properties?.["dynamicMemoryEnabled"], + isCustomizable: p.properties?.["isCustomizable"], + dynamicMemoryMaxMB: p.properties?.["dynamicMemoryMaxMB"], + dynamicMemoryMinMB: p.properties?.["dynamicMemoryMinMB"], + isHighlyAvailable: p.properties?.["isHighlyAvailable"], + generation: p.properties?.["generation"], + networkInterfaces: + p.properties?.["networkInterfaces"] === undefined + ? p.properties?.["networkInterfaces"] + : p.properties?.["networkInterfaces"].map((p) => { + return { + name: p["name"], + displayName: p["displayName"], + ipv4Addresses: p["ipv4Addresses"], + ipv6Addresses: p["ipv6Addresses"], + macAddress: p["macAddress"], + virtualNetworkId: p["virtualNetworkId"], + networkName: p["networkName"], + ipv4AddressType: p["ipv4AddressType"], + ipv6AddressType: p["ipv6AddressType"], + macAddressType: p["macAddressType"], + nicId: p["nicId"], + }; + }), + disks: + p.properties?.["disks"] === undefined + ? p.properties?.["disks"] + : p.properties?.["disks"].map((p) => { + return { + name: p["name"], + displayName: p["displayName"], + diskId: p["diskId"], + diskSizeGB: p["diskSizeGB"], + maxDiskSizeGB: p["maxDiskSizeGB"], + bus: p["bus"], + lun: p["lun"], + busType: p["busType"], + vhdType: p["vhdType"], + volumeType: p["volumeType"], + vhdFormatType: p["vhdFormatType"], + templateDiskId: p["templateDiskId"], + storageQosPolicy: !p.storageQoSPolicy + ? undefined + : { + name: p.storageQoSPolicy?.["name"], + id: p.storageQoSPolicy?.["id"], + }, + createDiffDisk: p["createDiffDisk"], + }; + }), + provisioningState: p.properties?.["provisioningState"], + }, + extendedLocation: { + type: p.extendedLocation["type"], + name: p.extendedLocation["name"], + }, + }; + }), + nextLink: result.body["nextLink"], + }; +} + +/** List of VirtualMachineTemplates in a resource group. */ +export function virtualMachineTemplatesListByResourceGroup( + context: Client, + subscriptionId: string, + resourceGroupName: string, + options: VirtualMachineTemplatesListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _virtualMachineTemplatesListByResourceGroupSend( + context, + subscriptionId, + resourceGroupName, + options, + ), + _virtualMachineTemplatesListByResourceGroupDeserialize, + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _virtualMachineTemplatesListBySubscriptionSend( + context: Client, + subscriptionId: string, + options: VirtualMachineTemplatesListBySubscriptionOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod< + | VirtualMachineTemplatesListBySubscription200Response + | VirtualMachineTemplatesListBySubscriptionDefaultResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/virtualMachineTemplates", + subscriptionId, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _virtualMachineTemplatesListBySubscriptionDeserialize( + result: + | VirtualMachineTemplatesListBySubscription200Response + | VirtualMachineTemplatesListBySubscriptionDefaultResponse, +): Promise<_VirtualMachineTemplateListResult> { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return { + value: result.body["value"].map((p) => { + return { + tags: p["tags"], + location: p["location"], + id: p["id"], + name: p["name"], + type: p["type"], + systemData: !p.systemData + ? undefined + : { + createdBy: p.systemData?.["createdBy"], + createdByType: p.systemData?.["createdByType"], + createdAt: + p.systemData?.["createdAt"] !== undefined + ? new Date(p.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: p.systemData?.["lastModifiedBy"], + lastModifiedByType: p.systemData?.["lastModifiedByType"], + lastModifiedAt: + p.systemData?.["lastModifiedAt"] !== undefined + ? new Date(p.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !p.properties + ? undefined + : { + inventoryItemId: p.properties?.["inventoryItemId"], + uuid: p.properties?.["uuid"], + vmmServerId: p.properties?.["vmmServerId"], + osType: p.properties?.["osType"], + osName: p.properties?.["osName"], + computerName: p.properties?.["computerName"], + memoryMB: p.properties?.["memoryMB"], + cpuCount: p.properties?.["cpuCount"], + limitCpuForMigration: p.properties?.["limitCpuForMigration"], + dynamicMemoryEnabled: p.properties?.["dynamicMemoryEnabled"], + isCustomizable: p.properties?.["isCustomizable"], + dynamicMemoryMaxMB: p.properties?.["dynamicMemoryMaxMB"], + dynamicMemoryMinMB: p.properties?.["dynamicMemoryMinMB"], + isHighlyAvailable: p.properties?.["isHighlyAvailable"], + generation: p.properties?.["generation"], + networkInterfaces: + p.properties?.["networkInterfaces"] === undefined + ? p.properties?.["networkInterfaces"] + : p.properties?.["networkInterfaces"].map((p) => { + return { + name: p["name"], + displayName: p["displayName"], + ipv4Addresses: p["ipv4Addresses"], + ipv6Addresses: p["ipv6Addresses"], + macAddress: p["macAddress"], + virtualNetworkId: p["virtualNetworkId"], + networkName: p["networkName"], + ipv4AddressType: p["ipv4AddressType"], + ipv6AddressType: p["ipv6AddressType"], + macAddressType: p["macAddressType"], + nicId: p["nicId"], + }; + }), + disks: + p.properties?.["disks"] === undefined + ? p.properties?.["disks"] + : p.properties?.["disks"].map((p) => { + return { + name: p["name"], + displayName: p["displayName"], + diskId: p["diskId"], + diskSizeGB: p["diskSizeGB"], + maxDiskSizeGB: p["maxDiskSizeGB"], + bus: p["bus"], + lun: p["lun"], + busType: p["busType"], + vhdType: p["vhdType"], + volumeType: p["volumeType"], + vhdFormatType: p["vhdFormatType"], + templateDiskId: p["templateDiskId"], + storageQosPolicy: !p.storageQoSPolicy + ? undefined + : { + name: p.storageQoSPolicy?.["name"], + id: p.storageQoSPolicy?.["id"], + }, + createDiffDisk: p["createDiffDisk"], + }; + }), + provisioningState: p.properties?.["provisioningState"], + }, + extendedLocation: { + type: p.extendedLocation["type"], + name: p.extendedLocation["name"], + }, + }; + }), + nextLink: result.body["nextLink"], + }; +} + +/** List of VirtualMachineTemplates in a subscription. */ +export function virtualMachineTemplatesListBySubscription( + context: Client, + subscriptionId: string, + options: VirtualMachineTemplatesListBySubscriptionOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _virtualMachineTemplatesListBySubscriptionSend( + context, + subscriptionId, + options, + ), + _virtualMachineTemplatesListBySubscriptionDeserialize, + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/scvmm/arm-scvmm/src/api/virtualNetworks/index.ts b/sdk/scvmm/arm-scvmm/src/api/virtualNetworks/index.ts new file mode 100644 index 000000000000..8bd0adea60c4 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/api/virtualNetworks/index.ts @@ -0,0 +1,592 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { getLongRunningPoller } from "../pollingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; +import { + extendedLocationSerializer, + virtualNetworkPropertiesSerializer, + VirtualNetwork, + VirtualNetworkTagsUpdate, + _VirtualNetworkListResult, +} from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../models/pagingTypes.js"; +import { buildPagedAsyncIterator } from "../pagingHelpers.js"; +import { + isUnexpected, + ScVmmContext as Client, + VirtualNetworksCreateOrUpdate200Response, + VirtualNetworksCreateOrUpdate201Response, + VirtualNetworksCreateOrUpdateDefaultResponse, + VirtualNetworksCreateOrUpdateLogicalResponse, + VirtualNetworksDelete202Response, + VirtualNetworksDelete204Response, + VirtualNetworksDeleteDefaultResponse, + VirtualNetworksDeleteLogicalResponse, + VirtualNetworksGet200Response, + VirtualNetworksGetDefaultResponse, + VirtualNetworksListByResourceGroup200Response, + VirtualNetworksListByResourceGroupDefaultResponse, + VirtualNetworksListBySubscription200Response, + VirtualNetworksListBySubscriptionDefaultResponse, + VirtualNetworksUpdate200Response, + VirtualNetworksUpdate202Response, + VirtualNetworksUpdateDefaultResponse, + VirtualNetworksUpdateLogicalResponse, +} from "../../rest/index.js"; +import { + StreamableMethod, + operationOptionsToRequestParameters, + createRestError, +} from "@azure-rest/core-client"; +import { serializeRecord } from "../../helpers/serializerHelpers.js"; +import { + VirtualNetworksGetOptionalParams, + VirtualNetworksCreateOrUpdateOptionalParams, + VirtualNetworksUpdateOptionalParams, + VirtualNetworksDeleteOptionalParams, + VirtualNetworksListByResourceGroupOptionalParams, + VirtualNetworksListBySubscriptionOptionalParams, +} from "../../models/options.js"; + +export function _virtualNetworksGetSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + virtualNetworkName: string, + options: VirtualNetworksGetOptionalParams = { requestOptions: {} }, +): StreamableMethod< + VirtualNetworksGet200Response | VirtualNetworksGetDefaultResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualNetworks/{virtualNetworkName}", + subscriptionId, + resourceGroupName, + virtualNetworkName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _virtualNetworksGetDeserialize( + result: VirtualNetworksGet200Response | VirtualNetworksGetDefaultResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return { + tags: result.body["tags"], + location: result.body["location"], + id: result.body["id"], + name: result.body["name"], + type: result.body["type"], + systemData: !result.body.systemData + ? undefined + : { + createdBy: result.body.systemData?.["createdBy"], + createdByType: result.body.systemData?.["createdByType"], + createdAt: + result.body.systemData?.["createdAt"] !== undefined + ? new Date(result.body.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: result.body.systemData?.["lastModifiedBy"], + lastModifiedByType: result.body.systemData?.["lastModifiedByType"], + lastModifiedAt: + result.body.systemData?.["lastModifiedAt"] !== undefined + ? new Date(result.body.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !result.body.properties + ? undefined + : { + inventoryItemId: result.body.properties?.["inventoryItemId"], + uuid: result.body.properties?.["uuid"], + vmmServerId: result.body.properties?.["vmmServerId"], + networkName: result.body.properties?.["networkName"], + provisioningState: result.body.properties?.["provisioningState"], + }, + extendedLocation: { + type: result.body.extendedLocation["type"], + name: result.body.extendedLocation["name"], + }, + }; +} + +/** Implements VirtualNetwork GET method. */ +export async function virtualNetworksGet( + context: Client, + subscriptionId: string, + resourceGroupName: string, + virtualNetworkName: string, + options: VirtualNetworksGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _virtualNetworksGetSend( + context, + subscriptionId, + resourceGroupName, + virtualNetworkName, + options, + ); + return _virtualNetworksGetDeserialize(result); +} + +export function _virtualNetworksCreateOrUpdateSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + virtualNetworkName: string, + resource: VirtualNetwork, + options: VirtualNetworksCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | VirtualNetworksCreateOrUpdate200Response + | VirtualNetworksCreateOrUpdate201Response + | VirtualNetworksCreateOrUpdateDefaultResponse + | VirtualNetworksCreateOrUpdateLogicalResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualNetworks/{virtualNetworkName}", + subscriptionId, + resourceGroupName, + virtualNetworkName, + ) + .put({ + ...operationOptionsToRequestParameters(options), + body: { + tags: !resource.tags + ? resource.tags + : (serializeRecord(resource.tags as any) as any), + location: resource["location"], + properties: !resource.properties + ? resource.properties + : virtualNetworkPropertiesSerializer(resource.properties), + extendedLocation: extendedLocationSerializer(resource.extendedLocation), + }, + }); +} + +export async function _virtualNetworksCreateOrUpdateDeserialize( + result: + | VirtualNetworksCreateOrUpdate200Response + | VirtualNetworksCreateOrUpdate201Response + | VirtualNetworksCreateOrUpdateDefaultResponse + | VirtualNetworksCreateOrUpdateLogicalResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + const res = result as unknown as VirtualNetworksCreateOrUpdateLogicalResponse; + return { + tags: res.body["tags"], + location: res.body["location"], + id: res.body["id"], + name: res.body["name"], + type: res.body["type"], + systemData: !res.body.systemData + ? undefined + : { + createdBy: res.body.systemData?.["createdBy"], + createdByType: res.body.systemData?.["createdByType"], + createdAt: + res.body.systemData?.["createdAt"] !== undefined + ? new Date(res.body.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: res.body.systemData?.["lastModifiedBy"], + lastModifiedByType: res.body.systemData?.["lastModifiedByType"], + lastModifiedAt: + res.body.systemData?.["lastModifiedAt"] !== undefined + ? new Date(res.body.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !res.body.properties + ? undefined + : { + inventoryItemId: res.body.properties?.["inventoryItemId"], + uuid: res.body.properties?.["uuid"], + vmmServerId: res.body.properties?.["vmmServerId"], + networkName: res.body.properties?.["networkName"], + provisioningState: res.body.properties?.["provisioningState"], + }, + extendedLocation: { + type: res.body.extendedLocation["type"], + name: res.body.extendedLocation["name"], + }, + }; +} + +/** Onboards the ScVmm virtual network as an Azure virtual network resource. */ +export function virtualNetworksCreateOrUpdate( + context: Client, + subscriptionId: string, + resourceGroupName: string, + virtualNetworkName: string, + resource: VirtualNetwork, + options: VirtualNetworksCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, VirtualNetwork> { + return getLongRunningPoller( + context, + _virtualNetworksCreateOrUpdateDeserialize, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _virtualNetworksCreateOrUpdateSend( + context, + subscriptionId, + resourceGroupName, + virtualNetworkName, + resource, + options, + ), + }, + ) as PollerLike, VirtualNetwork>; +} + +export function _virtualNetworksUpdateSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + virtualNetworkName: string, + properties: VirtualNetworkTagsUpdate, + options: VirtualNetworksUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | VirtualNetworksUpdate200Response + | VirtualNetworksUpdate202Response + | VirtualNetworksUpdateDefaultResponse + | VirtualNetworksUpdateLogicalResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualNetworks/{virtualNetworkName}", + subscriptionId, + resourceGroupName, + virtualNetworkName, + ) + .patch({ + ...operationOptionsToRequestParameters(options), + body: { + tags: !properties.tags + ? properties.tags + : (serializeRecord(properties.tags as any) as any), + }, + }); +} + +export async function _virtualNetworksUpdateDeserialize( + result: + | VirtualNetworksUpdate200Response + | VirtualNetworksUpdate202Response + | VirtualNetworksUpdateDefaultResponse + | VirtualNetworksUpdateLogicalResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + const res = result as unknown as VirtualNetworksUpdateLogicalResponse; + return { + tags: res.body["tags"], + location: res.body["location"], + id: res.body["id"], + name: res.body["name"], + type: res.body["type"], + systemData: !res.body.systemData + ? undefined + : { + createdBy: res.body.systemData?.["createdBy"], + createdByType: res.body.systemData?.["createdByType"], + createdAt: + res.body.systemData?.["createdAt"] !== undefined + ? new Date(res.body.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: res.body.systemData?.["lastModifiedBy"], + lastModifiedByType: res.body.systemData?.["lastModifiedByType"], + lastModifiedAt: + res.body.systemData?.["lastModifiedAt"] !== undefined + ? new Date(res.body.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !res.body.properties + ? undefined + : { + inventoryItemId: res.body.properties?.["inventoryItemId"], + uuid: res.body.properties?.["uuid"], + vmmServerId: res.body.properties?.["vmmServerId"], + networkName: res.body.properties?.["networkName"], + provisioningState: res.body.properties?.["provisioningState"], + }, + extendedLocation: { + type: res.body.extendedLocation["type"], + name: res.body.extendedLocation["name"], + }, + }; +} + +/** Updates the VirtualNetworks resource. */ +export function virtualNetworksUpdate( + context: Client, + subscriptionId: string, + resourceGroupName: string, + virtualNetworkName: string, + properties: VirtualNetworkTagsUpdate, + options: VirtualNetworksUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, VirtualNetwork> { + return getLongRunningPoller(context, _virtualNetworksUpdateDeserialize, { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _virtualNetworksUpdateSend( + context, + subscriptionId, + resourceGroupName, + virtualNetworkName, + properties, + options, + ), + }) as PollerLike, VirtualNetwork>; +} + +export function _virtualNetworksDeleteSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + virtualNetworkName: string, + options: VirtualNetworksDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | VirtualNetworksDelete202Response + | VirtualNetworksDelete204Response + | VirtualNetworksDeleteDefaultResponse + | VirtualNetworksDeleteLogicalResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualNetworks/{virtualNetworkName}", + subscriptionId, + resourceGroupName, + virtualNetworkName, + ) + .delete({ + ...operationOptionsToRequestParameters(options), + queryParameters: { force: options?.force }, + }); +} + +export async function _virtualNetworksDeleteDeserialize( + result: + | VirtualNetworksDelete202Response + | VirtualNetworksDelete204Response + | VirtualNetworksDeleteDefaultResponse + | VirtualNetworksDeleteLogicalResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return; +} + +/** Deregisters the ScVmm virtual network from Azure. */ +export function virtualNetworksDelete( + context: Client, + subscriptionId: string, + resourceGroupName: string, + virtualNetworkName: string, + options: VirtualNetworksDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _virtualNetworksDeleteDeserialize, { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _virtualNetworksDeleteSend( + context, + subscriptionId, + resourceGroupName, + virtualNetworkName, + options, + ), + }) as PollerLike, void>; +} + +export function _virtualNetworksListByResourceGroupSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + options: VirtualNetworksListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod< + | VirtualNetworksListByResourceGroup200Response + | VirtualNetworksListByResourceGroupDefaultResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualNetworks", + subscriptionId, + resourceGroupName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _virtualNetworksListByResourceGroupDeserialize( + result: + | VirtualNetworksListByResourceGroup200Response + | VirtualNetworksListByResourceGroupDefaultResponse, +): Promise<_VirtualNetworkListResult> { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return { + value: result.body["value"].map((p) => { + return { + tags: p["tags"], + location: p["location"], + id: p["id"], + name: p["name"], + type: p["type"], + systemData: !p.systemData + ? undefined + : { + createdBy: p.systemData?.["createdBy"], + createdByType: p.systemData?.["createdByType"], + createdAt: + p.systemData?.["createdAt"] !== undefined + ? new Date(p.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: p.systemData?.["lastModifiedBy"], + lastModifiedByType: p.systemData?.["lastModifiedByType"], + lastModifiedAt: + p.systemData?.["lastModifiedAt"] !== undefined + ? new Date(p.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !p.properties + ? undefined + : { + inventoryItemId: p.properties?.["inventoryItemId"], + uuid: p.properties?.["uuid"], + vmmServerId: p.properties?.["vmmServerId"], + networkName: p.properties?.["networkName"], + provisioningState: p.properties?.["provisioningState"], + }, + extendedLocation: { + type: p.extendedLocation["type"], + name: p.extendedLocation["name"], + }, + }; + }), + nextLink: result.body["nextLink"], + }; +} + +/** List of VirtualNetworks in a resource group. */ +export function virtualNetworksListByResourceGroup( + context: Client, + subscriptionId: string, + resourceGroupName: string, + options: VirtualNetworksListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _virtualNetworksListByResourceGroupSend( + context, + subscriptionId, + resourceGroupName, + options, + ), + _virtualNetworksListByResourceGroupDeserialize, + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _virtualNetworksListBySubscriptionSend( + context: Client, + subscriptionId: string, + options: VirtualNetworksListBySubscriptionOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod< + | VirtualNetworksListBySubscription200Response + | VirtualNetworksListBySubscriptionDefaultResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/virtualNetworks", + subscriptionId, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _virtualNetworksListBySubscriptionDeserialize( + result: + | VirtualNetworksListBySubscription200Response + | VirtualNetworksListBySubscriptionDefaultResponse, +): Promise<_VirtualNetworkListResult> { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return { + value: result.body["value"].map((p) => { + return { + tags: p["tags"], + location: p["location"], + id: p["id"], + name: p["name"], + type: p["type"], + systemData: !p.systemData + ? undefined + : { + createdBy: p.systemData?.["createdBy"], + createdByType: p.systemData?.["createdByType"], + createdAt: + p.systemData?.["createdAt"] !== undefined + ? new Date(p.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: p.systemData?.["lastModifiedBy"], + lastModifiedByType: p.systemData?.["lastModifiedByType"], + lastModifiedAt: + p.systemData?.["lastModifiedAt"] !== undefined + ? new Date(p.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !p.properties + ? undefined + : { + inventoryItemId: p.properties?.["inventoryItemId"], + uuid: p.properties?.["uuid"], + vmmServerId: p.properties?.["vmmServerId"], + networkName: p.properties?.["networkName"], + provisioningState: p.properties?.["provisioningState"], + }, + extendedLocation: { + type: p.extendedLocation["type"], + name: p.extendedLocation["name"], + }, + }; + }), + nextLink: result.body["nextLink"], + }; +} + +/** List of VirtualNetworks in a subscription. */ +export function virtualNetworksListBySubscription( + context: Client, + subscriptionId: string, + options: VirtualNetworksListBySubscriptionOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _virtualNetworksListBySubscriptionSend(context, subscriptionId, options), + _virtualNetworksListBySubscriptionDeserialize, + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/scvmm/arm-scvmm/src/api/vmInstanceHybridIdentityMetadatas/index.ts b/sdk/scvmm/arm-scvmm/src/api/vmInstanceHybridIdentityMetadatas/index.ts new file mode 100644 index 000000000000..f74657ece6e1 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/api/vmInstanceHybridIdentityMetadatas/index.ts @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { + VmInstanceHybridIdentityMetadata, + _VmInstanceHybridIdentityMetadataListResult, +} from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../models/pagingTypes.js"; +import { buildPagedAsyncIterator } from "../pagingHelpers.js"; +import { + isUnexpected, + ScVmmContext as Client, + VmInstanceHybridIdentityMetadatasGet200Response, + VmInstanceHybridIdentityMetadatasGetDefaultResponse, + VmInstanceHybridIdentityMetadatasListByVirtualMachineInstance200Response, + VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceDefaultResponse, +} from "../../rest/index.js"; +import { + StreamableMethod, + operationOptionsToRequestParameters, + createRestError, +} from "@azure-rest/core-client"; +import { + VmInstanceHybridIdentityMetadatasGetOptionalParams, + VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceOptionalParams, +} from "../../models/options.js"; + +export function _vmInstanceHybridIdentityMetadatasGetSend( + context: Client, + resourceUri: string, + options: VmInstanceHybridIdentityMetadatasGetOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod< + | VmInstanceHybridIdentityMetadatasGet200Response + | VmInstanceHybridIdentityMetadatasGetDefaultResponse +> { + return context + .path( + "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata/default", + resourceUri, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _vmInstanceHybridIdentityMetadatasGetDeserialize( + result: + | VmInstanceHybridIdentityMetadatasGet200Response + | VmInstanceHybridIdentityMetadatasGetDefaultResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return { + id: result.body["id"], + name: result.body["name"], + type: result.body["type"], + systemData: !result.body.systemData + ? undefined + : { + createdBy: result.body.systemData?.["createdBy"], + createdByType: result.body.systemData?.["createdByType"], + createdAt: + result.body.systemData?.["createdAt"] !== undefined + ? new Date(result.body.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: result.body.systemData?.["lastModifiedBy"], + lastModifiedByType: result.body.systemData?.["lastModifiedByType"], + lastModifiedAt: + result.body.systemData?.["lastModifiedAt"] !== undefined + ? new Date(result.body.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !result.body.properties + ? undefined + : { + resourceUid: result.body.properties?.["resourceUid"], + publicKey: result.body.properties?.["publicKey"], + provisioningState: result.body.properties?.["provisioningState"], + }, + }; +} + +/** Implements HybridIdentityMetadata GET method. */ +export async function vmInstanceHybridIdentityMetadatasGet( + context: Client, + resourceUri: string, + options: VmInstanceHybridIdentityMetadatasGetOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _vmInstanceHybridIdentityMetadatasGetSend( + context, + resourceUri, + options, + ); + return _vmInstanceHybridIdentityMetadatasGetDeserialize(result); +} + +export function _vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceSend( + context: Client, + resourceUri: string, + options: VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod< + | VmInstanceHybridIdentityMetadatasListByVirtualMachineInstance200Response + | VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceDefaultResponse +> { + return context + .path( + "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata", + resourceUri, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceDeserialize( + result: + | VmInstanceHybridIdentityMetadatasListByVirtualMachineInstance200Response + | VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceDefaultResponse, +): Promise<_VmInstanceHybridIdentityMetadataListResult> { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return { + value: result.body["value"].map((p) => { + return { + id: p["id"], + name: p["name"], + type: p["type"], + systemData: !p.systemData + ? undefined + : { + createdBy: p.systemData?.["createdBy"], + createdByType: p.systemData?.["createdByType"], + createdAt: + p.systemData?.["createdAt"] !== undefined + ? new Date(p.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: p.systemData?.["lastModifiedBy"], + lastModifiedByType: p.systemData?.["lastModifiedByType"], + lastModifiedAt: + p.systemData?.["lastModifiedAt"] !== undefined + ? new Date(p.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !p.properties + ? undefined + : { + resourceUid: p.properties?.["resourceUid"], + publicKey: p.properties?.["publicKey"], + provisioningState: p.properties?.["provisioningState"], + }, + }; + }), + nextLink: result.body["nextLink"], + }; +} + +/** Returns the list of HybridIdentityMetadata of the given VM. */ +export function vmInstanceHybridIdentityMetadatasListByVirtualMachineInstance( + context: Client, + resourceUri: string, + options: VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceSend( + context, + resourceUri, + options, + ), + _vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceDeserialize, + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/scvmm/arm-scvmm/src/api/vmmServers/index.ts b/sdk/scvmm/arm-scvmm/src/api/vmmServers/index.ts new file mode 100644 index 000000000000..a61751c538a8 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/api/vmmServers/index.ts @@ -0,0 +1,617 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { getLongRunningPoller } from "../pollingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; +import { + extendedLocationSerializer, + vmmServerPropertiesSerializer, + VmmServer, + VmmServerTagsUpdate, + _VmmServerListResult, +} from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../models/pagingTypes.js"; +import { buildPagedAsyncIterator } from "../pagingHelpers.js"; +import { + isUnexpected, + ScVmmContext as Client, + VmmServersCreateOrUpdate200Response, + VmmServersCreateOrUpdate201Response, + VmmServersCreateOrUpdateDefaultResponse, + VmmServersCreateOrUpdateLogicalResponse, + VmmServersDelete202Response, + VmmServersDelete204Response, + VmmServersDeleteDefaultResponse, + VmmServersDeleteLogicalResponse, + VmmServersGet200Response, + VmmServersGetDefaultResponse, + VmmServersListByResourceGroup200Response, + VmmServersListByResourceGroupDefaultResponse, + VmmServersListBySubscription200Response, + VmmServersListBySubscriptionDefaultResponse, + VmmServersUpdate200Response, + VmmServersUpdate202Response, + VmmServersUpdateDefaultResponse, + VmmServersUpdateLogicalResponse, +} from "../../rest/index.js"; +import { + StreamableMethod, + operationOptionsToRequestParameters, + createRestError, +} from "@azure-rest/core-client"; +import { serializeRecord } from "../../helpers/serializerHelpers.js"; +import { + VmmServersGetOptionalParams, + VmmServersCreateOrUpdateOptionalParams, + VmmServersUpdateOptionalParams, + VmmServersDeleteOptionalParams, + VmmServersListByResourceGroupOptionalParams, + VmmServersListBySubscriptionOptionalParams, +} from "../../models/options.js"; + +export function _vmmServersGetSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + vmmServerName: string, + options: VmmServersGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}", + subscriptionId, + resourceGroupName, + vmmServerName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _vmmServersGetDeserialize( + result: VmmServersGet200Response | VmmServersGetDefaultResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return { + tags: result.body["tags"], + location: result.body["location"], + id: result.body["id"], + name: result.body["name"], + type: result.body["type"], + systemData: !result.body.systemData + ? undefined + : { + createdBy: result.body.systemData?.["createdBy"], + createdByType: result.body.systemData?.["createdByType"], + createdAt: + result.body.systemData?.["createdAt"] !== undefined + ? new Date(result.body.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: result.body.systemData?.["lastModifiedBy"], + lastModifiedByType: result.body.systemData?.["lastModifiedByType"], + lastModifiedAt: + result.body.systemData?.["lastModifiedAt"] !== undefined + ? new Date(result.body.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !result.body.properties + ? undefined + : { + credentials: !result.body.properties?.credentials + ? undefined + : { + username: result.body.properties?.credentials?.["username"], + password: result.body.properties?.credentials?.["password"], + }, + fqdn: result.body.properties?.["fqdn"], + port: result.body.properties?.["port"], + connectionStatus: result.body.properties?.["connectionStatus"], + errorMessage: result.body.properties?.["errorMessage"], + uuid: result.body.properties?.["uuid"], + version: result.body.properties?.["version"], + provisioningState: result.body.properties?.["provisioningState"], + }, + extendedLocation: { + type: result.body.extendedLocation["type"], + name: result.body.extendedLocation["name"], + }, + }; +} + +/** Implements VmmServer GET method. */ +export async function vmmServersGet( + context: Client, + subscriptionId: string, + resourceGroupName: string, + vmmServerName: string, + options: VmmServersGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _vmmServersGetSend( + context, + subscriptionId, + resourceGroupName, + vmmServerName, + options, + ); + return _vmmServersGetDeserialize(result); +} + +export function _vmmServersCreateOrUpdateSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + vmmServerName: string, + resource: VmmServer, + options: VmmServersCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | VmmServersCreateOrUpdate200Response + | VmmServersCreateOrUpdate201Response + | VmmServersCreateOrUpdateDefaultResponse + | VmmServersCreateOrUpdateLogicalResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}", + subscriptionId, + resourceGroupName, + vmmServerName, + ) + .put({ + ...operationOptionsToRequestParameters(options), + body: { + tags: !resource.tags + ? resource.tags + : (serializeRecord(resource.tags as any) as any), + location: resource["location"], + properties: !resource.properties + ? resource.properties + : vmmServerPropertiesSerializer(resource.properties), + extendedLocation: extendedLocationSerializer(resource.extendedLocation), + }, + }); +} + +export async function _vmmServersCreateOrUpdateDeserialize( + result: + | VmmServersCreateOrUpdate200Response + | VmmServersCreateOrUpdate201Response + | VmmServersCreateOrUpdateDefaultResponse + | VmmServersCreateOrUpdateLogicalResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + const res = result as unknown as VmmServersCreateOrUpdateLogicalResponse; + return { + tags: res.body["tags"], + location: res.body["location"], + id: res.body["id"], + name: res.body["name"], + type: res.body["type"], + systemData: !res.body.systemData + ? undefined + : { + createdBy: res.body.systemData?.["createdBy"], + createdByType: res.body.systemData?.["createdByType"], + createdAt: + res.body.systemData?.["createdAt"] !== undefined + ? new Date(res.body.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: res.body.systemData?.["lastModifiedBy"], + lastModifiedByType: res.body.systemData?.["lastModifiedByType"], + lastModifiedAt: + res.body.systemData?.["lastModifiedAt"] !== undefined + ? new Date(res.body.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !res.body.properties + ? undefined + : { + credentials: !res.body.properties?.credentials + ? undefined + : { + username: res.body.properties?.credentials?.["username"], + password: res.body.properties?.credentials?.["password"], + }, + fqdn: res.body.properties?.["fqdn"], + port: res.body.properties?.["port"], + connectionStatus: res.body.properties?.["connectionStatus"], + errorMessage: res.body.properties?.["errorMessage"], + uuid: res.body.properties?.["uuid"], + version: res.body.properties?.["version"], + provisioningState: res.body.properties?.["provisioningState"], + }, + extendedLocation: { + type: res.body.extendedLocation["type"], + name: res.body.extendedLocation["name"], + }, + }; +} + +/** Onboards the SCVmm fabric as an Azure VmmServer resource. */ +export function vmmServersCreateOrUpdate( + context: Client, + subscriptionId: string, + resourceGroupName: string, + vmmServerName: string, + resource: VmmServer, + options: VmmServersCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, VmmServer> { + return getLongRunningPoller(context, _vmmServersCreateOrUpdateDeserialize, { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _vmmServersCreateOrUpdateSend( + context, + subscriptionId, + resourceGroupName, + vmmServerName, + resource, + options, + ), + }) as PollerLike, VmmServer>; +} + +export function _vmmServersUpdateSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + vmmServerName: string, + properties: VmmServerTagsUpdate, + options: VmmServersUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | VmmServersUpdate200Response + | VmmServersUpdate202Response + | VmmServersUpdateDefaultResponse + | VmmServersUpdateLogicalResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}", + subscriptionId, + resourceGroupName, + vmmServerName, + ) + .patch({ + ...operationOptionsToRequestParameters(options), + body: { + tags: !properties.tags + ? properties.tags + : (serializeRecord(properties.tags as any) as any), + }, + }); +} + +export async function _vmmServersUpdateDeserialize( + result: + | VmmServersUpdate200Response + | VmmServersUpdate202Response + | VmmServersUpdateDefaultResponse + | VmmServersUpdateLogicalResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + const res = result as unknown as VmmServersUpdateLogicalResponse; + return { + tags: res.body["tags"], + location: res.body["location"], + id: res.body["id"], + name: res.body["name"], + type: res.body["type"], + systemData: !res.body.systemData + ? undefined + : { + createdBy: res.body.systemData?.["createdBy"], + createdByType: res.body.systemData?.["createdByType"], + createdAt: + res.body.systemData?.["createdAt"] !== undefined + ? new Date(res.body.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: res.body.systemData?.["lastModifiedBy"], + lastModifiedByType: res.body.systemData?.["lastModifiedByType"], + lastModifiedAt: + res.body.systemData?.["lastModifiedAt"] !== undefined + ? new Date(res.body.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !res.body.properties + ? undefined + : { + credentials: !res.body.properties?.credentials + ? undefined + : { + username: res.body.properties?.credentials?.["username"], + password: res.body.properties?.credentials?.["password"], + }, + fqdn: res.body.properties?.["fqdn"], + port: res.body.properties?.["port"], + connectionStatus: res.body.properties?.["connectionStatus"], + errorMessage: res.body.properties?.["errorMessage"], + uuid: res.body.properties?.["uuid"], + version: res.body.properties?.["version"], + provisioningState: res.body.properties?.["provisioningState"], + }, + extendedLocation: { + type: res.body.extendedLocation["type"], + name: res.body.extendedLocation["name"], + }, + }; +} + +/** Updates the VmmServers resource. */ +export function vmmServersUpdate( + context: Client, + subscriptionId: string, + resourceGroupName: string, + vmmServerName: string, + properties: VmmServerTagsUpdate, + options: VmmServersUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, VmmServer> { + return getLongRunningPoller(context, _vmmServersUpdateDeserialize, { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _vmmServersUpdateSend( + context, + subscriptionId, + resourceGroupName, + vmmServerName, + properties, + options, + ), + }) as PollerLike, VmmServer>; +} + +export function _vmmServersDeleteSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + vmmServerName: string, + options: VmmServersDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | VmmServersDelete202Response + | VmmServersDelete204Response + | VmmServersDeleteDefaultResponse + | VmmServersDeleteLogicalResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}", + subscriptionId, + resourceGroupName, + vmmServerName, + ) + .delete({ + ...operationOptionsToRequestParameters(options), + queryParameters: { force: options?.force }, + }); +} + +export async function _vmmServersDeleteDeserialize( + result: + | VmmServersDelete202Response + | VmmServersDelete204Response + | VmmServersDeleteDefaultResponse + | VmmServersDeleteLogicalResponse, +): Promise { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return; +} + +/** Removes the SCVmm fabric from Azure. */ +export function vmmServersDelete( + context: Client, + subscriptionId: string, + resourceGroupName: string, + vmmServerName: string, + options: VmmServersDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _vmmServersDeleteDeserialize, { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _vmmServersDeleteSend( + context, + subscriptionId, + resourceGroupName, + vmmServerName, + options, + ), + }) as PollerLike, void>; +} + +export function _vmmServersListByResourceGroupSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + options: VmmServersListByResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | VmmServersListByResourceGroup200Response + | VmmServersListByResourceGroupDefaultResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers", + subscriptionId, + resourceGroupName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _vmmServersListByResourceGroupDeserialize( + result: + | VmmServersListByResourceGroup200Response + | VmmServersListByResourceGroupDefaultResponse, +): Promise<_VmmServerListResult> { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return { + value: result.body["value"].map((p) => { + return { + tags: p["tags"], + location: p["location"], + id: p["id"], + name: p["name"], + type: p["type"], + systemData: !p.systemData + ? undefined + : { + createdBy: p.systemData?.["createdBy"], + createdByType: p.systemData?.["createdByType"], + createdAt: + p.systemData?.["createdAt"] !== undefined + ? new Date(p.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: p.systemData?.["lastModifiedBy"], + lastModifiedByType: p.systemData?.["lastModifiedByType"], + lastModifiedAt: + p.systemData?.["lastModifiedAt"] !== undefined + ? new Date(p.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !p.properties + ? undefined + : { + credentials: !p.properties?.credentials + ? undefined + : { + username: p.properties?.credentials?.["username"], + password: p.properties?.credentials?.["password"], + }, + fqdn: p.properties?.["fqdn"], + port: p.properties?.["port"], + connectionStatus: p.properties?.["connectionStatus"], + errorMessage: p.properties?.["errorMessage"], + uuid: p.properties?.["uuid"], + version: p.properties?.["version"], + provisioningState: p.properties?.["provisioningState"], + }, + extendedLocation: { + type: p.extendedLocation["type"], + name: p.extendedLocation["name"], + }, + }; + }), + nextLink: result.body["nextLink"], + }; +} + +/** List of VmmServers in a resource group. */ +export function vmmServersListByResourceGroup( + context: Client, + subscriptionId: string, + resourceGroupName: string, + options: VmmServersListByResourceGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _vmmServersListByResourceGroupSend( + context, + subscriptionId, + resourceGroupName, + options, + ), + _vmmServersListByResourceGroupDeserialize, + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _vmmServersListBySubscriptionSend( + context: Client, + subscriptionId: string, + options: VmmServersListBySubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod< + | VmmServersListBySubscription200Response + | VmmServersListBySubscriptionDefaultResponse +> { + return context + .path( + "/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/vmmServers", + subscriptionId, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _vmmServersListBySubscriptionDeserialize( + result: + | VmmServersListBySubscription200Response + | VmmServersListBySubscriptionDefaultResponse, +): Promise<_VmmServerListResult> { + if (isUnexpected(result)) { + throw createRestError(result); + } + + return { + value: result.body["value"].map((p) => { + return { + tags: p["tags"], + location: p["location"], + id: p["id"], + name: p["name"], + type: p["type"], + systemData: !p.systemData + ? undefined + : { + createdBy: p.systemData?.["createdBy"], + createdByType: p.systemData?.["createdByType"], + createdAt: + p.systemData?.["createdAt"] !== undefined + ? new Date(p.systemData?.["createdAt"]) + : undefined, + lastModifiedBy: p.systemData?.["lastModifiedBy"], + lastModifiedByType: p.systemData?.["lastModifiedByType"], + lastModifiedAt: + p.systemData?.["lastModifiedAt"] !== undefined + ? new Date(p.systemData?.["lastModifiedAt"]) + : undefined, + }, + properties: !p.properties + ? undefined + : { + credentials: !p.properties?.credentials + ? undefined + : { + username: p.properties?.credentials?.["username"], + password: p.properties?.credentials?.["password"], + }, + fqdn: p.properties?.["fqdn"], + port: p.properties?.["port"], + connectionStatus: p.properties?.["connectionStatus"], + errorMessage: p.properties?.["errorMessage"], + uuid: p.properties?.["uuid"], + version: p.properties?.["version"], + provisioningState: p.properties?.["provisioningState"], + }, + extendedLocation: { + type: p.extendedLocation["type"], + name: p.extendedLocation["name"], + }, + }; + }), + nextLink: result.body["nextLink"], + }; +} + +/** List of VmmServers in a subscription. */ +export function vmmServersListBySubscription( + context: Client, + subscriptionId: string, + options: VmmServersListBySubscriptionOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _vmmServersListBySubscriptionSend(context, subscriptionId, options), + _vmmServersListBySubscriptionDeserialize, + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/scvmm/arm-scvmm/src/classic/availabilitySets/index.ts b/sdk/scvmm/arm-scvmm/src/classic/availabilitySets/index.ts new file mode 100644 index 000000000000..e052e9292727 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/classic/availabilitySets/index.ts @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { ScVmmContext } from "../../api/scVmmContext.js"; +import { + AvailabilitySet, + AvailabilitySetTagsUpdate, +} from "../../models/models.js"; +import { + availabilitySetsGet, + availabilitySetsCreateOrUpdate, + availabilitySetsUpdate, + availabilitySetsDelete, + availabilitySetsListByResourceGroup, + availabilitySetsListBySubscription, +} from "../../api/availabilitySets/index.js"; +import { PagedAsyncIterableIterator } from "../../models/pagingTypes.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; +import { + AvailabilitySetsGetOptionalParams, + AvailabilitySetsCreateOrUpdateOptionalParams, + AvailabilitySetsUpdateOptionalParams, + AvailabilitySetsDeleteOptionalParams, + AvailabilitySetsListByResourceGroupOptionalParams, + AvailabilitySetsListBySubscriptionOptionalParams, +} from "../../models/options.js"; + +/** Interface representing a AvailabilitySets operations. */ +export interface AvailabilitySetsOperations { + /** Implements AvailabilitySet GET method. */ + get: ( + resourceGroupName: string, + availabilitySetResourceName: string, + options?: AvailabilitySetsGetOptionalParams, + ) => Promise; + /** Onboards the ScVmm availability set as an Azure resource. */ + createOrUpdate: ( + resourceGroupName: string, + availabilitySetResourceName: string, + resource: AvailabilitySet, + options?: AvailabilitySetsCreateOrUpdateOptionalParams, + ) => PollerLike, AvailabilitySet>; + /** Updates the AvailabilitySets resource. */ + update: ( + resourceGroupName: string, + availabilitySetResourceName: string, + properties: AvailabilitySetTagsUpdate, + options?: AvailabilitySetsUpdateOptionalParams, + ) => PollerLike, AvailabilitySet>; + /** Deregisters the ScVmm availability set from Azure. */ + delete: ( + resourceGroupName: string, + availabilitySetResourceName: string, + options?: AvailabilitySetsDeleteOptionalParams, + ) => PollerLike, void>; + /** List of AvailabilitySets in a resource group. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: AvailabilitySetsListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** List of AvailabilitySets in a subscription. */ + listBySubscription: ( + options?: AvailabilitySetsListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; +} + +export function getAvailabilitySets( + context: ScVmmContext, + subscriptionId: string, +) { + return { + get: ( + resourceGroupName: string, + availabilitySetResourceName: string, + options?: AvailabilitySetsGetOptionalParams, + ) => + availabilitySetsGet( + context, + subscriptionId, + resourceGroupName, + availabilitySetResourceName, + options, + ), + createOrUpdate: ( + resourceGroupName: string, + availabilitySetResourceName: string, + resource: AvailabilitySet, + options?: AvailabilitySetsCreateOrUpdateOptionalParams, + ) => + availabilitySetsCreateOrUpdate( + context, + subscriptionId, + resourceGroupName, + availabilitySetResourceName, + resource, + options, + ), + update: ( + resourceGroupName: string, + availabilitySetResourceName: string, + properties: AvailabilitySetTagsUpdate, + options?: AvailabilitySetsUpdateOptionalParams, + ) => + availabilitySetsUpdate( + context, + subscriptionId, + resourceGroupName, + availabilitySetResourceName, + properties, + options, + ), + delete: ( + resourceGroupName: string, + availabilitySetResourceName: string, + options?: AvailabilitySetsDeleteOptionalParams, + ) => + availabilitySetsDelete( + context, + subscriptionId, + resourceGroupName, + availabilitySetResourceName, + options, + ), + listByResourceGroup: ( + resourceGroupName: string, + options?: AvailabilitySetsListByResourceGroupOptionalParams, + ) => + availabilitySetsListByResourceGroup( + context, + subscriptionId, + resourceGroupName, + options, + ), + listBySubscription: ( + options?: AvailabilitySetsListBySubscriptionOptionalParams, + ) => availabilitySetsListBySubscription(context, subscriptionId, options), + }; +} + +export function getAvailabilitySetsOperations( + context: ScVmmContext, + subscriptionId: string, +): AvailabilitySetsOperations { + return { + ...getAvailabilitySets(context, subscriptionId), + }; +} diff --git a/sdk/scvmm/arm-scvmm/src/classic/clouds/index.ts b/sdk/scvmm/arm-scvmm/src/classic/clouds/index.ts new file mode 100644 index 000000000000..0964a4017886 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/classic/clouds/index.ts @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { ScVmmContext } from "../../api/scVmmContext.js"; +import { Cloud, CloudTagsUpdate } from "../../models/models.js"; +import { + cloudsGet, + cloudsCreateOrUpdate, + cloudsUpdate, + cloudsDelete, + cloudsListByResourceGroup, + cloudsListBySubscription, +} from "../../api/clouds/index.js"; +import { PagedAsyncIterableIterator } from "../../models/pagingTypes.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; +import { + CloudsGetOptionalParams, + CloudsCreateOrUpdateOptionalParams, + CloudsUpdateOptionalParams, + CloudsDeleteOptionalParams, + CloudsListByResourceGroupOptionalParams, + CloudsListBySubscriptionOptionalParams, +} from "../../models/options.js"; + +/** Interface representing a Clouds operations. */ +export interface CloudsOperations { + /** Implements Cloud GET method. */ + get: ( + resourceGroupName: string, + cloudResourceName: string, + options?: CloudsGetOptionalParams, + ) => Promise; + /** Onboards the ScVmm fabric cloud as an Azure cloud resource. */ + createOrUpdate: ( + resourceGroupName: string, + cloudResourceName: string, + resource: Cloud, + options?: CloudsCreateOrUpdateOptionalParams, + ) => PollerLike, Cloud>; + /** Updates the Clouds resource. */ + update: ( + resourceGroupName: string, + cloudResourceName: string, + properties: CloudTagsUpdate, + options?: CloudsUpdateOptionalParams, + ) => PollerLike, Cloud>; + /** Deregisters the ScVmm fabric cloud from Azure. */ + delete: ( + resourceGroupName: string, + cloudResourceName: string, + options?: CloudsDeleteOptionalParams, + ) => PollerLike, void>; + /** List of Clouds in a resource group. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: CloudsListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** List of Clouds in a subscription. */ + listBySubscription: ( + options?: CloudsListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; +} + +export function getClouds(context: ScVmmContext, subscriptionId: string) { + return { + get: ( + resourceGroupName: string, + cloudResourceName: string, + options?: CloudsGetOptionalParams, + ) => + cloudsGet( + context, + subscriptionId, + resourceGroupName, + cloudResourceName, + options, + ), + createOrUpdate: ( + resourceGroupName: string, + cloudResourceName: string, + resource: Cloud, + options?: CloudsCreateOrUpdateOptionalParams, + ) => + cloudsCreateOrUpdate( + context, + subscriptionId, + resourceGroupName, + cloudResourceName, + resource, + options, + ), + update: ( + resourceGroupName: string, + cloudResourceName: string, + properties: CloudTagsUpdate, + options?: CloudsUpdateOptionalParams, + ) => + cloudsUpdate( + context, + subscriptionId, + resourceGroupName, + cloudResourceName, + properties, + options, + ), + delete: ( + resourceGroupName: string, + cloudResourceName: string, + options?: CloudsDeleteOptionalParams, + ) => + cloudsDelete( + context, + subscriptionId, + resourceGroupName, + cloudResourceName, + options, + ), + listByResourceGroup: ( + resourceGroupName: string, + options?: CloudsListByResourceGroupOptionalParams, + ) => + cloudsListByResourceGroup( + context, + subscriptionId, + resourceGroupName, + options, + ), + listBySubscription: (options?: CloudsListBySubscriptionOptionalParams) => + cloudsListBySubscription(context, subscriptionId, options), + }; +} + +export function getCloudsOperations( + context: ScVmmContext, + subscriptionId: string, +): CloudsOperations { + return { + ...getClouds(context, subscriptionId), + }; +} diff --git a/sdk/scvmm/arm-scvmm/src/classic/guestAgents/index.ts b/sdk/scvmm/arm-scvmm/src/classic/guestAgents/index.ts new file mode 100644 index 000000000000..60ddc23912bd --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/classic/guestAgents/index.ts @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { ScVmmContext } from "../../api/scVmmContext.js"; +import { GuestAgent } from "../../models/models.js"; +import { + guestAgentsGet, + guestAgentsCreate, + guestAgentsDelete, + guestAgentsListByVirtualMachineInstance, +} from "../../api/guestAgents/index.js"; +import { PagedAsyncIterableIterator } from "../../models/pagingTypes.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; +import { + GuestAgentsGetOptionalParams, + GuestAgentsCreateOptionalParams, + GuestAgentsDeleteOptionalParams, + GuestAgentsListByVirtualMachineInstanceOptionalParams, +} from "../../models/options.js"; + +/** Interface representing a GuestAgents operations. */ +export interface GuestAgentsOperations { + /** Implements GuestAgent GET method. */ + get: ( + resourceUri: string, + options?: GuestAgentsGetOptionalParams, + ) => Promise; + /** Create Or Update GuestAgent. */ + create: ( + resourceUri: string, + resource: GuestAgent, + options?: GuestAgentsCreateOptionalParams, + ) => PollerLike, GuestAgent>; + /** Implements GuestAgent DELETE method. */ + delete: ( + resourceUri: string, + options?: GuestAgentsDeleteOptionalParams, + ) => Promise; + /** Returns the list of GuestAgent of the given vm. */ + listByVirtualMachineInstance: ( + resourceUri: string, + options?: GuestAgentsListByVirtualMachineInstanceOptionalParams, + ) => PagedAsyncIterableIterator; +} + +export function getGuestAgents(context: ScVmmContext) { + return { + get: (resourceUri: string, options?: GuestAgentsGetOptionalParams) => + guestAgentsGet(context, resourceUri, options), + create: ( + resourceUri: string, + resource: GuestAgent, + options?: GuestAgentsCreateOptionalParams, + ) => guestAgentsCreate(context, resourceUri, resource, options), + delete: (resourceUri: string, options?: GuestAgentsDeleteOptionalParams) => + guestAgentsDelete(context, resourceUri, options), + listByVirtualMachineInstance: ( + resourceUri: string, + options?: GuestAgentsListByVirtualMachineInstanceOptionalParams, + ) => guestAgentsListByVirtualMachineInstance(context, resourceUri, options), + }; +} + +export function getGuestAgentsOperations( + context: ScVmmContext, +): GuestAgentsOperations { + return { + ...getGuestAgents(context), + }; +} diff --git a/sdk/scvmm/arm-scvmm/src/classic/index.ts b/sdk/scvmm/arm-scvmm/src/classic/index.ts new file mode 100644 index 000000000000..9028f92ce31f --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/classic/index.ts @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +export { AvailabilitySetsOperations } from "./availabilitySets/index.js"; +export { CloudsOperations } from "./clouds/index.js"; +export { GuestAgentsOperations } from "./guestAgents/index.js"; +export { InventoryItemsOperations } from "./inventoryItems/index.js"; +export { OperationsOperations } from "./operations/index.js"; +export { VirtualMachineInstancesOperations } from "./virtualMachineInstances/index.js"; +export { VirtualMachineTemplatesOperations } from "./virtualMachineTemplates/index.js"; +export { VirtualNetworksOperations } from "./virtualNetworks/index.js"; +export { VmInstanceHybridIdentityMetadatasOperations } from "./vmInstanceHybridIdentityMetadatas/index.js"; +export { VmmServersOperations } from "./vmmServers/index.js"; diff --git a/sdk/scvmm/arm-scvmm/src/classic/inventoryItems/index.ts b/sdk/scvmm/arm-scvmm/src/classic/inventoryItems/index.ts new file mode 100644 index 000000000000..544fce0b6220 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/classic/inventoryItems/index.ts @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { ScVmmContext } from "../../api/scVmmContext.js"; +import { InventoryItem } from "../../models/models.js"; +import { + inventoryItemsGet, + inventoryItemsCreate, + inventoryItemsDelete, + inventoryItemsListByVmmServer, +} from "../../api/inventoryItems/index.js"; +import { PagedAsyncIterableIterator } from "../../models/pagingTypes.js"; +import { + InventoryItemsGetOptionalParams, + InventoryItemsCreateOptionalParams, + InventoryItemsDeleteOptionalParams, + InventoryItemsListByVmmServerOptionalParams, +} from "../../models/options.js"; + +/** Interface representing a InventoryItems operations. */ +export interface InventoryItemsOperations { + /** Shows an inventory item. */ + get: ( + resourceGroupName: string, + vmmServerName: string, + inventoryItemResourceName: string, + options?: InventoryItemsGetOptionalParams, + ) => Promise; + /** Create Or Update InventoryItem. */ + create: ( + resourceGroupName: string, + vmmServerName: string, + inventoryItemResourceName: string, + resource: InventoryItem, + options?: InventoryItemsCreateOptionalParams, + ) => Promise; + /** Deletes an inventoryItem. */ + delete: ( + resourceGroupName: string, + vmmServerName: string, + inventoryItemResourceName: string, + options?: InventoryItemsDeleteOptionalParams, + ) => Promise; + /** Returns the list of inventoryItems in the given VmmServer. */ + listByVmmServer: ( + resourceGroupName: string, + vmmServerName: string, + options?: InventoryItemsListByVmmServerOptionalParams, + ) => PagedAsyncIterableIterator; +} + +export function getInventoryItems( + context: ScVmmContext, + subscriptionId: string, +) { + return { + get: ( + resourceGroupName: string, + vmmServerName: string, + inventoryItemResourceName: string, + options?: InventoryItemsGetOptionalParams, + ) => + inventoryItemsGet( + context, + subscriptionId, + resourceGroupName, + vmmServerName, + inventoryItemResourceName, + options, + ), + create: ( + resourceGroupName: string, + vmmServerName: string, + inventoryItemResourceName: string, + resource: InventoryItem, + options?: InventoryItemsCreateOptionalParams, + ) => + inventoryItemsCreate( + context, + subscriptionId, + resourceGroupName, + vmmServerName, + inventoryItemResourceName, + resource, + options, + ), + delete: ( + resourceGroupName: string, + vmmServerName: string, + inventoryItemResourceName: string, + options?: InventoryItemsDeleteOptionalParams, + ) => + inventoryItemsDelete( + context, + subscriptionId, + resourceGroupName, + vmmServerName, + inventoryItemResourceName, + options, + ), + listByVmmServer: ( + resourceGroupName: string, + vmmServerName: string, + options?: InventoryItemsListByVmmServerOptionalParams, + ) => + inventoryItemsListByVmmServer( + context, + subscriptionId, + resourceGroupName, + vmmServerName, + options, + ), + }; +} + +export function getInventoryItemsOperations( + context: ScVmmContext, + subscriptionId: string, +): InventoryItemsOperations { + return { + ...getInventoryItems(context, subscriptionId), + }; +} diff --git a/sdk/scvmm/arm-scvmm/src/classic/operations/index.ts b/sdk/scvmm/arm-scvmm/src/classic/operations/index.ts new file mode 100644 index 000000000000..a3690e4511ff --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/classic/operations/index.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { ScVmmContext } from "../../api/scVmmContext.js"; +import { Operation } from "../../models/models.js"; +import { operationsList } from "../../api/operations/index.js"; +import { PagedAsyncIterableIterator } from "../../models/pagingTypes.js"; +import { OperationsListOptionalParams } from "../../models/options.js"; + +/** Interface representing a Operations operations. */ +export interface OperationsOperations { + /** List the operations for the provider */ + list: ( + options?: OperationsListOptionalParams, + ) => PagedAsyncIterableIterator; +} + +export function getOperations(context: ScVmmContext) { + return { + list: (options?: OperationsListOptionalParams) => + operationsList(context, options), + }; +} + +export function getOperationsOperations( + context: ScVmmContext, +): OperationsOperations { + return { + ...getOperations(context), + }; +} diff --git a/sdk/scvmm/arm-scvmm/src/classic/virtualMachineInstances/index.ts b/sdk/scvmm/arm-scvmm/src/classic/virtualMachineInstances/index.ts new file mode 100644 index 000000000000..ba445d9c8d79 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/classic/virtualMachineInstances/index.ts @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { ScVmmContext } from "../../api/scVmmContext.js"; +import { + VirtualMachineInstance, + VirtualMachineInstanceUpdate, + StopVirtualMachineOptions, + VirtualMachineCreateCheckpoint, + VirtualMachineDeleteCheckpoint, + VirtualMachineRestoreCheckpoint, +} from "../../models/models.js"; +import { + virtualMachineInstancesGet, + virtualMachineInstancesCreateOrUpdate, + virtualMachineInstancesUpdate, + virtualMachineInstancesDelete, + virtualMachineInstancesList, + virtualMachineInstancesStop, + virtualMachineInstancesStart, + virtualMachineInstancesRestart, + virtualMachineInstancesCreateCheckpoint, + virtualMachineInstancesDeleteCheckpoint, + virtualMachineInstancesRestoreCheckpoint, +} from "../../api/virtualMachineInstances/index.js"; +import { PagedAsyncIterableIterator } from "../../models/pagingTypes.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; +import { + VirtualMachineInstancesGetOptionalParams, + VirtualMachineInstancesCreateOrUpdateOptionalParams, + VirtualMachineInstancesUpdateOptionalParams, + VirtualMachineInstancesDeleteOptionalParams, + VirtualMachineInstancesListOptionalParams, + VirtualMachineInstancesStopOptionalParams, + VirtualMachineInstancesStartOptionalParams, + VirtualMachineInstancesRestartOptionalParams, + VirtualMachineInstancesCreateCheckpointOptionalParams, + VirtualMachineInstancesDeleteCheckpointOptionalParams, + VirtualMachineInstancesRestoreCheckpointOptionalParams, +} from "../../models/options.js"; + +/** Interface representing a VirtualMachineInstances operations. */ +export interface VirtualMachineInstancesOperations { + /** Retrieves information about a virtual machine instance. */ + get: ( + resourceUri: string, + options?: VirtualMachineInstancesGetOptionalParams, + ) => Promise; + /** The operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. */ + createOrUpdate: ( + resourceUri: string, + resource: VirtualMachineInstance, + options?: VirtualMachineInstancesCreateOrUpdateOptionalParams, + ) => PollerLike< + OperationState, + VirtualMachineInstance + >; + /** The operation to update a virtual machine instance. */ + update: ( + resourceUri: string, + properties: VirtualMachineInstanceUpdate, + options?: VirtualMachineInstancesUpdateOptionalParams, + ) => PollerLike< + OperationState, + VirtualMachineInstance + >; + /** The operation to delete a virtual machine instance. */ + delete: ( + resourceUri: string, + options?: VirtualMachineInstancesDeleteOptionalParams, + ) => PollerLike, void>; + /** Lists all of the virtual machine instances within the specified parent resource. */ + list: ( + resourceUri: string, + options?: VirtualMachineInstancesListOptionalParams, + ) => PagedAsyncIterableIterator; + /** The operation to power off (stop) a virtual machine instance. */ + stop: ( + resourceUri: string, + body: StopVirtualMachineOptions, + options?: VirtualMachineInstancesStopOptionalParams, + ) => PollerLike, void>; + /** The operation to start a virtual machine instance. */ + start: ( + resourceUri: string, + options?: VirtualMachineInstancesStartOptionalParams, + ) => PollerLike, void>; + /** The operation to restart a virtual machine instance. */ + restart: ( + resourceUri: string, + options?: VirtualMachineInstancesRestartOptionalParams, + ) => PollerLike, void>; + /** Creates a checkpoint in virtual machine instance. */ + createCheckpoint: ( + resourceUri: string, + body: VirtualMachineCreateCheckpoint, + options?: VirtualMachineInstancesCreateCheckpointOptionalParams, + ) => PollerLike, void>; + /** Deletes a checkpoint in virtual machine instance. */ + deleteCheckpoint: ( + resourceUri: string, + body: VirtualMachineDeleteCheckpoint, + options?: VirtualMachineInstancesDeleteCheckpointOptionalParams, + ) => PollerLike, void>; + /** Restores to a checkpoint in virtual machine instance. */ + restoreCheckpoint: ( + resourceUri: string, + body: VirtualMachineRestoreCheckpoint, + options?: VirtualMachineInstancesRestoreCheckpointOptionalParams, + ) => PollerLike, void>; +} + +export function getVirtualMachineInstances(context: ScVmmContext) { + return { + get: ( + resourceUri: string, + options?: VirtualMachineInstancesGetOptionalParams, + ) => virtualMachineInstancesGet(context, resourceUri, options), + createOrUpdate: ( + resourceUri: string, + resource: VirtualMachineInstance, + options?: VirtualMachineInstancesCreateOrUpdateOptionalParams, + ) => + virtualMachineInstancesCreateOrUpdate( + context, + resourceUri, + resource, + options, + ), + update: ( + resourceUri: string, + properties: VirtualMachineInstanceUpdate, + options?: VirtualMachineInstancesUpdateOptionalParams, + ) => + virtualMachineInstancesUpdate(context, resourceUri, properties, options), + delete: ( + resourceUri: string, + options?: VirtualMachineInstancesDeleteOptionalParams, + ) => virtualMachineInstancesDelete(context, resourceUri, options), + list: ( + resourceUri: string, + options?: VirtualMachineInstancesListOptionalParams, + ) => virtualMachineInstancesList(context, resourceUri, options), + stop: ( + resourceUri: string, + body: StopVirtualMachineOptions, + options?: VirtualMachineInstancesStopOptionalParams, + ) => virtualMachineInstancesStop(context, resourceUri, body, options), + start: ( + resourceUri: string, + options?: VirtualMachineInstancesStartOptionalParams, + ) => virtualMachineInstancesStart(context, resourceUri, options), + restart: ( + resourceUri: string, + options?: VirtualMachineInstancesRestartOptionalParams, + ) => virtualMachineInstancesRestart(context, resourceUri, options), + createCheckpoint: ( + resourceUri: string, + body: VirtualMachineCreateCheckpoint, + options?: VirtualMachineInstancesCreateCheckpointOptionalParams, + ) => + virtualMachineInstancesCreateCheckpoint( + context, + resourceUri, + body, + options, + ), + deleteCheckpoint: ( + resourceUri: string, + body: VirtualMachineDeleteCheckpoint, + options?: VirtualMachineInstancesDeleteCheckpointOptionalParams, + ) => + virtualMachineInstancesDeleteCheckpoint( + context, + resourceUri, + body, + options, + ), + restoreCheckpoint: ( + resourceUri: string, + body: VirtualMachineRestoreCheckpoint, + options?: VirtualMachineInstancesRestoreCheckpointOptionalParams, + ) => + virtualMachineInstancesRestoreCheckpoint( + context, + resourceUri, + body, + options, + ), + }; +} + +export function getVirtualMachineInstancesOperations( + context: ScVmmContext, +): VirtualMachineInstancesOperations { + return { + ...getVirtualMachineInstances(context), + }; +} diff --git a/sdk/scvmm/arm-scvmm/src/classic/virtualMachineTemplates/index.ts b/sdk/scvmm/arm-scvmm/src/classic/virtualMachineTemplates/index.ts new file mode 100644 index 000000000000..208f6878c3ad --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/classic/virtualMachineTemplates/index.ts @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { ScVmmContext } from "../../api/scVmmContext.js"; +import { + VirtualMachineTemplate, + VirtualMachineTemplateTagsUpdate, +} from "../../models/models.js"; +import { + virtualMachineTemplatesGet, + virtualMachineTemplatesCreateOrUpdate, + virtualMachineTemplatesUpdate, + virtualMachineTemplatesDelete, + virtualMachineTemplatesListByResourceGroup, + virtualMachineTemplatesListBySubscription, +} from "../../api/virtualMachineTemplates/index.js"; +import { PagedAsyncIterableIterator } from "../../models/pagingTypes.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; +import { + VirtualMachineTemplatesGetOptionalParams, + VirtualMachineTemplatesCreateOrUpdateOptionalParams, + VirtualMachineTemplatesUpdateOptionalParams, + VirtualMachineTemplatesDeleteOptionalParams, + VirtualMachineTemplatesListByResourceGroupOptionalParams, + VirtualMachineTemplatesListBySubscriptionOptionalParams, +} from "../../models/options.js"; + +/** Interface representing a VirtualMachineTemplates operations. */ +export interface VirtualMachineTemplatesOperations { + /** Implements VirtualMachineTemplate GET method. */ + get: ( + resourceGroupName: string, + virtualMachineTemplateName: string, + options?: VirtualMachineTemplatesGetOptionalParams, + ) => Promise; + /** Onboards the ScVmm VM Template as an Azure VM Template resource. */ + createOrUpdate: ( + resourceGroupName: string, + virtualMachineTemplateName: string, + resource: VirtualMachineTemplate, + options?: VirtualMachineTemplatesCreateOrUpdateOptionalParams, + ) => PollerLike< + OperationState, + VirtualMachineTemplate + >; + /** Updates the VirtualMachineTemplate resource. */ + update: ( + resourceGroupName: string, + virtualMachineTemplateName: string, + properties: VirtualMachineTemplateTagsUpdate, + options?: VirtualMachineTemplatesUpdateOptionalParams, + ) => PollerLike< + OperationState, + VirtualMachineTemplate + >; + /** Deregisters the ScVmm VM Template from Azure. */ + delete: ( + resourceGroupName: string, + virtualMachineTemplateName: string, + options?: VirtualMachineTemplatesDeleteOptionalParams, + ) => PollerLike, void>; + /** List of VirtualMachineTemplates in a resource group. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: VirtualMachineTemplatesListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** List of VirtualMachineTemplates in a subscription. */ + listBySubscription: ( + options?: VirtualMachineTemplatesListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; +} + +export function getVirtualMachineTemplates( + context: ScVmmContext, + subscriptionId: string, +) { + return { + get: ( + resourceGroupName: string, + virtualMachineTemplateName: string, + options?: VirtualMachineTemplatesGetOptionalParams, + ) => + virtualMachineTemplatesGet( + context, + subscriptionId, + resourceGroupName, + virtualMachineTemplateName, + options, + ), + createOrUpdate: ( + resourceGroupName: string, + virtualMachineTemplateName: string, + resource: VirtualMachineTemplate, + options?: VirtualMachineTemplatesCreateOrUpdateOptionalParams, + ) => + virtualMachineTemplatesCreateOrUpdate( + context, + subscriptionId, + resourceGroupName, + virtualMachineTemplateName, + resource, + options, + ), + update: ( + resourceGroupName: string, + virtualMachineTemplateName: string, + properties: VirtualMachineTemplateTagsUpdate, + options?: VirtualMachineTemplatesUpdateOptionalParams, + ) => + virtualMachineTemplatesUpdate( + context, + subscriptionId, + resourceGroupName, + virtualMachineTemplateName, + properties, + options, + ), + delete: ( + resourceGroupName: string, + virtualMachineTemplateName: string, + options?: VirtualMachineTemplatesDeleteOptionalParams, + ) => + virtualMachineTemplatesDelete( + context, + subscriptionId, + resourceGroupName, + virtualMachineTemplateName, + options, + ), + listByResourceGroup: ( + resourceGroupName: string, + options?: VirtualMachineTemplatesListByResourceGroupOptionalParams, + ) => + virtualMachineTemplatesListByResourceGroup( + context, + subscriptionId, + resourceGroupName, + options, + ), + listBySubscription: ( + options?: VirtualMachineTemplatesListBySubscriptionOptionalParams, + ) => + virtualMachineTemplatesListBySubscription( + context, + subscriptionId, + options, + ), + }; +} + +export function getVirtualMachineTemplatesOperations( + context: ScVmmContext, + subscriptionId: string, +): VirtualMachineTemplatesOperations { + return { + ...getVirtualMachineTemplates(context, subscriptionId), + }; +} diff --git a/sdk/scvmm/arm-scvmm/src/classic/virtualNetworks/index.ts b/sdk/scvmm/arm-scvmm/src/classic/virtualNetworks/index.ts new file mode 100644 index 000000000000..57aaee4196f9 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/classic/virtualNetworks/index.ts @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { ScVmmContext } from "../../api/scVmmContext.js"; +import { + VirtualNetwork, + VirtualNetworkTagsUpdate, +} from "../../models/models.js"; +import { + virtualNetworksGet, + virtualNetworksCreateOrUpdate, + virtualNetworksUpdate, + virtualNetworksDelete, + virtualNetworksListByResourceGroup, + virtualNetworksListBySubscription, +} from "../../api/virtualNetworks/index.js"; +import { PagedAsyncIterableIterator } from "../../models/pagingTypes.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; +import { + VirtualNetworksGetOptionalParams, + VirtualNetworksCreateOrUpdateOptionalParams, + VirtualNetworksUpdateOptionalParams, + VirtualNetworksDeleteOptionalParams, + VirtualNetworksListByResourceGroupOptionalParams, + VirtualNetworksListBySubscriptionOptionalParams, +} from "../../models/options.js"; + +/** Interface representing a VirtualNetworks operations. */ +export interface VirtualNetworksOperations { + /** Implements VirtualNetwork GET method. */ + get: ( + resourceGroupName: string, + virtualNetworkName: string, + options?: VirtualNetworksGetOptionalParams, + ) => Promise; + /** Onboards the ScVmm virtual network as an Azure virtual network resource. */ + createOrUpdate: ( + resourceGroupName: string, + virtualNetworkName: string, + resource: VirtualNetwork, + options?: VirtualNetworksCreateOrUpdateOptionalParams, + ) => PollerLike, VirtualNetwork>; + /** Updates the VirtualNetworks resource. */ + update: ( + resourceGroupName: string, + virtualNetworkName: string, + properties: VirtualNetworkTagsUpdate, + options?: VirtualNetworksUpdateOptionalParams, + ) => PollerLike, VirtualNetwork>; + /** Deregisters the ScVmm virtual network from Azure. */ + delete: ( + resourceGroupName: string, + virtualNetworkName: string, + options?: VirtualNetworksDeleteOptionalParams, + ) => PollerLike, void>; + /** List of VirtualNetworks in a resource group. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: VirtualNetworksListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** List of VirtualNetworks in a subscription. */ + listBySubscription: ( + options?: VirtualNetworksListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; +} + +export function getVirtualNetworks( + context: ScVmmContext, + subscriptionId: string, +) { + return { + get: ( + resourceGroupName: string, + virtualNetworkName: string, + options?: VirtualNetworksGetOptionalParams, + ) => + virtualNetworksGet( + context, + subscriptionId, + resourceGroupName, + virtualNetworkName, + options, + ), + createOrUpdate: ( + resourceGroupName: string, + virtualNetworkName: string, + resource: VirtualNetwork, + options?: VirtualNetworksCreateOrUpdateOptionalParams, + ) => + virtualNetworksCreateOrUpdate( + context, + subscriptionId, + resourceGroupName, + virtualNetworkName, + resource, + options, + ), + update: ( + resourceGroupName: string, + virtualNetworkName: string, + properties: VirtualNetworkTagsUpdate, + options?: VirtualNetworksUpdateOptionalParams, + ) => + virtualNetworksUpdate( + context, + subscriptionId, + resourceGroupName, + virtualNetworkName, + properties, + options, + ), + delete: ( + resourceGroupName: string, + virtualNetworkName: string, + options?: VirtualNetworksDeleteOptionalParams, + ) => + virtualNetworksDelete( + context, + subscriptionId, + resourceGroupName, + virtualNetworkName, + options, + ), + listByResourceGroup: ( + resourceGroupName: string, + options?: VirtualNetworksListByResourceGroupOptionalParams, + ) => + virtualNetworksListByResourceGroup( + context, + subscriptionId, + resourceGroupName, + options, + ), + listBySubscription: ( + options?: VirtualNetworksListBySubscriptionOptionalParams, + ) => virtualNetworksListBySubscription(context, subscriptionId, options), + }; +} + +export function getVirtualNetworksOperations( + context: ScVmmContext, + subscriptionId: string, +): VirtualNetworksOperations { + return { + ...getVirtualNetworks(context, subscriptionId), + }; +} diff --git a/sdk/scvmm/arm-scvmm/src/classic/vmInstanceHybridIdentityMetadatas/index.ts b/sdk/scvmm/arm-scvmm/src/classic/vmInstanceHybridIdentityMetadatas/index.ts new file mode 100644 index 000000000000..2a0b049a0cbe --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/classic/vmInstanceHybridIdentityMetadatas/index.ts @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { ScVmmContext } from "../../api/scVmmContext.js"; +import { VmInstanceHybridIdentityMetadata } from "../../models/models.js"; +import { + vmInstanceHybridIdentityMetadatasGet, + vmInstanceHybridIdentityMetadatasListByVirtualMachineInstance, +} from "../../api/vmInstanceHybridIdentityMetadatas/index.js"; +import { PagedAsyncIterableIterator } from "../../models/pagingTypes.js"; +import { + VmInstanceHybridIdentityMetadatasGetOptionalParams, + VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceOptionalParams, +} from "../../models/options.js"; + +/** Interface representing a VmInstanceHybridIdentityMetadatas operations. */ +export interface VmInstanceHybridIdentityMetadatasOperations { + /** Implements HybridIdentityMetadata GET method. */ + get: ( + resourceUri: string, + options?: VmInstanceHybridIdentityMetadatasGetOptionalParams, + ) => Promise; + /** Returns the list of HybridIdentityMetadata of the given VM. */ + listByVirtualMachineInstance: ( + resourceUri: string, + options?: VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceOptionalParams, + ) => PagedAsyncIterableIterator; +} + +export function getVmInstanceHybridIdentityMetadatas(context: ScVmmContext) { + return { + get: ( + resourceUri: string, + options?: VmInstanceHybridIdentityMetadatasGetOptionalParams, + ) => vmInstanceHybridIdentityMetadatasGet(context, resourceUri, options), + listByVirtualMachineInstance: ( + resourceUri: string, + options?: VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceOptionalParams, + ) => + vmInstanceHybridIdentityMetadatasListByVirtualMachineInstance( + context, + resourceUri, + options, + ), + }; +} + +export function getVmInstanceHybridIdentityMetadatasOperations( + context: ScVmmContext, +): VmInstanceHybridIdentityMetadatasOperations { + return { + ...getVmInstanceHybridIdentityMetadatas(context), + }; +} diff --git a/sdk/scvmm/arm-scvmm/src/classic/vmmServers/index.ts b/sdk/scvmm/arm-scvmm/src/classic/vmmServers/index.ts new file mode 100644 index 000000000000..8039a5885cf0 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/classic/vmmServers/index.ts @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { ScVmmContext } from "../../api/scVmmContext.js"; +import { VmmServer, VmmServerTagsUpdate } from "../../models/models.js"; +import { + vmmServersGet, + vmmServersCreateOrUpdate, + vmmServersUpdate, + vmmServersDelete, + vmmServersListByResourceGroup, + vmmServersListBySubscription, +} from "../../api/vmmServers/index.js"; +import { PagedAsyncIterableIterator } from "../../models/pagingTypes.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; +import { + VmmServersGetOptionalParams, + VmmServersCreateOrUpdateOptionalParams, + VmmServersUpdateOptionalParams, + VmmServersDeleteOptionalParams, + VmmServersListByResourceGroupOptionalParams, + VmmServersListBySubscriptionOptionalParams, +} from "../../models/options.js"; + +/** Interface representing a VmmServers operations. */ +export interface VmmServersOperations { + /** Implements VmmServer GET method. */ + get: ( + resourceGroupName: string, + vmmServerName: string, + options?: VmmServersGetOptionalParams, + ) => Promise; + /** Onboards the SCVmm fabric as an Azure VmmServer resource. */ + createOrUpdate: ( + resourceGroupName: string, + vmmServerName: string, + resource: VmmServer, + options?: VmmServersCreateOrUpdateOptionalParams, + ) => PollerLike, VmmServer>; + /** Updates the VmmServers resource. */ + update: ( + resourceGroupName: string, + vmmServerName: string, + properties: VmmServerTagsUpdate, + options?: VmmServersUpdateOptionalParams, + ) => PollerLike, VmmServer>; + /** Removes the SCVmm fabric from Azure. */ + delete: ( + resourceGroupName: string, + vmmServerName: string, + options?: VmmServersDeleteOptionalParams, + ) => PollerLike, void>; + /** List of VmmServers in a resource group. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: VmmServersListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** List of VmmServers in a subscription. */ + listBySubscription: ( + options?: VmmServersListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; +} + +export function getVmmServers(context: ScVmmContext, subscriptionId: string) { + return { + get: ( + resourceGroupName: string, + vmmServerName: string, + options?: VmmServersGetOptionalParams, + ) => + vmmServersGet( + context, + subscriptionId, + resourceGroupName, + vmmServerName, + options, + ), + createOrUpdate: ( + resourceGroupName: string, + vmmServerName: string, + resource: VmmServer, + options?: VmmServersCreateOrUpdateOptionalParams, + ) => + vmmServersCreateOrUpdate( + context, + subscriptionId, + resourceGroupName, + vmmServerName, + resource, + options, + ), + update: ( + resourceGroupName: string, + vmmServerName: string, + properties: VmmServerTagsUpdate, + options?: VmmServersUpdateOptionalParams, + ) => + vmmServersUpdate( + context, + subscriptionId, + resourceGroupName, + vmmServerName, + properties, + options, + ), + delete: ( + resourceGroupName: string, + vmmServerName: string, + options?: VmmServersDeleteOptionalParams, + ) => + vmmServersDelete( + context, + subscriptionId, + resourceGroupName, + vmmServerName, + options, + ), + listByResourceGroup: ( + resourceGroupName: string, + options?: VmmServersListByResourceGroupOptionalParams, + ) => + vmmServersListByResourceGroup( + context, + subscriptionId, + resourceGroupName, + options, + ), + listBySubscription: ( + options?: VmmServersListBySubscriptionOptionalParams, + ) => vmmServersListBySubscription(context, subscriptionId, options), + }; +} + +export function getVmmServersOperations( + context: ScVmmContext, + subscriptionId: string, +): VmmServersOperations { + return { + ...getVmmServers(context, subscriptionId), + }; +} diff --git a/sdk/scvmm/arm-scvmm/src/helpers/serializerHelpers.ts b/sdk/scvmm/arm-scvmm/src/helpers/serializerHelpers.ts new file mode 100644 index 000000000000..332381cdb695 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/helpers/serializerHelpers.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +export function serializeRecord< + T extends string | number | boolean | Date | null, + R, +>(item: Record): Record; +export function serializeRecord( + item: Record, + serializer: (item: T) => R, +): Record; +export function serializeRecord( + item: Record, + serializer?: (item: T) => R, +): Record { + return Object.keys(item).reduce( + (acc, key) => { + if (isSupportedRecordType(item[key])) { + acc[key] = item[key] as any; + } else if (serializer) { + const value = item[key]; + if (value !== undefined) { + acc[key] = serializer(value); + } + } else { + console.warn(`Don't know how to serialize ${item[key]}`); + acc[key] = item[key] as any; + } + return acc; + }, + {} as Record, + ); +} + +function isSupportedRecordType(t: any) { + return ( + ["number", "string", "boolean", "null"].includes(typeof t) || + t instanceof Date + ); +} diff --git a/sdk/scvmm/arm-scvmm/src/index.ts b/sdk/scvmm/arm-scvmm/src/index.ts index aa31618ba97c..1df44b4253ec 100644 --- a/sdk/scvmm/arm-scvmm/src/index.ts +++ b/sdk/scvmm/arm-scvmm/src/index.ts @@ -1,13 +1,175 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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. -/// -export { getContinuationToken } from "./pagingHelper"; -export * from "./models"; -export { ScVmm } from "./scVmm"; -export * from "./operationsInterfaces"; +export { ScVmmClient, ScVmmClientOptionalParams } from "./scVmmClient.js"; +export { restorePoller, RestorePollerOptions } from "./restorePollerHelpers.js"; +export { + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + ProxyResource, + GuestAgent, + GuestAgentProperties, + GuestCredential, + HttpProxyConfiguration, + KnownProvisioningAction, + ProvisioningAction, + KnownResourceProvisioningState, + ResourceProvisioningState, + ErrorResponse, + ErrorDetail, + ErrorAdditionalInfo, + VmInstanceHybridIdentityMetadata, + VmInstanceHybridIdentityMetadataProperties, + ExtensionResource, + VirtualMachineInstance, + VirtualMachineInstanceProperties, + AvailabilitySetListItem, + OsProfileForVmInstance, + KnownOsType, + OsType, + HardwareProfile, + KnownLimitCpuForMigration, + LimitCpuForMigration, + KnownDynamicMemoryEnabled, + DynamicMemoryEnabled, + KnownIsHighlyAvailable, + IsHighlyAvailable, + NetworkProfile, + NetworkInterface, + KnownAllocationMethod, + AllocationMethod, + StorageProfile, + VirtualDisk, + StorageQosPolicyDetails, + KnownCreateDiffDisk, + CreateDiffDisk, + InfrastructureProfile, + Checkpoint, + ExtendedLocation, + VirtualMachineInstanceUpdate, + VirtualMachineInstanceUpdateProperties, + HardwareProfileUpdate, + NetworkProfileUpdate, + NetworkInterfaceUpdate, + StorageProfileUpdate, + VirtualDiskUpdate, + InfrastructureProfileUpdate, + KnownForceDelete, + ForceDelete, + KnownDeleteFromHost, + DeleteFromHost, + StopVirtualMachineOptions, + KnownSkipShutdown, + SkipShutdown, + VirtualMachineCreateCheckpoint, + VirtualMachineDeleteCheckpoint, + VirtualMachineRestoreCheckpoint, + InventoryItem, + InventoryItemProperties, + CloudInventoryItem, + VirtualNetworkInventoryItem, + VirtualMachineTemplateInventoryItem, + VirtualMachineInventoryItem, + InventoryItemDetails, + KnownInventoryType, + InventoryType, + TrackedResource, + AvailabilitySet, + AvailabilitySetProperties, + AvailabilitySetTagsUpdate, + VirtualMachineTemplate, + VirtualMachineTemplateProperties, + KnownIsCustomizable, + IsCustomizable, + VirtualMachineTemplateTagsUpdate, + VirtualNetwork, + VirtualNetworkProperties, + VirtualNetworkTagsUpdate, + Cloud, + CloudProperties, + CloudCapacity, + StorageQosPolicy, + CloudTagsUpdate, + VmmServer, + VmmServerProperties, + VmmCredential, + VmmServerTagsUpdate, + Operation, + OperationDisplay, + KnownOrigin, + Origin, + KnownActionType, + ActionType, + Versions, + ProvisioningState, + InventoryItemPropertiesUnion, + OperationsListOptionalParams, + VmmServersGetOptionalParams, + VmmServersCreateOrUpdateOptionalParams, + VmmServersUpdateOptionalParams, + VmmServersDeleteOptionalParams, + VmmServersListByResourceGroupOptionalParams, + VmmServersListBySubscriptionOptionalParams, + CloudsGetOptionalParams, + CloudsCreateOrUpdateOptionalParams, + CloudsUpdateOptionalParams, + CloudsDeleteOptionalParams, + CloudsListByResourceGroupOptionalParams, + CloudsListBySubscriptionOptionalParams, + VirtualNetworksGetOptionalParams, + VirtualNetworksCreateOrUpdateOptionalParams, + VirtualNetworksUpdateOptionalParams, + VirtualNetworksDeleteOptionalParams, + VirtualNetworksListByResourceGroupOptionalParams, + VirtualNetworksListBySubscriptionOptionalParams, + VirtualMachineTemplatesGetOptionalParams, + VirtualMachineTemplatesCreateOrUpdateOptionalParams, + VirtualMachineTemplatesUpdateOptionalParams, + VirtualMachineTemplatesDeleteOptionalParams, + VirtualMachineTemplatesListByResourceGroupOptionalParams, + VirtualMachineTemplatesListBySubscriptionOptionalParams, + AvailabilitySetsGetOptionalParams, + AvailabilitySetsCreateOrUpdateOptionalParams, + AvailabilitySetsUpdateOptionalParams, + AvailabilitySetsDeleteOptionalParams, + AvailabilitySetsListByResourceGroupOptionalParams, + AvailabilitySetsListBySubscriptionOptionalParams, + InventoryItemsGetOptionalParams, + InventoryItemsCreateOptionalParams, + InventoryItemsDeleteOptionalParams, + InventoryItemsListByVmmServerOptionalParams, + VirtualMachineInstancesGetOptionalParams, + VirtualMachineInstancesCreateOrUpdateOptionalParams, + VirtualMachineInstancesUpdateOptionalParams, + VirtualMachineInstancesDeleteOptionalParams, + VirtualMachineInstancesListOptionalParams, + VirtualMachineInstancesStopOptionalParams, + VirtualMachineInstancesStartOptionalParams, + VirtualMachineInstancesRestartOptionalParams, + VirtualMachineInstancesCreateCheckpointOptionalParams, + VirtualMachineInstancesDeleteCheckpointOptionalParams, + VirtualMachineInstancesRestoreCheckpointOptionalParams, + VmInstanceHybridIdentityMetadatasGetOptionalParams, + VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceOptionalParams, + GuestAgentsGetOptionalParams, + GuestAgentsCreateOptionalParams, + GuestAgentsDeleteOptionalParams, + GuestAgentsListByVirtualMachineInstanceOptionalParams, + PageSettings, + ContinuablePage, + PagedAsyncIterableIterator, +} from "./models/index.js"; +export { + AvailabilitySetsOperations, + CloudsOperations, + GuestAgentsOperations, + InventoryItemsOperations, + OperationsOperations, + VirtualMachineInstancesOperations, + VirtualMachineTemplatesOperations, + VirtualNetworksOperations, + VmInstanceHybridIdentityMetadatasOperations, + VmmServersOperations, +} from "./classic/index.js"; diff --git a/sdk/scvmm/arm-scvmm/src/logger.ts b/sdk/scvmm/arm-scvmm/src/logger.ts new file mode 100644 index 000000000000..feff2c7a1f01 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/logger.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { createClientLogger } from "@azure/logger"; +export const logger = createClientLogger("arm-scvmm"); diff --git a/sdk/scvmm/arm-scvmm/src/lroImpl.ts b/sdk/scvmm/arm-scvmm/src/lroImpl.ts deleted file mode 100644 index b27f5ac7209b..000000000000 --- a/sdk/scvmm/arm-scvmm/src/lroImpl.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { AbortSignalLike } from "@azure/abort-controller"; -import { LongRunningOperation, LroResponse } from "@azure/core-lro"; - -export function createLroSpec(inputs: { - sendOperationFn: (args: any, spec: any) => Promise>; - args: Record; - spec: { - readonly requestBody?: unknown; - readonly path?: string; - readonly httpMethod: string; - } & Record; -}): LongRunningOperation { - const { args, spec, sendOperationFn } = inputs; - return { - requestMethod: spec.httpMethod, - requestPath: spec.path!, - sendInitialRequest: () => sendOperationFn(args, spec), - sendPollRequest: ( - path: string, - options?: { abortSignal?: AbortSignalLike }, - ) => { - const { requestBody, ...restSpec } = spec; - return sendOperationFn(args, { - ...restSpec, - httpMethod: "GET", - path, - abortSignal: options?.abortSignal, - }); - }, - }; -} diff --git a/sdk/scvmm/arm-scvmm/src/models/index.ts b/sdk/scvmm/arm-scvmm/src/models/index.ts index 1333a36fa204..1ed278c7be13 100644 --- a/sdk/scvmm/arm-scvmm/src/models/index.ts +++ b/sdk/scvmm/arm-scvmm/src/models/index.ts @@ -1,2290 +1,165 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 - | CloudInventoryItem - | VirtualMachineInventoryItem - | VirtualMachineTemplateInventoryItem - | VirtualNetworkInventoryItem; - -/** The response of a VirtualMachineInstance list operation. */ -export interface VirtualMachineInstanceListResult { - /** The VirtualMachineInstance items on this page */ - value: VirtualMachineInstance[]; - /** - * The link to the next page of items - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** Defines the resource properties. */ -export interface VirtualMachineInstanceProperties { - /** Availability Sets in vm. */ - availabilitySets?: AvailabilitySetListItem[]; - /** OS properties. */ - osProfile?: OsProfileForVmInstance; - /** Hardware properties. */ - hardwareProfile?: HardwareProfile; - /** Network properties. */ - networkProfile?: NetworkProfile; - /** Storage properties. */ - storageProfile?: StorageProfile; - /** Gets the infrastructure profile. */ - infrastructureProfile?: InfrastructureProfile; - /** - * 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; - /** - * Provisioning state of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningState; -} - -/** Availability Set model */ -export interface AvailabilitySetListItem { - /** Gets the ARM Id of the microsoft.scvmm/availabilitySets resource. */ - id?: string; - /** Gets or sets the name of the availability set. */ - name?: string; -} - -/** Defines the resource properties. */ -export interface OsProfileForVmInstance { - /** - * Admin password of the virtual machine. - * This value contains a credential. Consider obscuring before showing to users - */ - adminPassword?: string; - /** Gets or sets computer name. */ - computerName?: string; - /** - * Gets the type of the os. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly osType?: OsType; - /** - * Gets os sku. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly osSku?: string; - /** - * Gets os version. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly osVersion?: string; -} - -/** Defines the resource properties. */ -export interface HardwareProfile { - /** MemoryMB is the size of a virtual machine's memory, in MB. */ - memoryMB?: number; - /** Gets or sets the number of vCPUs for the vm. */ - cpuCount?: number; - /** Gets or sets a value indicating whether to enable processor compatibility mode for live migration of VMs. */ - limitCpuForMigration?: LimitCpuForMigration; - /** Gets or sets a value indicating whether to enable dynamic memory or not. */ - dynamicMemoryEnabled?: DynamicMemoryEnabled; - /** Gets or sets the max dynamic memory for the vm. */ - dynamicMemoryMaxMB?: number; - /** Gets or sets the min dynamic memory for the vm. */ - dynamicMemoryMinMB?: number; - /** - * Gets highly available property. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isHighlyAvailable?: IsHighlyAvailable; -} - -/** 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 the display name of the network interface as shown in the vmmServer. This is the fallback label for a NIC when the name is not set. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly displayName?: string; - /** - * Gets the nic ipv4 addresses. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly ipv4Addresses?: string[]; - /** - * Gets the nic ipv6 addresses. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly ipv6Addresses?: string[]; - /** Gets or sets the nic MAC address. */ - macAddress?: string; - /** Gets or sets the ARM Id of the Microsoft.ScVmm/virtualNetwork resource to connect the nic. */ - virtualNetworkId?: string; - /** - * Gets the name of the virtual network in vmmServer that the nic is connected to. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly networkName?: string; - /** Gets or sets the ipv4 address type. */ - ipv4AddressType?: AllocationMethod; - /** Gets or sets the ipv6 address type. */ - ipv6AddressType?: AllocationMethod; - /** Gets or sets the mac address type. */ - macAddressType?: AllocationMethod; - /** Gets or sets the nic id. */ - nicId?: string; -} - -/** Defines the resource properties. */ -export interface StorageProfile { - /** Gets or sets the list of virtual disks associated with the virtual machine. */ - disks?: VirtualDisk[]; -} - -/** Virtual disk model */ -export interface VirtualDisk { - /** Gets or sets the name of the disk. */ - name?: string; - /** - * Gets the display name of the virtual disk as shown in the vmmServer. This is the fallback label for a disk when the name is not set. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly displayName?: string; - /** Gets or sets the disk id. */ - diskId?: string; - /** Gets or sets the disk total size. */ - diskSizeGB?: number; - /** - * Gets the max disk size. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly maxDiskSizeGB?: number; - /** Gets or sets the disk bus. */ - bus?: number; - /** Gets or sets the disk lun. */ - lun?: number; - /** Gets or sets the disk bus type. */ - busType?: string; - /** Gets or sets the disk vhd type. */ - vhdType?: string; - /** - * Gets the disk volume type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly volumeType?: string; - /** - * Gets the disk vhd format type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly vhdFormatType?: string; - /** Gets or sets the disk id in the template. */ - templateDiskId?: string; - /** The QoS policy for the disk. */ - storageQosPolicy?: StorageQosPolicyDetails; - /** Gets or sets a value indicating diff disk. */ - createDiffDisk?: CreateDiffDisk; -} - -/** The StorageQoSPolicyDetails definition. */ -export interface StorageQosPolicyDetails { - /** The name of the policy. */ - name?: string; - /** The ID of the QoS policy. */ - id?: string; -} - -/** Specifies the vmmServer infrastructure specific settings for the virtual machine instance. */ -export interface InfrastructureProfile { - /** Gets or sets the inventory Item ID for the resource. */ - inventoryItemId?: string; - /** ARM Id of the vmmServer resource in which this resource resides. */ - vmmServerId?: string; - /** ARM Id of the cloud resource to use for deploying the vm. */ - cloudId?: string; - /** ARM Id of the template resource to use for deploying the vm. */ - templateId?: string; - /** VMName is the name of VM on the SCVmm server. */ - vmName?: string; - /** Unique ID of the virtual machine. */ - uuid?: string; - /** - * Last restored checkpoint in the vm. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly lastRestoredVmCheckpoint?: Checkpoint; - /** - * Checkpoints in the vm. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly checkpoints?: Checkpoint[]; - /** Type of checkpoint supported for the vm. */ - checkpointType?: string; - /** Gets or sets the generation for the vm. */ - generation?: number; - /** Gets or sets the bios guid for the vm. */ - biosGuid?: string; -} - -/** Defines the resource properties. */ -export interface Checkpoint { - /** Gets ID of parent of the checkpoint. */ - parentCheckpointId?: string; - /** Gets ID of the checkpoint. */ - checkpointId?: string; - /** Gets name of the checkpoint. */ - name?: string; - /** Gets description of the checkpoint. */ - description?: string; -} - -/** The extended location. */ -export interface ExtendedLocation { - /** The extended location type. */ - type?: string; - /** The extended location name. */ - name?: 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. E.g. "/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; - /** - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; -} - -/** 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; -} - -/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ -export interface ErrorResponse { - /** The error object. */ - error?: ErrorDetail; -} - -/** The error detail. */ -export interface ErrorDetail { - /** - * The error code. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly code?: string; - /** - * The error message. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly message?: string; - /** - * The error target. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly target?: string; - /** - * The error details. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly details?: ErrorDetail[]; - /** - * The error additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly additionalInfo?: ErrorAdditionalInfo[]; -} - -/** The resource management error additional info. */ -export interface ErrorAdditionalInfo { - /** - * The additional info type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * The additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly info?: Record; -} - -/** The type used for update operations of the VirtualMachineInstance. */ -export interface VirtualMachineInstanceUpdate { - /** The update properties of the VirtualMachineInstance. */ - properties?: VirtualMachineInstanceUpdateProperties; -} - -/** Virtual Machine Instance Properties Update model */ -export interface VirtualMachineInstanceUpdateProperties { - /** Availability Sets in vm. */ - availabilitySets?: AvailabilitySetListItem[]; - /** Hardware properties. */ - hardwareProfile?: HardwareProfileUpdate; - /** Network properties. */ - networkProfile?: NetworkProfileUpdate; - /** Storage properties. */ - storageProfile?: StorageProfileUpdate; - /** Gets the infrastructure profile. */ - infrastructureProfile?: InfrastructureProfileUpdate; -} - -/** Defines the resource update properties. */ -export interface HardwareProfileUpdate { - /** MemoryMB is the size of a virtual machine's memory, in MB. */ - memoryMB?: number; - /** Gets or sets the number of vCPUs for the vm. */ - cpuCount?: number; - /** Gets or sets a value indicating whether to enable processor compatibility mode for live migration of VMs. */ - limitCpuForMigration?: LimitCpuForMigration; - /** Gets or sets a value indicating whether to enable dynamic memory or not. */ - dynamicMemoryEnabled?: DynamicMemoryEnabled; - /** Gets or sets the max dynamic memory for the vm. */ - dynamicMemoryMaxMB?: number; - /** Gets or sets the min dynamic memory for the vm. */ - dynamicMemoryMinMB?: number; -} - -/** Defines the resource update properties. */ -export interface NetworkProfileUpdate { - /** Gets or sets the list of network interfaces associated with the virtual machine. */ - networkInterfaces?: NetworkInterfaceUpdate[]; -} - -/** Network Interface Update model */ -export interface NetworkInterfaceUpdate { - /** Gets or sets the name of the network interface. */ - name?: string; - /** Gets or sets the nic MAC address. */ - macAddress?: string; - /** Gets or sets the ARM Id of the Microsoft.ScVmm/virtualNetwork resource to connect the nic. */ - virtualNetworkId?: string; - /** Gets or sets the ipv4 address type. */ - ipv4AddressType?: AllocationMethod; - /** Gets or sets the ipv6 address type. */ - ipv6AddressType?: AllocationMethod; - /** Gets or sets the mac address type. */ - macAddressType?: AllocationMethod; - /** Gets or sets the nic id. */ - nicId?: string; -} - -/** Defines the resource update properties. */ -export interface StorageProfileUpdate { - /** Gets or sets the list of virtual disks associated with the virtual machine. */ - disks?: VirtualDiskUpdate[]; -} - -/** Virtual Disk Update model */ -export interface VirtualDiskUpdate { - /** Gets or sets the name of the disk. */ - name?: string; - /** Gets or sets the disk id. */ - diskId?: string; - /** Gets or sets the disk total size. */ - diskSizeGB?: number; - /** Gets or sets the disk bus. */ - bus?: number; - /** Gets or sets the disk lun. */ - lun?: number; - /** Gets or sets the disk bus type. */ - busType?: string; - /** Gets or sets the disk vhd type. */ - vhdType?: string; - /** The QoS policy for the disk. */ - storageQosPolicy?: StorageQosPolicyDetails; -} - -/** Specifies the vmmServer infrastructure specific update settings for the virtual machine instance. */ -export interface InfrastructureProfileUpdate { - /** Type of checkpoint supported for the vm. */ - checkpointType?: string; -} - -/** Defines the create checkpoint action properties. */ -export interface VirtualMachineCreateCheckpoint { - /** Name of the checkpoint. */ - name?: string; - /** Description of the checkpoint. */ - description?: string; -} - -/** Defines the delete checkpoint action properties. */ -export interface VirtualMachineDeleteCheckpoint { - /** ID of the checkpoint to be deleted. */ - id?: string; -} - -/** The response of a GuestAgent list operation. */ -export interface GuestAgentListResult { - /** The GuestAgent items on this page */ - value: GuestAgent[]; - /** - * The link to the next page of items - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** Defines the resource properties. */ -export interface GuestAgentProperties { - /** - * Gets 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 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; - /** - * Provisioning state of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningState; -} - -/** 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. - * This value contains a credential. Consider obscuring before showing to users - */ - password: string; -} - -/** HTTP Proxy configuration for the VM. */ -export interface HttpProxyConfiguration { - /** Gets or sets httpsProxy url. */ - httpsProxy?: string; -} - -/** The response of a VmInstanceHybridIdentityMetadata list operation. */ -export interface VmInstanceHybridIdentityMetadataListResult { - /** The VmInstanceHybridIdentityMetadata items on this page */ - value: VmInstanceHybridIdentityMetadata[]; - /** - * The link to the next page of items - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** Describes the properties of Hybrid Identity Metadata for a Virtual Machine. */ -export interface VmInstanceHybridIdentityMetadataProperties { - /** The unique identifier for the resource. */ - resourceUid?: string; - /** Gets or sets the Public Key. */ - publicKey?: string; - /** - * Provisioning state of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningState; -} - -/** Defines the restore checkpoint action properties. */ -export interface VirtualMachineRestoreCheckpoint { - /** ID of the checkpoint to be restored to. */ - id?: string; -} - -/** 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?: SkipShutdown; -} - -/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ -export interface OperationListResult { - /** - * List of operations supported by the resource provider - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: Operation[]; - /** - * URL to get the next set of operation list results (if there are any). - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** Details of a REST API operation, returned from the Resource Provider Operations API */ -export interface Operation { - /** - * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isDataAction?: boolean; - /** Localized display information for this particular operation. */ - display?: OperationDisplay; - /** - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly origin?: Origin; - /** - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly actionType?: ActionType; -} - -/** Localized display information for this particular operation. */ -export interface OperationDisplay { - /** - * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provider?: string; - /** - * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resource?: string; - /** - * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly operation?: string; - /** - * The short, localized friendly description of the operation; suitable for tool tips and detailed views. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly description?: string; -} - -/** The response of a AvailabilitySet list operation. */ -export interface AvailabilitySetListResult { - /** The AvailabilitySet items on this page */ - value: AvailabilitySet[]; - /** - * The link to the next page of items - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** Defines the resource properties. */ -export interface AvailabilitySetProperties { - /** Name of the availability set. */ - availabilitySetName?: string; - /** ARM Id of the vmmServer resource in which this resource resides. */ - vmmServerId?: string; - /** - * Provisioning state of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningState; -} - -/** The response of a Cloud list operation. */ -export interface CloudListResult { - /** The Cloud items on this page */ - value: Cloud[]; - /** - * The link to the next page of items - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** Defines the resource properties. */ -export interface CloudProperties { - /** Gets or sets the inventory Item ID for the resource. */ - inventoryItemId?: string; - /** Unique ID of the cloud. */ - uuid?: string; - /** ARM Id of the vmmServer resource in which this resource resides. */ - vmmServerId?: string; - /** - * Name of the cloud in VmmServer. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly cloudName?: string; - /** - * Capacity of the cloud. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly cloudCapacity?: CloudCapacity; - /** - * List of QoS policies available for the cloud. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly storageQosPolicies?: StorageQosPolicy[]; - /** - * Provisioning state of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningState; -} - -/** Cloud Capacity model */ -export interface CloudCapacity { - /** - * CPUCount specifies the maximum number of CPUs that can be allocated in the cloud. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly cpuCount?: number; - /** - * MemoryMB specifies a memory usage limit in megabytes. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly memoryMB?: number; - /** - * VMCount gives the max number of VMs that can be deployed in the cloud. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly vmCount?: number; -} - -/** The StorageQoSPolicy definition. */ -export interface StorageQosPolicy { - /** The name of the policy. */ - name?: string; - /** The ID of the QoS policy. */ - id?: string; - /** The maximum IO operations per second. */ - iopsMaximum?: number; - /** The minimum IO operations per second. */ - iopsMinimum?: number; - /** The Bandwidth Limit for internet traffic. */ - bandwidthLimit?: number; - /** The underlying policy. */ - policyId?: string; -} - -/** The response of a VirtualMachineTemplate list operation. */ -export interface VirtualMachineTemplateListResult { - /** The VirtualMachineTemplate items on this page */ - value: VirtualMachineTemplate[]; - /** - * The link to the next page of items - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** Defines the resource properties. */ -export interface VirtualMachineTemplateProperties { - /** Gets or sets the inventory Item ID for the resource. */ - inventoryItemId?: string; - /** Unique ID of the virtual machine template. */ - uuid?: string; - /** ARM Id of the vmmServer resource in which this resource resides. */ - vmmServerId?: string; - /** - * Gets the type of the os. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly osType?: OsType; - /** - * Gets os name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly osName?: string; - /** - * Gets computer name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly computerName?: string; - /** - * MemoryMB is the desired size of a virtual machine's memory, in MB. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly memoryMB?: number; - /** - * Gets the desired number of vCPUs for the vm. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly cpuCount?: number; - /** - * Gets a value indicating whether to enable processor compatibility mode for live migration of VMs. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly limitCpuForMigration?: LimitCpuForMigration; - /** - * Gets a value indicating whether to enable dynamic memory or not. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly dynamicMemoryEnabled?: DynamicMemoryEnabled; - /** - * Gets a value indicating whether the vm template is customizable or not. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isCustomizable?: IsCustomizable; - /** - * Gets the max dynamic memory for the vm. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly dynamicMemoryMaxMB?: number; - /** - * Gets the min dynamic memory for the vm. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly dynamicMemoryMinMB?: number; - /** - * Gets highly available property. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isHighlyAvailable?: IsHighlyAvailable; - /** - * Gets the generation for the vm. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly generation?: number; - /** - * Gets 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 the disks of the template. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly disks?: VirtualDisk[]; - /** - * Provisioning state of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningState; -} - -/** The response of a VirtualNetwork list operation. */ -export interface VirtualNetworkListResult { - /** The VirtualNetwork items on this page */ - value: VirtualNetwork[]; - /** - * The link to the next page of items - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** Defines the resource properties. */ -export interface VirtualNetworkProperties { - /** Gets or sets the inventory Item ID for the resource. */ - inventoryItemId?: string; - /** Unique ID of the virtual network. */ - uuid?: string; - /** ARM Id of the vmmServer resource in which this resource resides. */ - vmmServerId?: string; - /** - * Name of the virtual network in vmmServer. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly networkName?: string; - /** - * Provisioning state of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningState; -} - -/** The response of a VmmServer list operation. */ -export interface VmmServerListResult { - /** The VmmServer items on this page */ - value: VmmServer[]; - /** - * The link to the next page of items - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** Defines the resource properties. */ -export interface VmmServerProperties { - /** Credentials to connect to VmmServer. */ - credentials?: VmmCredential; - /** Fqdn is the hostname/ip of the vmmServer. */ - fqdn: string; - /** Port is the port on which the vmmServer is listening. */ - port?: number; - /** - * Gets the connection status to the vmmServer. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly connectionStatus?: string; - /** - * Gets any error message if connection to vmmServer is having any issue. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly errorMessage?: string; - /** - * Unique ID of vmmServer. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly uuid?: string; - /** - * Version is the version of the vmmSever. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly version?: string; - /** - * Provisioning state of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningState; -} - -/** Credentials to connect to VmmServer. */ -export interface VmmCredential { - /** Username to use to connect to VmmServer. */ - username?: string; - /** - * Password to use to connect to VmmServer. - * This value contains a credential. Consider obscuring before showing to users - */ - password?: string; -} - -/** The type used for updating tags in AvailabilitySet resources. */ -export interface AvailabilitySetTagsUpdate { - /** Resource tags. */ - tags?: { [propertyName: string]: string }; -} - -/** The type used for updating tags in Cloud resources. */ -export interface CloudTagsUpdate { - /** Resource tags. */ - tags?: { [propertyName: string]: string }; -} - -/** The type used for updating tags in VirtualMachineTemplate resources. */ -export interface VirtualMachineTemplateTagsUpdate { - /** Resource tags. */ - tags?: { [propertyName: string]: string }; -} - -/** The type used for updating tags in VirtualNetwork resources. */ -export interface VirtualNetworkTagsUpdate { - /** Resource tags. */ - tags?: { [propertyName: string]: string }; -} - -/** The type used for updating tags in VmmServer resources. */ -export interface VmmServerTagsUpdate { - /** Resource tags. */ - tags?: { [propertyName: string]: string }; -} - -/** The response of a InventoryItem list operation. */ -export interface InventoryItemListResult { - /** The InventoryItem items on this page */ - value: InventoryItem[]; - /** - * The link to the next page of items - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** Defines the resource properties. */ -export interface InventoryItemProperties { - /** Polymorphic discriminator, which specifies the different types this object can be */ - inventoryType: - | "Cloud" - | "VirtualMachine" - | "VirtualMachineTemplate" - | "VirtualNetwork"; - /** - * Gets the tracked resource id corresponding to the inventory resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly managedResourceId?: string; - /** - * Gets the UUID (which is assigned by Vmm) for the inventory item. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly uuid?: string; - /** - * Gets the Managed Object name in Vmm for the inventory item. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly inventoryItemName?: string; - /** - * Provisioning state of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningState; -} - -/** Defines the resource properties. */ -export interface InventoryItemDetails { - /** Gets or sets the inventory Item ID for the resource. */ - inventoryItemId?: string; - /** Gets or sets the Managed Object name in Vmm for the resource. */ - inventoryItemName?: string; -} - -/** 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 resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ -export interface TrackedResource extends Resource { - /** Resource tags. */ - tags?: { [propertyName: string]: string }; - /** The geo-location where the resource lives */ - location: string; -} - -/** The Cloud inventory item. */ -export interface CloudInventoryItem extends InventoryItemProperties { - /** Polymorphic discriminator, which specifies the different types this object can be */ - inventoryType: "Cloud"; -} - -/** The Virtual machine inventory item. */ -export interface VirtualMachineInventoryItem extends InventoryItemProperties { - /** Polymorphic discriminator, which specifies the different types this object can be */ - inventoryType: "VirtualMachine"; - /** - * Gets the type of the os. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly osType?: OsType; - /** - * Gets os name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly osName?: string; - /** - * Gets os version. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly osVersion?: 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 nic ip addresses. */ - ipAddresses?: string[]; - /** Cloud inventory resource details where the VM is present. */ - cloud?: InventoryItemDetails; - /** - * Gets the bios guid. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly biosGuid?: string; - /** - * Gets the tracked resource id corresponding to the inventory resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly managedMachineResourceId?: string; -} - -/** The Virtual machine template inventory item. */ -export interface VirtualMachineTemplateInventoryItem - extends InventoryItemProperties { - /** Polymorphic discriminator, which specifies the different types this object can be */ - inventoryType: "VirtualMachineTemplate"; - /** - * Gets the desired number of vCPUs for the vm. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly cpuCount?: number; - /** - * MemoryMB is the desired size of a virtual machine's memory, in MB. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly memoryMB?: number; - /** - * Gets the type of the os. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly osType?: OsType; - /** - * Gets os name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly osName?: string; -} - -/** The Virtual network inventory item. */ -export interface VirtualNetworkInventoryItem extends InventoryItemProperties { - /** Polymorphic discriminator, which specifies the different types this object can be */ - inventoryType: "VirtualNetwork"; -} - -/** Define the virtualMachineInstance. */ -export interface VirtualMachineInstance extends ProxyResource { - /** The resource-specific properties for this resource. */ - properties?: VirtualMachineInstanceProperties; - /** Gets or sets the extended location. */ - extendedLocation: ExtendedLocation; -} - -/** Defines the GuestAgent. */ -export interface GuestAgent extends ProxyResource { - /** The resource-specific properties for this resource. */ - properties?: GuestAgentProperties; -} - -/** Defines the HybridIdentityMetadata. */ -export interface VmInstanceHybridIdentityMetadata extends ProxyResource { - /** The resource-specific properties for this resource. */ - properties?: VmInstanceHybridIdentityMetadataProperties; -} - -/** Defines the inventory item. */ -export interface InventoryItem extends ProxyResource { - /** The resource-specific properties for this resource. */ - properties?: InventoryItemPropertiesUnion; - /** 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 AvailabilitySets resource definition. */ -export interface AvailabilitySet extends TrackedResource { - /** The resource-specific properties for this resource. */ - properties?: AvailabilitySetProperties; - /** The extended location. */ - extendedLocation: ExtendedLocation; -} - -/** The Clouds resource definition. */ -export interface Cloud extends TrackedResource { - /** The resource-specific properties for this resource. */ - properties?: CloudProperties; - /** The extended location. */ - extendedLocation: ExtendedLocation; -} - -/** The VirtualMachineTemplates resource definition. */ -export interface VirtualMachineTemplate extends TrackedResource { - /** The resource-specific properties for this resource. */ - properties?: VirtualMachineTemplateProperties; - /** The extended location. */ - extendedLocation: ExtendedLocation; -} - -/** The VirtualNetworks resource definition. */ -export interface VirtualNetwork extends TrackedResource { - /** The resource-specific properties for this resource. */ - properties?: VirtualNetworkProperties; - /** The extended location. */ - extendedLocation: ExtendedLocation; -} - -/** The VmmServers resource definition. */ -export interface VmmServer extends TrackedResource { - /** The resource-specific properties for this resource. */ - properties?: VmmServerProperties; - /** The extended location. */ - extendedLocation: ExtendedLocation; -} - -/** Defines headers for VirtualMachineInstances_createOrUpdate operation. */ -export interface VirtualMachineInstancesCreateOrUpdateHeaders { - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineInstances_update operation. */ -export interface VirtualMachineInstancesUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineInstances_delete operation. */ -export interface VirtualMachineInstancesDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineInstances_createCheckpoint operation. */ -export interface VirtualMachineInstancesCreateCheckpointHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineInstances_deleteCheckpoint operation. */ -export interface VirtualMachineInstancesDeleteCheckpointHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineInstances_restart operation. */ -export interface VirtualMachineInstancesRestartHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineInstances_restoreCheckpoint operation. */ -export interface VirtualMachineInstancesRestoreCheckpointHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineInstances_start operation. */ -export interface VirtualMachineInstancesStartHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineInstances_stop operation. */ -export interface VirtualMachineInstancesStopHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for GuestAgents_create operation. */ -export interface GuestAgentsCreateHeaders { - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for AvailabilitySets_createOrUpdate operation. */ -export interface AvailabilitySetsCreateOrUpdateHeaders { - /** A link to the status monitor */ - azureAsyncOperation?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for AvailabilitySets_update operation. */ -export interface AvailabilitySetsUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for AvailabilitySets_delete operation. */ -export interface AvailabilitySetsDeleteHeaders { - /** A link to the status monitor */ - azureAsyncOperation?: string; - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for Clouds_createOrUpdate operation. */ -export interface CloudsCreateOrUpdateHeaders { - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for Clouds_update operation. */ -export interface CloudsUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for Clouds_delete operation. */ -export interface CloudsDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineTemplates_createOrUpdate operation. */ -export interface VirtualMachineTemplatesCreateOrUpdateHeaders { - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineTemplates_update operation. */ -export interface VirtualMachineTemplatesUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineTemplates_delete operation. */ -export interface VirtualMachineTemplatesDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualNetworks_createOrUpdate operation. */ -export interface VirtualNetworksCreateOrUpdateHeaders { - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualNetworks_update operation. */ -export interface VirtualNetworksUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualNetworks_delete operation. */ -export interface VirtualNetworksDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VmmServers_createOrUpdate operation. */ -export interface VmmServersCreateOrUpdateHeaders { - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VmmServers_update operation. */ -export interface VmmServersUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VmmServers_delete operation. */ -export interface VmmServersDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Known values of {@link OsType} that the service accepts. */ -export enum KnownOsType { - /** Windows operating system. */ - Windows = "Windows", - /** Linux operating system. */ - Linux = "Linux", - /** Other operating system. */ - 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**: Windows operating system. \ - * **Linux**: Linux operating system. \ - * **Other**: Other operating system. - */ -export type OsType = string; - -/** Known values of {@link LimitCpuForMigration} that the service accepts. */ -export enum KnownLimitCpuForMigration { - /** Enable limit CPU for migration. */ - True = "true", - /** Disable limit CPU for migration. */ - False = "false", -} - -/** - * Defines values for LimitCpuForMigration. \ - * {@link KnownLimitCpuForMigration} can be used interchangeably with LimitCpuForMigration, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **true**: Enable limit CPU for migration. \ - * **false**: Disable limit CPU for migration. - */ -export type LimitCpuForMigration = string; - -/** Known values of {@link DynamicMemoryEnabled} that the service accepts. */ -export enum KnownDynamicMemoryEnabled { - /** Enable dynamic memory. */ - True = "true", - /** Disable dynamic memory. */ - False = "false", -} - -/** - * Defines values for DynamicMemoryEnabled. \ - * {@link KnownDynamicMemoryEnabled} can be used interchangeably with DynamicMemoryEnabled, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **true**: Enable dynamic memory. \ - * **false**: Disable dynamic memory. - */ -export type DynamicMemoryEnabled = string; - -/** Known values of {@link IsHighlyAvailable} that the service accepts. */ -export enum KnownIsHighlyAvailable { - /** Enable highly available. */ - True = "true", - /** Disable highly available. */ - False = "false", -} - -/** - * Defines values for IsHighlyAvailable. \ - * {@link KnownIsHighlyAvailable} can be used interchangeably with IsHighlyAvailable, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **true**: Enable highly available. \ - * **false**: Disable highly available. - */ -export type IsHighlyAvailable = string; - -/** Known values of {@link AllocationMethod} that the service accepts. */ -export enum KnownAllocationMethod { - /** Dynamically allocated address. */ - Dynamic = "Dynamic", - /** Statically allocated address. */ - Static = "Static", -} - -/** - * Defines values for AllocationMethod. \ - * {@link KnownAllocationMethod} can be used interchangeably with AllocationMethod, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Dynamic**: Dynamically allocated address. \ - * **Static**: Statically allocated address. - */ -export type AllocationMethod = string; - -/** Known values of {@link CreateDiffDisk} that the service accepts. */ -export enum KnownCreateDiffDisk { - /** Enable create diff disk. */ - True = "true", - /** Disable create diff disk. */ - False = "false", -} - -/** - * Defines values for CreateDiffDisk. \ - * {@link KnownCreateDiffDisk} can be used interchangeably with CreateDiffDisk, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **true**: Enable create diff disk. \ - * **false**: Disable create diff disk. - */ -export type CreateDiffDisk = string; - -/** Known values of {@link ProvisioningState} that the service accepts. */ -export enum KnownProvisioningState { - /** Resource has been created. */ - Succeeded = "Succeeded", - /** Resource creation failed. */ - Failed = "Failed", - /** Resource creation was canceled. */ - Canceled = "Canceled", - /** The resource is provisioning. */ - Provisioning = "Provisioning", - /** The resource is updating. */ - Updating = "Updating", - /** The resource is being deleted. */ - Deleting = "Deleting", - /** The resource has been accepted. */ - Accepted = "Accepted", - /** The resource was 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**: Resource has been created. \ - * **Failed**: Resource creation failed. \ - * **Canceled**: Resource creation was canceled. \ - * **Provisioning**: The resource is provisioning. \ - * **Updating**: The resource is updating. \ - * **Deleting**: The resource is being deleted. \ - * **Accepted**: The resource has been accepted. \ - * **Created**: The resource was created. - */ -export type ProvisioningState = 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 ForceDelete} that the service accepts. */ -export enum KnownForceDelete { - /** Enable force delete. */ - True = "true", - /** Disable force delete. */ - False = "false", -} - -/** - * Defines values for ForceDelete. \ - * {@link KnownForceDelete} can be used interchangeably with ForceDelete, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **true**: Enable force delete. \ - * **false**: Disable force delete. - */ -export type ForceDelete = string; - -/** Known values of {@link DeleteFromHost} that the service accepts. */ -export enum KnownDeleteFromHost { - /** Enable delete from host. */ - True = "true", - /** Disable delete from host. */ - False = "false", -} - -/** - * Defines values for DeleteFromHost. \ - * {@link KnownDeleteFromHost} can be used interchangeably with DeleteFromHost, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **true**: Enable delete from host. \ - * **false**: Disable delete from host. - */ -export type DeleteFromHost = string; - -/** Known values of {@link ProvisioningAction} that the service accepts. */ -export enum KnownProvisioningAction { - /** Install guest agent. */ - Install = "install", - /** Uninstall guest agent. */ - Uninstall = "uninstall", - /** Repair guest agent. */ - 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**: Install guest agent. \ - * **uninstall**: Uninstall guest agent. \ - * **repair**: Repair guest agent. - */ -export type ProvisioningAction = string; - -/** Known values of {@link SkipShutdown} that the service accepts. */ -export enum KnownSkipShutdown { - /** Enable skip shutdown. */ - True = "true", - /** Disable skip shutdown. */ - False = "false", -} - -/** - * Defines values for SkipShutdown. \ - * {@link KnownSkipShutdown} can be used interchangeably with SkipShutdown, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **true**: Enable skip shutdown. \ - * **false**: Disable skip shutdown. - */ -export type SkipShutdown = string; - -/** Known values of {@link Origin} that the service accepts. */ -export enum KnownOrigin { - /** User */ - User = "user", - /** System */ - System = "system", - /** UserSystem */ - UserSystem = "user,system", -} - -/** - * Defines values for Origin. \ - * {@link KnownOrigin} can be used interchangeably with Origin, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **user** \ - * **system** \ - * **user,system** - */ -export type Origin = string; - -/** Known values of {@link ActionType} that the service accepts. */ -export enum KnownActionType { - /** Internal */ - Internal = "Internal", -} - -/** - * Defines values for ActionType. \ - * {@link KnownActionType} can be used interchangeably with ActionType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Internal** - */ -export type ActionType = string; - -/** Known values of {@link IsCustomizable} that the service accepts. */ -export enum KnownIsCustomizable { - /** Enable customizable. */ - True = "true", - /** Disable customizable. */ - False = "false", -} - -/** - * Defines values for IsCustomizable. \ - * {@link KnownIsCustomizable} can be used interchangeably with IsCustomizable, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **true**: Enable customizable. \ - * **false**: Disable customizable. - */ -export type IsCustomizable = string; - -/** Known values of {@link InventoryType} that the service accepts. */ -export enum KnownInventoryType { - /** Cloud inventory type */ - Cloud = "Cloud", - /** VirtualNetwork inventory type */ - VirtualNetwork = "VirtualNetwork", - /** VirtualMachine inventory type */ - VirtualMachine = "VirtualMachine", - /** VirtualMachineTemplate inventory type */ - VirtualMachineTemplate = "VirtualMachineTemplate", -} - -/** - * 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 - * **Cloud**: Cloud inventory type \ - * **VirtualNetwork**: VirtualNetwork inventory type \ - * **VirtualMachine**: VirtualMachine inventory type \ - * **VirtualMachineTemplate**: VirtualMachineTemplate inventory type - */ -export type InventoryType = string; - -/** Optional parameters. */ -export interface VirtualMachineInstancesListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type VirtualMachineInstancesListResponse = - VirtualMachineInstanceListResult; - -/** Optional parameters. */ -export interface VirtualMachineInstancesGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type VirtualMachineInstancesGetResponse = VirtualMachineInstance; - -/** Optional parameters. */ -export interface VirtualMachineInstancesCreateOrUpdateOptionalParams - 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 VirtualMachineInstancesCreateOrUpdateResponse = - VirtualMachineInstance; - -/** Optional parameters. */ -export interface VirtualMachineInstancesUpdateOptionalParams - 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 VirtualMachineInstancesUpdateResponse = VirtualMachineInstance; - -/** Optional parameters. */ -export interface VirtualMachineInstancesDeleteOptionalParams - extends coreClient.OperationOptions { - /** Forces the resource to be deleted. */ - force?: ForceDelete; - /** Whether to disable the VM from azure and also delete it from Vmm. */ - deleteFromHost?: DeleteFromHost; - /** 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 delete operation. */ -export type VirtualMachineInstancesDeleteResponse = - VirtualMachineInstancesDeleteHeaders; - -/** Optional parameters. */ -export interface VirtualMachineInstancesCreateCheckpointOptionalParams - 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 createCheckpoint operation. */ -export type VirtualMachineInstancesCreateCheckpointResponse = - VirtualMachineInstancesCreateCheckpointHeaders; - -/** Optional parameters. */ -export interface VirtualMachineInstancesDeleteCheckpointOptionalParams - 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 deleteCheckpoint operation. */ -export type VirtualMachineInstancesDeleteCheckpointResponse = - VirtualMachineInstancesDeleteCheckpointHeaders; - -/** Optional parameters. */ -export interface VirtualMachineInstancesRestartOptionalParams - 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 restart operation. */ -export type VirtualMachineInstancesRestartResponse = - VirtualMachineInstancesRestartHeaders; - -/** Optional parameters. */ -export interface VirtualMachineInstancesRestoreCheckpointOptionalParams - 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 restoreCheckpoint operation. */ -export type VirtualMachineInstancesRestoreCheckpointResponse = - VirtualMachineInstancesRestoreCheckpointHeaders; - -/** Optional parameters. */ -export interface VirtualMachineInstancesStartOptionalParams - 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 start operation. */ -export type VirtualMachineInstancesStartResponse = - VirtualMachineInstancesStartHeaders; - -/** Optional parameters. */ -export interface VirtualMachineInstancesStopOptionalParams - 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 stop operation. */ -export type VirtualMachineInstancesStopResponse = - VirtualMachineInstancesStopHeaders; - -/** Optional parameters. */ -export interface VirtualMachineInstancesListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type VirtualMachineInstancesListNextResponse = - VirtualMachineInstanceListResult; - -/** Optional parameters. */ -export interface GuestAgentsListByVirtualMachineInstanceOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByVirtualMachineInstance operation. */ -export type GuestAgentsListByVirtualMachineInstanceResponse = - GuestAgentListResult; - -/** Optional parameters. */ -export interface GuestAgentsGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type GuestAgentsGetResponse = GuestAgent; - -/** Optional parameters. */ -export interface GuestAgentsCreateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the create operation. */ -export type GuestAgentsCreateResponse = GuestAgent; - -/** Optional parameters. */ -export interface GuestAgentsDeleteOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface GuestAgentsListByVirtualMachineInstanceNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByVirtualMachineInstanceNext operation. */ -export type GuestAgentsListByVirtualMachineInstanceNextResponse = - GuestAgentListResult; - -/** Optional parameters. */ -export interface VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByVirtualMachineInstance operation. */ -export type VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceResponse = - VmInstanceHybridIdentityMetadataListResult; - -/** Optional parameters. */ -export interface VmInstanceHybridIdentityMetadatasGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type VmInstanceHybridIdentityMetadatasGetResponse = - VmInstanceHybridIdentityMetadata; - -/** Optional parameters. */ -export interface VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByVirtualMachineInstanceNext operation. */ -export type VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceNextResponse = - VmInstanceHybridIdentityMetadataListResult; - -/** Optional parameters. */ -export interface OperationsListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type OperationsListResponse = OperationListResult; - -/** Optional parameters. */ -export interface OperationsListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type OperationsListNextResponse = OperationListResult; - -/** Optional parameters. */ -export interface AvailabilitySetsListBySubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscription operation. */ -export type AvailabilitySetsListBySubscriptionResponse = - AvailabilitySetListResult; - -/** Optional parameters. */ -export interface AvailabilitySetsListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type AvailabilitySetsListByResourceGroupResponse = - AvailabilitySetListResult; - -/** Optional parameters. */ -export interface AvailabilitySetsGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type AvailabilitySetsGetResponse = AvailabilitySet; - -/** Optional parameters. */ -export interface AvailabilitySetsCreateOrUpdateOptionalParams - 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 AvailabilitySetsCreateOrUpdateResponse = AvailabilitySet; - -/** Optional parameters. */ -export interface AvailabilitySetsUpdateOptionalParams - 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 AvailabilitySetsUpdateResponse = AvailabilitySet; - -/** Optional parameters. */ -export interface AvailabilitySetsDeleteOptionalParams - extends coreClient.OperationOptions { - /** Forces the resource to be deleted. */ - force?: ForceDelete; - /** 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 delete operation. */ -export type AvailabilitySetsDeleteResponse = AvailabilitySetsDeleteHeaders; - -/** Optional parameters. */ -export interface AvailabilitySetsListBySubscriptionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscriptionNext operation. */ -export type AvailabilitySetsListBySubscriptionNextResponse = - AvailabilitySetListResult; - -/** Optional parameters. */ -export interface AvailabilitySetsListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type AvailabilitySetsListByResourceGroupNextResponse = - AvailabilitySetListResult; - -/** Optional parameters. */ -export interface CloudsListBySubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscription operation. */ -export type CloudsListBySubscriptionResponse = CloudListResult; - -/** Optional parameters. */ -export interface CloudsListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type CloudsListByResourceGroupResponse = CloudListResult; - -/** Optional parameters. */ -export interface CloudsGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type CloudsGetResponse = Cloud; - -/** Optional parameters. */ -export interface CloudsCreateOrUpdateOptionalParams - 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 CloudsCreateOrUpdateResponse = Cloud; - -/** Optional parameters. */ -export interface CloudsUpdateOptionalParams - 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 CloudsUpdateResponse = Cloud; - -/** Optional parameters. */ -export interface CloudsDeleteOptionalParams - extends coreClient.OperationOptions { - /** Forces the resource to be deleted. */ - force?: ForceDelete; - /** 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 delete operation. */ -export type CloudsDeleteResponse = CloudsDeleteHeaders; - -/** Optional parameters. */ -export interface CloudsListBySubscriptionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscriptionNext operation. */ -export type CloudsListBySubscriptionNextResponse = CloudListResult; - -/** Optional parameters. */ -export interface CloudsListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type CloudsListByResourceGroupNextResponse = CloudListResult; - -/** Optional parameters. */ -export interface VirtualMachineTemplatesListBySubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscription operation. */ -export type VirtualMachineTemplatesListBySubscriptionResponse = - VirtualMachineTemplateListResult; - -/** Optional parameters. */ -export interface VirtualMachineTemplatesListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type VirtualMachineTemplatesListByResourceGroupResponse = - VirtualMachineTemplateListResult; - -/** Optional parameters. */ -export interface VirtualMachineTemplatesGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type VirtualMachineTemplatesGetResponse = VirtualMachineTemplate; - -/** Optional parameters. */ -export interface VirtualMachineTemplatesCreateOrUpdateOptionalParams - 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 VirtualMachineTemplatesCreateOrUpdateResponse = - VirtualMachineTemplate; - -/** Optional parameters. */ -export interface VirtualMachineTemplatesUpdateOptionalParams - 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 VirtualMachineTemplatesUpdateResponse = VirtualMachineTemplate; - -/** Optional parameters. */ -export interface VirtualMachineTemplatesDeleteOptionalParams - extends coreClient.OperationOptions { - /** Forces the resource to be deleted. */ - force?: ForceDelete; - /** 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 delete operation. */ -export type VirtualMachineTemplatesDeleteResponse = - VirtualMachineTemplatesDeleteHeaders; - -/** Optional parameters. */ -export interface VirtualMachineTemplatesListBySubscriptionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscriptionNext operation. */ -export type VirtualMachineTemplatesListBySubscriptionNextResponse = - VirtualMachineTemplateListResult; - -/** Optional parameters. */ -export interface VirtualMachineTemplatesListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type VirtualMachineTemplatesListByResourceGroupNextResponse = - VirtualMachineTemplateListResult; - -/** Optional parameters. */ -export interface VirtualNetworksListBySubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscription operation. */ -export type VirtualNetworksListBySubscriptionResponse = - VirtualNetworkListResult; - -/** Optional parameters. */ -export interface VirtualNetworksListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type VirtualNetworksListByResourceGroupResponse = - VirtualNetworkListResult; - -/** Optional parameters. */ -export interface VirtualNetworksGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type VirtualNetworksGetResponse = VirtualNetwork; - -/** Optional parameters. */ -export interface VirtualNetworksCreateOrUpdateOptionalParams - 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 VirtualNetworksCreateOrUpdateResponse = VirtualNetwork; - -/** Optional parameters. */ -export interface VirtualNetworksUpdateOptionalParams - 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 VirtualNetworksUpdateResponse = VirtualNetwork; - -/** Optional parameters. */ -export interface VirtualNetworksDeleteOptionalParams - extends coreClient.OperationOptions { - /** Forces the resource to be deleted. */ - force?: ForceDelete; - /** 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 delete operation. */ -export type VirtualNetworksDeleteResponse = VirtualNetworksDeleteHeaders; - -/** Optional parameters. */ -export interface VirtualNetworksListBySubscriptionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscriptionNext operation. */ -export type VirtualNetworksListBySubscriptionNextResponse = - VirtualNetworkListResult; - -/** Optional parameters. */ -export interface VirtualNetworksListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type VirtualNetworksListByResourceGroupNextResponse = - VirtualNetworkListResult; - -/** Optional parameters. */ -export interface VmmServersListBySubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscription operation. */ -export type VmmServersListBySubscriptionResponse = VmmServerListResult; - -/** Optional parameters. */ -export interface VmmServersListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type VmmServersListByResourceGroupResponse = VmmServerListResult; - -/** Optional parameters. */ -export interface VmmServersGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type VmmServersGetResponse = VmmServer; - -/** Optional parameters. */ -export interface VmmServersCreateOrUpdateOptionalParams - 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 VmmServersCreateOrUpdateResponse = VmmServer; - -/** Optional parameters. */ -export interface VmmServersUpdateOptionalParams - 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 VmmServersUpdateResponse = VmmServer; - -/** Optional parameters. */ -export interface VmmServersDeleteOptionalParams - extends coreClient.OperationOptions { - /** Forces the resource to be deleted. */ - force?: ForceDelete; - /** 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 delete operation. */ -export type VmmServersDeleteResponse = VmmServersDeleteHeaders; - -/** Optional parameters. */ -export interface VmmServersListBySubscriptionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscriptionNext operation. */ -export type VmmServersListBySubscriptionNextResponse = VmmServerListResult; - -/** Optional parameters. */ -export interface VmmServersListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type VmmServersListByResourceGroupNextResponse = VmmServerListResult; - -/** Optional parameters. */ -export interface InventoryItemsListByVmmServerOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByVmmServer operation. */ -export type InventoryItemsListByVmmServerResponse = InventoryItemListResult; - -/** Optional parameters. */ -export interface InventoryItemsGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type InventoryItemsGetResponse = InventoryItem; - -/** Optional parameters. */ -export interface InventoryItemsCreateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the create operation. */ -export type InventoryItemsCreateResponse = InventoryItem; - -/** Optional parameters. */ -export interface InventoryItemsDeleteOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface InventoryItemsListByVmmServerNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByVmmServerNext operation. */ -export type InventoryItemsListByVmmServerNextResponse = InventoryItemListResult; - -/** Optional parameters. */ -export interface ScVmmOptionalParams extends coreClient.ServiceClientOptions { - /** server parameter */ - $host?: string; - /** Api Version */ - apiVersion?: string; - /** Overrides client endpoint. */ - endpoint?: string; -} +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +export { + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + ProxyResource, + GuestAgent, + GuestAgentProperties, + GuestCredential, + HttpProxyConfiguration, + KnownProvisioningAction, + ProvisioningAction, + KnownResourceProvisioningState, + ResourceProvisioningState, + ErrorResponse, + ErrorDetail, + ErrorAdditionalInfo, + VmInstanceHybridIdentityMetadata, + VmInstanceHybridIdentityMetadataProperties, + ExtensionResource, + VirtualMachineInstance, + VirtualMachineInstanceProperties, + AvailabilitySetListItem, + OsProfileForVmInstance, + KnownOsType, + OsType, + HardwareProfile, + KnownLimitCpuForMigration, + LimitCpuForMigration, + KnownDynamicMemoryEnabled, + DynamicMemoryEnabled, + KnownIsHighlyAvailable, + IsHighlyAvailable, + NetworkProfile, + NetworkInterface, + KnownAllocationMethod, + AllocationMethod, + StorageProfile, + VirtualDisk, + StorageQosPolicyDetails, + KnownCreateDiffDisk, + CreateDiffDisk, + InfrastructureProfile, + Checkpoint, + ExtendedLocation, + VirtualMachineInstanceUpdate, + VirtualMachineInstanceUpdateProperties, + HardwareProfileUpdate, + NetworkProfileUpdate, + NetworkInterfaceUpdate, + StorageProfileUpdate, + VirtualDiskUpdate, + InfrastructureProfileUpdate, + KnownForceDelete, + ForceDelete, + KnownDeleteFromHost, + DeleteFromHost, + StopVirtualMachineOptions, + KnownSkipShutdown, + SkipShutdown, + VirtualMachineCreateCheckpoint, + VirtualMachineDeleteCheckpoint, + VirtualMachineRestoreCheckpoint, + InventoryItem, + InventoryItemProperties, + CloudInventoryItem, + VirtualNetworkInventoryItem, + VirtualMachineTemplateInventoryItem, + VirtualMachineInventoryItem, + InventoryItemDetails, + KnownInventoryType, + InventoryType, + TrackedResource, + AvailabilitySet, + AvailabilitySetProperties, + AvailabilitySetTagsUpdate, + VirtualMachineTemplate, + VirtualMachineTemplateProperties, + KnownIsCustomizable, + IsCustomizable, + VirtualMachineTemplateTagsUpdate, + VirtualNetwork, + VirtualNetworkProperties, + VirtualNetworkTagsUpdate, + Cloud, + CloudProperties, + CloudCapacity, + StorageQosPolicy, + CloudTagsUpdate, + VmmServer, + VmmServerProperties, + VmmCredential, + VmmServerTagsUpdate, + Operation, + OperationDisplay, + KnownOrigin, + Origin, + KnownActionType, + ActionType, + Versions, + ProvisioningState, + InventoryItemPropertiesUnion, +} from "./models.js"; +export { + OperationsListOptionalParams, + VmmServersGetOptionalParams, + VmmServersCreateOrUpdateOptionalParams, + VmmServersUpdateOptionalParams, + VmmServersDeleteOptionalParams, + VmmServersListByResourceGroupOptionalParams, + VmmServersListBySubscriptionOptionalParams, + CloudsGetOptionalParams, + CloudsCreateOrUpdateOptionalParams, + CloudsUpdateOptionalParams, + CloudsDeleteOptionalParams, + CloudsListByResourceGroupOptionalParams, + CloudsListBySubscriptionOptionalParams, + VirtualNetworksGetOptionalParams, + VirtualNetworksCreateOrUpdateOptionalParams, + VirtualNetworksUpdateOptionalParams, + VirtualNetworksDeleteOptionalParams, + VirtualNetworksListByResourceGroupOptionalParams, + VirtualNetworksListBySubscriptionOptionalParams, + VirtualMachineTemplatesGetOptionalParams, + VirtualMachineTemplatesCreateOrUpdateOptionalParams, + VirtualMachineTemplatesUpdateOptionalParams, + VirtualMachineTemplatesDeleteOptionalParams, + VirtualMachineTemplatesListByResourceGroupOptionalParams, + VirtualMachineTemplatesListBySubscriptionOptionalParams, + AvailabilitySetsGetOptionalParams, + AvailabilitySetsCreateOrUpdateOptionalParams, + AvailabilitySetsUpdateOptionalParams, + AvailabilitySetsDeleteOptionalParams, + AvailabilitySetsListByResourceGroupOptionalParams, + AvailabilitySetsListBySubscriptionOptionalParams, + InventoryItemsGetOptionalParams, + InventoryItemsCreateOptionalParams, + InventoryItemsDeleteOptionalParams, + InventoryItemsListByVmmServerOptionalParams, + VirtualMachineInstancesGetOptionalParams, + VirtualMachineInstancesCreateOrUpdateOptionalParams, + VirtualMachineInstancesUpdateOptionalParams, + VirtualMachineInstancesDeleteOptionalParams, + VirtualMachineInstancesListOptionalParams, + VirtualMachineInstancesStopOptionalParams, + VirtualMachineInstancesStartOptionalParams, + VirtualMachineInstancesRestartOptionalParams, + VirtualMachineInstancesCreateCheckpointOptionalParams, + VirtualMachineInstancesDeleteCheckpointOptionalParams, + VirtualMachineInstancesRestoreCheckpointOptionalParams, + VmInstanceHybridIdentityMetadatasGetOptionalParams, + VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceOptionalParams, + GuestAgentsGetOptionalParams, + GuestAgentsCreateOptionalParams, + GuestAgentsDeleteOptionalParams, + GuestAgentsListByVirtualMachineInstanceOptionalParams, +} from "./options.js"; +export { + PageSettings, + ContinuablePage, + PagedAsyncIterableIterator, +} from "./pagingTypes.js"; diff --git a/sdk/scvmm/arm-scvmm/src/models/mappers.ts b/sdk/scvmm/arm-scvmm/src/models/mappers.ts deleted file mode 100644 index 41a3ca0ab468..000000000000 --- a/sdk/scvmm/arm-scvmm/src/models/mappers.ts +++ /dev/null @@ -1,3106 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 VirtualMachineInstanceListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineInstanceListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineInstance", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineInstanceProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineInstanceProperties", - modelProperties: { - availabilitySets: { - serializedName: "availabilitySets", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AvailabilitySetListItem", - }, - }, - }, - }, - osProfile: { - serializedName: "osProfile", - type: { - name: "Composite", - className: "OsProfileForVmInstance", - }, - }, - hardwareProfile: { - serializedName: "hardwareProfile", - type: { - name: "Composite", - className: "HardwareProfile", - }, - }, - networkProfile: { - serializedName: "networkProfile", - type: { - name: "Composite", - className: "NetworkProfile", - }, - }, - storageProfile: { - serializedName: "storageProfile", - type: { - name: "Composite", - className: "StorageProfile", - }, - }, - infrastructureProfile: { - serializedName: "infrastructureProfile", - type: { - name: "Composite", - className: "InfrastructureProfile", - }, - }, - powerState: { - serializedName: "powerState", - readOnly: true, - type: { - name: "String", - }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const AvailabilitySetListItem: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AvailabilitySetListItem", - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const OsProfileForVmInstance: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OsProfileForVmInstance", - modelProperties: { - adminPassword: { - serializedName: "adminPassword", - type: { - name: "String", - }, - }, - computerName: { - serializedName: "computerName", - type: { - name: "String", - }, - }, - osType: { - serializedName: "osType", - readOnly: true, - type: { - name: "String", - }, - }, - osSku: { - serializedName: "osSku", - readOnly: true, - type: { - name: "String", - }, - }, - osVersion: { - serializedName: "osVersion", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const HardwareProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "HardwareProfile", - modelProperties: { - memoryMB: { - serializedName: "memoryMB", - type: { - name: "Number", - }, - }, - cpuCount: { - serializedName: "cpuCount", - type: { - name: "Number", - }, - }, - limitCpuForMigration: { - serializedName: "limitCpuForMigration", - type: { - name: "String", - }, - }, - dynamicMemoryEnabled: { - serializedName: "dynamicMemoryEnabled", - type: { - name: "String", - }, - }, - dynamicMemoryMaxMB: { - serializedName: "dynamicMemoryMaxMB", - type: { - name: "Number", - }, - }, - dynamicMemoryMinMB: { - serializedName: "dynamicMemoryMinMB", - type: { - name: "Number", - }, - }, - isHighlyAvailable: { - serializedName: "isHighlyAvailable", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -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", - }, - }, - displayName: { - serializedName: "displayName", - readOnly: true, - type: { - name: "String", - }, - }, - ipv4Addresses: { - serializedName: "ipv4Addresses", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - ipv6Addresses: { - serializedName: "ipv6Addresses", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - macAddress: { - serializedName: "macAddress", - type: { - name: "String", - }, - }, - virtualNetworkId: { - serializedName: "virtualNetworkId", - type: { - name: "String", - }, - }, - networkName: { - serializedName: "networkName", - readOnly: true, - type: { - name: "String", - }, - }, - ipv4AddressType: { - serializedName: "ipv4AddressType", - type: { - name: "String", - }, - }, - ipv6AddressType: { - serializedName: "ipv6AddressType", - type: { - name: "String", - }, - }, - macAddressType: { - serializedName: "macAddressType", - type: { - name: "String", - }, - }, - nicId: { - serializedName: "nicId", - 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", - }, - }, - }, - }, - }, - }, -}; - -export const VirtualDisk: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualDisk", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - displayName: { - serializedName: "displayName", - readOnly: true, - type: { - name: "String", - }, - }, - diskId: { - serializedName: "diskId", - type: { - name: "String", - }, - }, - diskSizeGB: { - serializedName: "diskSizeGB", - type: { - name: "Number", - }, - }, - maxDiskSizeGB: { - serializedName: "maxDiskSizeGB", - readOnly: true, - type: { - name: "Number", - }, - }, - bus: { - serializedName: "bus", - type: { - name: "Number", - }, - }, - lun: { - serializedName: "lun", - type: { - name: "Number", - }, - }, - busType: { - serializedName: "busType", - type: { - name: "String", - }, - }, - vhdType: { - serializedName: "vhdType", - type: { - name: "String", - }, - }, - volumeType: { - serializedName: "volumeType", - readOnly: true, - type: { - name: "String", - }, - }, - vhdFormatType: { - serializedName: "vhdFormatType", - readOnly: true, - type: { - name: "String", - }, - }, - templateDiskId: { - serializedName: "templateDiskId", - type: { - name: "String", - }, - }, - storageQosPolicy: { - serializedName: "storageQoSPolicy", - type: { - name: "Composite", - className: "StorageQosPolicyDetails", - }, - }, - createDiffDisk: { - serializedName: "createDiffDisk", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const StorageQosPolicyDetails: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "StorageQosPolicyDetails", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - id: { - serializedName: "id", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const InfrastructureProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "InfrastructureProfile", - modelProperties: { - inventoryItemId: { - serializedName: "inventoryItemId", - type: { - name: "String", - }, - }, - vmmServerId: { - serializedName: "vmmServerId", - type: { - name: "String", - }, - }, - cloudId: { - serializedName: "cloudId", - type: { - name: "String", - }, - }, - templateId: { - serializedName: "templateId", - type: { - name: "String", - }, - }, - vmName: { - constraints: { - MinLength: 1, - }, - serializedName: "vmName", - type: { - name: "String", - }, - }, - uuid: { - serializedName: "uuid", - type: { - name: "String", - }, - }, - lastRestoredVmCheckpoint: { - serializedName: "lastRestoredVMCheckpoint", - type: { - name: "Composite", - className: "Checkpoint", - }, - }, - checkpoints: { - serializedName: "checkpoints", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Checkpoint", - }, - }, - }, - }, - checkpointType: { - serializedName: "checkpointType", - type: { - name: "String", - }, - }, - generation: { - serializedName: "generation", - type: { - name: "Number", - }, - }, - biosGuid: { - serializedName: "biosGuid", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const Checkpoint: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Checkpoint", - modelProperties: { - parentCheckpointId: { - serializedName: "parentCheckpointID", - type: { - name: "String", - }, - }, - checkpointId: { - serializedName: "checkpointID", - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - description: { - serializedName: "description", - type: { - name: "String", - }, - }, - }, - }, -}; - -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 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", - }, - }, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData", - }, - }, - }, - }, -}; - -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 ErrorResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorResponse", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorDetail", - }, - }, - }, - }, -}; - -export const ErrorDetail: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorDetail", - modelProperties: { - code: { - serializedName: "code", - readOnly: true, - type: { - name: "String", - }, - }, - message: { - serializedName: "message", - readOnly: true, - type: { - name: "String", - }, - }, - target: { - serializedName: "target", - readOnly: true, - type: { - name: "String", - }, - }, - details: { - serializedName: "details", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorDetail", - }, - }, - }, - }, - additionalInfo: { - serializedName: "additionalInfo", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - }, - }, - }, - }, - }, - }, -}; - -export const ErrorAdditionalInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - modelProperties: { - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - info: { - serializedName: "info", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, - }, - }, -}; - -export const VirtualMachineInstanceUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineInstanceUpdate", - modelProperties: { - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "VirtualMachineInstanceUpdateProperties", - }, - }, - }, - }, -}; - -export const VirtualMachineInstanceUpdateProperties: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "VirtualMachineInstanceUpdateProperties", - modelProperties: { - availabilitySets: { - serializedName: "availabilitySets", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AvailabilitySetListItem", - }, - }, - }, - }, - hardwareProfile: { - serializedName: "hardwareProfile", - type: { - name: "Composite", - className: "HardwareProfileUpdate", - }, - }, - networkProfile: { - serializedName: "networkProfile", - type: { - name: "Composite", - className: "NetworkProfileUpdate", - }, - }, - storageProfile: { - serializedName: "storageProfile", - type: { - name: "Composite", - className: "StorageProfileUpdate", - }, - }, - infrastructureProfile: { - serializedName: "infrastructureProfile", - type: { - name: "Composite", - className: "InfrastructureProfileUpdate", - }, - }, - }, - }, - }; - -export const HardwareProfileUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "HardwareProfileUpdate", - modelProperties: { - memoryMB: { - serializedName: "memoryMB", - type: { - name: "Number", - }, - }, - cpuCount: { - serializedName: "cpuCount", - type: { - name: "Number", - }, - }, - limitCpuForMigration: { - serializedName: "limitCpuForMigration", - type: { - name: "String", - }, - }, - dynamicMemoryEnabled: { - serializedName: "dynamicMemoryEnabled", - type: { - name: "String", - }, - }, - dynamicMemoryMaxMB: { - serializedName: "dynamicMemoryMaxMB", - type: { - name: "Number", - }, - }, - dynamicMemoryMinMB: { - serializedName: "dynamicMemoryMinMB", - type: { - name: "Number", - }, - }, - }, - }, -}; - -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", - }, - }, - macAddress: { - serializedName: "macAddress", - type: { - name: "String", - }, - }, - virtualNetworkId: { - serializedName: "virtualNetworkId", - type: { - name: "String", - }, - }, - ipv4AddressType: { - serializedName: "ipv4AddressType", - type: { - name: "String", - }, - }, - ipv6AddressType: { - serializedName: "ipv6AddressType", - type: { - name: "String", - }, - }, - macAddressType: { - serializedName: "macAddressType", - type: { - name: "String", - }, - }, - nicId: { - serializedName: "nicId", - 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", - }, - }, - diskId: { - serializedName: "diskId", - type: { - name: "String", - }, - }, - diskSizeGB: { - serializedName: "diskSizeGB", - type: { - name: "Number", - }, - }, - bus: { - serializedName: "bus", - type: { - name: "Number", - }, - }, - lun: { - serializedName: "lun", - type: { - name: "Number", - }, - }, - busType: { - serializedName: "busType", - type: { - name: "String", - }, - }, - vhdType: { - serializedName: "vhdType", - type: { - name: "String", - }, - }, - storageQosPolicy: { - serializedName: "storageQoSPolicy", - type: { - name: "Composite", - className: "StorageQosPolicyDetails", - }, - }, - }, - }, -}; - -export const InfrastructureProfileUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "InfrastructureProfileUpdate", - modelProperties: { - checkpointType: { - serializedName: "checkpointType", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineCreateCheckpoint: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineCreateCheckpoint", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - description: { - serializedName: "description", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineDeleteCheckpoint: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineDeleteCheckpoint", - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GuestAgentListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GuestAgentListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GuestAgent", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GuestAgentProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GuestAgentProperties", - modelProperties: { - uuid: { - serializedName: "uuid", - readOnly: true, - type: { - name: "String", - }, - }, - credentials: { - serializedName: "credentials", - type: { - name: "Composite", - className: "GuestCredential", - }, - }, - httpProxyConfig: { - serializedName: "httpProxyConfig", - type: { - name: "Composite", - className: "HttpProxyConfiguration", - }, - }, - provisioningAction: { - serializedName: "provisioningAction", - type: { - name: "String", - }, - }, - status: { - serializedName: "status", - readOnly: true, - type: { - name: "String", - }, - }, - customResourceName: { - serializedName: "customResourceName", - readOnly: true, - type: { - name: "String", - }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GuestCredential: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GuestCredential", - modelProperties: { - username: { - serializedName: "username", - required: true, - type: { - name: "String", - }, - }, - password: { - serializedName: "password", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const HttpProxyConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "HttpProxyConfiguration", - modelProperties: { - httpsProxy: { - serializedName: "httpsProxy", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VmInstanceHybridIdentityMetadataListResult: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "VmInstanceHybridIdentityMetadataListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VmInstanceHybridIdentityMetadata", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, - }; - -export const VmInstanceHybridIdentityMetadataProperties: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "VmInstanceHybridIdentityMetadataProperties", - modelProperties: { - resourceUid: { - serializedName: "resourceUid", - type: { - name: "String", - }, - }, - publicKey: { - serializedName: "publicKey", - type: { - name: "String", - }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, - }; - -export const VirtualMachineRestoreCheckpoint: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineRestoreCheckpoint", - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const StopVirtualMachineOptions: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "StopVirtualMachineOptions", - modelProperties: { - skipShutdown: { - defaultValue: "false", - serializedName: "skipShutdown", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const OperationListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationListResult", - modelProperties: { - value: { - serializedName: "value", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const Operation: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Operation", - modelProperties: { - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - isDataAction: { - serializedName: "isDataAction", - readOnly: true, - type: { - name: "Boolean", - }, - }, - display: { - serializedName: "display", - type: { - name: "Composite", - className: "OperationDisplay", - }, - }, - origin: { - serializedName: "origin", - readOnly: true, - type: { - name: "String", - }, - }, - actionType: { - serializedName: "actionType", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const OperationDisplay: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationDisplay", - modelProperties: { - provider: { - serializedName: "provider", - readOnly: true, - type: { - name: "String", - }, - }, - resource: { - serializedName: "resource", - readOnly: true, - type: { - name: "String", - }, - }, - operation: { - serializedName: "operation", - readOnly: true, - type: { - name: "String", - }, - }, - description: { - serializedName: "description", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const AvailabilitySetListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AvailabilitySetListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AvailabilitySet", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const AvailabilitySetProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AvailabilitySetProperties", - modelProperties: { - availabilitySetName: { - constraints: { - MinLength: 1, - }, - serializedName: "availabilitySetName", - type: { - name: "String", - }, - }, - vmmServerId: { - serializedName: "vmmServerId", - type: { - name: "String", - }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const CloudListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Cloud", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const CloudProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudProperties", - modelProperties: { - inventoryItemId: { - serializedName: "inventoryItemId", - type: { - name: "String", - }, - }, - uuid: { - constraints: { - Pattern: new RegExp( - "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", - ), - }, - serializedName: "uuid", - type: { - name: "String", - }, - }, - vmmServerId: { - serializedName: "vmmServerId", - type: { - name: "String", - }, - }, - cloudName: { - serializedName: "cloudName", - readOnly: true, - type: { - name: "String", - }, - }, - cloudCapacity: { - serializedName: "cloudCapacity", - type: { - name: "Composite", - className: "CloudCapacity", - }, - }, - storageQosPolicies: { - serializedName: "storageQoSPolicies", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "StorageQosPolicy", - }, - }, - }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const CloudCapacity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudCapacity", - modelProperties: { - cpuCount: { - serializedName: "cpuCount", - readOnly: true, - type: { - name: "Number", - }, - }, - memoryMB: { - serializedName: "memoryMB", - readOnly: true, - type: { - name: "Number", - }, - }, - vmCount: { - serializedName: "vmCount", - readOnly: true, - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const StorageQosPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "StorageQosPolicy", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - id: { - serializedName: "id", - type: { - name: "String", - }, - }, - iopsMaximum: { - serializedName: "iopsMaximum", - type: { - name: "Number", - }, - }, - iopsMinimum: { - serializedName: "iopsMinimum", - type: { - name: "Number", - }, - }, - bandwidthLimit: { - serializedName: "bandwidthLimit", - type: { - name: "Number", - }, - }, - policyId: { - serializedName: "policyId", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineTemplateListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineTemplateListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineTemplate", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineTemplateProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineTemplateProperties", - modelProperties: { - inventoryItemId: { - serializedName: "inventoryItemId", - type: { - name: "String", - }, - }, - uuid: { - constraints: { - Pattern: new RegExp( - "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", - ), - }, - serializedName: "uuid", - type: { - name: "String", - }, - }, - vmmServerId: { - serializedName: "vmmServerId", - type: { - name: "String", - }, - }, - osType: { - serializedName: "osType", - readOnly: true, - type: { - name: "String", - }, - }, - osName: { - serializedName: "osName", - readOnly: true, - type: { - name: "String", - }, - }, - computerName: { - serializedName: "computerName", - readOnly: true, - type: { - name: "String", - }, - }, - memoryMB: { - serializedName: "memoryMB", - readOnly: true, - type: { - name: "Number", - }, - }, - cpuCount: { - serializedName: "cpuCount", - readOnly: true, - type: { - name: "Number", - }, - }, - limitCpuForMigration: { - serializedName: "limitCpuForMigration", - readOnly: true, - type: { - name: "String", - }, - }, - dynamicMemoryEnabled: { - serializedName: "dynamicMemoryEnabled", - readOnly: true, - type: { - name: "String", - }, - }, - isCustomizable: { - serializedName: "isCustomizable", - readOnly: true, - type: { - name: "String", - }, - }, - dynamicMemoryMaxMB: { - serializedName: "dynamicMemoryMaxMB", - readOnly: true, - type: { - name: "Number", - }, - }, - dynamicMemoryMinMB: { - serializedName: "dynamicMemoryMinMB", - readOnly: true, - type: { - name: "Number", - }, - }, - isHighlyAvailable: { - serializedName: "isHighlyAvailable", - readOnly: true, - type: { - name: "String", - }, - }, - generation: { - serializedName: "generation", - readOnly: true, - type: { - name: "Number", - }, - }, - networkInterfaces: { - serializedName: "networkInterfaces", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "NetworkInterface", - }, - }, - }, - }, - disks: { - serializedName: "disks", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualDisk", - }, - }, - }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualNetworkListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualNetworkListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualNetwork", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualNetworkProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualNetworkProperties", - modelProperties: { - inventoryItemId: { - serializedName: "inventoryItemId", - type: { - name: "String", - }, - }, - uuid: { - constraints: { - Pattern: new RegExp( - "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", - ), - }, - serializedName: "uuid", - type: { - name: "String", - }, - }, - vmmServerId: { - serializedName: "vmmServerId", - type: { - name: "String", - }, - }, - networkName: { - serializedName: "networkName", - readOnly: true, - type: { - name: "String", - }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VmmServerListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VmmServerListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VmmServer", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VmmServerProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VmmServerProperties", - modelProperties: { - credentials: { - serializedName: "credentials", - type: { - name: "Composite", - className: "VmmCredential", - }, - }, - fqdn: { - constraints: { - MinLength: 1, - }, - serializedName: "fqdn", - required: true, - type: { - name: "String", - }, - }, - port: { - constraints: { - InclusiveMaximum: 65535, - InclusiveMinimum: 1, - }, - serializedName: "port", - type: { - name: "Number", - }, - }, - connectionStatus: { - serializedName: "connectionStatus", - readOnly: true, - type: { - name: "String", - }, - }, - errorMessage: { - serializedName: "errorMessage", - readOnly: true, - type: { - name: "String", - }, - }, - uuid: { - serializedName: "uuid", - readOnly: true, - type: { - name: "String", - }, - }, - version: { - serializedName: "version", - readOnly: true, - type: { - name: "String", - }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VmmCredential: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VmmCredential", - modelProperties: { - username: { - serializedName: "username", - type: { - name: "String", - }, - }, - password: { - serializedName: "password", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const AvailabilitySetTagsUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AvailabilitySetTagsUpdate", - modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const CloudTagsUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudTagsUpdate", - modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const VirtualMachineTemplateTagsUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineTemplateTagsUpdate", - modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const VirtualNetworkTagsUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualNetworkTagsUpdate", - modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const VmmServerTagsUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VmmServerTagsUpdate", - modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const InventoryItemListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "InventoryItemListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "InventoryItem", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -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", - readOnly: true, - type: { - name: "String", - }, - }, - uuid: { - serializedName: "uuid", - readOnly: true, - type: { - name: "String", - }, - }, - inventoryItemName: { - serializedName: "inventoryItemName", - readOnly: true, - type: { - name: "String", - }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const InventoryItemDetails: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "InventoryItemDetails", - modelProperties: { - inventoryItemId: { - serializedName: "inventoryItemId", - type: { - name: "String", - }, - }, - inventoryItemName: { - serializedName: "inventoryItemName", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ProxyResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ProxyResource", - modelProperties: { - ...Resource.type.modelProperties, - }, - }, -}; - -export const TrackedResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TrackedResource", - modelProperties: { - ...Resource.type.modelProperties, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - location: { - serializedName: "location", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const CloudInventoryItem: coreClient.CompositeMapper = { - serializedName: "Cloud", - type: { - name: "Composite", - className: "CloudInventoryItem", - uberParent: "InventoryItemProperties", - polymorphicDiscriminator: - InventoryItemProperties.type.polymorphicDiscriminator, - modelProperties: { - ...InventoryItemProperties.type.modelProperties, - }, - }, -}; - -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", - readOnly: true, - type: { - name: "String", - }, - }, - osName: { - serializedName: "osName", - readOnly: true, - type: { - name: "String", - }, - }, - osVersion: { - serializedName: "osVersion", - readOnly: true, - type: { - name: "String", - }, - }, - powerState: { - serializedName: "powerState", - readOnly: true, - type: { - name: "String", - }, - }, - ipAddresses: { - serializedName: "ipAddresses", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - cloud: { - serializedName: "cloud", - type: { - name: "Composite", - className: "InventoryItemDetails", - }, - }, - biosGuid: { - serializedName: "biosGuid", - readOnly: true, - type: { - name: "String", - }, - }, - managedMachineResourceId: { - serializedName: "managedMachineResourceId", - 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, - cpuCount: { - serializedName: "cpuCount", - readOnly: true, - type: { - name: "Number", - }, - }, - memoryMB: { - serializedName: "memoryMB", - readOnly: true, - type: { - name: "Number", - }, - }, - osType: { - serializedName: "osType", - readOnly: true, - type: { - name: "String", - }, - }, - osName: { - serializedName: "osName", - readOnly: true, - 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 VirtualMachineInstance: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineInstance", - modelProperties: { - ...ProxyResource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "VirtualMachineInstanceProperties", - }, - }, - extendedLocation: { - serializedName: "extendedLocation", - type: { - name: "Composite", - className: "ExtendedLocation", - }, - }, - }, - }, -}; - -export const GuestAgent: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GuestAgent", - modelProperties: { - ...ProxyResource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "GuestAgentProperties", - }, - }, - }, - }, -}; - -export const VmInstanceHybridIdentityMetadata: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VmInstanceHybridIdentityMetadata", - modelProperties: { - ...ProxyResource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "VmInstanceHybridIdentityMetadataProperties", - }, - }, - }, - }, -}; - -export const InventoryItem: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "InventoryItem", - modelProperties: { - ...ProxyResource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "InventoryItemProperties", - }, - }, - kind: { - serializedName: "kind", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const AvailabilitySet: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AvailabilitySet", - modelProperties: { - ...TrackedResource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "AvailabilitySetProperties", - }, - }, - extendedLocation: { - serializedName: "extendedLocation", - type: { - name: "Composite", - className: "ExtendedLocation", - }, - }, - }, - }, -}; - -export const Cloud: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Cloud", - modelProperties: { - ...TrackedResource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "CloudProperties", - }, - }, - extendedLocation: { - serializedName: "extendedLocation", - type: { - name: "Composite", - className: "ExtendedLocation", - }, - }, - }, - }, -}; - -export const VirtualMachineTemplate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineTemplate", - modelProperties: { - ...TrackedResource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "VirtualMachineTemplateProperties", - }, - }, - extendedLocation: { - serializedName: "extendedLocation", - type: { - name: "Composite", - className: "ExtendedLocation", - }, - }, - }, - }, -}; - -export const VirtualNetwork: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualNetwork", - modelProperties: { - ...TrackedResource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "VirtualNetworkProperties", - }, - }, - extendedLocation: { - serializedName: "extendedLocation", - type: { - name: "Composite", - className: "ExtendedLocation", - }, - }, - }, - }, -}; - -export const VmmServer: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VmmServer", - modelProperties: { - ...TrackedResource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "VmmServerProperties", - }, - }, - extendedLocation: { - serializedName: "extendedLocation", - type: { - name: "Composite", - className: "ExtendedLocation", - }, - }, - }, - }, -}; - -export const VirtualMachineInstancesCreateOrUpdateHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "VirtualMachineInstancesCreateOrUpdateHeaders", - modelProperties: { - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, - }; - -export const VirtualMachineInstancesUpdateHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "VirtualMachineInstancesUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, - }; - -export const VirtualMachineInstancesDeleteHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "VirtualMachineInstancesDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, - }; - -export const VirtualMachineInstancesCreateCheckpointHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "VirtualMachineInstancesCreateCheckpointHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, - }; - -export const VirtualMachineInstancesDeleteCheckpointHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "VirtualMachineInstancesDeleteCheckpointHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, - }; - -export const VirtualMachineInstancesRestartHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "VirtualMachineInstancesRestartHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, - }; - -export const VirtualMachineInstancesRestoreCheckpointHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "VirtualMachineInstancesRestoreCheckpointHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, - }; - -export const VirtualMachineInstancesStartHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineInstancesStartHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineInstancesStopHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineInstancesStopHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GuestAgentsCreateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GuestAgentsCreateHeaders", - modelProperties: { - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const AvailabilitySetsCreateOrUpdateHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "AvailabilitySetsCreateOrUpdateHeaders", - modelProperties: { - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, - }; - -export const AvailabilitySetsUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AvailabilitySetsUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const AvailabilitySetsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AvailabilitySetsDeleteHeaders", - modelProperties: { - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String", - }, - }, - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const CloudsCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudsCreateOrUpdateHeaders", - modelProperties: { - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const CloudsUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudsUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const CloudsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudsDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineTemplatesCreateOrUpdateHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "VirtualMachineTemplatesCreateOrUpdateHeaders", - modelProperties: { - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, - }; - -export const VirtualMachineTemplatesUpdateHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "VirtualMachineTemplatesUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, - }; - -export const VirtualMachineTemplatesDeleteHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "VirtualMachineTemplatesDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, - }; - -export const VirtualNetworksCreateOrUpdateHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "VirtualNetworksCreateOrUpdateHeaders", - modelProperties: { - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, - }; - -export const VirtualNetworksUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualNetworksUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualNetworksDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualNetworksDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VmmServersCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VmmServersCreateOrUpdateHeaders", - modelProperties: { - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VmmServersUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VmmServersUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VmmServersDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VmmServersDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export let discriminators = { - InventoryItemProperties: InventoryItemProperties, - "InventoryItemProperties.Cloud": CloudInventoryItem, - "InventoryItemProperties.VirtualMachine": VirtualMachineInventoryItem, - "InventoryItemProperties.VirtualMachineTemplate": - VirtualMachineTemplateInventoryItem, - "InventoryItemProperties.VirtualNetwork": VirtualNetworkInventoryItem, -}; diff --git a/sdk/scvmm/arm-scvmm/src/models/models.ts b/sdk/scvmm/arm-scvmm/src/models/models.ts new file mode 100644 index 000000000000..6a90e81ab7d3 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/models/models.ts @@ -0,0 +1,1841 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { serializeRecord } from "../helpers/serializerHelpers.js"; +import { + GuestAgent as GuestAgentRest, + GuestAgentProperties as GuestAgentPropertiesRest, + GuestCredential as GuestCredentialRest, + HttpProxyConfiguration as HttpProxyConfigurationRest, + VirtualMachineInstance as VirtualMachineInstanceRest, + VirtualMachineInstanceProperties as VirtualMachineInstancePropertiesRest, + AvailabilitySetListItem as AvailabilitySetListItemRest, + OsProfileForVmInstance as OsProfileForVmInstanceRest, + HardwareProfile as HardwareProfileRest, + NetworkProfile as NetworkProfileRest, + NetworkInterface as NetworkInterfaceRest, + StorageProfile as StorageProfileRest, + VirtualDisk as VirtualDiskRest, + StorageQosPolicyDetails as StorageQosPolicyDetailsRest, + InfrastructureProfile as InfrastructureProfileRest, + ExtendedLocation as ExtendedLocationRest, + VirtualMachineInstanceUpdate as VirtualMachineInstanceUpdateRest, + VirtualMachineInstanceUpdateProperties as VirtualMachineInstanceUpdatePropertiesRest, + HardwareProfileUpdate as HardwareProfileUpdateRest, + NetworkProfileUpdate as NetworkProfileUpdateRest, + NetworkInterfaceUpdate as NetworkInterfaceUpdateRest, + StorageProfileUpdate as StorageProfileUpdateRest, + VirtualDiskUpdate as VirtualDiskUpdateRest, + InfrastructureProfileUpdate as InfrastructureProfileUpdateRest, + StopVirtualMachineOptions as StopVirtualMachineOptionsRest, + VirtualMachineCreateCheckpoint as VirtualMachineCreateCheckpointRest, + VirtualMachineDeleteCheckpoint as VirtualMachineDeleteCheckpointRest, + VirtualMachineRestoreCheckpoint as VirtualMachineRestoreCheckpointRest, + InventoryItem as InventoryItemRest, + InventoryItemProperties as InventoryItemPropertiesRest, + CloudInventoryItem as CloudInventoryItemRest, + VirtualNetworkInventoryItem as VirtualNetworkInventoryItemRest, + VirtualMachineTemplateInventoryItem as VirtualMachineTemplateInventoryItemRest, + VirtualMachineInventoryItem as VirtualMachineInventoryItemRest, + InventoryItemDetails as InventoryItemDetailsRest, + TrackedResource as TrackedResourceRest, + AvailabilitySet as AvailabilitySetRest, + AvailabilitySetProperties as AvailabilitySetPropertiesRest, + AvailabilitySetTagsUpdate as AvailabilitySetTagsUpdateRest, + VirtualMachineTemplate as VirtualMachineTemplateRest, + VirtualMachineTemplateProperties as VirtualMachineTemplatePropertiesRest, + VirtualMachineTemplateTagsUpdate as VirtualMachineTemplateTagsUpdateRest, + VirtualNetwork as VirtualNetworkRest, + VirtualNetworkProperties as VirtualNetworkPropertiesRest, + VirtualNetworkTagsUpdate as VirtualNetworkTagsUpdateRest, + Cloud as CloudRest, + CloudProperties as CloudPropertiesRest, + CloudTagsUpdate as CloudTagsUpdateRest, + VmmServer as VmmServerRest, + VmmServerProperties as VmmServerPropertiesRest, + VmmCredential as VmmCredentialRest, + VmmServerTagsUpdate as VmmServerTagsUpdateRest, +} from "../rest/index.js"; + +/** 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} */ + readonly id?: string; + /** The name of the resource */ + readonly name?: string; + /** The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" */ + readonly type?: string; + /** Azure Resource Manager metadata containing createdBy and modifiedBy information. */ + readonly systemData?: SystemData; +} + +export function resourceSerializer(item: Resource) { + return item as any; +} + +/** 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; +} + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + /** User */ + User = "User", + /** Application */ + Application = "Application", + /** ManagedIdentity */ + ManagedIdentity = "ManagedIdentity", + /** Key */ + Key = "Key", +} + +/** + * The kind of entity that created the resource. \ + * {@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; + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + +export function proxyResourceSerializer(item: ProxyResource) { + return item as any; +} + +/** Defines the GuestAgent. */ +export interface GuestAgent extends ProxyResource { + /** The resource-specific properties for this resource. */ + properties?: GuestAgentProperties; +} + +export function guestAgentSerializer(item: GuestAgent): GuestAgentRest { + return { + properties: !item.properties + ? item.properties + : guestAgentPropertiesSerializer(item.properties), + }; +} + +/** Defines the resource properties. */ +export interface GuestAgentProperties { + /** Gets a unique identifier for this resource. */ + 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 the guest agent status. */ + readonly status?: string; + /** Gets the name of the corresponding resource in Kubernetes. */ + readonly customResourceName?: string; + /** Provisioning state of the resource. */ + readonly provisioningState?: ProvisioningState; + /** The resource id of the private link scope this machine is assigned to, if any. */ + privateLinkScopeResourceId?: string; +} + +export function guestAgentPropertiesSerializer( + item: GuestAgentProperties, +): GuestAgentPropertiesRest { + return { + credentials: !item.credentials + ? item.credentials + : guestCredentialSerializer(item.credentials), + httpProxyConfig: !item.httpProxyConfig + ? item.httpProxyConfig + : httpProxyConfigurationSerializer(item.httpProxyConfig), + provisioningAction: item["provisioningAction"], + privateLinkScopeResourceId: item["privateLinkScopeResourceId"], + }; +} + +/** 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; +} + +export function guestCredentialSerializer( + item: GuestCredential, +): GuestCredentialRest { + return { + username: item["username"], + password: item["password"], + }; +} + +/** HTTP Proxy configuration for the VM. */ +export interface HttpProxyConfiguration { + /** Gets or sets httpsProxy url. */ + httpsProxy?: string; +} + +export function httpProxyConfigurationSerializer( + item: HttpProxyConfiguration, +): HttpProxyConfigurationRest { + return { + httpsProxy: item["httpsProxy"], + }; +} + +/** Known values of {@link ProvisioningAction} that the service accepts. */ +export enum KnownProvisioningAction { + /** install */ + install = "install", + /** uninstall */ + uninstall = "uninstall", + /** repair */ + repair = "repair", +} + +/** + * Guest agent provisioning action. \ + * {@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; + +/** Known values of {@link ResourceProvisioningState} that the service accepts. */ +export enum KnownResourceProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", +} + +/** + * The provisioning state of a resource type. \ + * {@link KnownResourceProvisioningState} can be used interchangeably with ResourceProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Canceled** + */ +export type ResourceProvisioningState = string; + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { + /** The error code. */ + readonly code?: string; + /** The error message. */ + readonly message?: string; + /** The error target. */ + readonly target?: string; + /** The error details. */ + readonly details?: ErrorDetail[]; + /** The error additional info. */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** The additional info type. */ + readonly type?: string; + /** The additional info. */ + readonly info?: Record; +} + +/** The response of a GuestAgent list operation. */ +export interface _GuestAgentListResult { + /** The GuestAgent items on this page */ + value: GuestAgent[]; + /** The link to the next page of items */ + readonly nextLink?: string; +} + +/** Defines the HybridIdentityMetadata. */ +export interface VmInstanceHybridIdentityMetadata extends ProxyResource { + /** The resource-specific properties for this resource. */ + properties?: VmInstanceHybridIdentityMetadataProperties; +} + +/** Describes the properties of Hybrid Identity Metadata for a Virtual Machine. */ +export interface VmInstanceHybridIdentityMetadataProperties { + /** The unique identifier for the resource. */ + resourceUid?: string; + /** Gets or sets the Public Key. */ + publicKey?: string; + /** Provisioning state of the resource. */ + readonly provisioningState?: ProvisioningState; +} + +/** The response of a VmInstanceHybridIdentityMetadata list operation. */ +export interface _VmInstanceHybridIdentityMetadataListResult { + /** The VmInstanceHybridIdentityMetadata items on this page */ + value: VmInstanceHybridIdentityMetadata[]; + /** The link to the next page of items */ + readonly nextLink?: string; +} + +/** The base extension resource. */ +export interface ExtensionResource extends Resource {} + +export function extensionResourceSerializer(item: ExtensionResource) { + return item as any; +} + +/** Define the virtualMachineInstance. */ +export interface VirtualMachineInstance extends ExtensionResource { + /** The resource-specific properties for this resource. */ + properties?: VirtualMachineInstanceProperties; + /** Gets or sets the extended location. */ + extendedLocation: ExtendedLocation; +} + +export function virtualMachineInstanceSerializer( + item: VirtualMachineInstance, +): VirtualMachineInstanceRest { + return { + properties: !item.properties + ? item.properties + : virtualMachineInstancePropertiesSerializer(item.properties), + extendedLocation: extendedLocationSerializer(item.extendedLocation), + }; +} + +/** Defines the resource properties. */ +export interface VirtualMachineInstanceProperties { + /** Availability Sets in vm. */ + availabilitySets?: AvailabilitySetListItem[]; + /** OS properties. */ + osProfile?: OsProfileForVmInstance; + /** Hardware properties. */ + hardwareProfile?: HardwareProfile; + /** Network properties. */ + networkProfile?: NetworkProfile; + /** Storage properties. */ + storageProfile?: StorageProfile; + /** Gets the infrastructure profile. */ + infrastructureProfile?: InfrastructureProfile; + /** Gets the power state of the virtual machine. */ + readonly powerState?: string; + /** Provisioning state of the resource. */ + readonly provisioningState?: ProvisioningState; +} + +export function virtualMachineInstancePropertiesSerializer( + item: VirtualMachineInstanceProperties, +): VirtualMachineInstancePropertiesRest { + return { + availabilitySets: + item["availabilitySets"] === undefined + ? item["availabilitySets"] + : item["availabilitySets"].map(availabilitySetListItemSerializer), + osProfile: !item.osProfile + ? item.osProfile + : osProfileForVmInstanceSerializer(item.osProfile), + hardwareProfile: !item.hardwareProfile + ? item.hardwareProfile + : hardwareProfileSerializer(item.hardwareProfile), + networkProfile: !item.networkProfile + ? item.networkProfile + : networkProfileSerializer(item.networkProfile), + storageProfile: !item.storageProfile + ? item.storageProfile + : storageProfileSerializer(item.storageProfile), + infrastructureProfile: !item.infrastructureProfile + ? item.infrastructureProfile + : infrastructureProfileSerializer(item.infrastructureProfile), + }; +} + +/** Availability Set model */ +export interface AvailabilitySetListItem { + /** Gets the ARM Id of the microsoft.scvmm/availabilitySets resource. */ + id?: string; + /** Gets or sets the name of the availability set. */ + name?: string; +} + +export function availabilitySetListItemSerializer( + item: AvailabilitySetListItem, +): AvailabilitySetListItemRest { + return { + id: item["id"], + name: item["name"], + }; +} + +/** Defines the resource properties. */ +export interface OsProfileForVmInstance { + /** Admin password of the virtual machine. */ + adminPassword?: string; + /** Gets or sets computer name. */ + computerName?: string; + /** Gets the type of the os. */ + readonly osType?: OsType; + /** Gets os sku. */ + readonly osSku?: string; + /** Gets os version. */ + readonly osVersion?: string; + /** Gets or sets the domain name. */ + domainName?: string; + /** Gets or sets the domain username. */ + domainUsername?: string; + /** Password of the domain the VM has to join. */ + domainPassword?: string; + /** Gets or sets the workgroup. */ + workgroup?: string; + /** Gets or sets the product key.Input format xxxxx-xxxxx-xxxxx-xxxxx-xxxxx */ + productKey?: string; + /** Gets or sets the index value of the timezone. */ + timezone?: number; + /** Get or sets the commands to be run once at the time of creation separated by semicolons. */ + runOnceCommands?: string; +} + +export function osProfileForVmInstanceSerializer( + item: OsProfileForVmInstance, +): OsProfileForVmInstanceRest { + return { + adminPassword: item["adminPassword"], + computerName: item["computerName"], + domainName: item["domainName"], + domainUsername: item["domainUsername"], + domainPassword: item["domainPassword"], + workgroup: item["workgroup"], + productKey: item["productKey"], + timezone: item["timezone"], + runOnceCommands: item["runOnceCommands"], + }; +} + +/** Known values of {@link OsType} that the service accepts. */ +export enum KnownOsType { + /** Windows */ + Windows = "Windows", + /** Linux */ + Linux = "Linux", + /** Other */ + Other = "Other", +} + +/** + * Virtual machine operating system type. \ + * {@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; + +/** Defines the resource properties. */ +export interface HardwareProfile { + /** MemoryMB is the size of a virtual machine's memory, in MB. */ + memoryMB?: number; + /** Gets or sets the number of vCPUs for the vm. */ + cpuCount?: number; + /** Gets or sets a value indicating whether to enable processor compatibility mode for live migration of VMs. */ + limitCpuForMigration?: LimitCpuForMigration; + /** Gets or sets a value indicating whether to enable dynamic memory or not. */ + dynamicMemoryEnabled?: DynamicMemoryEnabled; + /** Gets or sets the max dynamic memory for the vm. */ + dynamicMemoryMaxMB?: number; + /** Gets or sets the min dynamic memory for the vm. */ + dynamicMemoryMinMB?: number; + /** Gets highly available property. */ + readonly isHighlyAvailable?: IsHighlyAvailable; +} + +export function hardwareProfileSerializer( + item: HardwareProfile, +): HardwareProfileRest { + return { + memoryMB: item["memoryMB"], + cpuCount: item["cpuCount"], + limitCpuForMigration: item["limitCpuForMigration"], + dynamicMemoryEnabled: item["dynamicMemoryEnabled"], + dynamicMemoryMaxMB: item["dynamicMemoryMaxMB"], + dynamicMemoryMinMB: item["dynamicMemoryMinMB"], + }; +} + +/** Known values of {@link LimitCpuForMigration} that the service accepts. */ +export enum KnownLimitCpuForMigration { + /** true */ + "true" = "true", + /** false */ + "false" = "false", +} + +/** + * Limit CPU for migration. \ + * {@link KnownLimitCpuForMigration} can be used interchangeably with LimitCpuForMigration, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **true** \ + * **false** + */ +export type LimitCpuForMigration = string; + +/** Known values of {@link DynamicMemoryEnabled} that the service accepts. */ +export enum KnownDynamicMemoryEnabled { + /** true */ + "true" = "true", + /** false */ + "false" = "false", +} + +/** + * Dynamic memory enabled. \ + * {@link KnownDynamicMemoryEnabled} can be used interchangeably with DynamicMemoryEnabled, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **true** \ + * **false** + */ +export type DynamicMemoryEnabled = string; + +/** Known values of {@link IsHighlyAvailable} that the service accepts. */ +export enum KnownIsHighlyAvailable { + /** true */ + "true" = "true", + /** false */ + "false" = "false", +} + +/** + * Highly available. \ + * {@link KnownIsHighlyAvailable} can be used interchangeably with IsHighlyAvailable, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **true** \ + * **false** + */ +export type IsHighlyAvailable = string; + +/** Defines the resource properties. */ +export interface NetworkProfile { + /** Gets or sets the list of network interfaces associated with the virtual machine. */ + networkInterfaces?: NetworkInterface[]; +} + +export function networkProfileSerializer( + item: NetworkProfile, +): NetworkProfileRest { + return { + networkInterfaces: + item["networkInterfaces"] === undefined + ? item["networkInterfaces"] + : item["networkInterfaces"].map(networkInterfaceSerializer), + }; +} + +/** Network Interface model */ +export interface NetworkInterface { + /** Gets or sets the name of the network interface. */ + name?: string; + /** Gets the display name of the network interface as shown in the vmmServer. This is the fallback label for a NIC when the name is not set. */ + readonly displayName?: string; + /** Gets the nic ipv4 addresses. */ + readonly ipv4Addresses?: string[]; + /** Gets the nic ipv6 addresses. */ + readonly ipv6Addresses?: string[]; + /** Gets or sets the nic MAC address. */ + macAddress?: string; + /** Gets or sets the ARM Id of the Microsoft.ScVmm/virtualNetwork resource to connect the nic. */ + virtualNetworkId?: string; + /** Gets the name of the virtual network in vmmServer that the nic is connected to. */ + readonly networkName?: string; + /** Gets or sets the ipv4 address type. */ + ipv4AddressType?: AllocationMethod; + /** Gets or sets the ipv6 address type. */ + ipv6AddressType?: AllocationMethod; + /** Gets or sets the mac address type. */ + macAddressType?: AllocationMethod; + /** Gets or sets the nic id. */ + nicId?: string; +} + +export function networkInterfaceSerializer( + item: NetworkInterface, +): NetworkInterfaceRest { + return { + name: item["name"], + macAddress: item["macAddress"], + virtualNetworkId: item["virtualNetworkId"], + ipv4AddressType: item["ipv4AddressType"], + ipv6AddressType: item["ipv6AddressType"], + macAddressType: item["macAddressType"], + nicId: item["nicId"], + }; +} + +/** Known values of {@link AllocationMethod} that the service accepts. */ +export enum KnownAllocationMethod { + /** Dynamic */ + Dynamic = "Dynamic", + /** Static */ + Static = "Static", +} + +/** + * Network address allocation method. \ + * {@link KnownAllocationMethod} can be used interchangeably with AllocationMethod, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Dynamic** \ + * **Static** + */ +export type AllocationMethod = string; + +/** Defines the resource properties. */ +export interface StorageProfile { + /** Gets or sets the list of virtual disks associated with the virtual machine. */ + disks?: VirtualDisk[]; +} + +export function storageProfileSerializer( + item: StorageProfile, +): StorageProfileRest { + return { + disks: + item["disks"] === undefined + ? item["disks"] + : item["disks"].map(virtualDiskSerializer), + }; +} + +/** Virtual disk model */ +export interface VirtualDisk { + /** Gets or sets the name of the disk. */ + name?: string; + /** Gets the display name of the virtual disk as shown in the vmmServer. This is the fallback label for a disk when the name is not set. */ + readonly displayName?: string; + /** Gets or sets the disk id. */ + diskId?: string; + /** Gets or sets the disk total size. */ + diskSizeGB?: number; + /** Gets the max disk size. */ + readonly maxDiskSizeGB?: number; + /** Gets or sets the disk bus. */ + bus?: number; + /** Gets or sets the disk lun. */ + lun?: number; + /** Gets or sets the disk bus type. */ + busType?: string; + /** Gets or sets the disk vhd type. */ + vhdType?: string; + /** Gets the disk volume type. */ + readonly volumeType?: string; + /** Gets the disk vhd format type. */ + readonly vhdFormatType?: string; + /** Gets or sets the disk id in the template. */ + templateDiskId?: string; + /** The QoS policy for the disk. */ + storageQosPolicy?: StorageQosPolicyDetails; + /** Gets or sets a value indicating diff disk. */ + createDiffDisk?: CreateDiffDisk; +} + +export function virtualDiskSerializer(item: VirtualDisk): VirtualDiskRest { + return { + name: item["name"], + diskId: item["diskId"], + diskSizeGB: item["diskSizeGB"], + bus: item["bus"], + lun: item["lun"], + busType: item["busType"], + vhdType: item["vhdType"], + templateDiskId: item["templateDiskId"], + storageQoSPolicy: !item.storageQosPolicy + ? item.storageQosPolicy + : storageQosPolicyDetailsSerializer(item.storageQosPolicy), + createDiffDisk: item["createDiffDisk"], + }; +} + +/** The StorageQoSPolicyDetails definition. */ +export interface StorageQosPolicyDetails { + /** The name of the policy. */ + name?: string; + /** The ID of the QoS policy. */ + id?: string; +} + +export function storageQosPolicyDetailsSerializer( + item: StorageQosPolicyDetails, +): StorageQosPolicyDetailsRest { + return { + name: item["name"], + id: item["id"], + }; +} + +/** Known values of {@link CreateDiffDisk} that the service accepts. */ +export enum KnownCreateDiffDisk { + /** true */ + "true" = "true", + /** false */ + "false" = "false", +} + +/** + * Create diff disk. \ + * {@link KnownCreateDiffDisk} can be used interchangeably with CreateDiffDisk, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **true** \ + * **false** + */ +export type CreateDiffDisk = string; + +/** Specifies the vmmServer infrastructure specific settings for the virtual machine instance. */ +export interface InfrastructureProfile { + /** Gets or sets the inventory Item ID for the resource. */ + inventoryItemId?: string; + /** ARM Id of the vmmServer resource in which this resource resides. */ + vmmServerId?: string; + /** ARM Id of the cloud resource to use for deploying the vm. */ + cloudId?: string; + /** ARM Id of the template resource to use for deploying the vm. */ + templateId?: string; + /** VMName is the name of VM on the SCVmm server. */ + vmName?: string; + /** Unique ID of the virtual machine. */ + uuid?: string; + /** Last restored checkpoint in the vm. */ + readonly lastRestoredVmCheckpoint?: Checkpoint; + /** Checkpoints in the vm. */ + readonly checkpoints?: Checkpoint[]; + /** Type of checkpoint supported for the vm. */ + checkpointType?: string; + /** Gets or sets the generation for the vm. */ + generation?: number; + /** Gets or sets the bios guid for the vm. */ + biosGuid?: string; +} + +export function infrastructureProfileSerializer( + item: InfrastructureProfile, +): InfrastructureProfileRest { + return { + inventoryItemId: item["inventoryItemId"], + vmmServerId: item["vmmServerId"], + cloudId: item["cloudId"], + templateId: item["templateId"], + vmName: item["vmName"], + uuid: item["uuid"], + checkpointType: item["checkpointType"], + generation: item["generation"], + biosGuid: item["biosGuid"], + }; +} + +/** Defines the resource properties. */ +export interface Checkpoint { + /** Gets ID of parent of the checkpoint. */ + parentCheckpointId?: string; + /** Gets ID of the checkpoint. */ + checkpointId?: string; + /** Gets name of the checkpoint. */ + name?: string; + /** Gets description of the checkpoint. */ + description?: string; +} + +/** The extended location. */ +export interface ExtendedLocation { + /** The extended location type. */ + type?: string; + /** The extended location name. */ + name?: string; +} + +export function extendedLocationSerializer( + item: ExtendedLocation, +): ExtendedLocationRest { + return { + type: item["type"], + name: item["name"], + }; +} + +/** The type used for update operations of the VirtualMachineInstance. */ +export interface VirtualMachineInstanceUpdate { + /** The update properties of the VirtualMachineInstance. */ + properties?: VirtualMachineInstanceUpdateProperties; +} + +export function virtualMachineInstanceUpdateSerializer( + item: VirtualMachineInstanceUpdate, +): VirtualMachineInstanceUpdateRest { + return { + properties: !item.properties + ? item.properties + : virtualMachineInstanceUpdatePropertiesSerializer(item.properties), + }; +} + +/** Virtual Machine Instance Properties Update model */ +export interface VirtualMachineInstanceUpdateProperties { + /** Availability Sets in vm. */ + availabilitySets?: AvailabilitySetListItem[]; + /** Hardware properties. */ + hardwareProfile?: HardwareProfileUpdate; + /** Network properties. */ + networkProfile?: NetworkProfileUpdate; + /** Storage properties. */ + storageProfile?: StorageProfileUpdate; + /** Gets the infrastructure profile. */ + infrastructureProfile?: InfrastructureProfileUpdate; +} + +export function virtualMachineInstanceUpdatePropertiesSerializer( + item: VirtualMachineInstanceUpdateProperties, +): VirtualMachineInstanceUpdatePropertiesRest { + return { + availabilitySets: + item["availabilitySets"] === undefined + ? item["availabilitySets"] + : item["availabilitySets"].map(availabilitySetListItemSerializer), + hardwareProfile: !item.hardwareProfile + ? item.hardwareProfile + : hardwareProfileUpdateSerializer(item.hardwareProfile), + networkProfile: !item.networkProfile + ? item.networkProfile + : networkProfileUpdateSerializer(item.networkProfile), + storageProfile: !item.storageProfile + ? item.storageProfile + : storageProfileUpdateSerializer(item.storageProfile), + infrastructureProfile: !item.infrastructureProfile + ? item.infrastructureProfile + : infrastructureProfileUpdateSerializer(item.infrastructureProfile), + }; +} + +/** Defines the resource update properties. */ +export interface HardwareProfileUpdate { + /** MemoryMB is the size of a virtual machine's memory, in MB. */ + memoryMB?: number; + /** Gets or sets the number of vCPUs for the vm. */ + cpuCount?: number; + /** Gets or sets a value indicating whether to enable processor compatibility mode for live migration of VMs. */ + limitCpuForMigration?: LimitCpuForMigration; + /** Gets or sets a value indicating whether to enable dynamic memory or not. */ + dynamicMemoryEnabled?: DynamicMemoryEnabled; + /** Gets or sets the max dynamic memory for the vm. */ + dynamicMemoryMaxMB?: number; + /** Gets or sets the min dynamic memory for the vm. */ + dynamicMemoryMinMB?: number; +} + +export function hardwareProfileUpdateSerializer( + item: HardwareProfileUpdate, +): HardwareProfileUpdateRest { + return { + memoryMB: item["memoryMB"], + cpuCount: item["cpuCount"], + limitCpuForMigration: item["limitCpuForMigration"], + dynamicMemoryEnabled: item["dynamicMemoryEnabled"], + dynamicMemoryMaxMB: item["dynamicMemoryMaxMB"], + dynamicMemoryMinMB: item["dynamicMemoryMinMB"], + }; +} + +/** Defines the resource update properties. */ +export interface NetworkProfileUpdate { + /** Gets or sets the list of network interfaces associated with the virtual machine. */ + networkInterfaces?: NetworkInterfaceUpdate[]; +} + +export function networkProfileUpdateSerializer( + item: NetworkProfileUpdate, +): NetworkProfileUpdateRest { + return { + networkInterfaces: + item["networkInterfaces"] === undefined + ? item["networkInterfaces"] + : item["networkInterfaces"].map(networkInterfaceUpdateSerializer), + }; +} + +/** Network Interface Update model */ +export interface NetworkInterfaceUpdate { + /** Gets or sets the name of the network interface. */ + name?: string; + /** Gets or sets the nic MAC address. */ + macAddress?: string; + /** Gets or sets the ARM Id of the Microsoft.ScVmm/virtualNetwork resource to connect the nic. */ + virtualNetworkId?: string; + /** Gets or sets the ipv4 address type. */ + ipv4AddressType?: AllocationMethod; + /** Gets or sets the ipv6 address type. */ + ipv6AddressType?: AllocationMethod; + /** Gets or sets the mac address type. */ + macAddressType?: AllocationMethod; + /** Gets or sets the nic id. */ + nicId?: string; +} + +export function networkInterfaceUpdateSerializer( + item: NetworkInterfaceUpdate, +): NetworkInterfaceUpdateRest { + return { + name: item["name"], + macAddress: item["macAddress"], + virtualNetworkId: item["virtualNetworkId"], + ipv4AddressType: item["ipv4AddressType"], + ipv6AddressType: item["ipv6AddressType"], + macAddressType: item["macAddressType"], + nicId: item["nicId"], + }; +} + +/** Defines the resource update properties. */ +export interface StorageProfileUpdate { + /** Gets or sets the list of virtual disks associated with the virtual machine. */ + disks?: VirtualDiskUpdate[]; +} + +export function storageProfileUpdateSerializer( + item: StorageProfileUpdate, +): StorageProfileUpdateRest { + return { + disks: + item["disks"] === undefined + ? item["disks"] + : item["disks"].map(virtualDiskUpdateSerializer), + }; +} + +/** Virtual Disk Update model */ +export interface VirtualDiskUpdate { + /** Gets or sets the name of the disk. */ + name?: string; + /** Gets or sets the disk id. */ + diskId?: string; + /** Gets or sets the disk total size. */ + diskSizeGB?: number; + /** Gets or sets the disk bus. */ + bus?: number; + /** Gets or sets the disk lun. */ + lun?: number; + /** Gets or sets the disk bus type. */ + busType?: string; + /** Gets or sets the disk vhd type. */ + vhdType?: string; + /** The QoS policy for the disk. */ + storageQosPolicy?: StorageQosPolicyDetails; +} + +export function virtualDiskUpdateSerializer( + item: VirtualDiskUpdate, +): VirtualDiskUpdateRest { + return { + name: item["name"], + diskId: item["diskId"], + diskSizeGB: item["diskSizeGB"], + bus: item["bus"], + lun: item["lun"], + busType: item["busType"], + vhdType: item["vhdType"], + storageQoSPolicy: !item.storageQosPolicy + ? item.storageQosPolicy + : storageQosPolicyDetailsSerializer(item.storageQosPolicy), + }; +} + +/** Specifies the vmmServer infrastructure specific update settings for the virtual machine instance. */ +export interface InfrastructureProfileUpdate { + /** Type of checkpoint supported for the vm. */ + checkpointType?: string; +} + +export function infrastructureProfileUpdateSerializer( + item: InfrastructureProfileUpdate, +): InfrastructureProfileUpdateRest { + return { + checkpointType: item["checkpointType"], + }; +} + +/** Known values of {@link ForceDelete} that the service accepts. */ +export enum KnownForceDelete { + /** true */ + "true" = "true", + /** false */ + "false" = "false", +} + +/** + * Force Delete \ + * {@link KnownForceDelete} can be used interchangeably with ForceDelete, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **true** \ + * **false** + */ +export type ForceDelete = string; + +/** Known values of {@link DeleteFromHost} that the service accepts. */ +export enum KnownDeleteFromHost { + /** true */ + "true" = "true", + /** false */ + "false" = "false", +} + +/** + * Delete From Host \ + * {@link KnownDeleteFromHost} can be used interchangeably with DeleteFromHost, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **true** \ + * **false** + */ +export type DeleteFromHost = string; + +/** The response of a VirtualMachineInstance list operation. */ +export interface _VirtualMachineInstanceListResult { + /** The VirtualMachineInstance items on this page */ + value: VirtualMachineInstance[]; + /** The link to the next page of items */ + readonly nextLink?: string; +} + +/** 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?: SkipShutdown; +} + +export function stopVirtualMachineOptionsSerializer( + item: StopVirtualMachineOptions, +): StopVirtualMachineOptionsRest { + return { + skipShutdown: item["skipShutdown"], + }; +} + +/** Known values of {@link SkipShutdown} that the service accepts. */ +export enum KnownSkipShutdown { + /** true */ + "true" = "true", + /** false */ + "false" = "false", +} + +/** + * Skip shutdown. \ + * {@link KnownSkipShutdown} can be used interchangeably with SkipShutdown, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **true** \ + * **false** + */ +export type SkipShutdown = string; + +/** Defines the create checkpoint action properties. */ +export interface VirtualMachineCreateCheckpoint { + /** Name of the checkpoint. */ + name?: string; + /** Description of the checkpoint. */ + description?: string; +} + +export function virtualMachineCreateCheckpointSerializer( + item: VirtualMachineCreateCheckpoint, +): VirtualMachineCreateCheckpointRest { + return { + name: item["name"], + description: item["description"], + }; +} + +/** Defines the delete checkpoint action properties. */ +export interface VirtualMachineDeleteCheckpoint { + /** ID of the checkpoint to be deleted. */ + id?: string; +} + +export function virtualMachineDeleteCheckpointSerializer( + item: VirtualMachineDeleteCheckpoint, +): VirtualMachineDeleteCheckpointRest { + return { + id: item["id"], + }; +} + +/** Defines the restore checkpoint action properties. */ +export interface VirtualMachineRestoreCheckpoint { + /** ID of the checkpoint to be restored to. */ + id?: string; +} + +export function virtualMachineRestoreCheckpointSerializer( + item: VirtualMachineRestoreCheckpoint, +): VirtualMachineRestoreCheckpointRest { + return { + id: item["id"], + }; +} + +/** Defines the inventory item. */ +export interface InventoryItem extends ProxyResource { + /** The resource-specific properties for this resource. */ + properties?: InventoryItemPropertiesUnion; + /** 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; +} + +export function inventoryItemSerializer( + item: InventoryItem, +): InventoryItemRest { + return { + properties: !item.properties + ? item.properties + : inventoryItemPropertiesUnionSerializer(item.properties), + kind: item["kind"], + }; +} + +/** Defines the resource properties. */ +export interface InventoryItemProperties { + /** the discriminator possible values: Cloud, VirtualNetwork, VirtualMachineTemplate, VirtualMachine */ + inventoryType: InventoryType; + /** Gets the tracked resource id corresponding to the inventory resource. */ + readonly managedResourceId?: string; + /** Gets the UUID (which is assigned by Vmm) for the inventory item. */ + readonly uuid?: string; + /** Gets the Managed Object name in Vmm for the inventory item. */ + readonly inventoryItemName?: string; + /** Provisioning state of the resource. */ + readonly provisioningState?: ProvisioningState; +} + +export function inventoryItemPropertiesUnionSerializer( + item: InventoryItemPropertiesUnion, +) { + switch (item.inventoryType) { + case "Cloud": + return cloudInventoryItemSerializer(item as CloudInventoryItem); + + case "VirtualNetwork": + return virtualNetworkInventoryItemSerializer( + item as VirtualNetworkInventoryItem, + ); + + case "VirtualMachineTemplate": + return virtualMachineTemplateInventoryItemSerializer( + item as VirtualMachineTemplateInventoryItem, + ); + + case "VirtualMachine": + return virtualMachineInventoryItemSerializer( + item as VirtualMachineInventoryItem, + ); + + default: + return inventoryItemPropertiesSerializer(item); + } +} + +export function inventoryItemPropertiesSerializer( + item: InventoryItemPropertiesUnion, +): InventoryItemPropertiesRest { + return { + inventoryType: item["inventoryType"], + }; +} + +/** The Cloud inventory item. */ +export interface CloudInventoryItem extends InventoryItemProperties { + /** They inventory type. */ + inventoryType: "Cloud"; +} + +export function cloudInventoryItemSerializer( + item: CloudInventoryItem, +): CloudInventoryItemRest { + return { + inventoryType: item["inventoryType"], + }; +} + +/** The Virtual network inventory item. */ +export interface VirtualNetworkInventoryItem extends InventoryItemProperties { + /** They inventory type. */ + inventoryType: "VirtualNetwork"; +} + +export function virtualNetworkInventoryItemSerializer( + item: VirtualNetworkInventoryItem, +): VirtualNetworkInventoryItemRest { + return { + inventoryType: item["inventoryType"], + }; +} + +/** The Virtual machine template inventory item. */ +export interface VirtualMachineTemplateInventoryItem + extends InventoryItemProperties { + /** Gets the desired number of vCPUs for the vm. */ + readonly cpuCount?: number; + /** MemoryMB is the desired size of a virtual machine's memory, in MB. */ + readonly memoryMB?: number; + /** Gets the type of the os. */ + readonly osType?: OsType; + /** Gets os name. */ + readonly osName?: string; + /** They inventory type. */ + inventoryType: "VirtualMachineTemplate"; +} + +export function virtualMachineTemplateInventoryItemSerializer( + item: VirtualMachineTemplateInventoryItem, +): VirtualMachineTemplateInventoryItemRest { + return { + inventoryType: item["inventoryType"], + }; +} + +/** The Virtual machine inventory item. */ +export interface VirtualMachineInventoryItem extends InventoryItemProperties { + /** Gets the type of the os. */ + readonly osType?: OsType; + /** Gets os name. */ + readonly osName?: string; + /** Gets os version. */ + readonly osVersion?: string; + /** Gets the power state of the virtual machine. */ + readonly powerState?: string; + /** Gets or sets the nic ip addresses. */ + ipAddresses?: string[]; + /** Cloud inventory resource details where the VM is present. */ + cloud?: InventoryItemDetails; + /** Gets the bios guid. */ + readonly biosGuid?: string; + /** Gets the tracked resource id corresponding to the inventory resource. */ + readonly managedMachineResourceId?: string; + /** They inventory type. */ + inventoryType: "VirtualMachine"; +} + +export function virtualMachineInventoryItemSerializer( + item: VirtualMachineInventoryItem, +): VirtualMachineInventoryItemRest { + return { + inventoryType: item["inventoryType"], + ipAddresses: item["ipAddresses"], + cloud: !item.cloud + ? item.cloud + : inventoryItemDetailsSerializer(item.cloud), + }; +} + +/** Defines the resource properties. */ +export interface InventoryItemDetails { + /** Gets or sets the inventory Item ID for the resource. */ + inventoryItemId?: string; + /** Gets or sets the Managed Object name in Vmm for the resource. */ + inventoryItemName?: string; +} + +export function inventoryItemDetailsSerializer( + item: InventoryItemDetails, +): InventoryItemDetailsRest { + return { + inventoryItemId: item["inventoryItemId"], + inventoryItemName: item["inventoryItemName"], + }; +} + +/** Known values of {@link InventoryType} that the service accepts. */ +export enum KnownInventoryType { + /** Cloud */ + Cloud = "Cloud", + /** VirtualNetwork */ + VirtualNetwork = "VirtualNetwork", + /** VirtualMachine */ + VirtualMachine = "VirtualMachine", + /** VirtualMachineTemplate */ + VirtualMachineTemplate = "VirtualMachineTemplate", +} + +/** + * The inventory type \ + * {@link KnownInventoryType} can be used interchangeably with InventoryType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Cloud** \ + * **VirtualNetwork** \ + * **VirtualMachine** \ + * **VirtualMachineTemplate** + */ +export type InventoryType = string; + +/** The response of a InventoryItem list operation. */ +export interface _InventoryItemListResult { + /** The InventoryItem items on this page */ + value: InventoryItem[]; + /** The link to the next page of items */ + readonly nextLink?: string; +} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: Record; + /** The geo-location where the resource lives */ + location: string; +} + +export function trackedResourceSerializer( + item: TrackedResource, +): TrackedResourceRest { + return { + tags: !item.tags ? item.tags : (serializeRecord(item.tags as any) as any), + location: item["location"], + }; +} + +/** The AvailabilitySets resource definition. */ +export interface AvailabilitySet extends TrackedResource { + /** The resource-specific properties for this resource. */ + properties?: AvailabilitySetProperties; + /** The extended location. */ + extendedLocation: ExtendedLocation; +} + +export function availabilitySetSerializer( + item: AvailabilitySet, +): AvailabilitySetRest { + return { + tags: !item.tags ? item.tags : (serializeRecord(item.tags as any) as any), + location: item["location"], + properties: !item.properties + ? item.properties + : availabilitySetPropertiesSerializer(item.properties), + extendedLocation: extendedLocationSerializer(item.extendedLocation), + }; +} + +/** Defines the resource properties. */ +export interface AvailabilitySetProperties { + /** Name of the availability set. */ + availabilitySetName?: string; + /** ARM Id of the vmmServer resource in which this resource resides. */ + vmmServerId?: string; + /** Provisioning state of the resource. */ + readonly provisioningState?: ProvisioningState; +} + +export function availabilitySetPropertiesSerializer( + item: AvailabilitySetProperties, +): AvailabilitySetPropertiesRest { + return { + availabilitySetName: item["availabilitySetName"], + vmmServerId: item["vmmServerId"], + }; +} + +/** The type used for updating tags in AvailabilitySet resources. */ +export interface AvailabilitySetTagsUpdate { + /** Resource tags. */ + tags?: Record; +} + +export function availabilitySetTagsUpdateSerializer( + item: AvailabilitySetTagsUpdate, +): AvailabilitySetTagsUpdateRest { + return { + tags: !item.tags ? item.tags : (serializeRecord(item.tags as any) as any), + }; +} + +/** The response of a AvailabilitySet list operation. */ +export interface _AvailabilitySetListResult { + /** The AvailabilitySet items on this page */ + value: AvailabilitySet[]; + /** The link to the next page of items */ + readonly nextLink?: string; +} + +/** The VirtualMachineTemplates resource definition. */ +export interface VirtualMachineTemplate extends TrackedResource { + /** The resource-specific properties for this resource. */ + properties?: VirtualMachineTemplateProperties; + /** The extended location. */ + extendedLocation: ExtendedLocation; +} + +export function virtualMachineTemplateSerializer( + item: VirtualMachineTemplate, +): VirtualMachineTemplateRest { + return { + tags: !item.tags ? item.tags : (serializeRecord(item.tags as any) as any), + location: item["location"], + properties: !item.properties + ? item.properties + : virtualMachineTemplatePropertiesSerializer(item.properties), + extendedLocation: extendedLocationSerializer(item.extendedLocation), + }; +} + +/** Defines the resource properties. */ +export interface VirtualMachineTemplateProperties { + /** Gets or sets the inventory Item ID for the resource. */ + inventoryItemId?: string; + /** Unique ID of the virtual machine template. */ + uuid?: string; + /** ARM Id of the vmmServer resource in which this resource resides. */ + vmmServerId?: string; + /** Gets the type of the os. */ + readonly osType?: OsType; + /** Gets os name. */ + readonly osName?: string; + /** Gets computer name. */ + readonly computerName?: string; + /** MemoryMB is the desired size of a virtual machine's memory, in MB. */ + readonly memoryMB?: number; + /** Gets the desired number of vCPUs for the vm. */ + readonly cpuCount?: number; + /** Gets a value indicating whether to enable processor compatibility mode for live migration of VMs. */ + readonly limitCpuForMigration?: LimitCpuForMigration; + /** Gets a value indicating whether to enable dynamic memory or not. */ + readonly dynamicMemoryEnabled?: DynamicMemoryEnabled; + /** Gets a value indicating whether the vm template is customizable or not. */ + readonly isCustomizable?: IsCustomizable; + /** Gets the max dynamic memory for the vm. */ + readonly dynamicMemoryMaxMB?: number; + /** Gets the min dynamic memory for the vm. */ + readonly dynamicMemoryMinMB?: number; + /** Gets highly available property. */ + readonly isHighlyAvailable?: IsHighlyAvailable; + /** Gets the generation for the vm. */ + readonly generation?: number; + /** Gets the network interfaces of the template. */ + readonly networkInterfaces?: NetworkInterface[]; + /** Gets the disks of the template. */ + readonly disks?: VirtualDisk[]; + /** Provisioning state of the resource. */ + readonly provisioningState?: ProvisioningState; +} + +export function virtualMachineTemplatePropertiesSerializer( + item: VirtualMachineTemplateProperties, +): VirtualMachineTemplatePropertiesRest { + return { + inventoryItemId: item["inventoryItemId"], + uuid: item["uuid"], + vmmServerId: item["vmmServerId"], + }; +} + +/** Known values of {@link IsCustomizable} that the service accepts. */ +export enum KnownIsCustomizable { + /** true */ + "true" = "true", + /** false */ + "false" = "false", +} + +/** + * Customizable. \ + * {@link KnownIsCustomizable} can be used interchangeably with IsCustomizable, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **true** \ + * **false** + */ +export type IsCustomizable = string; + +/** The type used for updating tags in VirtualMachineTemplate resources. */ +export interface VirtualMachineTemplateTagsUpdate { + /** Resource tags. */ + tags?: Record; +} + +export function virtualMachineTemplateTagsUpdateSerializer( + item: VirtualMachineTemplateTagsUpdate, +): VirtualMachineTemplateTagsUpdateRest { + return { + tags: !item.tags ? item.tags : (serializeRecord(item.tags as any) as any), + }; +} + +/** The response of a VirtualMachineTemplate list operation. */ +export interface _VirtualMachineTemplateListResult { + /** The VirtualMachineTemplate items on this page */ + value: VirtualMachineTemplate[]; + /** The link to the next page of items */ + readonly nextLink?: string; +} + +/** The VirtualNetworks resource definition. */ +export interface VirtualNetwork extends TrackedResource { + /** The resource-specific properties for this resource. */ + properties?: VirtualNetworkProperties; + /** The extended location. */ + extendedLocation: ExtendedLocation; +} + +export function virtualNetworkSerializer( + item: VirtualNetwork, +): VirtualNetworkRest { + return { + tags: !item.tags ? item.tags : (serializeRecord(item.tags as any) as any), + location: item["location"], + properties: !item.properties + ? item.properties + : virtualNetworkPropertiesSerializer(item.properties), + extendedLocation: extendedLocationSerializer(item.extendedLocation), + }; +} + +/** Defines the resource properties. */ +export interface VirtualNetworkProperties { + /** Gets or sets the inventory Item ID for the resource. */ + inventoryItemId?: string; + /** Unique ID of the virtual network. */ + uuid?: string; + /** ARM Id of the vmmServer resource in which this resource resides. */ + vmmServerId?: string; + /** Name of the virtual network in vmmServer. */ + readonly networkName?: string; + /** Provisioning state of the resource. */ + readonly provisioningState?: ProvisioningState; +} + +export function virtualNetworkPropertiesSerializer( + item: VirtualNetworkProperties, +): VirtualNetworkPropertiesRest { + return { + inventoryItemId: item["inventoryItemId"], + uuid: item["uuid"], + vmmServerId: item["vmmServerId"], + }; +} + +/** The type used for updating tags in VirtualNetwork resources. */ +export interface VirtualNetworkTagsUpdate { + /** Resource tags. */ + tags?: Record; +} + +export function virtualNetworkTagsUpdateSerializer( + item: VirtualNetworkTagsUpdate, +): VirtualNetworkTagsUpdateRest { + return { + tags: !item.tags ? item.tags : (serializeRecord(item.tags as any) as any), + }; +} + +/** The response of a VirtualNetwork list operation. */ +export interface _VirtualNetworkListResult { + /** The VirtualNetwork items on this page */ + value: VirtualNetwork[]; + /** The link to the next page of items */ + readonly nextLink?: string; +} + +/** The Clouds resource definition. */ +export interface Cloud extends TrackedResource { + /** The resource-specific properties for this resource. */ + properties?: CloudProperties; + /** The extended location. */ + extendedLocation: ExtendedLocation; +} + +export function cloudSerializer(item: Cloud): CloudRest { + return { + tags: !item.tags ? item.tags : (serializeRecord(item.tags as any) as any), + location: item["location"], + properties: !item.properties + ? item.properties + : cloudPropertiesSerializer(item.properties), + extendedLocation: extendedLocationSerializer(item.extendedLocation), + }; +} + +/** Defines the resource properties. */ +export interface CloudProperties { + /** Gets or sets the inventory Item ID for the resource. */ + inventoryItemId?: string; + /** Unique ID of the cloud. */ + uuid?: string; + /** ARM Id of the vmmServer resource in which this resource resides. */ + vmmServerId?: string; + /** Name of the cloud in VmmServer. */ + readonly cloudName?: string; + /** Capacity of the cloud. */ + readonly cloudCapacity?: CloudCapacity; + /** List of QoS policies available for the cloud. */ + readonly storageQosPolicies?: StorageQosPolicy[]; + /** Provisioning state of the resource. */ + readonly provisioningState?: ProvisioningState; +} + +export function cloudPropertiesSerializer( + item: CloudProperties, +): CloudPropertiesRest { + return { + inventoryItemId: item["inventoryItemId"], + uuid: item["uuid"], + vmmServerId: item["vmmServerId"], + }; +} + +/** Cloud Capacity model */ +export interface CloudCapacity { + /** CPUCount specifies the maximum number of CPUs that can be allocated in the cloud. */ + readonly cpuCount?: number; + /** MemoryMB specifies a memory usage limit in megabytes. */ + readonly memoryMB?: number; + /** VMCount gives the max number of VMs that can be deployed in the cloud. */ + readonly vmCount?: number; +} + +/** The StorageQoSPolicy definition. */ +export interface StorageQosPolicy { + /** The name of the policy. */ + name?: string; + /** The ID of the QoS policy. */ + id?: string; + /** The maximum IO operations per second. */ + iopsMaximum?: number; + /** The minimum IO operations per second. */ + iopsMinimum?: number; + /** The Bandwidth Limit for internet traffic. */ + bandwidthLimit?: number; + /** The underlying policy. */ + policyId?: string; +} + +/** The type used for updating tags in Cloud resources. */ +export interface CloudTagsUpdate { + /** Resource tags. */ + tags?: Record; +} + +export function cloudTagsUpdateSerializer( + item: CloudTagsUpdate, +): CloudTagsUpdateRest { + return { + tags: !item.tags ? item.tags : (serializeRecord(item.tags as any) as any), + }; +} + +/** The response of a Cloud list operation. */ +export interface _CloudListResult { + /** The Cloud items on this page */ + value: Cloud[]; + /** The link to the next page of items */ + readonly nextLink?: string; +} + +/** The VmmServers resource definition. */ +export interface VmmServer extends TrackedResource { + /** The resource-specific properties for this resource. */ + properties?: VmmServerProperties; + /** The extended location. */ + extendedLocation: ExtendedLocation; +} + +export function vmmServerSerializer(item: VmmServer): VmmServerRest { + return { + tags: !item.tags ? item.tags : (serializeRecord(item.tags as any) as any), + location: item["location"], + properties: !item.properties + ? item.properties + : vmmServerPropertiesSerializer(item.properties), + extendedLocation: extendedLocationSerializer(item.extendedLocation), + }; +} + +/** Defines the resource properties. */ +export interface VmmServerProperties { + /** Credentials to connect to VmmServer. */ + credentials?: VmmCredential; + /** Fqdn is the hostname/ip of the vmmServer. */ + fqdn: string; + /** Port is the port on which the vmmServer is listening. */ + port?: number; + /** Gets the connection status to the vmmServer. */ + readonly connectionStatus?: string; + /** Gets any error message if connection to vmmServer is having any issue. */ + readonly errorMessage?: string; + /** Unique ID of vmmServer. */ + readonly uuid?: string; + /** Version is the version of the vmmSever. */ + readonly version?: string; + /** Provisioning state of the resource. */ + readonly provisioningState?: ProvisioningState; +} + +export function vmmServerPropertiesSerializer( + item: VmmServerProperties, +): VmmServerPropertiesRest { + return { + credentials: !item.credentials + ? item.credentials + : vmmCredentialSerializer(item.credentials), + fqdn: item["fqdn"], + port: item["port"], + }; +} + +/** Credentials to connect to VmmServer. */ +export interface VmmCredential { + /** Username to use to connect to VmmServer. */ + username?: string; + /** Password to use to connect to VmmServer. */ + password?: string; +} + +export function vmmCredentialSerializer( + item: VmmCredential, +): VmmCredentialRest { + return { + username: item["username"], + password: item["password"], + }; +} + +/** The type used for updating tags in VmmServer resources. */ +export interface VmmServerTagsUpdate { + /** Resource tags. */ + tags?: Record; +} + +export function vmmServerTagsUpdateSerializer( + item: VmmServerTagsUpdate, +): VmmServerTagsUpdateRest { + return { + tags: !item.tags ? item.tags : (serializeRecord(item.tags as any) as any), + }; +} + +/** The response of a VmmServer list operation. */ +export interface _VmmServerListResult { + /** The VmmServer items on this page */ + value: VmmServer[]; + /** The link to the next page of items */ + readonly nextLink?: string; +} + +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface _OperationListResult { + /** The Operation items on this page */ + value: Operation[]; + /** The link to the next page of items */ + readonly nextLink?: string; +} + +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { + /** The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ + readonly name?: string; + /** Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure Resource Manager/control-plane operations. */ + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + readonly display?: OperationDisplay; + /** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" */ + readonly origin?: Origin; + /** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ + actionType?: ActionType; +} + +/** Localized display information for and operation. */ +export interface OperationDisplay { + /** The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". */ + readonly provider?: string; + /** The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". */ + readonly resource?: string; + /** The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". */ + readonly operation?: string; + /** The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ + readonly description?: string; +} + +/** Known values of {@link Origin} that the service accepts. */ +export enum KnownOrigin { + /** user */ + user = "user", + /** system */ + system = "system", + /** user,system */ + "user,system" = "user,system", +} + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user** \ + * **system** \ + * **user,system** + */ +export type Origin = string; + +/** Known values of {@link ActionType} that the service accepts. */ +export enum KnownActionType { + /** Internal */ + Internal = "Internal", +} + +/** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal** + */ +export type ActionType = string; +/** The available API versions. */ +export type Versions = "2023-10-07" | "2024-06-01"; +/** Alias for ProvisioningState */ +export type ProvisioningState = + | string + | ResourceProvisioningState + | "Provisioning" + | "Updating" + | "Deleting" + | "Accepted" + | "Created"; +/** Alias for InventoryItemPropertiesUnion */ +export type InventoryItemPropertiesUnion = + | CloudInventoryItem + | VirtualNetworkInventoryItem + | VirtualMachineTemplateInventoryItem + | VirtualMachineInventoryItem + | InventoryItemProperties; diff --git a/sdk/scvmm/arm-scvmm/src/models/options.ts b/sdk/scvmm/arm-scvmm/src/models/options.ts new file mode 100644 index 000000000000..74129cc72e1d --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/models/options.ts @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { OperationOptions } from "@azure-rest/core-client"; +import { ForceDelete, DeleteFromHost } from "./models.js"; + +/** Optional parameters. */ +export interface OperationsListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VmmServersGetOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VmmServersCreateOrUpdateOptionalParams + extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VmmServersUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VmmServersDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** Forces the resource to be deleted. */ + force?: ForceDelete; +} + +/** Optional parameters. */ +export interface VmmServersListByResourceGroupOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface VmmServersListBySubscriptionOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface CloudsGetOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface CloudsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface CloudsUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface CloudsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** Forces the resource to be deleted. */ + force?: ForceDelete; +} + +/** Optional parameters. */ +export interface CloudsListByResourceGroupOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface CloudsListBySubscriptionOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualNetworksGetOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualNetworksCreateOrUpdateOptionalParams + extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualNetworksUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualNetworksDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** Forces the resource to be deleted. */ + force?: ForceDelete; +} + +/** Optional parameters. */ +export interface VirtualNetworksListByResourceGroupOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualNetworksListBySubscriptionOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineTemplatesGetOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineTemplatesCreateOrUpdateOptionalParams + extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineTemplatesUpdateOptionalParams + extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineTemplatesDeleteOptionalParams + extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** Forces the resource to be deleted. */ + force?: ForceDelete; +} + +/** Optional parameters. */ +export interface VirtualMachineTemplatesListByResourceGroupOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineTemplatesListBySubscriptionOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface AvailabilitySetsGetOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface AvailabilitySetsCreateOrUpdateOptionalParams + extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface AvailabilitySetsUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface AvailabilitySetsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** Forces the resource to be deleted. */ + force?: ForceDelete; +} + +/** Optional parameters. */ +export interface AvailabilitySetsListByResourceGroupOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface AvailabilitySetsListBySubscriptionOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface InventoryItemsGetOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface InventoryItemsCreateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface InventoryItemsDeleteOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface InventoryItemsListByVmmServerOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineInstancesGetOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineInstancesCreateOrUpdateOptionalParams + extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineInstancesUpdateOptionalParams + extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineInstancesDeleteOptionalParams + extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** Forces the resource to be deleted. */ + force?: ForceDelete; + /** Whether to disable the VM from azure and also delete it from Vmm. */ + deleteFromHost?: DeleteFromHost; +} + +/** Optional parameters. */ +export interface VirtualMachineInstancesListOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineInstancesStopOptionalParams + extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineInstancesStartOptionalParams + extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineInstancesRestartOptionalParams + extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineInstancesCreateCheckpointOptionalParams + extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineInstancesDeleteCheckpointOptionalParams + extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineInstancesRestoreCheckpointOptionalParams + extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VmInstanceHybridIdentityMetadatasGetOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface GuestAgentsGetOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface GuestAgentsCreateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GuestAgentsDeleteOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface GuestAgentsListByVirtualMachineInstanceOptionalParams + extends OperationOptions {} diff --git a/sdk/scvmm/arm-scvmm/src/models/pagingTypes.ts b/sdk/scvmm/arm-scvmm/src/models/pagingTypes.ts new file mode 100644 index 000000000000..f734b48e62f9 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/models/pagingTypes.ts @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +/** + * Options for the byPage method + */ +export interface PageSettings { + /** + * A reference to a specific page to start iterating from. + */ + continuationToken?: string; +} + +/** + * An interface that describes a page of results. + */ +export type ContinuablePage = TPage & { + /** + * The token that keeps track of where to continue the iterator + */ + continuationToken?: string; +}; + +/** + * An interface that allows async iterable iteration both to completion and by page. + */ +export interface PagedAsyncIterableIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * The next method, part of the iteration protocol + */ + next(): Promise>; + /** + * The connection to the async iterator, part of the iteration protocol + */ + [Symbol.asyncIterator](): PagedAsyncIterableIterator< + TElement, + TPage, + TPageSettings + >; + /** + * Return an AsyncIterableIterator that works a page at a time + */ + byPage: ( + settings?: TPageSettings, + ) => AsyncIterableIterator>; +} + +/** + * An interface that describes how to communicate with the service. + */ +export interface PagedResult< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * Link to the first page of results. + */ + firstPageLink?: string; + /** + * A method that returns a page of results. + */ + getPage: ( + pageLink?: string, + ) => Promise<{ page: TPage; nextPageLink?: string } | undefined>; + /** + * a function to implement the `byPage` method on the paged async iterator. + */ + byPage?: ( + settings?: TPageSettings, + ) => AsyncIterableIterator>; + + /** + * A function to extract elements from a page. + */ + toElements?: (page: TPage) => TElement[]; +} + +/** + * Options for the paging helper + */ +export interface BuildPagedAsyncIteratorOptions { + itemName?: string; + nextLinkName?: string; +} diff --git a/sdk/scvmm/arm-scvmm/src/models/parameters.ts b/sdk/scvmm/arm-scvmm/src/models/parameters.ts deleted file mode 100644 index 02ea9d02e1e5..000000000000 --- a/sdk/scvmm/arm-scvmm/src/models/parameters.ts +++ /dev/null @@ -1,337 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { - VirtualMachineInstance as VirtualMachineInstanceMapper, - VirtualMachineInstanceUpdate as VirtualMachineInstanceUpdateMapper, - VirtualMachineCreateCheckpoint as VirtualMachineCreateCheckpointMapper, - VirtualMachineDeleteCheckpoint as VirtualMachineDeleteCheckpointMapper, - VirtualMachineRestoreCheckpoint as VirtualMachineRestoreCheckpointMapper, - StopVirtualMachineOptions as StopVirtualMachineOptionsMapper, - GuestAgent as GuestAgentMapper, - AvailabilitySet as AvailabilitySetMapper, - AvailabilitySetTagsUpdate as AvailabilitySetTagsUpdateMapper, - Cloud as CloudMapper, - CloudTagsUpdate as CloudTagsUpdateMapper, - VirtualMachineTemplate as VirtualMachineTemplateMapper, - VirtualMachineTemplateTagsUpdate as VirtualMachineTemplateTagsUpdateMapper, - VirtualNetwork as VirtualNetworkMapper, - VirtualNetworkTagsUpdate as VirtualNetworkTagsUpdateMapper, - VmmServer as VmmServerMapper, - VmmServerTagsUpdate as VmmServerTagsUpdateMapper, - InventoryItem as InventoryItemMapper, -} 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: "2023-10-07", - isConstant: true, - serializedName: "api-version", - type: { - name: "String", - }, - }, -}; - -export const resourceUri: OperationURLParameter = { - parameterPath: "resourceUri", - mapper: { - serializedName: "resourceUri", - required: true, - type: { - name: "String", - }, - }, - skipEncoding: true, -}; - -export const contentType: OperationParameter = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/json", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String", - }, - }, -}; - -export const resource: OperationParameter = { - parameterPath: "resource", - mapper: VirtualMachineInstanceMapper, -}; - -export const properties: OperationParameter = { - parameterPath: "properties", - mapper: VirtualMachineInstanceUpdateMapper, -}; - -export const force: OperationQueryParameter = { - parameterPath: ["options", "force"], - mapper: { - serializedName: "force", - type: { - name: "String", - }, - }, -}; - -export const deleteFromHost: OperationQueryParameter = { - parameterPath: ["options", "deleteFromHost"], - mapper: { - serializedName: "deleteFromHost", - type: { - name: "String", - }, - }, -}; - -export const body: OperationParameter = { - parameterPath: "body", - mapper: VirtualMachineCreateCheckpointMapper, -}; - -export const body1: OperationParameter = { - parameterPath: "body", - mapper: VirtualMachineDeleteCheckpointMapper, -}; - -export const body2: OperationParameter = { - parameterPath: "body", - mapper: VirtualMachineRestoreCheckpointMapper, -}; - -export const body3: OperationParameter = { - parameterPath: "body", - mapper: StopVirtualMachineOptionsMapper, -}; - -export const nextLink: OperationURLParameter = { - parameterPath: "nextLink", - mapper: { - serializedName: "nextLink", - required: true, - type: { - name: "String", - }, - }, - skipEncoding: true, -}; - -export const resource1: OperationParameter = { - parameterPath: "resource", - mapper: GuestAgentMapper, -}; - -export const subscriptionId: OperationURLParameter = { - parameterPath: "subscriptionId", - mapper: { - serializedName: "subscriptionId", - required: true, - type: { - name: "Uuid", - }, - }, -}; - -export const resourceGroupName: OperationURLParameter = { - parameterPath: "resourceGroupName", - mapper: { - constraints: { - MaxLength: 90, - MinLength: 1, - }, - serializedName: "resourceGroupName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const availabilitySetResourceName: OperationURLParameter = { - parameterPath: "availabilitySetResourceName", - mapper: { - constraints: { - Pattern: new RegExp("[a-zA-Z0-9-_\\.]"), - MaxLength: 54, - MinLength: 1, - }, - serializedName: "availabilitySetResourceName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const resource2: OperationParameter = { - parameterPath: "resource", - mapper: AvailabilitySetMapper, -}; - -export const properties1: OperationParameter = { - parameterPath: "properties", - mapper: AvailabilitySetTagsUpdateMapper, -}; - -export const cloudResourceName: OperationURLParameter = { - parameterPath: "cloudResourceName", - mapper: { - constraints: { - Pattern: new RegExp("[a-zA-Z0-9-_\\.]"), - MaxLength: 54, - MinLength: 1, - }, - serializedName: "cloudResourceName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const resource3: OperationParameter = { - parameterPath: "resource", - mapper: CloudMapper, -}; - -export const properties2: OperationParameter = { - parameterPath: "properties", - mapper: CloudTagsUpdateMapper, -}; - -export const virtualMachineTemplateName: OperationURLParameter = { - parameterPath: "virtualMachineTemplateName", - mapper: { - constraints: { - Pattern: new RegExp("[a-zA-Z0-9-_\\.]"), - MaxLength: 54, - MinLength: 1, - }, - serializedName: "virtualMachineTemplateName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const resource4: OperationParameter = { - parameterPath: "resource", - mapper: VirtualMachineTemplateMapper, -}; - -export const properties3: OperationParameter = { - parameterPath: "properties", - mapper: VirtualMachineTemplateTagsUpdateMapper, -}; - -export const virtualNetworkName: OperationURLParameter = { - parameterPath: "virtualNetworkName", - mapper: { - constraints: { - Pattern: new RegExp("[a-zA-Z0-9-_\\.]"), - MaxLength: 54, - MinLength: 1, - }, - serializedName: "virtualNetworkName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const resource5: OperationParameter = { - parameterPath: "resource", - mapper: VirtualNetworkMapper, -}; - -export const properties4: OperationParameter = { - parameterPath: "properties", - mapper: VirtualNetworkTagsUpdateMapper, -}; - -export const vmmServerName: OperationURLParameter = { - parameterPath: "vmmServerName", - mapper: { - constraints: { - Pattern: new RegExp("[a-zA-Z0-9-_\\.]"), - MaxLength: 54, - MinLength: 1, - }, - serializedName: "vmmServerName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const resource6: OperationParameter = { - parameterPath: "resource", - mapper: VmmServerMapper, -}; - -export const properties5: OperationParameter = { - parameterPath: "properties", - mapper: VmmServerTagsUpdateMapper, -}; - -export const inventoryItemResourceName: OperationURLParameter = { - parameterPath: "inventoryItemResourceName", - mapper: { - constraints: { - Pattern: new RegExp( - "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", - ), - }, - serializedName: "inventoryItemResourceName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const resource7: OperationParameter = { - parameterPath: "resource", - mapper: InventoryItemMapper, -}; diff --git a/sdk/scvmm/arm-scvmm/src/operations/availabilitySets.ts b/sdk/scvmm/arm-scvmm/src/operations/availabilitySets.ts deleted file mode 100644 index dc9d1eef079d..000000000000 --- a/sdk/scvmm/arm-scvmm/src/operations/availabilitySets.ts +++ /dev/null @@ -1,738 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { AvailabilitySets } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { ScVmm } from "../scVmm"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; -import { - AvailabilitySet, - AvailabilitySetsListBySubscriptionNextOptionalParams, - AvailabilitySetsListBySubscriptionOptionalParams, - AvailabilitySetsListBySubscriptionResponse, - AvailabilitySetsListByResourceGroupNextOptionalParams, - AvailabilitySetsListByResourceGroupOptionalParams, - AvailabilitySetsListByResourceGroupResponse, - AvailabilitySetsGetOptionalParams, - AvailabilitySetsGetResponse, - AvailabilitySetsCreateOrUpdateOptionalParams, - AvailabilitySetsCreateOrUpdateResponse, - AvailabilitySetTagsUpdate, - AvailabilitySetsUpdateOptionalParams, - AvailabilitySetsUpdateResponse, - AvailabilitySetsDeleteOptionalParams, - AvailabilitySetsDeleteResponse, - AvailabilitySetsListBySubscriptionNextResponse, - AvailabilitySetsListByResourceGroupNextResponse, -} from "../models"; - -/// -/** Class containing AvailabilitySets operations. */ -export class AvailabilitySetsImpl implements AvailabilitySets { - private readonly client: ScVmm; - - /** - * Initialize a new instance of the class AvailabilitySets class. - * @param client Reference to the service client - */ - constructor(client: ScVmm) { - this.client = client; - } - - /** - * List of AvailabilitySets in a subscription. - * @param options The options parameters. - */ - public listBySubscription( - options?: AvailabilitySetsListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listBySubscriptionPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listBySubscriptionPagingPage(options, settings); - }, - }; - } - - private async *listBySubscriptionPagingPage( - options?: AvailabilitySetsListBySubscriptionOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: AvailabilitySetsListBySubscriptionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listBySubscription(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listBySubscriptionNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listBySubscriptionPagingAll( - options?: AvailabilitySetsListBySubscriptionOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listBySubscriptionPagingPage(options)) { - yield* page; - } - } - - /** - * List of AvailabilitySets in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: AvailabilitySetsListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings, - ); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: AvailabilitySetsListByResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: AvailabilitySetsListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext( - resourceGroupName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: AvailabilitySetsListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage( - resourceGroupName, - options, - )) { - yield* page; - } - } - - /** - * List of AvailabilitySets in a subscription. - * @param options The options parameters. - */ - private _listBySubscription( - options?: AvailabilitySetsListBySubscriptionOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { options }, - listBySubscriptionOperationSpec, - ); - } - - /** - * List of AvailabilitySets in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: AvailabilitySetsListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * Implements AvailabilitySet GET method. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetResourceName Name of the AvailabilitySet. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - availabilitySetResourceName: string, - options?: AvailabilitySetsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, availabilitySetResourceName, options }, - getOperationSpec, - ); - } - - /** - * Onboards the ScVmm availability set as an Azure resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetResourceName Name of the AvailabilitySet. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - availabilitySetResourceName: string, - resource: AvailabilitySet, - options?: AvailabilitySetsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - AvailabilitySetsCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - availabilitySetResourceName, - resource, - options, - }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - AvailabilitySetsCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * Onboards the ScVmm availability set as an Azure resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetResourceName Name of the AvailabilitySet. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - availabilitySetResourceName: string, - resource: AvailabilitySet, - options?: AvailabilitySetsCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - availabilitySetResourceName, - resource, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Updates the AvailabilitySets resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetResourceName Name of the AvailabilitySet. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - availabilitySetResourceName: string, - properties: AvailabilitySetTagsUpdate, - options?: AvailabilitySetsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - AvailabilitySetsUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - availabilitySetResourceName, - properties, - options, - }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - AvailabilitySetsUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * Updates the AvailabilitySets resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetResourceName Name of the AvailabilitySet. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - availabilitySetResourceName: string, - properties: AvailabilitySetTagsUpdate, - options?: AvailabilitySetsUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - availabilitySetResourceName, - properties, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Deregisters the ScVmm availability set from Azure. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetResourceName Name of the AvailabilitySet. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - availabilitySetResourceName: string, - options?: AvailabilitySetsDeleteOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - AvailabilitySetsDeleteResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, availabilitySetResourceName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller< - AvailabilitySetsDeleteResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Deregisters the ScVmm availability set from Azure. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetResourceName Name of the AvailabilitySet. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - availabilitySetResourceName: string, - options?: AvailabilitySetsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - availabilitySetResourceName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * ListBySubscriptionNext - * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. - * @param options The options parameters. - */ - private _listBySubscriptionNext( - nextLink: string, - options?: AvailabilitySetsListBySubscriptionNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listBySubscriptionNextOperationSpec, - ); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: AvailabilitySetsListByResourceGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/availabilitySets", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AvailabilitySetListResult, - }, - 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.ScVmm/availabilitySets", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AvailabilitySetListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets/{availabilitySetResourceName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AvailabilitySet, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.availabilitySetResourceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets/{availabilitySetResourceName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.AvailabilitySet, - }, - 201: { - bodyMapper: Mappers.AvailabilitySet, - }, - 202: { - bodyMapper: Mappers.AvailabilitySet, - }, - 204: { - bodyMapper: Mappers.AvailabilitySet, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.resource2, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.availabilitySetResourceName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets/{availabilitySetResourceName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.AvailabilitySet, - }, - 201: { - bodyMapper: Mappers.AvailabilitySet, - }, - 202: { - bodyMapper: Mappers.AvailabilitySet, - }, - 204: { - bodyMapper: Mappers.AvailabilitySet, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.properties1, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.availabilitySetResourceName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets/{availabilitySetResourceName}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: Mappers.AvailabilitySetsDeleteHeaders, - }, - 201: { - headersMapper: Mappers.AvailabilitySetsDeleteHeaders, - }, - 202: { - headersMapper: Mappers.AvailabilitySetsDeleteHeaders, - }, - 204: { - headersMapper: Mappers.AvailabilitySetsDeleteHeaders, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.force], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.availabilitySetResourceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AvailabilitySetListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AvailabilitySetListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/scvmm/arm-scvmm/src/operations/clouds.ts b/sdk/scvmm/arm-scvmm/src/operations/clouds.ts deleted file mode 100644 index 3debbde941ea..000000000000 --- a/sdk/scvmm/arm-scvmm/src/operations/clouds.ts +++ /dev/null @@ -1,722 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { Clouds } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { ScVmm } from "../scVmm"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; -import { - Cloud, - CloudsListBySubscriptionNextOptionalParams, - CloudsListBySubscriptionOptionalParams, - CloudsListBySubscriptionResponse, - CloudsListByResourceGroupNextOptionalParams, - CloudsListByResourceGroupOptionalParams, - CloudsListByResourceGroupResponse, - CloudsGetOptionalParams, - CloudsGetResponse, - CloudsCreateOrUpdateOptionalParams, - CloudsCreateOrUpdateResponse, - CloudTagsUpdate, - CloudsUpdateOptionalParams, - CloudsUpdateResponse, - CloudsDeleteOptionalParams, - CloudsDeleteResponse, - CloudsListBySubscriptionNextResponse, - CloudsListByResourceGroupNextResponse, -} from "../models"; - -/// -/** Class containing Clouds operations. */ -export class CloudsImpl implements Clouds { - private readonly client: ScVmm; - - /** - * Initialize a new instance of the class Clouds class. - * @param client Reference to the service client - */ - constructor(client: ScVmm) { - this.client = client; - } - - /** - * List of Clouds in a subscription. - * @param options The options parameters. - */ - public listBySubscription( - options?: CloudsListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listBySubscriptionPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listBySubscriptionPagingPage(options, settings); - }, - }; - } - - private async *listBySubscriptionPagingPage( - options?: CloudsListBySubscriptionOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: CloudsListBySubscriptionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listBySubscription(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listBySubscriptionNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listBySubscriptionPagingAll( - options?: CloudsListBySubscriptionOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listBySubscriptionPagingPage(options)) { - yield* page; - } - } - - /** - * List of Clouds in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: CloudsListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings, - ); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: CloudsListByResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: CloudsListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext( - resourceGroupName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: CloudsListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage( - resourceGroupName, - options, - )) { - yield* page; - } - } - - /** - * List of Clouds in a subscription. - * @param options The options parameters. - */ - private _listBySubscription( - options?: CloudsListBySubscriptionOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { options }, - listBySubscriptionOperationSpec, - ); - } - - /** - * List of Clouds in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: CloudsListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * Implements Cloud GET method. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudResourceName Name of the Cloud. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - cloudResourceName: string, - options?: CloudsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, cloudResourceName, options }, - getOperationSpec, - ); - } - - /** - * Onboards the ScVmm fabric cloud as an Azure cloud resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudResourceName Name of the Cloud. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - cloudResourceName: string, - resource: Cloud, - options?: CloudsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - CloudsCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, cloudResourceName, resource, options }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - CloudsCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * Onboards the ScVmm fabric cloud as an Azure cloud resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudResourceName Name of the Cloud. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - cloudResourceName: string, - resource: Cloud, - options?: CloudsCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - cloudResourceName, - resource, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Updates the Clouds resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudResourceName Name of the Cloud. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - cloudResourceName: string, - properties: CloudTagsUpdate, - options?: CloudsUpdateOptionalParams, - ): Promise< - SimplePollerLike, CloudsUpdateResponse> - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, cloudResourceName, properties, options }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - CloudsUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * Updates the Clouds resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudResourceName Name of the Cloud. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - cloudResourceName: string, - properties: CloudTagsUpdate, - options?: CloudsUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - cloudResourceName, - properties, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Deregisters the ScVmm fabric cloud from Azure. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudResourceName Name of the Cloud. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - cloudResourceName: string, - options?: CloudsDeleteOptionalParams, - ): Promise< - SimplePollerLike, CloudsDeleteResponse> - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, cloudResourceName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller< - CloudsDeleteResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * Deregisters the ScVmm fabric cloud from Azure. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudResourceName Name of the Cloud. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - cloudResourceName: string, - options?: CloudsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - cloudResourceName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * ListBySubscriptionNext - * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. - * @param options The options parameters. - */ - private _listBySubscriptionNext( - nextLink: string, - options?: CloudsListBySubscriptionNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listBySubscriptionNextOperationSpec, - ); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: CloudsListByResourceGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/clouds", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CloudListResult, - }, - 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.ScVmm/clouds", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CloudListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds/{cloudResourceName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.Cloud, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.cloudResourceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds/{cloudResourceName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.Cloud, - }, - 201: { - bodyMapper: Mappers.Cloud, - }, - 202: { - bodyMapper: Mappers.Cloud, - }, - 204: { - bodyMapper: Mappers.Cloud, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.resource3, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.cloudResourceName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds/{cloudResourceName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.Cloud, - }, - 201: { - bodyMapper: Mappers.Cloud, - }, - 202: { - bodyMapper: Mappers.Cloud, - }, - 204: { - bodyMapper: Mappers.Cloud, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.properties2, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.cloudResourceName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds/{cloudResourceName}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: Mappers.CloudsDeleteHeaders, - }, - 201: { - headersMapper: Mappers.CloudsDeleteHeaders, - }, - 202: { - headersMapper: Mappers.CloudsDeleteHeaders, - }, - 204: { - headersMapper: Mappers.CloudsDeleteHeaders, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.force], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.cloudResourceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CloudListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CloudListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/scvmm/arm-scvmm/src/operations/guestAgents.ts b/sdk/scvmm/arm-scvmm/src/operations/guestAgents.ts deleted file mode 100644 index 4a5bd28686ce..000000000000 --- a/sdk/scvmm/arm-scvmm/src/operations/guestAgents.ts +++ /dev/null @@ -1,365 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { GuestAgents } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { ScVmm } from "../scVmm"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; -import { - GuestAgent, - GuestAgentsListByVirtualMachineInstanceNextOptionalParams, - GuestAgentsListByVirtualMachineInstanceOptionalParams, - GuestAgentsListByVirtualMachineInstanceResponse, - GuestAgentsGetOptionalParams, - GuestAgentsGetResponse, - GuestAgentsCreateOptionalParams, - GuestAgentsCreateResponse, - GuestAgentsDeleteOptionalParams, - GuestAgentsListByVirtualMachineInstanceNextResponse, -} from "../models"; - -/// -/** Class containing GuestAgents operations. */ -export class GuestAgentsImpl implements GuestAgents { - private readonly client: ScVmm; - - /** - * Initialize a new instance of the class GuestAgents class. - * @param client Reference to the service client - */ - constructor(client: ScVmm) { - this.client = client; - } - - /** - * Returns the list of GuestAgent of the given vm. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - public listByVirtualMachineInstance( - resourceUri: string, - options?: GuestAgentsListByVirtualMachineInstanceOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByVirtualMachineInstancePagingAll( - resourceUri, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByVirtualMachineInstancePagingPage( - resourceUri, - options, - settings, - ); - }, - }; - } - - private async *listByVirtualMachineInstancePagingPage( - resourceUri: string, - options?: GuestAgentsListByVirtualMachineInstanceOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: GuestAgentsListByVirtualMachineInstanceResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByVirtualMachineInstance(resourceUri, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByVirtualMachineInstanceNext( - resourceUri, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByVirtualMachineInstancePagingAll( - resourceUri: string, - options?: GuestAgentsListByVirtualMachineInstanceOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByVirtualMachineInstancePagingPage( - resourceUri, - options, - )) { - yield* page; - } - } - - /** - * Returns the list of GuestAgent of the given vm. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - private _listByVirtualMachineInstance( - resourceUri: string, - options?: GuestAgentsListByVirtualMachineInstanceOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, options }, - listByVirtualMachineInstanceOperationSpec, - ); - } - - /** - * Implements GuestAgent GET method. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - get( - resourceUri: string, - options?: GuestAgentsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, options }, - getOperationSpec, - ); - } - - /** - * Create Or Update GuestAgent. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - async beginCreate( - resourceUri: string, - resource: GuestAgent, - options?: GuestAgentsCreateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GuestAgentsCreateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { resourceUri, resource, options }, - spec: createOperationSpec, - }); - const poller = await createHttpPoller< - GuestAgentsCreateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * Create Or Update GuestAgent. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - async beginCreateAndWait( - resourceUri: string, - resource: GuestAgent, - options?: GuestAgentsCreateOptionalParams, - ): Promise { - const poller = await this.beginCreate(resourceUri, resource, options); - return poller.pollUntilDone(); - } - - /** - * Implements GuestAgent DELETE method. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - delete( - resourceUri: string, - options?: GuestAgentsDeleteOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, options }, - deleteOperationSpec, - ); - } - - /** - * ListByVirtualMachineInstanceNext - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param nextLink The nextLink from the previous successful call to the ListByVirtualMachineInstance - * method. - * @param options The options parameters. - */ - private _listByVirtualMachineInstanceNext( - resourceUri: string, - nextLink: string, - options?: GuestAgentsListByVirtualMachineInstanceNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, nextLink, options }, - listByVirtualMachineInstanceNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByVirtualMachineInstanceOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GuestAgentListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.resourceUri], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GuestAgent, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.resourceUri], - headerParameters: [Parameters.accept], - serializer, -}; -const createOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default", - 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.resource1, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.resourceUri], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.resourceUri], - headerParameters: [Parameters.accept], - serializer, -}; -const listByVirtualMachineInstanceNextOperationSpec: coreClient.OperationSpec = -{ - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GuestAgentListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.resourceUri, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/scvmm/arm-scvmm/src/operations/index.ts b/sdk/scvmm/arm-scvmm/src/operations/index.ts deleted file mode 100644 index 8e792fd233b8..000000000000 --- a/sdk/scvmm/arm-scvmm/src/operations/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 "./virtualMachineInstances"; -export * from "./guestAgents"; -export * from "./vmInstanceHybridIdentityMetadatas"; -export * from "./operations"; -export * from "./availabilitySets"; -export * from "./clouds"; -export * from "./virtualMachineTemplates"; -export * from "./virtualNetworks"; -export * from "./vmmServers"; -export * from "./inventoryItems"; diff --git a/sdk/scvmm/arm-scvmm/src/operations/inventoryItems.ts b/sdk/scvmm/arm-scvmm/src/operations/inventoryItems.ts deleted file mode 100644 index 004e981c94ef..000000000000 --- a/sdk/scvmm/arm-scvmm/src/operations/inventoryItems.ts +++ /dev/null @@ -1,341 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { InventoryItems } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { ScVmm } from "../scVmm"; -import { - InventoryItem, - InventoryItemsListByVmmServerNextOptionalParams, - InventoryItemsListByVmmServerOptionalParams, - InventoryItemsListByVmmServerResponse, - InventoryItemsGetOptionalParams, - InventoryItemsGetResponse, - InventoryItemsCreateOptionalParams, - InventoryItemsCreateResponse, - InventoryItemsDeleteOptionalParams, - InventoryItemsListByVmmServerNextResponse, -} from "../models"; - -/// -/** Class containing InventoryItems operations. */ -export class InventoryItemsImpl implements InventoryItems { - private readonly client: ScVmm; - - /** - * Initialize a new instance of the class InventoryItems class. - * @param client Reference to the service client - */ - constructor(client: ScVmm) { - this.client = client; - } - - /** - * Returns the list of inventoryItems in the given VmmServer. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmmServerName Name of the VmmServer. - * @param options The options parameters. - */ - public listByVmmServer( - resourceGroupName: string, - vmmServerName: string, - options?: InventoryItemsListByVmmServerOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByVmmServerPagingAll( - resourceGroupName, - vmmServerName, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByVmmServerPagingPage( - resourceGroupName, - vmmServerName, - options, - settings, - ); - }, - }; - } - - private async *listByVmmServerPagingPage( - resourceGroupName: string, - vmmServerName: string, - options?: InventoryItemsListByVmmServerOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: InventoryItemsListByVmmServerResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByVmmServer( - resourceGroupName, - vmmServerName, - options, - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByVmmServerNext( - resourceGroupName, - vmmServerName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByVmmServerPagingAll( - resourceGroupName: string, - vmmServerName: string, - options?: InventoryItemsListByVmmServerOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByVmmServerPagingPage( - resourceGroupName, - vmmServerName, - options, - )) { - yield* page; - } - } - - /** - * Returns the list of inventoryItems in the given VmmServer. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmmServerName Name of the VmmServer. - * @param options The options parameters. - */ - private _listByVmmServer( - resourceGroupName: string, - vmmServerName: string, - options?: InventoryItemsListByVmmServerOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmmServerName, options }, - listByVmmServerOperationSpec, - ); - } - - /** - * Shows an inventory item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmmServerName Name of the VmmServer. - * @param inventoryItemResourceName Name of the inventoryItem. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - vmmServerName: string, - inventoryItemResourceName: string, - options?: InventoryItemsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmmServerName, inventoryItemResourceName, options }, - getOperationSpec, - ); - } - - /** - * Create Or Update InventoryItem. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmmServerName Name of the VmmServer. - * @param inventoryItemResourceName Name of the inventoryItem. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - create( - resourceGroupName: string, - vmmServerName: string, - inventoryItemResourceName: string, - resource: InventoryItem, - options?: InventoryItemsCreateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - vmmServerName, - inventoryItemResourceName, - resource, - options, - }, - createOperationSpec, - ); - } - - /** - * Deletes an inventoryItem. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmmServerName Name of the VmmServer. - * @param inventoryItemResourceName Name of the inventoryItem. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - vmmServerName: string, - inventoryItemResourceName: string, - options?: InventoryItemsDeleteOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmmServerName, inventoryItemResourceName, options }, - deleteOperationSpec, - ); - } - - /** - * ListByVmmServerNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmmServerName Name of the VmmServer. - * @param nextLink The nextLink from the previous successful call to the ListByVmmServer method. - * @param options The options parameters. - */ - private _listByVmmServerNext( - resourceGroupName: string, - vmmServerName: string, - nextLink: string, - options?: InventoryItemsListByVmmServerNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmmServerName, nextLink, options }, - listByVmmServerNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByVmmServerOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.InventoryItemListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmmServerName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/{inventoryItemResourceName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.InventoryItem, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmmServerName, - Parameters.inventoryItemResourceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/{inventoryItemResourceName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.InventoryItem, - }, - 201: { - bodyMapper: Mappers.InventoryItem, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.resource7, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmmServerName, - Parameters.inventoryItemResourceName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/{inventoryItemResourceName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmmServerName, - Parameters.inventoryItemResourceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByVmmServerNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.InventoryItemListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmmServerName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/scvmm/arm-scvmm/src/operations/operations.ts b/sdk/scvmm/arm-scvmm/src/operations/operations.ts deleted file mode 100644 index fa11d95c305f..000000000000 --- a/sdk/scvmm/arm-scvmm/src/operations/operations.ts +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { Operations } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { ScVmm } from "../scVmm"; -import { - Operation, - OperationsListNextOptionalParams, - OperationsListOptionalParams, - OperationsListResponse, - OperationsListNextResponse, -} from "../models"; - -/// -/** Class containing Operations operations. */ -export class OperationsImpl implements Operations { - private readonly client: ScVmm; - - /** - * Initialize a new instance of the class Operations class. - * @param client Reference to the service client - */ - constructor(client: ScVmm) { - this.client = client; - } - - /** - * List the operations for the provider - * @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: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(options, settings); - }, - }; - } - - private async *listPagingPage( - options?: OperationsListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: OperationsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - options?: OperationsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * List the operations for the provider - * @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.ScVmm/operations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OperationListResult, - }, - 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.OperationListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/scvmm/arm-scvmm/src/operations/virtualMachineInstances.ts b/sdk/scvmm/arm-scvmm/src/operations/virtualMachineInstances.ts deleted file mode 100644 index 71bfe1cf74be..000000000000 --- a/sdk/scvmm/arm-scvmm/src/operations/virtualMachineInstances.ts +++ /dev/null @@ -1,1239 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { VirtualMachineInstances } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { ScVmm } from "../scVmm"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; -import { - VirtualMachineInstance, - VirtualMachineInstancesListNextOptionalParams, - VirtualMachineInstancesListOptionalParams, - VirtualMachineInstancesListResponse, - VirtualMachineInstancesGetOptionalParams, - VirtualMachineInstancesGetResponse, - VirtualMachineInstancesCreateOrUpdateOptionalParams, - VirtualMachineInstancesCreateOrUpdateResponse, - VirtualMachineInstanceUpdate, - VirtualMachineInstancesUpdateOptionalParams, - VirtualMachineInstancesUpdateResponse, - VirtualMachineInstancesDeleteOptionalParams, - VirtualMachineInstancesDeleteResponse, - VirtualMachineCreateCheckpoint, - VirtualMachineInstancesCreateCheckpointOptionalParams, - VirtualMachineInstancesCreateCheckpointResponse, - VirtualMachineDeleteCheckpoint, - VirtualMachineInstancesDeleteCheckpointOptionalParams, - VirtualMachineInstancesDeleteCheckpointResponse, - VirtualMachineInstancesRestartOptionalParams, - VirtualMachineInstancesRestartResponse, - VirtualMachineRestoreCheckpoint, - VirtualMachineInstancesRestoreCheckpointOptionalParams, - VirtualMachineInstancesRestoreCheckpointResponse, - VirtualMachineInstancesStartOptionalParams, - VirtualMachineInstancesStartResponse, - StopVirtualMachineOptions, - VirtualMachineInstancesStopOptionalParams, - VirtualMachineInstancesStopResponse, - VirtualMachineInstancesListNextResponse, -} from "../models"; - -/// -/** Class containing VirtualMachineInstances operations. */ -export class VirtualMachineInstancesImpl implements VirtualMachineInstances { - private readonly client: ScVmm; - - /** - * Initialize a new instance of the class VirtualMachineInstances class. - * @param client Reference to the service client - */ - constructor(client: ScVmm) { - this.client = client; - } - - /** - * Lists all of the virtual machine instances within the specified parent resource. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - public list( - resourceUri: string, - options?: VirtualMachineInstancesListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceUri, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(resourceUri, options, settings); - }, - }; - } - - private async *listPagingPage( - resourceUri: string, - options?: VirtualMachineInstancesListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VirtualMachineInstancesListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(resourceUri, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(resourceUri, continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - resourceUri: string, - options?: VirtualMachineInstancesListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(resourceUri, options)) { - yield* page; - } - } - - /** - * Lists all of the virtual machine instances within the specified parent resource. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - private _list( - resourceUri: string, - options?: VirtualMachineInstancesListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, options }, - listOperationSpec, - ); - } - - /** - * Retrieves information about a virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - get( - resourceUri: string, - options?: VirtualMachineInstancesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, options }, - getOperationSpec, - ); - } - - /** - * The operation to create or update a virtual machine instance. Please note some properties can be set - * only during virtual machine instance creation. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceUri: string, - resource: VirtualMachineInstance, - options?: VirtualMachineInstancesCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineInstancesCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { resourceUri, resource, options }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineInstancesCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to create or update a virtual machine instance. Please note some properties can be set - * only during virtual machine instance creation. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceUri: string, - resource: VirtualMachineInstance, - options?: VirtualMachineInstancesCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceUri, - resource, - options, - ); - return poller.pollUntilDone(); - } - - /** - * The operation to update a virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - async beginUpdate( - resourceUri: string, - properties: VirtualMachineInstanceUpdate, - options?: VirtualMachineInstancesUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineInstancesUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { resourceUri, properties, options }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineInstancesUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to update a virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceUri: string, - properties: VirtualMachineInstanceUpdate, - options?: VirtualMachineInstancesUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate(resourceUri, properties, options); - return poller.pollUntilDone(); - } - - /** - * The operation to delete a virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - async beginDelete( - resourceUri: string, - options?: VirtualMachineInstancesDeleteOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineInstancesDeleteResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { resourceUri, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineInstancesDeleteResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to delete a virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceUri: string, - options?: VirtualMachineInstancesDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete(resourceUri, options); - return poller.pollUntilDone(); - } - - /** - * Creates a checkpoint in virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param body The content of the action request - * @param options The options parameters. - */ - async beginCreateCheckpoint( - resourceUri: string, - body: VirtualMachineCreateCheckpoint, - options?: VirtualMachineInstancesCreateCheckpointOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineInstancesCreateCheckpointResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { resourceUri, body, options }, - spec: createCheckpointOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineInstancesCreateCheckpointResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Creates a checkpoint in virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param body The content of the action request - * @param options The options parameters. - */ - async beginCreateCheckpointAndWait( - resourceUri: string, - body: VirtualMachineCreateCheckpoint, - options?: VirtualMachineInstancesCreateCheckpointOptionalParams, - ): Promise { - const poller = await this.beginCreateCheckpoint(resourceUri, body, options); - return poller.pollUntilDone(); - } - - /** - * Deletes a checkpoint in virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param body The content of the action request - * @param options The options parameters. - */ - async beginDeleteCheckpoint( - resourceUri: string, - body: VirtualMachineDeleteCheckpoint, - options?: VirtualMachineInstancesDeleteCheckpointOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineInstancesDeleteCheckpointResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { resourceUri, body, options }, - spec: deleteCheckpointOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineInstancesDeleteCheckpointResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Deletes a checkpoint in virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param body The content of the action request - * @param options The options parameters. - */ - async beginDeleteCheckpointAndWait( - resourceUri: string, - body: VirtualMachineDeleteCheckpoint, - options?: VirtualMachineInstancesDeleteCheckpointOptionalParams, - ): Promise { - const poller = await this.beginDeleteCheckpoint(resourceUri, body, options); - return poller.pollUntilDone(); - } - - /** - * The operation to restart a virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - async beginRestart( - resourceUri: string, - options?: VirtualMachineInstancesRestartOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineInstancesRestartResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { resourceUri, options }, - spec: restartOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineInstancesRestartResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to restart a virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - async beginRestartAndWait( - resourceUri: string, - options?: VirtualMachineInstancesRestartOptionalParams, - ): Promise { - const poller = await this.beginRestart(resourceUri, options); - return poller.pollUntilDone(); - } - - /** - * Restores to a checkpoint in virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param body The content of the action request - * @param options The options parameters. - */ - async beginRestoreCheckpoint( - resourceUri: string, - body: VirtualMachineRestoreCheckpoint, - options?: VirtualMachineInstancesRestoreCheckpointOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineInstancesRestoreCheckpointResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { resourceUri, body, options }, - spec: restoreCheckpointOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineInstancesRestoreCheckpointResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Restores to a checkpoint in virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param body The content of the action request - * @param options The options parameters. - */ - async beginRestoreCheckpointAndWait( - resourceUri: string, - body: VirtualMachineRestoreCheckpoint, - options?: VirtualMachineInstancesRestoreCheckpointOptionalParams, - ): Promise { - const poller = await this.beginRestoreCheckpoint( - resourceUri, - body, - options, - ); - return poller.pollUntilDone(); - } - - /** - * The operation to start a virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - async beginStart( - resourceUri: string, - options?: VirtualMachineInstancesStartOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineInstancesStartResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { resourceUri, options }, - spec: startOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineInstancesStartResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to start a virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - async beginStartAndWait( - resourceUri: string, - options?: VirtualMachineInstancesStartOptionalParams, - ): Promise { - const poller = await this.beginStart(resourceUri, options); - return poller.pollUntilDone(); - } - - /** - * The operation to power off (stop) a virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param body The content of the action request - * @param options The options parameters. - */ - async beginStop( - resourceUri: string, - body: StopVirtualMachineOptions, - options?: VirtualMachineInstancesStopOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineInstancesStopResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { resourceUri, body, options }, - spec: stopOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineInstancesStopResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to power off (stop) a virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param body The content of the action request - * @param options The options parameters. - */ - async beginStopAndWait( - resourceUri: string, - body: StopVirtualMachineOptions, - options?: VirtualMachineInstancesStopOptionalParams, - ): Promise { - const poller = await this.beginStop(resourceUri, body, options); - return poller.pollUntilDone(); - } - - /** - * ListNext - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - resourceUri: string, - nextLink: string, - options?: VirtualMachineInstancesListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, nextLink, options }, - listNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineInstanceListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.resourceUri], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineInstance, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.resourceUri], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineInstance, - }, - 201: { - bodyMapper: Mappers.VirtualMachineInstance, - }, - 202: { - bodyMapper: Mappers.VirtualMachineInstance, - }, - 204: { - bodyMapper: Mappers.VirtualMachineInstance, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.resource, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.resourceUri], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineInstance, - }, - 201: { - bodyMapper: Mappers.VirtualMachineInstance, - }, - 202: { - bodyMapper: Mappers.VirtualMachineInstance, - }, - 204: { - bodyMapper: Mappers.VirtualMachineInstance, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.properties, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.resourceUri], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: Mappers.VirtualMachineInstancesDeleteHeaders, - }, - 201: { - headersMapper: Mappers.VirtualMachineInstancesDeleteHeaders, - }, - 202: { - headersMapper: Mappers.VirtualMachineInstancesDeleteHeaders, - }, - 204: { - headersMapper: Mappers.VirtualMachineInstancesDeleteHeaders, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.force, - Parameters.deleteFromHost, - ], - urlParameters: [Parameters.$host, Parameters.resourceUri], - headerParameters: [Parameters.accept], - serializer, -}; -const createCheckpointOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/createCheckpoint", - httpMethod: "POST", - responses: { - 200: { - headersMapper: Mappers.VirtualMachineInstancesCreateCheckpointHeaders, - }, - 201: { - headersMapper: Mappers.VirtualMachineInstancesCreateCheckpointHeaders, - }, - 202: { - headersMapper: Mappers.VirtualMachineInstancesCreateCheckpointHeaders, - }, - 204: { - headersMapper: Mappers.VirtualMachineInstancesCreateCheckpointHeaders, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.body, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.resourceUri], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteCheckpointOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/deleteCheckpoint", - httpMethod: "POST", - responses: { - 200: { - headersMapper: Mappers.VirtualMachineInstancesDeleteCheckpointHeaders, - }, - 201: { - headersMapper: Mappers.VirtualMachineInstancesDeleteCheckpointHeaders, - }, - 202: { - headersMapper: Mappers.VirtualMachineInstancesDeleteCheckpointHeaders, - }, - 204: { - headersMapper: Mappers.VirtualMachineInstancesDeleteCheckpointHeaders, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.body1, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.resourceUri], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const restartOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/restart", - httpMethod: "POST", - responses: { - 200: { - headersMapper: Mappers.VirtualMachineInstancesRestartHeaders, - }, - 201: { - headersMapper: Mappers.VirtualMachineInstancesRestartHeaders, - }, - 202: { - headersMapper: Mappers.VirtualMachineInstancesRestartHeaders, - }, - 204: { - headersMapper: Mappers.VirtualMachineInstancesRestartHeaders, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.resourceUri], - headerParameters: [Parameters.accept], - serializer, -}; -const restoreCheckpointOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/restoreCheckpoint", - httpMethod: "POST", - responses: { - 200: { - headersMapper: Mappers.VirtualMachineInstancesRestoreCheckpointHeaders, - }, - 201: { - headersMapper: Mappers.VirtualMachineInstancesRestoreCheckpointHeaders, - }, - 202: { - headersMapper: Mappers.VirtualMachineInstancesRestoreCheckpointHeaders, - }, - 204: { - headersMapper: Mappers.VirtualMachineInstancesRestoreCheckpointHeaders, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.body2, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.resourceUri], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const startOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/start", - httpMethod: "POST", - responses: { - 200: { - headersMapper: Mappers.VirtualMachineInstancesStartHeaders, - }, - 201: { - headersMapper: Mappers.VirtualMachineInstancesStartHeaders, - }, - 202: { - headersMapper: Mappers.VirtualMachineInstancesStartHeaders, - }, - 204: { - headersMapper: Mappers.VirtualMachineInstancesStartHeaders, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.resourceUri], - headerParameters: [Parameters.accept], - serializer, -}; -const stopOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/stop", - httpMethod: "POST", - responses: { - 200: { - headersMapper: Mappers.VirtualMachineInstancesStopHeaders, - }, - 201: { - headersMapper: Mappers.VirtualMachineInstancesStopHeaders, - }, - 202: { - headersMapper: Mappers.VirtualMachineInstancesStopHeaders, - }, - 204: { - headersMapper: Mappers.VirtualMachineInstancesStopHeaders, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.body3, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.resourceUri], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineInstanceListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.resourceUri, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/scvmm/arm-scvmm/src/operations/virtualMachineTemplates.ts b/sdk/scvmm/arm-scvmm/src/operations/virtualMachineTemplates.ts deleted file mode 100644 index 60ab6712f9dd..000000000000 --- a/sdk/scvmm/arm-scvmm/src/operations/virtualMachineTemplates.ts +++ /dev/null @@ -1,738 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { VirtualMachineTemplates } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { ScVmm } from "../scVmm"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; -import { - VirtualMachineTemplate, - VirtualMachineTemplatesListBySubscriptionNextOptionalParams, - VirtualMachineTemplatesListBySubscriptionOptionalParams, - VirtualMachineTemplatesListBySubscriptionResponse, - VirtualMachineTemplatesListByResourceGroupNextOptionalParams, - VirtualMachineTemplatesListByResourceGroupOptionalParams, - VirtualMachineTemplatesListByResourceGroupResponse, - VirtualMachineTemplatesGetOptionalParams, - VirtualMachineTemplatesGetResponse, - VirtualMachineTemplatesCreateOrUpdateOptionalParams, - VirtualMachineTemplatesCreateOrUpdateResponse, - VirtualMachineTemplateTagsUpdate, - VirtualMachineTemplatesUpdateOptionalParams, - VirtualMachineTemplatesUpdateResponse, - VirtualMachineTemplatesDeleteOptionalParams, - VirtualMachineTemplatesDeleteResponse, - VirtualMachineTemplatesListBySubscriptionNextResponse, - VirtualMachineTemplatesListByResourceGroupNextResponse, -} from "../models"; - -/// -/** Class containing VirtualMachineTemplates operations. */ -export class VirtualMachineTemplatesImpl implements VirtualMachineTemplates { - private readonly client: ScVmm; - - /** - * Initialize a new instance of the class VirtualMachineTemplates class. - * @param client Reference to the service client - */ - constructor(client: ScVmm) { - this.client = client; - } - - /** - * List of VirtualMachineTemplates in a subscription. - * @param options The options parameters. - */ - public listBySubscription( - options?: VirtualMachineTemplatesListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listBySubscriptionPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listBySubscriptionPagingPage(options, settings); - }, - }; - } - - private async *listBySubscriptionPagingPage( - options?: VirtualMachineTemplatesListBySubscriptionOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VirtualMachineTemplatesListBySubscriptionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listBySubscription(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listBySubscriptionNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listBySubscriptionPagingAll( - options?: VirtualMachineTemplatesListBySubscriptionOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listBySubscriptionPagingPage(options)) { - yield* page; - } - } - - /** - * List of VirtualMachineTemplates in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @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: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings, - ); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: VirtualMachineTemplatesListByResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VirtualMachineTemplatesListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext( - resourceGroupName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: VirtualMachineTemplatesListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage( - resourceGroupName, - options, - )) { - yield* page; - } - } - - /** - * List of VirtualMachineTemplates in a subscription. - * @param options The options parameters. - */ - private _listBySubscription( - options?: VirtualMachineTemplatesListBySubscriptionOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { options }, - listBySubscriptionOperationSpec, - ); - } - - /** - * List of VirtualMachineTemplates in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: VirtualMachineTemplatesListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * Implements VirtualMachineTemplate GET method. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - virtualMachineTemplateName: string, - options?: VirtualMachineTemplatesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, virtualMachineTemplateName, options }, - getOperationSpec, - ); - } - - /** - * Onboards the ScVmm VM Template as an Azure VM Template resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - virtualMachineTemplateName: string, - resource: VirtualMachineTemplate, - options?: VirtualMachineTemplatesCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineTemplatesCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - virtualMachineTemplateName, - resource, - options, - }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineTemplatesCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * Onboards the ScVmm VM Template as an Azure VM Template resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - virtualMachineTemplateName: string, - resource: VirtualMachineTemplate, - options?: VirtualMachineTemplatesCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - virtualMachineTemplateName, - resource, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Updates the VirtualMachineTemplate resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - virtualMachineTemplateName: string, - properties: VirtualMachineTemplateTagsUpdate, - options?: VirtualMachineTemplatesUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineTemplatesUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - virtualMachineTemplateName, - properties, - options, - }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineTemplatesUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * Updates the VirtualMachineTemplate resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - virtualMachineTemplateName: string, - properties: VirtualMachineTemplateTagsUpdate, - options?: VirtualMachineTemplatesUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - virtualMachineTemplateName, - properties, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Deregisters the ScVmm VM Template from Azure. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - virtualMachineTemplateName: string, - options?: VirtualMachineTemplatesDeleteOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineTemplatesDeleteResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, virtualMachineTemplateName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineTemplatesDeleteResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * Deregisters the ScVmm VM Template from Azure. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @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(); - } - - /** - * ListBySubscriptionNext - * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. - * @param options The options parameters. - */ - private _listBySubscriptionNext( - nextLink: string, - options?: VirtualMachineTemplatesListBySubscriptionNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listBySubscriptionNextOperationSpec, - ); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - 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 listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/virtualMachineTemplates", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineTemplateListResult, - }, - 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.ScVmm/virtualMachineTemplates", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineTemplateListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/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 createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/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.resource4, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.virtualMachineTemplateName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachineTemplates/{virtualMachineTemplateName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineTemplate, - }, - 201: { - bodyMapper: Mappers.VirtualMachineTemplate, - }, - 202: { - bodyMapper: Mappers.VirtualMachineTemplate, - }, - 204: { - bodyMapper: Mappers.VirtualMachineTemplate, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.properties3, - 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.ScVmm/virtualMachineTemplates/{virtualMachineTemplateName}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: Mappers.VirtualMachineTemplatesDeleteHeaders, - }, - 201: { - headersMapper: Mappers.VirtualMachineTemplatesDeleteHeaders, - }, - 202: { - headersMapper: Mappers.VirtualMachineTemplatesDeleteHeaders, - }, - 204: { - headersMapper: Mappers.VirtualMachineTemplatesDeleteHeaders, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.force], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.virtualMachineTemplateName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineTemplateListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineTemplateListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/scvmm/arm-scvmm/src/operations/virtualNetworks.ts b/sdk/scvmm/arm-scvmm/src/operations/virtualNetworks.ts deleted file mode 100644 index 1d31a1bf9565..000000000000 --- a/sdk/scvmm/arm-scvmm/src/operations/virtualNetworks.ts +++ /dev/null @@ -1,728 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { VirtualNetworks } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { ScVmm } from "../scVmm"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; -import { - VirtualNetwork, - VirtualNetworksListBySubscriptionNextOptionalParams, - VirtualNetworksListBySubscriptionOptionalParams, - VirtualNetworksListBySubscriptionResponse, - VirtualNetworksListByResourceGroupNextOptionalParams, - VirtualNetworksListByResourceGroupOptionalParams, - VirtualNetworksListByResourceGroupResponse, - VirtualNetworksGetOptionalParams, - VirtualNetworksGetResponse, - VirtualNetworksCreateOrUpdateOptionalParams, - VirtualNetworksCreateOrUpdateResponse, - VirtualNetworkTagsUpdate, - VirtualNetworksUpdateOptionalParams, - VirtualNetworksUpdateResponse, - VirtualNetworksDeleteOptionalParams, - VirtualNetworksDeleteResponse, - VirtualNetworksListBySubscriptionNextResponse, - VirtualNetworksListByResourceGroupNextResponse, -} from "../models"; - -/// -/** Class containing VirtualNetworks operations. */ -export class VirtualNetworksImpl implements VirtualNetworks { - private readonly client: ScVmm; - - /** - * Initialize a new instance of the class VirtualNetworks class. - * @param client Reference to the service client - */ - constructor(client: ScVmm) { - this.client = client; - } - - /** - * List of VirtualNetworks in a subscription. - * @param options The options parameters. - */ - public listBySubscription( - options?: VirtualNetworksListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listBySubscriptionPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listBySubscriptionPagingPage(options, settings); - }, - }; - } - - private async *listBySubscriptionPagingPage( - options?: VirtualNetworksListBySubscriptionOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VirtualNetworksListBySubscriptionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listBySubscription(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listBySubscriptionNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listBySubscriptionPagingAll( - options?: VirtualNetworksListBySubscriptionOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listBySubscriptionPagingPage(options)) { - yield* page; - } - } - - /** - * List of VirtualNetworks in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @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: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings, - ); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: VirtualNetworksListByResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VirtualNetworksListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext( - resourceGroupName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: VirtualNetworksListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage( - resourceGroupName, - options, - )) { - yield* page; - } - } - - /** - * List of VirtualNetworks in a subscription. - * @param options The options parameters. - */ - private _listBySubscription( - options?: VirtualNetworksListBySubscriptionOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { options }, - listBySubscriptionOperationSpec, - ); - } - - /** - * List of VirtualNetworks in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: VirtualNetworksListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * Implements VirtualNetwork GET method. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualNetworkName Name of the VirtualNetwork. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - virtualNetworkName: string, - options?: VirtualNetworksGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, virtualNetworkName, options }, - getOperationSpec, - ); - } - - /** - * Onboards the ScVmm virtual network as an Azure virtual network resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualNetworkName Name of the VirtualNetwork. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - virtualNetworkName: string, - resource: VirtualNetwork, - options?: VirtualNetworksCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualNetworksCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, virtualNetworkName, resource, options }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - VirtualNetworksCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * Onboards the ScVmm virtual network as an Azure virtual network resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualNetworkName Name of the VirtualNetwork. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - virtualNetworkName: string, - resource: VirtualNetwork, - options?: VirtualNetworksCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - virtualNetworkName, - resource, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Updates the VirtualNetworks resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualNetworkName Name of the VirtualNetwork. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - virtualNetworkName: string, - properties: VirtualNetworkTagsUpdate, - options?: VirtualNetworksUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualNetworksUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, virtualNetworkName, properties, options }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - VirtualNetworksUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * Updates the VirtualNetworks resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualNetworkName Name of the VirtualNetwork. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - virtualNetworkName: string, - properties: VirtualNetworkTagsUpdate, - options?: VirtualNetworksUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - virtualNetworkName, - properties, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Deregisters the ScVmm virtual network from Azure. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualNetworkName Name of the VirtualNetwork. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - virtualNetworkName: string, - options?: VirtualNetworksDeleteOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualNetworksDeleteResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, virtualNetworkName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller< - VirtualNetworksDeleteResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * Deregisters the ScVmm virtual network from Azure. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualNetworkName Name of the VirtualNetwork. - * @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(); - } - - /** - * ListBySubscriptionNext - * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. - * @param options The options parameters. - */ - private _listBySubscriptionNext( - nextLink: string, - options?: VirtualNetworksListBySubscriptionNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listBySubscriptionNextOperationSpec, - ); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - 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 listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/virtualNetworks", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualNetworkListResult, - }, - 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.ScVmm/virtualNetworks", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualNetworkListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/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 createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/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.resource5, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.virtualNetworkName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualNetworks/{virtualNetworkName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.VirtualNetwork, - }, - 201: { - bodyMapper: Mappers.VirtualNetwork, - }, - 202: { - bodyMapper: Mappers.VirtualNetwork, - }, - 204: { - bodyMapper: Mappers.VirtualNetwork, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.properties4, - 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.ScVmm/virtualNetworks/{virtualNetworkName}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: Mappers.VirtualNetworksDeleteHeaders, - }, - 201: { - headersMapper: Mappers.VirtualNetworksDeleteHeaders, - }, - 202: { - headersMapper: Mappers.VirtualNetworksDeleteHeaders, - }, - 204: { - headersMapper: Mappers.VirtualNetworksDeleteHeaders, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.force], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.virtualNetworkName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualNetworkListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualNetworkListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/scvmm/arm-scvmm/src/operations/vmInstanceHybridIdentityMetadatas.ts b/sdk/scvmm/arm-scvmm/src/operations/vmInstanceHybridIdentityMetadatas.ts deleted file mode 100644 index 0cfbe9e78850..000000000000 --- a/sdk/scvmm/arm-scvmm/src/operations/vmInstanceHybridIdentityMetadatas.ts +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { VmInstanceHybridIdentityMetadatas } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { ScVmm } from "../scVmm"; -import { - VmInstanceHybridIdentityMetadata, - VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceNextOptionalParams, - VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceOptionalParams, - VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceResponse, - VmInstanceHybridIdentityMetadatasGetOptionalParams, - VmInstanceHybridIdentityMetadatasGetResponse, - VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceNextResponse, -} from "../models"; - -/// -/** Class containing VmInstanceHybridIdentityMetadatas operations. */ -export class VmInstanceHybridIdentityMetadatasImpl - implements VmInstanceHybridIdentityMetadatas { - private readonly client: ScVmm; - - /** - * Initialize a new instance of the class VmInstanceHybridIdentityMetadatas class. - * @param client Reference to the service client - */ - constructor(client: ScVmm) { - this.client = client; - } - - /** - * Returns the list of HybridIdentityMetadata of the given VM. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - public listByVirtualMachineInstance( - resourceUri: string, - options?: VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByVirtualMachineInstancePagingAll( - resourceUri, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByVirtualMachineInstancePagingPage( - resourceUri, - options, - settings, - ); - }, - }; - } - - private async *listByVirtualMachineInstancePagingPage( - resourceUri: string, - options?: VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByVirtualMachineInstance(resourceUri, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByVirtualMachineInstanceNext( - resourceUri, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByVirtualMachineInstancePagingAll( - resourceUri: string, - options?: VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByVirtualMachineInstancePagingPage( - resourceUri, - options, - )) { - yield* page; - } - } - - /** - * Returns the list of HybridIdentityMetadata of the given VM. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - private _listByVirtualMachineInstance( - resourceUri: string, - options?: VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, options }, - listByVirtualMachineInstanceOperationSpec, - ); - } - - /** - * Implements HybridIdentityMetadata GET method. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - get( - resourceUri: string, - options?: VmInstanceHybridIdentityMetadatasGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, options }, - getOperationSpec, - ); - } - - /** - * ListByVirtualMachineInstanceNext - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param nextLink The nextLink from the previous successful call to the ListByVirtualMachineInstance - * method. - * @param options The options parameters. - */ - private _listByVirtualMachineInstanceNext( - resourceUri: string, - nextLink: string, - options?: VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, nextLink, options }, - listByVirtualMachineInstanceNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByVirtualMachineInstanceOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VmInstanceHybridIdentityMetadataListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.resourceUri], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata/default", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VmInstanceHybridIdentityMetadata, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.resourceUri], - headerParameters: [Parameters.accept], - serializer, -}; -const listByVirtualMachineInstanceNextOperationSpec: coreClient.OperationSpec = -{ - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VmInstanceHybridIdentityMetadataListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.resourceUri, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/scvmm/arm-scvmm/src/operations/vmmServers.ts b/sdk/scvmm/arm-scvmm/src/operations/vmmServers.ts deleted file mode 100644 index a987b79a4882..000000000000 --- a/sdk/scvmm/arm-scvmm/src/operations/vmmServers.ts +++ /dev/null @@ -1,728 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { VmmServers } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { ScVmm } from "../scVmm"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; -import { - VmmServer, - VmmServersListBySubscriptionNextOptionalParams, - VmmServersListBySubscriptionOptionalParams, - VmmServersListBySubscriptionResponse, - VmmServersListByResourceGroupNextOptionalParams, - VmmServersListByResourceGroupOptionalParams, - VmmServersListByResourceGroupResponse, - VmmServersGetOptionalParams, - VmmServersGetResponse, - VmmServersCreateOrUpdateOptionalParams, - VmmServersCreateOrUpdateResponse, - VmmServerTagsUpdate, - VmmServersUpdateOptionalParams, - VmmServersUpdateResponse, - VmmServersDeleteOptionalParams, - VmmServersDeleteResponse, - VmmServersListBySubscriptionNextResponse, - VmmServersListByResourceGroupNextResponse, -} from "../models"; - -/// -/** Class containing VmmServers operations. */ -export class VmmServersImpl implements VmmServers { - private readonly client: ScVmm; - - /** - * Initialize a new instance of the class VmmServers class. - * @param client Reference to the service client - */ - constructor(client: ScVmm) { - this.client = client; - } - - /** - * List of VmmServers in a subscription. - * @param options The options parameters. - */ - public listBySubscription( - options?: VmmServersListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listBySubscriptionPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listBySubscriptionPagingPage(options, settings); - }, - }; - } - - private async *listBySubscriptionPagingPage( - options?: VmmServersListBySubscriptionOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VmmServersListBySubscriptionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listBySubscription(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listBySubscriptionNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listBySubscriptionPagingAll( - options?: VmmServersListBySubscriptionOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listBySubscriptionPagingPage(options)) { - yield* page; - } - } - - /** - * List of VmmServers in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: VmmServersListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings, - ); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: VmmServersListByResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VmmServersListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext( - resourceGroupName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: VmmServersListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage( - resourceGroupName, - options, - )) { - yield* page; - } - } - - /** - * List of VmmServers in a subscription. - * @param options The options parameters. - */ - private _listBySubscription( - options?: VmmServersListBySubscriptionOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { options }, - listBySubscriptionOperationSpec, - ); - } - - /** - * List of VmmServers in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: VmmServersListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * Implements VmmServer GET method. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmmServerName Name of the VmmServer. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - vmmServerName: string, - options?: VmmServersGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmmServerName, options }, - getOperationSpec, - ); - } - - /** - * Onboards the SCVmm fabric as an Azure VmmServer resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmmServerName Name of the VmmServer. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - vmmServerName: string, - resource: VmmServer, - options?: VmmServersCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VmmServersCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmmServerName, resource, options }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - VmmServersCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * Onboards the SCVmm fabric as an Azure VmmServer resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmmServerName Name of the VmmServer. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - vmmServerName: string, - resource: VmmServer, - options?: VmmServersCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - vmmServerName, - resource, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Updates the VmmServers resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmmServerName Name of the VmmServer. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - vmmServerName: string, - properties: VmmServerTagsUpdate, - options?: VmmServersUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VmmServersUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmmServerName, properties, options }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - VmmServersUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * Updates the VmmServers resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmmServerName Name of the VmmServer. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - vmmServerName: string, - properties: VmmServerTagsUpdate, - options?: VmmServersUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - vmmServerName, - properties, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Removes the SCVmm fabric from Azure. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmmServerName Name of the VmmServer. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - vmmServerName: string, - options?: VmmServersDeleteOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VmmServersDeleteResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmmServerName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller< - VmmServersDeleteResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * Removes the SCVmm fabric from Azure. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmmServerName Name of the VmmServer. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - vmmServerName: string, - options?: VmmServersDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - vmmServerName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * ListBySubscriptionNext - * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. - * @param options The options parameters. - */ - private _listBySubscriptionNext( - nextLink: string, - options?: VmmServersListBySubscriptionNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listBySubscriptionNextOperationSpec, - ); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: VmmServersListByResourceGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/vmmServers", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VmmServerListResult, - }, - 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.ScVmm/vmmServers", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VmmServerListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VmmServer, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmmServerName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.VmmServer, - }, - 201: { - bodyMapper: Mappers.VmmServer, - }, - 202: { - bodyMapper: Mappers.VmmServer, - }, - 204: { - bodyMapper: Mappers.VmmServer, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.resource6, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmmServerName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.VmmServer, - }, - 201: { - bodyMapper: Mappers.VmmServer, - }, - 202: { - bodyMapper: Mappers.VmmServer, - }, - 204: { - bodyMapper: Mappers.VmmServer, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.properties5, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmmServerName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: Mappers.VmmServersDeleteHeaders, - }, - 201: { - headersMapper: Mappers.VmmServersDeleteHeaders, - }, - 202: { - headersMapper: Mappers.VmmServersDeleteHeaders, - }, - 204: { - headersMapper: Mappers.VmmServersDeleteHeaders, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.force], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmmServerName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VmmServerListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VmmServerListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/scvmm/arm-scvmm/src/operationsInterfaces/availabilitySets.ts b/sdk/scvmm/arm-scvmm/src/operationsInterfaces/availabilitySets.ts deleted file mode 100644 index 2ff81c9a2d33..000000000000 --- a/sdk/scvmm/arm-scvmm/src/operationsInterfaces/availabilitySets.ts +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - AvailabilitySet, - AvailabilitySetsListBySubscriptionOptionalParams, - AvailabilitySetsListByResourceGroupOptionalParams, - AvailabilitySetsGetOptionalParams, - AvailabilitySetsGetResponse, - AvailabilitySetsCreateOrUpdateOptionalParams, - AvailabilitySetsCreateOrUpdateResponse, - AvailabilitySetTagsUpdate, - AvailabilitySetsUpdateOptionalParams, - AvailabilitySetsUpdateResponse, - AvailabilitySetsDeleteOptionalParams, - AvailabilitySetsDeleteResponse, -} from "../models"; - -/// -/** Interface representing a AvailabilitySets. */ -export interface AvailabilitySets { - /** - * List of AvailabilitySets in a subscription. - * @param options The options parameters. - */ - listBySubscription( - options?: AvailabilitySetsListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator; - /** - * List of AvailabilitySets in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: AvailabilitySetsListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Implements AvailabilitySet GET method. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetResourceName Name of the AvailabilitySet. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - availabilitySetResourceName: string, - options?: AvailabilitySetsGetOptionalParams, - ): Promise; - /** - * Onboards the ScVmm availability set as an Azure resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetResourceName Name of the AvailabilitySet. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - availabilitySetResourceName: string, - resource: AvailabilitySet, - options?: AvailabilitySetsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - AvailabilitySetsCreateOrUpdateResponse - > - >; - /** - * Onboards the ScVmm availability set as an Azure resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetResourceName Name of the AvailabilitySet. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - availabilitySetResourceName: string, - resource: AvailabilitySet, - options?: AvailabilitySetsCreateOrUpdateOptionalParams, - ): Promise; - /** - * Updates the AvailabilitySets resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetResourceName Name of the AvailabilitySet. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - availabilitySetResourceName: string, - properties: AvailabilitySetTagsUpdate, - options?: AvailabilitySetsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - AvailabilitySetsUpdateResponse - > - >; - /** - * Updates the AvailabilitySets resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetResourceName Name of the AvailabilitySet. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - availabilitySetResourceName: string, - properties: AvailabilitySetTagsUpdate, - options?: AvailabilitySetsUpdateOptionalParams, - ): Promise; - /** - * Deregisters the ScVmm availability set from Azure. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetResourceName Name of the AvailabilitySet. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - availabilitySetResourceName: string, - options?: AvailabilitySetsDeleteOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - AvailabilitySetsDeleteResponse - > - >; - /** - * Deregisters the ScVmm availability set from Azure. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetResourceName Name of the AvailabilitySet. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - availabilitySetResourceName: string, - options?: AvailabilitySetsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/scvmm/arm-scvmm/src/operationsInterfaces/clouds.ts b/sdk/scvmm/arm-scvmm/src/operationsInterfaces/clouds.ts deleted file mode 100644 index 18ad93c61efb..000000000000 --- a/sdk/scvmm/arm-scvmm/src/operationsInterfaces/clouds.ts +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - Cloud, - CloudsListBySubscriptionOptionalParams, - CloudsListByResourceGroupOptionalParams, - CloudsGetOptionalParams, - CloudsGetResponse, - CloudsCreateOrUpdateOptionalParams, - CloudsCreateOrUpdateResponse, - CloudTagsUpdate, - CloudsUpdateOptionalParams, - CloudsUpdateResponse, - CloudsDeleteOptionalParams, - CloudsDeleteResponse, -} from "../models"; - -/// -/** Interface representing a Clouds. */ -export interface Clouds { - /** - * List of Clouds in a subscription. - * @param options The options parameters. - */ - listBySubscription( - options?: CloudsListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator; - /** - * List of Clouds in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: CloudsListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Implements Cloud GET method. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudResourceName Name of the Cloud. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - cloudResourceName: string, - options?: CloudsGetOptionalParams, - ): Promise; - /** - * Onboards the ScVmm fabric cloud as an Azure cloud resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudResourceName Name of the Cloud. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - cloudResourceName: string, - resource: Cloud, - options?: CloudsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - CloudsCreateOrUpdateResponse - > - >; - /** - * Onboards the ScVmm fabric cloud as an Azure cloud resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudResourceName Name of the Cloud. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - cloudResourceName: string, - resource: Cloud, - options?: CloudsCreateOrUpdateOptionalParams, - ): Promise; - /** - * Updates the Clouds resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudResourceName Name of the Cloud. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - cloudResourceName: string, - properties: CloudTagsUpdate, - options?: CloudsUpdateOptionalParams, - ): Promise< - SimplePollerLike, CloudsUpdateResponse> - >; - /** - * Updates the Clouds resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudResourceName Name of the Cloud. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - cloudResourceName: string, - properties: CloudTagsUpdate, - options?: CloudsUpdateOptionalParams, - ): Promise; - /** - * Deregisters the ScVmm fabric cloud from Azure. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudResourceName Name of the Cloud. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - cloudResourceName: string, - options?: CloudsDeleteOptionalParams, - ): Promise< - SimplePollerLike, CloudsDeleteResponse> - >; - /** - * Deregisters the ScVmm fabric cloud from Azure. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cloudResourceName Name of the Cloud. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - cloudResourceName: string, - options?: CloudsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/scvmm/arm-scvmm/src/operationsInterfaces/guestAgents.ts b/sdk/scvmm/arm-scvmm/src/operationsInterfaces/guestAgents.ts deleted file mode 100644 index 54f6aa516e3b..000000000000 --- a/sdk/scvmm/arm-scvmm/src/operationsInterfaces/guestAgents.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - GuestAgent, - GuestAgentsListByVirtualMachineInstanceOptionalParams, - GuestAgentsGetOptionalParams, - GuestAgentsGetResponse, - GuestAgentsCreateOptionalParams, - GuestAgentsCreateResponse, - GuestAgentsDeleteOptionalParams, -} from "../models"; - -/// -/** Interface representing a GuestAgents. */ -export interface GuestAgents { - /** - * Returns the list of GuestAgent of the given vm. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - listByVirtualMachineInstance( - resourceUri: string, - options?: GuestAgentsListByVirtualMachineInstanceOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Implements GuestAgent GET method. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - get( - resourceUri: string, - options?: GuestAgentsGetOptionalParams, - ): Promise; - /** - * Create Or Update GuestAgent. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - beginCreate( - resourceUri: string, - resource: GuestAgent, - options?: GuestAgentsCreateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GuestAgentsCreateResponse - > - >; - /** - * Create Or Update GuestAgent. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - beginCreateAndWait( - resourceUri: string, - resource: GuestAgent, - options?: GuestAgentsCreateOptionalParams, - ): Promise; - /** - * Implements GuestAgent DELETE method. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - delete( - resourceUri: string, - options?: GuestAgentsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/scvmm/arm-scvmm/src/operationsInterfaces/index.ts b/sdk/scvmm/arm-scvmm/src/operationsInterfaces/index.ts deleted file mode 100644 index 8e792fd233b8..000000000000 --- a/sdk/scvmm/arm-scvmm/src/operationsInterfaces/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 "./virtualMachineInstances"; -export * from "./guestAgents"; -export * from "./vmInstanceHybridIdentityMetadatas"; -export * from "./operations"; -export * from "./availabilitySets"; -export * from "./clouds"; -export * from "./virtualMachineTemplates"; -export * from "./virtualNetworks"; -export * from "./vmmServers"; -export * from "./inventoryItems"; diff --git a/sdk/scvmm/arm-scvmm/src/operationsInterfaces/inventoryItems.ts b/sdk/scvmm/arm-scvmm/src/operationsInterfaces/inventoryItems.ts deleted file mode 100644 index 7c059724996a..000000000000 --- a/sdk/scvmm/arm-scvmm/src/operationsInterfaces/inventoryItems.ts +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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, - InventoryItemsListByVmmServerOptionalParams, - InventoryItemsGetOptionalParams, - InventoryItemsGetResponse, - InventoryItemsCreateOptionalParams, - InventoryItemsCreateResponse, - InventoryItemsDeleteOptionalParams, -} from "../models"; - -/// -/** Interface representing a InventoryItems. */ -export interface InventoryItems { - /** - * Returns the list of inventoryItems in the given VmmServer. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmmServerName Name of the VmmServer. - * @param options The options parameters. - */ - listByVmmServer( - resourceGroupName: string, - vmmServerName: string, - options?: InventoryItemsListByVmmServerOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Shows an inventory item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmmServerName Name of the VmmServer. - * @param inventoryItemResourceName Name of the inventoryItem. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - vmmServerName: string, - inventoryItemResourceName: string, - options?: InventoryItemsGetOptionalParams, - ): Promise; - /** - * Create Or Update InventoryItem. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmmServerName Name of the VmmServer. - * @param inventoryItemResourceName Name of the inventoryItem. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - create( - resourceGroupName: string, - vmmServerName: string, - inventoryItemResourceName: string, - resource: InventoryItem, - options?: InventoryItemsCreateOptionalParams, - ): Promise; - /** - * Deletes an inventoryItem. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmmServerName Name of the VmmServer. - * @param inventoryItemResourceName Name of the inventoryItem. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - vmmServerName: string, - inventoryItemResourceName: string, - options?: InventoryItemsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/scvmm/arm-scvmm/src/operationsInterfaces/operations.ts b/sdk/scvmm/arm-scvmm/src/operationsInterfaces/operations.ts deleted file mode 100644 index 251f5f582e64..000000000000 --- a/sdk/scvmm/arm-scvmm/src/operationsInterfaces/operations.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { - /** - * List the operations for the provider - * @param options The options parameters. - */ - list( - options?: OperationsListOptionalParams, - ): PagedAsyncIterableIterator; -} diff --git a/sdk/scvmm/arm-scvmm/src/operationsInterfaces/virtualMachineInstances.ts b/sdk/scvmm/arm-scvmm/src/operationsInterfaces/virtualMachineInstances.ts deleted file mode 100644 index 9a63b27d1911..000000000000 --- a/sdk/scvmm/arm-scvmm/src/operationsInterfaces/virtualMachineInstances.ts +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - VirtualMachineInstance, - VirtualMachineInstancesListOptionalParams, - VirtualMachineInstancesGetOptionalParams, - VirtualMachineInstancesGetResponse, - VirtualMachineInstancesCreateOrUpdateOptionalParams, - VirtualMachineInstancesCreateOrUpdateResponse, - VirtualMachineInstanceUpdate, - VirtualMachineInstancesUpdateOptionalParams, - VirtualMachineInstancesUpdateResponse, - VirtualMachineInstancesDeleteOptionalParams, - VirtualMachineInstancesDeleteResponse, - VirtualMachineCreateCheckpoint, - VirtualMachineInstancesCreateCheckpointOptionalParams, - VirtualMachineInstancesCreateCheckpointResponse, - VirtualMachineDeleteCheckpoint, - VirtualMachineInstancesDeleteCheckpointOptionalParams, - VirtualMachineInstancesDeleteCheckpointResponse, - VirtualMachineInstancesRestartOptionalParams, - VirtualMachineInstancesRestartResponse, - VirtualMachineRestoreCheckpoint, - VirtualMachineInstancesRestoreCheckpointOptionalParams, - VirtualMachineInstancesRestoreCheckpointResponse, - VirtualMachineInstancesStartOptionalParams, - VirtualMachineInstancesStartResponse, - StopVirtualMachineOptions, - VirtualMachineInstancesStopOptionalParams, - VirtualMachineInstancesStopResponse, -} from "../models"; - -/// -/** Interface representing a VirtualMachineInstances. */ -export interface VirtualMachineInstances { - /** - * Lists all of the virtual machine instances within the specified parent resource. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - list( - resourceUri: string, - options?: VirtualMachineInstancesListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Retrieves information about a virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - get( - resourceUri: string, - options?: VirtualMachineInstancesGetOptionalParams, - ): Promise; - /** - * The operation to create or update a virtual machine instance. Please note some properties can be set - * only during virtual machine instance creation. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceUri: string, - resource: VirtualMachineInstance, - options?: VirtualMachineInstancesCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineInstancesCreateOrUpdateResponse - > - >; - /** - * The operation to create or update a virtual machine instance. Please note some properties can be set - * only during virtual machine instance creation. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceUri: string, - resource: VirtualMachineInstance, - options?: VirtualMachineInstancesCreateOrUpdateOptionalParams, - ): Promise; - /** - * The operation to update a virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - beginUpdate( - resourceUri: string, - properties: VirtualMachineInstanceUpdate, - options?: VirtualMachineInstancesUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineInstancesUpdateResponse - > - >; - /** - * The operation to update a virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceUri: string, - properties: VirtualMachineInstanceUpdate, - options?: VirtualMachineInstancesUpdateOptionalParams, - ): Promise; - /** - * The operation to delete a virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - beginDelete( - resourceUri: string, - options?: VirtualMachineInstancesDeleteOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineInstancesDeleteResponse - > - >; - /** - * The operation to delete a virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceUri: string, - options?: VirtualMachineInstancesDeleteOptionalParams, - ): Promise; - /** - * Creates a checkpoint in virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param body The content of the action request - * @param options The options parameters. - */ - beginCreateCheckpoint( - resourceUri: string, - body: VirtualMachineCreateCheckpoint, - options?: VirtualMachineInstancesCreateCheckpointOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineInstancesCreateCheckpointResponse - > - >; - /** - * Creates a checkpoint in virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param body The content of the action request - * @param options The options parameters. - */ - beginCreateCheckpointAndWait( - resourceUri: string, - body: VirtualMachineCreateCheckpoint, - options?: VirtualMachineInstancesCreateCheckpointOptionalParams, - ): Promise; - /** - * Deletes a checkpoint in virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param body The content of the action request - * @param options The options parameters. - */ - beginDeleteCheckpoint( - resourceUri: string, - body: VirtualMachineDeleteCheckpoint, - options?: VirtualMachineInstancesDeleteCheckpointOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineInstancesDeleteCheckpointResponse - > - >; - /** - * Deletes a checkpoint in virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param body The content of the action request - * @param options The options parameters. - */ - beginDeleteCheckpointAndWait( - resourceUri: string, - body: VirtualMachineDeleteCheckpoint, - options?: VirtualMachineInstancesDeleteCheckpointOptionalParams, - ): Promise; - /** - * The operation to restart a virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - beginRestart( - resourceUri: string, - options?: VirtualMachineInstancesRestartOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineInstancesRestartResponse - > - >; - /** - * The operation to restart a virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - beginRestartAndWait( - resourceUri: string, - options?: VirtualMachineInstancesRestartOptionalParams, - ): Promise; - /** - * Restores to a checkpoint in virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param body The content of the action request - * @param options The options parameters. - */ - beginRestoreCheckpoint( - resourceUri: string, - body: VirtualMachineRestoreCheckpoint, - options?: VirtualMachineInstancesRestoreCheckpointOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineInstancesRestoreCheckpointResponse - > - >; - /** - * Restores to a checkpoint in virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param body The content of the action request - * @param options The options parameters. - */ - beginRestoreCheckpointAndWait( - resourceUri: string, - body: VirtualMachineRestoreCheckpoint, - options?: VirtualMachineInstancesRestoreCheckpointOptionalParams, - ): Promise; - /** - * The operation to start a virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - beginStart( - resourceUri: string, - options?: VirtualMachineInstancesStartOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineInstancesStartResponse - > - >; - /** - * The operation to start a virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - beginStartAndWait( - resourceUri: string, - options?: VirtualMachineInstancesStartOptionalParams, - ): Promise; - /** - * The operation to power off (stop) a virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param body The content of the action request - * @param options The options parameters. - */ - beginStop( - resourceUri: string, - body: StopVirtualMachineOptions, - options?: VirtualMachineInstancesStopOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineInstancesStopResponse - > - >; - /** - * The operation to power off (stop) a virtual machine instance. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param body The content of the action request - * @param options The options parameters. - */ - beginStopAndWait( - resourceUri: string, - body: StopVirtualMachineOptions, - options?: VirtualMachineInstancesStopOptionalParams, - ): Promise; -} diff --git a/sdk/scvmm/arm-scvmm/src/operationsInterfaces/virtualMachineTemplates.ts b/sdk/scvmm/arm-scvmm/src/operationsInterfaces/virtualMachineTemplates.ts deleted file mode 100644 index fea622b373a1..000000000000 --- a/sdk/scvmm/arm-scvmm/src/operationsInterfaces/virtualMachineTemplates.ts +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - VirtualMachineTemplate, - VirtualMachineTemplatesListBySubscriptionOptionalParams, - VirtualMachineTemplatesListByResourceGroupOptionalParams, - VirtualMachineTemplatesGetOptionalParams, - VirtualMachineTemplatesGetResponse, - VirtualMachineTemplatesCreateOrUpdateOptionalParams, - VirtualMachineTemplatesCreateOrUpdateResponse, - VirtualMachineTemplateTagsUpdate, - VirtualMachineTemplatesUpdateOptionalParams, - VirtualMachineTemplatesUpdateResponse, - VirtualMachineTemplatesDeleteOptionalParams, - VirtualMachineTemplatesDeleteResponse, -} from "../models"; - -/// -/** Interface representing a VirtualMachineTemplates. */ -export interface VirtualMachineTemplates { - /** - * List of VirtualMachineTemplates in a subscription. - * @param options The options parameters. - */ - listBySubscription( - options?: VirtualMachineTemplatesListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator; - /** - * List of VirtualMachineTemplates in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: VirtualMachineTemplatesListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Implements VirtualMachineTemplate GET method. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - virtualMachineTemplateName: string, - options?: VirtualMachineTemplatesGetOptionalParams, - ): Promise; - /** - * Onboards the ScVmm VM Template as an Azure VM Template resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - virtualMachineTemplateName: string, - resource: VirtualMachineTemplate, - options?: VirtualMachineTemplatesCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineTemplatesCreateOrUpdateResponse - > - >; - /** - * Onboards the ScVmm VM Template as an Azure VM Template resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - virtualMachineTemplateName: string, - resource: VirtualMachineTemplate, - options?: VirtualMachineTemplatesCreateOrUpdateOptionalParams, - ): Promise; - /** - * Updates the VirtualMachineTemplate resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - virtualMachineTemplateName: string, - properties: VirtualMachineTemplateTagsUpdate, - options?: VirtualMachineTemplatesUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineTemplatesUpdateResponse - > - >; - /** - * Updates the VirtualMachineTemplate resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - virtualMachineTemplateName: string, - properties: VirtualMachineTemplateTagsUpdate, - options?: VirtualMachineTemplatesUpdateOptionalParams, - ): Promise; - /** - * Deregisters the ScVmm VM Template from Azure. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - virtualMachineTemplateName: string, - options?: VirtualMachineTemplatesDeleteOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineTemplatesDeleteResponse - > - >; - /** - * Deregisters the ScVmm VM Template from Azure. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - virtualMachineTemplateName: string, - options?: VirtualMachineTemplatesDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/scvmm/arm-scvmm/src/operationsInterfaces/virtualNetworks.ts b/sdk/scvmm/arm-scvmm/src/operationsInterfaces/virtualNetworks.ts deleted file mode 100644 index c97f8504467e..000000000000 --- a/sdk/scvmm/arm-scvmm/src/operationsInterfaces/virtualNetworks.ts +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - VirtualNetwork, - VirtualNetworksListBySubscriptionOptionalParams, - VirtualNetworksListByResourceGroupOptionalParams, - VirtualNetworksGetOptionalParams, - VirtualNetworksGetResponse, - VirtualNetworksCreateOrUpdateOptionalParams, - VirtualNetworksCreateOrUpdateResponse, - VirtualNetworkTagsUpdate, - VirtualNetworksUpdateOptionalParams, - VirtualNetworksUpdateResponse, - VirtualNetworksDeleteOptionalParams, - VirtualNetworksDeleteResponse, -} from "../models"; - -/// -/** Interface representing a VirtualNetworks. */ -export interface VirtualNetworks { - /** - * List of VirtualNetworks in a subscription. - * @param options The options parameters. - */ - listBySubscription( - options?: VirtualNetworksListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator; - /** - * List of VirtualNetworks in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: VirtualNetworksListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Implements VirtualNetwork GET method. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualNetworkName Name of the VirtualNetwork. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - virtualNetworkName: string, - options?: VirtualNetworksGetOptionalParams, - ): Promise; - /** - * Onboards the ScVmm virtual network as an Azure virtual network resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualNetworkName Name of the VirtualNetwork. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - virtualNetworkName: string, - resource: VirtualNetwork, - options?: VirtualNetworksCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualNetworksCreateOrUpdateResponse - > - >; - /** - * Onboards the ScVmm virtual network as an Azure virtual network resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualNetworkName Name of the VirtualNetwork. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - virtualNetworkName: string, - resource: VirtualNetwork, - options?: VirtualNetworksCreateOrUpdateOptionalParams, - ): Promise; - /** - * Updates the VirtualNetworks resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualNetworkName Name of the VirtualNetwork. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - virtualNetworkName: string, - properties: VirtualNetworkTagsUpdate, - options?: VirtualNetworksUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualNetworksUpdateResponse - > - >; - /** - * Updates the VirtualNetworks resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualNetworkName Name of the VirtualNetwork. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - virtualNetworkName: string, - properties: VirtualNetworkTagsUpdate, - options?: VirtualNetworksUpdateOptionalParams, - ): Promise; - /** - * Deregisters the ScVmm virtual network from Azure. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualNetworkName Name of the VirtualNetwork. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - virtualNetworkName: string, - options?: VirtualNetworksDeleteOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualNetworksDeleteResponse - > - >; - /** - * Deregisters the ScVmm virtual network from Azure. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualNetworkName Name of the VirtualNetwork. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - virtualNetworkName: string, - options?: VirtualNetworksDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/scvmm/arm-scvmm/src/operationsInterfaces/vmInstanceHybridIdentityMetadatas.ts b/sdk/scvmm/arm-scvmm/src/operationsInterfaces/vmInstanceHybridIdentityMetadatas.ts deleted file mode 100644 index c81a1de2f6a4..000000000000 --- a/sdk/scvmm/arm-scvmm/src/operationsInterfaces/vmInstanceHybridIdentityMetadatas.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { - VmInstanceHybridIdentityMetadata, - VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceOptionalParams, - VmInstanceHybridIdentityMetadatasGetOptionalParams, - VmInstanceHybridIdentityMetadatasGetResponse, -} from "../models"; - -/// -/** Interface representing a VmInstanceHybridIdentityMetadatas. */ -export interface VmInstanceHybridIdentityMetadatas { - /** - * Returns the list of HybridIdentityMetadata of the given VM. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - listByVirtualMachineInstance( - resourceUri: string, - options?: VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Implements HybridIdentityMetadata GET method. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. - * @param options The options parameters. - */ - get( - resourceUri: string, - options?: VmInstanceHybridIdentityMetadatasGetOptionalParams, - ): Promise; -} diff --git a/sdk/scvmm/arm-scvmm/src/operationsInterfaces/vmmServers.ts b/sdk/scvmm/arm-scvmm/src/operationsInterfaces/vmmServers.ts deleted file mode 100644 index 16475af2d550..000000000000 --- a/sdk/scvmm/arm-scvmm/src/operationsInterfaces/vmmServers.ts +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - VmmServer, - VmmServersListBySubscriptionOptionalParams, - VmmServersListByResourceGroupOptionalParams, - VmmServersGetOptionalParams, - VmmServersGetResponse, - VmmServersCreateOrUpdateOptionalParams, - VmmServersCreateOrUpdateResponse, - VmmServerTagsUpdate, - VmmServersUpdateOptionalParams, - VmmServersUpdateResponse, - VmmServersDeleteOptionalParams, - VmmServersDeleteResponse, -} from "../models"; - -/// -/** Interface representing a VmmServers. */ -export interface VmmServers { - /** - * List of VmmServers in a subscription. - * @param options The options parameters. - */ - listBySubscription( - options?: VmmServersListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator; - /** - * List of VmmServers in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: VmmServersListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Implements VmmServer GET method. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmmServerName Name of the VmmServer. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - vmmServerName: string, - options?: VmmServersGetOptionalParams, - ): Promise; - /** - * Onboards the SCVmm fabric as an Azure VmmServer resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmmServerName Name of the VmmServer. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - vmmServerName: string, - resource: VmmServer, - options?: VmmServersCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VmmServersCreateOrUpdateResponse - > - >; - /** - * Onboards the SCVmm fabric as an Azure VmmServer resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmmServerName Name of the VmmServer. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - vmmServerName: string, - resource: VmmServer, - options?: VmmServersCreateOrUpdateOptionalParams, - ): Promise; - /** - * Updates the VmmServers resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmmServerName Name of the VmmServer. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - vmmServerName: string, - properties: VmmServerTagsUpdate, - options?: VmmServersUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VmmServersUpdateResponse - > - >; - /** - * Updates the VmmServers resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmmServerName Name of the VmmServer. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - vmmServerName: string, - properties: VmmServerTagsUpdate, - options?: VmmServersUpdateOptionalParams, - ): Promise; - /** - * Removes the SCVmm fabric from Azure. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmmServerName Name of the VmmServer. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - vmmServerName: string, - options?: VmmServersDeleteOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VmmServersDeleteResponse - > - >; - /** - * Removes the SCVmm fabric from Azure. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmmServerName Name of the VmmServer. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - vmmServerName: string, - options?: VmmServersDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/scvmm/arm-scvmm/src/pagingHelper.ts b/sdk/scvmm/arm-scvmm/src/pagingHelper.ts deleted file mode 100644 index 205cccc26592..000000000000 --- a/sdk/scvmm/arm-scvmm/src/pagingHelper.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 interface PageInfo { - continuationToken?: string; -} - -const pageMap = new WeakMap(); - -/** - * Given the last `.value` produced by the `byPage` iterator, - * returns a continuation token that can be used to begin paging from - * that point later. - * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. - * @returns The continuation token that can be passed into byPage() during future calls. - */ -export function getContinuationToken(page: unknown): string | undefined { - if (typeof page !== "object" || page === null) { - return undefined; - } - return pageMap.get(page)?.continuationToken; -} - -export function setContinuationToken( - page: unknown, - continuationToken: string | undefined, -): void { - if (typeof page !== "object" || page === null || !continuationToken) { - return; - } - const pageInfo = pageMap.get(page) ?? {}; - pageInfo.continuationToken = continuationToken; - pageMap.set(page, pageInfo); -} diff --git a/sdk/scvmm/arm-scvmm/src/rest/clientDefinitions.ts b/sdk/scvmm/arm-scvmm/src/rest/clientDefinitions.ts new file mode 100644 index 000000000000..dfbcb88cc1a0 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/rest/clientDefinitions.ts @@ -0,0 +1,825 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { + OperationsListParameters, + VmmServersGetParameters, + VmmServersCreateOrUpdateParameters, + VmmServersUpdateParameters, + VmmServersDeleteParameters, + VmmServersListByResourceGroupParameters, + VmmServersListBySubscriptionParameters, + CloudsGetParameters, + CloudsCreateOrUpdateParameters, + CloudsUpdateParameters, + CloudsDeleteParameters, + CloudsListByResourceGroupParameters, + CloudsListBySubscriptionParameters, + VirtualNetworksGetParameters, + VirtualNetworksCreateOrUpdateParameters, + VirtualNetworksUpdateParameters, + VirtualNetworksDeleteParameters, + VirtualNetworksListByResourceGroupParameters, + VirtualNetworksListBySubscriptionParameters, + VirtualMachineTemplatesGetParameters, + VirtualMachineTemplatesCreateOrUpdateParameters, + VirtualMachineTemplatesUpdateParameters, + VirtualMachineTemplatesDeleteParameters, + VirtualMachineTemplatesListByResourceGroupParameters, + VirtualMachineTemplatesListBySubscriptionParameters, + AvailabilitySetsGetParameters, + AvailabilitySetsCreateOrUpdateParameters, + AvailabilitySetsUpdateParameters, + AvailabilitySetsDeleteParameters, + AvailabilitySetsListByResourceGroupParameters, + AvailabilitySetsListBySubscriptionParameters, + InventoryItemsGetParameters, + InventoryItemsCreateParameters, + InventoryItemsDeleteParameters, + InventoryItemsListByVmmServerParameters, + VirtualMachineInstancesGetParameters, + VirtualMachineInstancesCreateOrUpdateParameters, + VirtualMachineInstancesUpdateParameters, + VirtualMachineInstancesDeleteParameters, + VirtualMachineInstancesListParameters, + VirtualMachineInstancesStopParameters, + VirtualMachineInstancesStartParameters, + VirtualMachineInstancesRestartParameters, + VirtualMachineInstancesCreateCheckpointParameters, + VirtualMachineInstancesDeleteCheckpointParameters, + VirtualMachineInstancesRestoreCheckpointParameters, + VmInstanceHybridIdentityMetadatasGetParameters, + VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceParameters, + GuestAgentsGetParameters, + GuestAgentsCreateParameters, + GuestAgentsDeleteParameters, + GuestAgentsListByVirtualMachineInstanceParameters, +} from "./parameters.js"; +import { + OperationsList200Response, + OperationsListDefaultResponse, + VmmServersGet200Response, + VmmServersGetDefaultResponse, + VmmServersCreateOrUpdate200Response, + VmmServersCreateOrUpdate201Response, + VmmServersCreateOrUpdateDefaultResponse, + VmmServersUpdate200Response, + VmmServersUpdate202Response, + VmmServersUpdateDefaultResponse, + VmmServersDelete202Response, + VmmServersDelete204Response, + VmmServersDeleteDefaultResponse, + VmmServersListByResourceGroup200Response, + VmmServersListByResourceGroupDefaultResponse, + VmmServersListBySubscription200Response, + VmmServersListBySubscriptionDefaultResponse, + CloudsGet200Response, + CloudsGetDefaultResponse, + CloudsCreateOrUpdate200Response, + CloudsCreateOrUpdate201Response, + CloudsCreateOrUpdateDefaultResponse, + CloudsUpdate200Response, + CloudsUpdate202Response, + CloudsUpdateDefaultResponse, + CloudsDelete202Response, + CloudsDelete204Response, + CloudsDeleteDefaultResponse, + CloudsListByResourceGroup200Response, + CloudsListByResourceGroupDefaultResponse, + CloudsListBySubscription200Response, + CloudsListBySubscriptionDefaultResponse, + VirtualNetworksGet200Response, + VirtualNetworksGetDefaultResponse, + VirtualNetworksCreateOrUpdate200Response, + VirtualNetworksCreateOrUpdate201Response, + VirtualNetworksCreateOrUpdateDefaultResponse, + VirtualNetworksUpdate200Response, + VirtualNetworksUpdate202Response, + VirtualNetworksUpdateDefaultResponse, + VirtualNetworksDelete202Response, + VirtualNetworksDelete204Response, + VirtualNetworksDeleteDefaultResponse, + VirtualNetworksListByResourceGroup200Response, + VirtualNetworksListByResourceGroupDefaultResponse, + VirtualNetworksListBySubscription200Response, + VirtualNetworksListBySubscriptionDefaultResponse, + VirtualMachineTemplatesGet200Response, + VirtualMachineTemplatesGetDefaultResponse, + VirtualMachineTemplatesCreateOrUpdate200Response, + VirtualMachineTemplatesCreateOrUpdate201Response, + VirtualMachineTemplatesCreateOrUpdateDefaultResponse, + VirtualMachineTemplatesUpdate200Response, + VirtualMachineTemplatesUpdate202Response, + VirtualMachineTemplatesUpdateDefaultResponse, + VirtualMachineTemplatesDelete202Response, + VirtualMachineTemplatesDelete204Response, + VirtualMachineTemplatesDeleteDefaultResponse, + VirtualMachineTemplatesListByResourceGroup200Response, + VirtualMachineTemplatesListByResourceGroupDefaultResponse, + VirtualMachineTemplatesListBySubscription200Response, + VirtualMachineTemplatesListBySubscriptionDefaultResponse, + AvailabilitySetsGet200Response, + AvailabilitySetsGetDefaultResponse, + AvailabilitySetsCreateOrUpdate200Response, + AvailabilitySetsCreateOrUpdate201Response, + AvailabilitySetsCreateOrUpdateDefaultResponse, + AvailabilitySetsUpdate200Response, + AvailabilitySetsUpdate202Response, + AvailabilitySetsUpdateDefaultResponse, + AvailabilitySetsDelete202Response, + AvailabilitySetsDelete204Response, + AvailabilitySetsDeleteDefaultResponse, + AvailabilitySetsListByResourceGroup200Response, + AvailabilitySetsListByResourceGroupDefaultResponse, + AvailabilitySetsListBySubscription200Response, + AvailabilitySetsListBySubscriptionDefaultResponse, + InventoryItemsGet200Response, + InventoryItemsGetDefaultResponse, + InventoryItemsCreate200Response, + InventoryItemsCreate201Response, + InventoryItemsCreateDefaultResponse, + InventoryItemsDelete200Response, + InventoryItemsDelete204Response, + InventoryItemsDeleteDefaultResponse, + InventoryItemsListByVmmServer200Response, + InventoryItemsListByVmmServerDefaultResponse, + VirtualMachineInstancesGet200Response, + VirtualMachineInstancesGetDefaultResponse, + VirtualMachineInstancesCreateOrUpdate200Response, + VirtualMachineInstancesCreateOrUpdate201Response, + VirtualMachineInstancesCreateOrUpdateDefaultResponse, + VirtualMachineInstancesUpdate200Response, + VirtualMachineInstancesUpdate202Response, + VirtualMachineInstancesUpdateDefaultResponse, + VirtualMachineInstancesDelete202Response, + VirtualMachineInstancesDelete204Response, + VirtualMachineInstancesDeleteDefaultResponse, + VirtualMachineInstancesList200Response, + VirtualMachineInstancesListDefaultResponse, + VirtualMachineInstancesStop202Response, + VirtualMachineInstancesStopDefaultResponse, + VirtualMachineInstancesStart202Response, + VirtualMachineInstancesStartDefaultResponse, + VirtualMachineInstancesRestart202Response, + VirtualMachineInstancesRestartDefaultResponse, + VirtualMachineInstancesCreateCheckpoint202Response, + VirtualMachineInstancesCreateCheckpointDefaultResponse, + VirtualMachineInstancesDeleteCheckpoint202Response, + VirtualMachineInstancesDeleteCheckpointDefaultResponse, + VirtualMachineInstancesRestoreCheckpoint202Response, + VirtualMachineInstancesRestoreCheckpointDefaultResponse, + VmInstanceHybridIdentityMetadatasGet200Response, + VmInstanceHybridIdentityMetadatasGetDefaultResponse, + VmInstanceHybridIdentityMetadatasListByVirtualMachineInstance200Response, + VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceDefaultResponse, + GuestAgentsGet200Response, + GuestAgentsGetDefaultResponse, + GuestAgentsCreate200Response, + GuestAgentsCreate201Response, + GuestAgentsCreateDefaultResponse, + GuestAgentsDelete200Response, + GuestAgentsDelete204Response, + GuestAgentsDeleteDefaultResponse, + GuestAgentsListByVirtualMachineInstance200Response, + GuestAgentsListByVirtualMachineInstanceDefaultResponse, +} from "./responses.js"; +import { Client, StreamableMethod } from "@azure-rest/core-client"; + +export interface OperationsList { + /** List the operations for the provider */ + get( + options?: OperationsListParameters, + ): StreamableMethod< + OperationsList200Response | OperationsListDefaultResponse + >; +} + +export interface VmmServersGet { + /** Implements VmmServer GET method. */ + get( + options?: VmmServersGetParameters, + ): StreamableMethod; + /** Onboards the SCVmm fabric as an Azure VmmServer resource. */ + put( + options: VmmServersCreateOrUpdateParameters, + ): StreamableMethod< + | VmmServersCreateOrUpdate200Response + | VmmServersCreateOrUpdate201Response + | VmmServersCreateOrUpdateDefaultResponse + >; + /** Updates the VmmServers resource. */ + patch( + options: VmmServersUpdateParameters, + ): StreamableMethod< + | VmmServersUpdate200Response + | VmmServersUpdate202Response + | VmmServersUpdateDefaultResponse + >; + /** Removes the SCVmm fabric from Azure. */ + delete( + options?: VmmServersDeleteParameters, + ): StreamableMethod< + | VmmServersDelete202Response + | VmmServersDelete204Response + | VmmServersDeleteDefaultResponse + >; +} + +export interface VmmServersListByResourceGroup { + /** List of VmmServers in a resource group. */ + get( + options?: VmmServersListByResourceGroupParameters, + ): StreamableMethod< + | VmmServersListByResourceGroup200Response + | VmmServersListByResourceGroupDefaultResponse + >; +} + +export interface VmmServersListBySubscription { + /** List of VmmServers in a subscription. */ + get( + options?: VmmServersListBySubscriptionParameters, + ): StreamableMethod< + | VmmServersListBySubscription200Response + | VmmServersListBySubscriptionDefaultResponse + >; +} + +export interface CloudsGet { + /** Implements Cloud GET method. */ + get( + options?: CloudsGetParameters, + ): StreamableMethod; + /** Onboards the ScVmm fabric cloud as an Azure cloud resource. */ + put( + options: CloudsCreateOrUpdateParameters, + ): StreamableMethod< + | CloudsCreateOrUpdate200Response + | CloudsCreateOrUpdate201Response + | CloudsCreateOrUpdateDefaultResponse + >; + /** Updates the Clouds resource. */ + patch( + options: CloudsUpdateParameters, + ): StreamableMethod< + | CloudsUpdate200Response + | CloudsUpdate202Response + | CloudsUpdateDefaultResponse + >; + /** Deregisters the ScVmm fabric cloud from Azure. */ + delete( + options?: CloudsDeleteParameters, + ): StreamableMethod< + | CloudsDelete202Response + | CloudsDelete204Response + | CloudsDeleteDefaultResponse + >; +} + +export interface CloudsListByResourceGroup { + /** List of Clouds in a resource group. */ + get( + options?: CloudsListByResourceGroupParameters, + ): StreamableMethod< + | CloudsListByResourceGroup200Response + | CloudsListByResourceGroupDefaultResponse + >; +} + +export interface CloudsListBySubscription { + /** List of Clouds in a subscription. */ + get( + options?: CloudsListBySubscriptionParameters, + ): StreamableMethod< + | CloudsListBySubscription200Response + | CloudsListBySubscriptionDefaultResponse + >; +} + +export interface VirtualNetworksGet { + /** Implements VirtualNetwork GET method. */ + get( + options?: VirtualNetworksGetParameters, + ): StreamableMethod< + VirtualNetworksGet200Response | VirtualNetworksGetDefaultResponse + >; + /** Onboards the ScVmm virtual network as an Azure virtual network resource. */ + put( + options: VirtualNetworksCreateOrUpdateParameters, + ): StreamableMethod< + | VirtualNetworksCreateOrUpdate200Response + | VirtualNetworksCreateOrUpdate201Response + | VirtualNetworksCreateOrUpdateDefaultResponse + >; + /** Updates the VirtualNetworks resource. */ + patch( + options: VirtualNetworksUpdateParameters, + ): StreamableMethod< + | VirtualNetworksUpdate200Response + | VirtualNetworksUpdate202Response + | VirtualNetworksUpdateDefaultResponse + >; + /** Deregisters the ScVmm virtual network from Azure. */ + delete( + options?: VirtualNetworksDeleteParameters, + ): StreamableMethod< + | VirtualNetworksDelete202Response + | VirtualNetworksDelete204Response + | VirtualNetworksDeleteDefaultResponse + >; +} + +export interface VirtualNetworksListByResourceGroup { + /** List of VirtualNetworks in a resource group. */ + get( + options?: VirtualNetworksListByResourceGroupParameters, + ): StreamableMethod< + | VirtualNetworksListByResourceGroup200Response + | VirtualNetworksListByResourceGroupDefaultResponse + >; +} + +export interface VirtualNetworksListBySubscription { + /** List of VirtualNetworks in a subscription. */ + get( + options?: VirtualNetworksListBySubscriptionParameters, + ): StreamableMethod< + | VirtualNetworksListBySubscription200Response + | VirtualNetworksListBySubscriptionDefaultResponse + >; +} + +export interface VirtualMachineTemplatesGet { + /** Implements VirtualMachineTemplate GET method. */ + get( + options?: VirtualMachineTemplatesGetParameters, + ): StreamableMethod< + | VirtualMachineTemplatesGet200Response + | VirtualMachineTemplatesGetDefaultResponse + >; + /** Onboards the ScVmm VM Template as an Azure VM Template resource. */ + put( + options: VirtualMachineTemplatesCreateOrUpdateParameters, + ): StreamableMethod< + | VirtualMachineTemplatesCreateOrUpdate200Response + | VirtualMachineTemplatesCreateOrUpdate201Response + | VirtualMachineTemplatesCreateOrUpdateDefaultResponse + >; + /** Updates the VirtualMachineTemplate resource. */ + patch( + options: VirtualMachineTemplatesUpdateParameters, + ): StreamableMethod< + | VirtualMachineTemplatesUpdate200Response + | VirtualMachineTemplatesUpdate202Response + | VirtualMachineTemplatesUpdateDefaultResponse + >; + /** Deregisters the ScVmm VM Template from Azure. */ + delete( + options?: VirtualMachineTemplatesDeleteParameters, + ): StreamableMethod< + | VirtualMachineTemplatesDelete202Response + | VirtualMachineTemplatesDelete204Response + | VirtualMachineTemplatesDeleteDefaultResponse + >; +} + +export interface VirtualMachineTemplatesListByResourceGroup { + /** List of VirtualMachineTemplates in a resource group. */ + get( + options?: VirtualMachineTemplatesListByResourceGroupParameters, + ): StreamableMethod< + | VirtualMachineTemplatesListByResourceGroup200Response + | VirtualMachineTemplatesListByResourceGroupDefaultResponse + >; +} + +export interface VirtualMachineTemplatesListBySubscription { + /** List of VirtualMachineTemplates in a subscription. */ + get( + options?: VirtualMachineTemplatesListBySubscriptionParameters, + ): StreamableMethod< + | VirtualMachineTemplatesListBySubscription200Response + | VirtualMachineTemplatesListBySubscriptionDefaultResponse + >; +} + +export interface AvailabilitySetsGet { + /** Implements AvailabilitySet GET method. */ + get( + options?: AvailabilitySetsGetParameters, + ): StreamableMethod< + AvailabilitySetsGet200Response | AvailabilitySetsGetDefaultResponse + >; + /** Onboards the ScVmm availability set as an Azure resource. */ + put( + options: AvailabilitySetsCreateOrUpdateParameters, + ): StreamableMethod< + | AvailabilitySetsCreateOrUpdate200Response + | AvailabilitySetsCreateOrUpdate201Response + | AvailabilitySetsCreateOrUpdateDefaultResponse + >; + /** Updates the AvailabilitySets resource. */ + patch( + options: AvailabilitySetsUpdateParameters, + ): StreamableMethod< + | AvailabilitySetsUpdate200Response + | AvailabilitySetsUpdate202Response + | AvailabilitySetsUpdateDefaultResponse + >; + /** Deregisters the ScVmm availability set from Azure. */ + delete( + options?: AvailabilitySetsDeleteParameters, + ): StreamableMethod< + | AvailabilitySetsDelete202Response + | AvailabilitySetsDelete204Response + | AvailabilitySetsDeleteDefaultResponse + >; +} + +export interface AvailabilitySetsListByResourceGroup { + /** List of AvailabilitySets in a resource group. */ + get( + options?: AvailabilitySetsListByResourceGroupParameters, + ): StreamableMethod< + | AvailabilitySetsListByResourceGroup200Response + | AvailabilitySetsListByResourceGroupDefaultResponse + >; +} + +export interface AvailabilitySetsListBySubscription { + /** List of AvailabilitySets in a subscription. */ + get( + options?: AvailabilitySetsListBySubscriptionParameters, + ): StreamableMethod< + | AvailabilitySetsListBySubscription200Response + | AvailabilitySetsListBySubscriptionDefaultResponse + >; +} + +export interface InventoryItemsGet { + /** Shows an inventory item. */ + get( + options?: InventoryItemsGetParameters, + ): StreamableMethod< + InventoryItemsGet200Response | InventoryItemsGetDefaultResponse + >; + /** Create Or Update InventoryItem. */ + put( + options: InventoryItemsCreateParameters, + ): StreamableMethod< + | InventoryItemsCreate200Response + | InventoryItemsCreate201Response + | InventoryItemsCreateDefaultResponse + >; + /** Deletes an inventoryItem. */ + delete( + options?: InventoryItemsDeleteParameters, + ): StreamableMethod< + | InventoryItemsDelete200Response + | InventoryItemsDelete204Response + | InventoryItemsDeleteDefaultResponse + >; +} + +export interface InventoryItemsListByVmmServer { + /** Returns the list of inventoryItems in the given VmmServer. */ + get( + options?: InventoryItemsListByVmmServerParameters, + ): StreamableMethod< + | InventoryItemsListByVmmServer200Response + | InventoryItemsListByVmmServerDefaultResponse + >; +} + +export interface VirtualMachineInstancesGet { + /** Retrieves information about a virtual machine instance. */ + get( + options?: VirtualMachineInstancesGetParameters, + ): StreamableMethod< + | VirtualMachineInstancesGet200Response + | VirtualMachineInstancesGetDefaultResponse + >; + /** The operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. */ + put( + options: VirtualMachineInstancesCreateOrUpdateParameters, + ): StreamableMethod< + | VirtualMachineInstancesCreateOrUpdate200Response + | VirtualMachineInstancesCreateOrUpdate201Response + | VirtualMachineInstancesCreateOrUpdateDefaultResponse + >; + /** The operation to update a virtual machine instance. */ + patch( + options: VirtualMachineInstancesUpdateParameters, + ): StreamableMethod< + | VirtualMachineInstancesUpdate200Response + | VirtualMachineInstancesUpdate202Response + | VirtualMachineInstancesUpdateDefaultResponse + >; + /** The operation to delete a virtual machine instance. */ + delete( + options?: VirtualMachineInstancesDeleteParameters, + ): StreamableMethod< + | VirtualMachineInstancesDelete202Response + | VirtualMachineInstancesDelete204Response + | VirtualMachineInstancesDeleteDefaultResponse + >; +} + +export interface VirtualMachineInstancesList { + /** Lists all of the virtual machine instances within the specified parent resource. */ + get( + options?: VirtualMachineInstancesListParameters, + ): StreamableMethod< + | VirtualMachineInstancesList200Response + | VirtualMachineInstancesListDefaultResponse + >; +} + +export interface VirtualMachineInstancesStop { + /** The operation to power off (stop) a virtual machine instance. */ + post( + options: VirtualMachineInstancesStopParameters, + ): StreamableMethod< + | VirtualMachineInstancesStop202Response + | VirtualMachineInstancesStopDefaultResponse + >; +} + +export interface VirtualMachineInstancesStart { + /** The operation to start a virtual machine instance. */ + post( + options: VirtualMachineInstancesStartParameters, + ): StreamableMethod< + | VirtualMachineInstancesStart202Response + | VirtualMachineInstancesStartDefaultResponse + >; +} + +export interface VirtualMachineInstancesRestart { + /** The operation to restart a virtual machine instance. */ + post( + options: VirtualMachineInstancesRestartParameters, + ): StreamableMethod< + | VirtualMachineInstancesRestart202Response + | VirtualMachineInstancesRestartDefaultResponse + >; +} + +export interface VirtualMachineInstancesCreateCheckpoint { + /** Creates a checkpoint in virtual machine instance. */ + post( + options: VirtualMachineInstancesCreateCheckpointParameters, + ): StreamableMethod< + | VirtualMachineInstancesCreateCheckpoint202Response + | VirtualMachineInstancesCreateCheckpointDefaultResponse + >; +} + +export interface VirtualMachineInstancesDeleteCheckpoint { + /** Deletes a checkpoint in virtual machine instance. */ + post( + options: VirtualMachineInstancesDeleteCheckpointParameters, + ): StreamableMethod< + | VirtualMachineInstancesDeleteCheckpoint202Response + | VirtualMachineInstancesDeleteCheckpointDefaultResponse + >; +} + +export interface VirtualMachineInstancesRestoreCheckpoint { + /** Restores to a checkpoint in virtual machine instance. */ + post( + options: VirtualMachineInstancesRestoreCheckpointParameters, + ): StreamableMethod< + | VirtualMachineInstancesRestoreCheckpoint202Response + | VirtualMachineInstancesRestoreCheckpointDefaultResponse + >; +} + +export interface VmInstanceHybridIdentityMetadatasGet { + /** Implements HybridIdentityMetadata GET method. */ + get( + options?: VmInstanceHybridIdentityMetadatasGetParameters, + ): StreamableMethod< + | VmInstanceHybridIdentityMetadatasGet200Response + | VmInstanceHybridIdentityMetadatasGetDefaultResponse + >; +} + +export interface VmInstanceHybridIdentityMetadatasListByVirtualMachineInstance { + /** Returns the list of HybridIdentityMetadata of the given VM. */ + get( + options?: VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceParameters, + ): StreamableMethod< + | VmInstanceHybridIdentityMetadatasListByVirtualMachineInstance200Response + | VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceDefaultResponse + >; +} + +export interface GuestAgentsGet { + /** Implements GuestAgent GET method. */ + get( + options?: GuestAgentsGetParameters, + ): StreamableMethod< + GuestAgentsGet200Response | GuestAgentsGetDefaultResponse + >; + /** Create Or Update GuestAgent. */ + put( + options: GuestAgentsCreateParameters, + ): StreamableMethod< + | GuestAgentsCreate200Response + | GuestAgentsCreate201Response + | GuestAgentsCreateDefaultResponse + >; + /** Implements GuestAgent DELETE method. */ + delete( + options?: GuestAgentsDeleteParameters, + ): StreamableMethod< + | GuestAgentsDelete200Response + | GuestAgentsDelete204Response + | GuestAgentsDeleteDefaultResponse + >; +} + +export interface GuestAgentsListByVirtualMachineInstance { + /** Returns the list of GuestAgent of the given vm. */ + get( + options?: GuestAgentsListByVirtualMachineInstanceParameters, + ): StreamableMethod< + | GuestAgentsListByVirtualMachineInstance200Response + | GuestAgentsListByVirtualMachineInstanceDefaultResponse + >; +} + +export interface Routes { + /** Resource for '/providers/Microsoft.ScVmm/operations' has methods for the following verbs: get */ + (path: "/providers/Microsoft.ScVmm/operations"): OperationsList; + /** Resource for '/subscriptions/\{subscriptionId\}/resourceGroups/\{resourceGroupName\}/providers/Microsoft.ScVmm/vmmServers/\{vmmServerName\}' has methods for the following verbs: get, put, patch, delete */ + ( + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}", + subscriptionId: string, + resourceGroupName: string, + vmmServerName: string, + ): VmmServersGet; + /** Resource for '/subscriptions/\{subscriptionId\}/resourceGroups/\{resourceGroupName\}/providers/Microsoft.ScVmm/vmmServers' has methods for the following verbs: get */ + ( + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers", + subscriptionId: string, + resourceGroupName: string, + ): VmmServersListByResourceGroup; + /** Resource for '/subscriptions/\{subscriptionId\}/providers/Microsoft.ScVmm/vmmServers' has methods for the following verbs: get */ + ( + path: "/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/vmmServers", + subscriptionId: string, + ): VmmServersListBySubscription; + /** Resource for '/subscriptions/\{subscriptionId\}/resourceGroups/\{resourceGroupName\}/providers/Microsoft.ScVmm/clouds/\{cloudResourceName\}' has methods for the following verbs: get, put, patch, delete */ + ( + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds/{cloudResourceName}", + subscriptionId: string, + resourceGroupName: string, + cloudResourceName: string, + ): CloudsGet; + /** Resource for '/subscriptions/\{subscriptionId\}/resourceGroups/\{resourceGroupName\}/providers/Microsoft.ScVmm/clouds' has methods for the following verbs: get */ + ( + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds", + subscriptionId: string, + resourceGroupName: string, + ): CloudsListByResourceGroup; + /** Resource for '/subscriptions/\{subscriptionId\}/providers/Microsoft.ScVmm/clouds' has methods for the following verbs: get */ + ( + path: "/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/clouds", + subscriptionId: string, + ): CloudsListBySubscription; + /** Resource for '/subscriptions/\{subscriptionId\}/resourceGroups/\{resourceGroupName\}/providers/Microsoft.ScVmm/virtualNetworks/\{virtualNetworkName\}' has methods for the following verbs: get, put, patch, delete */ + ( + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualNetworks/{virtualNetworkName}", + subscriptionId: string, + resourceGroupName: string, + virtualNetworkName: string, + ): VirtualNetworksGet; + /** Resource for '/subscriptions/\{subscriptionId\}/resourceGroups/\{resourceGroupName\}/providers/Microsoft.ScVmm/virtualNetworks' has methods for the following verbs: get */ + ( + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualNetworks", + subscriptionId: string, + resourceGroupName: string, + ): VirtualNetworksListByResourceGroup; + /** Resource for '/subscriptions/\{subscriptionId\}/providers/Microsoft.ScVmm/virtualNetworks' has methods for the following verbs: get */ + ( + path: "/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/virtualNetworks", + subscriptionId: string, + ): VirtualNetworksListBySubscription; + /** Resource for '/subscriptions/\{subscriptionId\}/resourceGroups/\{resourceGroupName\}/providers/Microsoft.ScVmm/virtualMachineTemplates/\{virtualMachineTemplateName\}' has methods for the following verbs: get, put, patch, delete */ + ( + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachineTemplates/{virtualMachineTemplateName}", + subscriptionId: string, + resourceGroupName: string, + virtualMachineTemplateName: string, + ): VirtualMachineTemplatesGet; + /** Resource for '/subscriptions/\{subscriptionId\}/resourceGroups/\{resourceGroupName\}/providers/Microsoft.ScVmm/virtualMachineTemplates' has methods for the following verbs: get */ + ( + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachineTemplates", + subscriptionId: string, + resourceGroupName: string, + ): VirtualMachineTemplatesListByResourceGroup; + /** Resource for '/subscriptions/\{subscriptionId\}/providers/Microsoft.ScVmm/virtualMachineTemplates' has methods for the following verbs: get */ + ( + path: "/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/virtualMachineTemplates", + subscriptionId: string, + ): VirtualMachineTemplatesListBySubscription; + /** Resource for '/subscriptions/\{subscriptionId\}/resourceGroups/\{resourceGroupName\}/providers/Microsoft.ScVmm/availabilitySets/\{availabilitySetResourceName\}' has methods for the following verbs: get, put, patch, delete */ + ( + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets/{availabilitySetResourceName}", + subscriptionId: string, + resourceGroupName: string, + availabilitySetResourceName: string, + ): AvailabilitySetsGet; + /** Resource for '/subscriptions/\{subscriptionId\}/resourceGroups/\{resourceGroupName\}/providers/Microsoft.ScVmm/availabilitySets' has methods for the following verbs: get */ + ( + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets", + subscriptionId: string, + resourceGroupName: string, + ): AvailabilitySetsListByResourceGroup; + /** Resource for '/subscriptions/\{subscriptionId\}/providers/Microsoft.ScVmm/availabilitySets' has methods for the following verbs: get */ + ( + path: "/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/availabilitySets", + subscriptionId: string, + ): AvailabilitySetsListBySubscription; + /** Resource for '/subscriptions/\{subscriptionId\}/resourceGroups/\{resourceGroupName\}/providers/Microsoft.ScVmm/vmmServers/\{vmmServerName\}/inventoryItems/\{inventoryItemResourceName\}' has methods for the following verbs: get, put, delete */ + ( + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/{inventoryItemResourceName}", + subscriptionId: string, + resourceGroupName: string, + vmmServerName: string, + inventoryItemResourceName: string, + ): InventoryItemsGet; + /** Resource for '/subscriptions/\{subscriptionId\}/resourceGroups/\{resourceGroupName\}/providers/Microsoft.ScVmm/vmmServers/\{vmmServerName\}/inventoryItems' has methods for the following verbs: get */ + ( + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems", + subscriptionId: string, + resourceGroupName: string, + vmmServerName: string, + ): InventoryItemsListByVmmServer; + /** Resource for '/\{resourceUri\}/providers/Microsoft.ScVmm/virtualMachineInstances/default' has methods for the following verbs: get, put, patch, delete */ + ( + path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default", + resourceUri: string, + ): VirtualMachineInstancesGet; + /** Resource for '/\{resourceUri\}/providers/Microsoft.ScVmm/virtualMachineInstances' has methods for the following verbs: get */ + ( + path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances", + resourceUri: string, + ): VirtualMachineInstancesList; + /** Resource for '/\{resourceUri\}/providers/Microsoft.ScVmm/virtualMachineInstances/default/stop' has methods for the following verbs: post */ + ( + path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/stop", + resourceUri: string, + ): VirtualMachineInstancesStop; + /** Resource for '/\{resourceUri\}/providers/Microsoft.ScVmm/virtualMachineInstances/default/start' has methods for the following verbs: post */ + ( + path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/start", + resourceUri: string, + ): VirtualMachineInstancesStart; + /** Resource for '/\{resourceUri\}/providers/Microsoft.ScVmm/virtualMachineInstances/default/restart' has methods for the following verbs: post */ + ( + path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/restart", + resourceUri: string, + ): VirtualMachineInstancesRestart; + /** Resource for '/\{resourceUri\}/providers/Microsoft.ScVmm/virtualMachineInstances/default/createCheckpoint' has methods for the following verbs: post */ + ( + path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/createCheckpoint", + resourceUri: string, + ): VirtualMachineInstancesCreateCheckpoint; + /** Resource for '/\{resourceUri\}/providers/Microsoft.ScVmm/virtualMachineInstances/default/deleteCheckpoint' has methods for the following verbs: post */ + ( + path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/deleteCheckpoint", + resourceUri: string, + ): VirtualMachineInstancesDeleteCheckpoint; + /** Resource for '/\{resourceUri\}/providers/Microsoft.ScVmm/virtualMachineInstances/default/restoreCheckpoint' has methods for the following verbs: post */ + ( + path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/restoreCheckpoint", + resourceUri: string, + ): VirtualMachineInstancesRestoreCheckpoint; + /** Resource for '/\{resourceUri\}/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata/default' has methods for the following verbs: get */ + ( + path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata/default", + resourceUri: string, + ): VmInstanceHybridIdentityMetadatasGet; + /** Resource for '/\{resourceUri\}/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata' has methods for the following verbs: get */ + ( + path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata", + resourceUri: string, + ): VmInstanceHybridIdentityMetadatasListByVirtualMachineInstance; + /** Resource for '/\{resourceUri\}/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default' has methods for the following verbs: get, put, delete */ + ( + path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default", + resourceUri: string, + ): GuestAgentsGet; + /** Resource for '/\{resourceUri\}/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents' has methods for the following verbs: get */ + ( + path: "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents", + resourceUri: string, + ): GuestAgentsListByVirtualMachineInstance; +} + +export type ScVmmContext = Client & { + path: Routes; +}; diff --git a/sdk/scvmm/arm-scvmm/src/rest/index.ts b/sdk/scvmm/arm-scvmm/src/rest/index.ts new file mode 100644 index 000000000000..ed7cddc1a9a9 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/rest/index.ts @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import ScVmmClient from "./scVmmClient.js"; + +export * from "./scVmmClient.js"; +export * from "./parameters.js"; +export * from "./responses.js"; +export * from "./clientDefinitions.js"; +export * from "./isUnexpected.js"; +export * from "./models.js"; +export * from "./outputModels.js"; +export * from "./paginateHelper.js"; +export * from "./pollingHelper.js"; + +export default ScVmmClient; diff --git a/sdk/scvmm/arm-scvmm/src/rest/isUnexpected.ts b/sdk/scvmm/arm-scvmm/src/rest/isUnexpected.ts new file mode 100644 index 000000000000..f8b2d92aad48 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/rest/isUnexpected.ts @@ -0,0 +1,859 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { + OperationsList200Response, + OperationsListDefaultResponse, + VmmServersGet200Response, + VmmServersGetDefaultResponse, + VmmServersCreateOrUpdate200Response, + VmmServersCreateOrUpdate201Response, + VmmServersCreateOrUpdateLogicalResponse, + VmmServersCreateOrUpdateDefaultResponse, + VmmServersUpdate200Response, + VmmServersUpdate202Response, + VmmServersUpdateLogicalResponse, + VmmServersUpdateDefaultResponse, + VmmServersDelete202Response, + VmmServersDelete204Response, + VmmServersDeleteLogicalResponse, + VmmServersDeleteDefaultResponse, + VmmServersListByResourceGroup200Response, + VmmServersListByResourceGroupDefaultResponse, + VmmServersListBySubscription200Response, + VmmServersListBySubscriptionDefaultResponse, + CloudsGet200Response, + CloudsGetDefaultResponse, + CloudsCreateOrUpdate200Response, + CloudsCreateOrUpdate201Response, + CloudsCreateOrUpdateLogicalResponse, + CloudsCreateOrUpdateDefaultResponse, + CloudsUpdate200Response, + CloudsUpdate202Response, + CloudsUpdateLogicalResponse, + CloudsUpdateDefaultResponse, + CloudsDelete202Response, + CloudsDelete204Response, + CloudsDeleteLogicalResponse, + CloudsDeleteDefaultResponse, + CloudsListByResourceGroup200Response, + CloudsListByResourceGroupDefaultResponse, + CloudsListBySubscription200Response, + CloudsListBySubscriptionDefaultResponse, + VirtualNetworksGet200Response, + VirtualNetworksGetDefaultResponse, + VirtualNetworksCreateOrUpdate200Response, + VirtualNetworksCreateOrUpdate201Response, + VirtualNetworksCreateOrUpdateLogicalResponse, + VirtualNetworksCreateOrUpdateDefaultResponse, + VirtualNetworksUpdate200Response, + VirtualNetworksUpdate202Response, + VirtualNetworksUpdateLogicalResponse, + VirtualNetworksUpdateDefaultResponse, + VirtualNetworksDelete202Response, + VirtualNetworksDelete204Response, + VirtualNetworksDeleteLogicalResponse, + VirtualNetworksDeleteDefaultResponse, + VirtualNetworksListByResourceGroup200Response, + VirtualNetworksListByResourceGroupDefaultResponse, + VirtualNetworksListBySubscription200Response, + VirtualNetworksListBySubscriptionDefaultResponse, + VirtualMachineTemplatesGet200Response, + VirtualMachineTemplatesGetDefaultResponse, + VirtualMachineTemplatesCreateOrUpdate200Response, + VirtualMachineTemplatesCreateOrUpdate201Response, + VirtualMachineTemplatesCreateOrUpdateLogicalResponse, + VirtualMachineTemplatesCreateOrUpdateDefaultResponse, + VirtualMachineTemplatesUpdate200Response, + VirtualMachineTemplatesUpdate202Response, + VirtualMachineTemplatesUpdateLogicalResponse, + VirtualMachineTemplatesUpdateDefaultResponse, + VirtualMachineTemplatesDelete202Response, + VirtualMachineTemplatesDelete204Response, + VirtualMachineTemplatesDeleteLogicalResponse, + VirtualMachineTemplatesDeleteDefaultResponse, + VirtualMachineTemplatesListByResourceGroup200Response, + VirtualMachineTemplatesListByResourceGroupDefaultResponse, + VirtualMachineTemplatesListBySubscription200Response, + VirtualMachineTemplatesListBySubscriptionDefaultResponse, + AvailabilitySetsGet200Response, + AvailabilitySetsGetDefaultResponse, + AvailabilitySetsCreateOrUpdate200Response, + AvailabilitySetsCreateOrUpdate201Response, + AvailabilitySetsCreateOrUpdateLogicalResponse, + AvailabilitySetsCreateOrUpdateDefaultResponse, + AvailabilitySetsUpdate200Response, + AvailabilitySetsUpdate202Response, + AvailabilitySetsUpdateLogicalResponse, + AvailabilitySetsUpdateDefaultResponse, + AvailabilitySetsDelete202Response, + AvailabilitySetsDelete204Response, + AvailabilitySetsDeleteLogicalResponse, + AvailabilitySetsDeleteDefaultResponse, + AvailabilitySetsListByResourceGroup200Response, + AvailabilitySetsListByResourceGroupDefaultResponse, + AvailabilitySetsListBySubscription200Response, + AvailabilitySetsListBySubscriptionDefaultResponse, + InventoryItemsGet200Response, + InventoryItemsGetDefaultResponse, + InventoryItemsCreate200Response, + InventoryItemsCreate201Response, + InventoryItemsCreateDefaultResponse, + InventoryItemsDelete200Response, + InventoryItemsDelete204Response, + InventoryItemsDeleteDefaultResponse, + InventoryItemsListByVmmServer200Response, + InventoryItemsListByVmmServerDefaultResponse, + VirtualMachineInstancesGet200Response, + VirtualMachineInstancesGetDefaultResponse, + VirtualMachineInstancesCreateOrUpdate200Response, + VirtualMachineInstancesCreateOrUpdate201Response, + VirtualMachineInstancesCreateOrUpdateLogicalResponse, + VirtualMachineInstancesCreateOrUpdateDefaultResponse, + VirtualMachineInstancesUpdate200Response, + VirtualMachineInstancesUpdate202Response, + VirtualMachineInstancesUpdateLogicalResponse, + VirtualMachineInstancesUpdateDefaultResponse, + VirtualMachineInstancesDelete202Response, + VirtualMachineInstancesDelete204Response, + VirtualMachineInstancesDeleteLogicalResponse, + VirtualMachineInstancesDeleteDefaultResponse, + VirtualMachineInstancesList200Response, + VirtualMachineInstancesListDefaultResponse, + VirtualMachineInstancesStop202Response, + VirtualMachineInstancesStopLogicalResponse, + VirtualMachineInstancesStopDefaultResponse, + VirtualMachineInstancesStart202Response, + VirtualMachineInstancesStartLogicalResponse, + VirtualMachineInstancesStartDefaultResponse, + VirtualMachineInstancesRestart202Response, + VirtualMachineInstancesRestartLogicalResponse, + VirtualMachineInstancesRestartDefaultResponse, + VirtualMachineInstancesCreateCheckpoint202Response, + VirtualMachineInstancesCreateCheckpointLogicalResponse, + VirtualMachineInstancesCreateCheckpointDefaultResponse, + VirtualMachineInstancesDeleteCheckpoint202Response, + VirtualMachineInstancesDeleteCheckpointLogicalResponse, + VirtualMachineInstancesDeleteCheckpointDefaultResponse, + VirtualMachineInstancesRestoreCheckpoint202Response, + VirtualMachineInstancesRestoreCheckpointLogicalResponse, + VirtualMachineInstancesRestoreCheckpointDefaultResponse, + VmInstanceHybridIdentityMetadatasGet200Response, + VmInstanceHybridIdentityMetadatasGetDefaultResponse, + VmInstanceHybridIdentityMetadatasListByVirtualMachineInstance200Response, + VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceDefaultResponse, + GuestAgentsGet200Response, + GuestAgentsGetDefaultResponse, + GuestAgentsCreate200Response, + GuestAgentsCreate201Response, + GuestAgentsCreateLogicalResponse, + GuestAgentsCreateDefaultResponse, + GuestAgentsDelete200Response, + GuestAgentsDelete204Response, + GuestAgentsDeleteDefaultResponse, + GuestAgentsListByVirtualMachineInstance200Response, + GuestAgentsListByVirtualMachineInstanceDefaultResponse, +} from "./responses.js"; + +const responseMap: Record = { + "GET /providers/Microsoft.ScVmm/operations": ["200"], + "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}": + ["200"], + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}": + ["200", "201"], + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}": + ["200", "202"], + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}": + ["202", "204"], + "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers": + ["200"], + "GET /subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/vmmServers": [ + "200", + ], + "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds/{cloudResourceName}": + ["200"], + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds/{cloudResourceName}": + ["200", "201"], + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds/{cloudResourceName}": + ["200", "202"], + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds/{cloudResourceName}": + ["202", "204"], + "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds": + ["200"], + "GET /subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/clouds": [ + "200", + ], + "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualNetworks/{virtualNetworkName}": + ["200"], + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualNetworks/{virtualNetworkName}": + ["200", "201"], + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualNetworks/{virtualNetworkName}": + ["200", "202"], + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualNetworks/{virtualNetworkName}": + ["202", "204"], + "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualNetworks": + ["200"], + "GET /subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/virtualNetworks": + ["200"], + "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachineTemplates/{virtualMachineTemplateName}": + ["200"], + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachineTemplates/{virtualMachineTemplateName}": + ["200", "201"], + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachineTemplates/{virtualMachineTemplateName}": + ["200", "202"], + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachineTemplates/{virtualMachineTemplateName}": + ["202", "204"], + "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachineTemplates": + ["200"], + "GET /subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/virtualMachineTemplates": + ["200"], + "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets/{availabilitySetResourceName}": + ["200"], + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets/{availabilitySetResourceName}": + ["200", "201"], + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets/{availabilitySetResourceName}": + ["200", "202"], + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets/{availabilitySetResourceName}": + ["202", "204"], + "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets": + ["200"], + "GET /subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/availabilitySets": + ["200"], + "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/{inventoryItemResourceName}": + ["200"], + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/{inventoryItemResourceName}": + ["200", "201"], + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/{inventoryItemResourceName}": + ["200", "204"], + "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems": + ["200"], + "GET /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default": + ["200"], + "PUT /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default": + ["200", "201"], + "PATCH /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default": + ["200", "202"], + "DELETE /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default": + ["202", "204"], + "GET /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances": [ + "200", + ], + "GET /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/stop": + ["200", "202"], + "POST /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/stop": + ["202"], + "GET /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/start": + ["200", "202"], + "POST /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/start": + ["202"], + "GET /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/restart": + ["200", "202"], + "POST /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/restart": + ["202"], + "GET /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/createCheckpoint": + ["200", "202"], + "POST /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/createCheckpoint": + ["202"], + "GET /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/deleteCheckpoint": + ["200", "202"], + "POST /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/deleteCheckpoint": + ["202"], + "GET /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/restoreCheckpoint": + ["200", "202"], + "POST /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/restoreCheckpoint": + ["202"], + "GET /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata/default": + ["200"], + "GET /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata": + ["200"], + "GET /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default": + ["200"], + "PUT /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default": + ["200", "201"], + "DELETE /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default": + ["200", "204"], + "GET /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents": + ["200"], +}; + +export function isUnexpected( + response: OperationsList200Response | OperationsListDefaultResponse, +): response is OperationsListDefaultResponse; +export function isUnexpected( + response: VmmServersGet200Response | VmmServersGetDefaultResponse, +): response is VmmServersGetDefaultResponse; +export function isUnexpected( + response: + | VmmServersCreateOrUpdate200Response + | VmmServersCreateOrUpdate201Response + | VmmServersCreateOrUpdateLogicalResponse + | VmmServersCreateOrUpdateDefaultResponse, +): response is VmmServersCreateOrUpdateDefaultResponse; +export function isUnexpected( + response: + | VmmServersUpdate200Response + | VmmServersUpdate202Response + | VmmServersUpdateLogicalResponse + | VmmServersUpdateDefaultResponse, +): response is VmmServersUpdateDefaultResponse; +export function isUnexpected( + response: + | VmmServersDelete202Response + | VmmServersDelete204Response + | VmmServersDeleteLogicalResponse + | VmmServersDeleteDefaultResponse, +): response is VmmServersDeleteDefaultResponse; +export function isUnexpected( + response: + | VmmServersListByResourceGroup200Response + | VmmServersListByResourceGroupDefaultResponse, +): response is VmmServersListByResourceGroupDefaultResponse; +export function isUnexpected( + response: + | VmmServersListBySubscription200Response + | VmmServersListBySubscriptionDefaultResponse, +): response is VmmServersListBySubscriptionDefaultResponse; +export function isUnexpected( + response: CloudsGet200Response | CloudsGetDefaultResponse, +): response is CloudsGetDefaultResponse; +export function isUnexpected( + response: + | CloudsCreateOrUpdate200Response + | CloudsCreateOrUpdate201Response + | CloudsCreateOrUpdateLogicalResponse + | CloudsCreateOrUpdateDefaultResponse, +): response is CloudsCreateOrUpdateDefaultResponse; +export function isUnexpected( + response: + | CloudsUpdate200Response + | CloudsUpdate202Response + | CloudsUpdateLogicalResponse + | CloudsUpdateDefaultResponse, +): response is CloudsUpdateDefaultResponse; +export function isUnexpected( + response: + | CloudsDelete202Response + | CloudsDelete204Response + | CloudsDeleteLogicalResponse + | CloudsDeleteDefaultResponse, +): response is CloudsDeleteDefaultResponse; +export function isUnexpected( + response: + | CloudsListByResourceGroup200Response + | CloudsListByResourceGroupDefaultResponse, +): response is CloudsListByResourceGroupDefaultResponse; +export function isUnexpected( + response: + | CloudsListBySubscription200Response + | CloudsListBySubscriptionDefaultResponse, +): response is CloudsListBySubscriptionDefaultResponse; +export function isUnexpected( + response: VirtualNetworksGet200Response | VirtualNetworksGetDefaultResponse, +): response is VirtualNetworksGetDefaultResponse; +export function isUnexpected( + response: + | VirtualNetworksCreateOrUpdate200Response + | VirtualNetworksCreateOrUpdate201Response + | VirtualNetworksCreateOrUpdateLogicalResponse + | VirtualNetworksCreateOrUpdateDefaultResponse, +): response is VirtualNetworksCreateOrUpdateDefaultResponse; +export function isUnexpected( + response: + | VirtualNetworksUpdate200Response + | VirtualNetworksUpdate202Response + | VirtualNetworksUpdateLogicalResponse + | VirtualNetworksUpdateDefaultResponse, +): response is VirtualNetworksUpdateDefaultResponse; +export function isUnexpected( + response: + | VirtualNetworksDelete202Response + | VirtualNetworksDelete204Response + | VirtualNetworksDeleteLogicalResponse + | VirtualNetworksDeleteDefaultResponse, +): response is VirtualNetworksDeleteDefaultResponse; +export function isUnexpected( + response: + | VirtualNetworksListByResourceGroup200Response + | VirtualNetworksListByResourceGroupDefaultResponse, +): response is VirtualNetworksListByResourceGroupDefaultResponse; +export function isUnexpected( + response: + | VirtualNetworksListBySubscription200Response + | VirtualNetworksListBySubscriptionDefaultResponse, +): response is VirtualNetworksListBySubscriptionDefaultResponse; +export function isUnexpected( + response: + | VirtualMachineTemplatesGet200Response + | VirtualMachineTemplatesGetDefaultResponse, +): response is VirtualMachineTemplatesGetDefaultResponse; +export function isUnexpected( + response: + | VirtualMachineTemplatesCreateOrUpdate200Response + | VirtualMachineTemplatesCreateOrUpdate201Response + | VirtualMachineTemplatesCreateOrUpdateLogicalResponse + | VirtualMachineTemplatesCreateOrUpdateDefaultResponse, +): response is VirtualMachineTemplatesCreateOrUpdateDefaultResponse; +export function isUnexpected( + response: + | VirtualMachineTemplatesUpdate200Response + | VirtualMachineTemplatesUpdate202Response + | VirtualMachineTemplatesUpdateLogicalResponse + | VirtualMachineTemplatesUpdateDefaultResponse, +): response is VirtualMachineTemplatesUpdateDefaultResponse; +export function isUnexpected( + response: + | VirtualMachineTemplatesDelete202Response + | VirtualMachineTemplatesDelete204Response + | VirtualMachineTemplatesDeleteLogicalResponse + | VirtualMachineTemplatesDeleteDefaultResponse, +): response is VirtualMachineTemplatesDeleteDefaultResponse; +export function isUnexpected( + response: + | VirtualMachineTemplatesListByResourceGroup200Response + | VirtualMachineTemplatesListByResourceGroupDefaultResponse, +): response is VirtualMachineTemplatesListByResourceGroupDefaultResponse; +export function isUnexpected( + response: + | VirtualMachineTemplatesListBySubscription200Response + | VirtualMachineTemplatesListBySubscriptionDefaultResponse, +): response is VirtualMachineTemplatesListBySubscriptionDefaultResponse; +export function isUnexpected( + response: AvailabilitySetsGet200Response | AvailabilitySetsGetDefaultResponse, +): response is AvailabilitySetsGetDefaultResponse; +export function isUnexpected( + response: + | AvailabilitySetsCreateOrUpdate200Response + | AvailabilitySetsCreateOrUpdate201Response + | AvailabilitySetsCreateOrUpdateLogicalResponse + | AvailabilitySetsCreateOrUpdateDefaultResponse, +): response is AvailabilitySetsCreateOrUpdateDefaultResponse; +export function isUnexpected( + response: + | AvailabilitySetsUpdate200Response + | AvailabilitySetsUpdate202Response + | AvailabilitySetsUpdateLogicalResponse + | AvailabilitySetsUpdateDefaultResponse, +): response is AvailabilitySetsUpdateDefaultResponse; +export function isUnexpected( + response: + | AvailabilitySetsDelete202Response + | AvailabilitySetsDelete204Response + | AvailabilitySetsDeleteLogicalResponse + | AvailabilitySetsDeleteDefaultResponse, +): response is AvailabilitySetsDeleteDefaultResponse; +export function isUnexpected( + response: + | AvailabilitySetsListByResourceGroup200Response + | AvailabilitySetsListByResourceGroupDefaultResponse, +): response is AvailabilitySetsListByResourceGroupDefaultResponse; +export function isUnexpected( + response: + | AvailabilitySetsListBySubscription200Response + | AvailabilitySetsListBySubscriptionDefaultResponse, +): response is AvailabilitySetsListBySubscriptionDefaultResponse; +export function isUnexpected( + response: InventoryItemsGet200Response | InventoryItemsGetDefaultResponse, +): response is InventoryItemsGetDefaultResponse; +export function isUnexpected( + response: + | InventoryItemsCreate200Response + | InventoryItemsCreate201Response + | InventoryItemsCreateDefaultResponse, +): response is InventoryItemsCreateDefaultResponse; +export function isUnexpected( + response: + | InventoryItemsDelete200Response + | InventoryItemsDelete204Response + | InventoryItemsDeleteDefaultResponse, +): response is InventoryItemsDeleteDefaultResponse; +export function isUnexpected( + response: + | InventoryItemsListByVmmServer200Response + | InventoryItemsListByVmmServerDefaultResponse, +): response is InventoryItemsListByVmmServerDefaultResponse; +export function isUnexpected( + response: + | VirtualMachineInstancesGet200Response + | VirtualMachineInstancesGetDefaultResponse, +): response is VirtualMachineInstancesGetDefaultResponse; +export function isUnexpected( + response: + | VirtualMachineInstancesCreateOrUpdate200Response + | VirtualMachineInstancesCreateOrUpdate201Response + | VirtualMachineInstancesCreateOrUpdateLogicalResponse + | VirtualMachineInstancesCreateOrUpdateDefaultResponse, +): response is VirtualMachineInstancesCreateOrUpdateDefaultResponse; +export function isUnexpected( + response: + | VirtualMachineInstancesUpdate200Response + | VirtualMachineInstancesUpdate202Response + | VirtualMachineInstancesUpdateLogicalResponse + | VirtualMachineInstancesUpdateDefaultResponse, +): response is VirtualMachineInstancesUpdateDefaultResponse; +export function isUnexpected( + response: + | VirtualMachineInstancesDelete202Response + | VirtualMachineInstancesDelete204Response + | VirtualMachineInstancesDeleteLogicalResponse + | VirtualMachineInstancesDeleteDefaultResponse, +): response is VirtualMachineInstancesDeleteDefaultResponse; +export function isUnexpected( + response: + | VirtualMachineInstancesList200Response + | VirtualMachineInstancesListDefaultResponse, +): response is VirtualMachineInstancesListDefaultResponse; +export function isUnexpected( + response: + | VirtualMachineInstancesStop202Response + | VirtualMachineInstancesStopLogicalResponse + | VirtualMachineInstancesStopDefaultResponse, +): response is VirtualMachineInstancesStopDefaultResponse; +export function isUnexpected( + response: + | VirtualMachineInstancesStart202Response + | VirtualMachineInstancesStartLogicalResponse + | VirtualMachineInstancesStartDefaultResponse, +): response is VirtualMachineInstancesStartDefaultResponse; +export function isUnexpected( + response: + | VirtualMachineInstancesRestart202Response + | VirtualMachineInstancesRestartLogicalResponse + | VirtualMachineInstancesRestartDefaultResponse, +): response is VirtualMachineInstancesRestartDefaultResponse; +export function isUnexpected( + response: + | VirtualMachineInstancesCreateCheckpoint202Response + | VirtualMachineInstancesCreateCheckpointLogicalResponse + | VirtualMachineInstancesCreateCheckpointDefaultResponse, +): response is VirtualMachineInstancesCreateCheckpointDefaultResponse; +export function isUnexpected( + response: + | VirtualMachineInstancesDeleteCheckpoint202Response + | VirtualMachineInstancesDeleteCheckpointLogicalResponse + | VirtualMachineInstancesDeleteCheckpointDefaultResponse, +): response is VirtualMachineInstancesDeleteCheckpointDefaultResponse; +export function isUnexpected( + response: + | VirtualMachineInstancesRestoreCheckpoint202Response + | VirtualMachineInstancesRestoreCheckpointLogicalResponse + | VirtualMachineInstancesRestoreCheckpointDefaultResponse, +): response is VirtualMachineInstancesRestoreCheckpointDefaultResponse; +export function isUnexpected( + response: + | VmInstanceHybridIdentityMetadatasGet200Response + | VmInstanceHybridIdentityMetadatasGetDefaultResponse, +): response is VmInstanceHybridIdentityMetadatasGetDefaultResponse; +export function isUnexpected( + response: + | VmInstanceHybridIdentityMetadatasListByVirtualMachineInstance200Response + | VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceDefaultResponse, +): response is VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceDefaultResponse; +export function isUnexpected( + response: GuestAgentsGet200Response | GuestAgentsGetDefaultResponse, +): response is GuestAgentsGetDefaultResponse; +export function isUnexpected( + response: + | GuestAgentsCreate200Response + | GuestAgentsCreate201Response + | GuestAgentsCreateLogicalResponse + | GuestAgentsCreateDefaultResponse, +): response is GuestAgentsCreateDefaultResponse; +export function isUnexpected( + response: + | GuestAgentsDelete200Response + | GuestAgentsDelete204Response + | GuestAgentsDeleteDefaultResponse, +): response is GuestAgentsDeleteDefaultResponse; +export function isUnexpected( + response: + | GuestAgentsListByVirtualMachineInstance200Response + | GuestAgentsListByVirtualMachineInstanceDefaultResponse, +): response is GuestAgentsListByVirtualMachineInstanceDefaultResponse; +export function isUnexpected( + response: + | OperationsList200Response + | OperationsListDefaultResponse + | VmmServersGet200Response + | VmmServersGetDefaultResponse + | VmmServersCreateOrUpdate200Response + | VmmServersCreateOrUpdate201Response + | VmmServersCreateOrUpdateLogicalResponse + | VmmServersCreateOrUpdateDefaultResponse + | VmmServersUpdate200Response + | VmmServersUpdate202Response + | VmmServersUpdateLogicalResponse + | VmmServersUpdateDefaultResponse + | VmmServersDelete202Response + | VmmServersDelete204Response + | VmmServersDeleteLogicalResponse + | VmmServersDeleteDefaultResponse + | VmmServersListByResourceGroup200Response + | VmmServersListByResourceGroupDefaultResponse + | VmmServersListBySubscription200Response + | VmmServersListBySubscriptionDefaultResponse + | CloudsGet200Response + | CloudsGetDefaultResponse + | CloudsCreateOrUpdate200Response + | CloudsCreateOrUpdate201Response + | CloudsCreateOrUpdateLogicalResponse + | CloudsCreateOrUpdateDefaultResponse + | CloudsUpdate200Response + | CloudsUpdate202Response + | CloudsUpdateLogicalResponse + | CloudsUpdateDefaultResponse + | CloudsDelete202Response + | CloudsDelete204Response + | CloudsDeleteLogicalResponse + | CloudsDeleteDefaultResponse + | CloudsListByResourceGroup200Response + | CloudsListByResourceGroupDefaultResponse + | CloudsListBySubscription200Response + | CloudsListBySubscriptionDefaultResponse + | VirtualNetworksGet200Response + | VirtualNetworksGetDefaultResponse + | VirtualNetworksCreateOrUpdate200Response + | VirtualNetworksCreateOrUpdate201Response + | VirtualNetworksCreateOrUpdateLogicalResponse + | VirtualNetworksCreateOrUpdateDefaultResponse + | VirtualNetworksUpdate200Response + | VirtualNetworksUpdate202Response + | VirtualNetworksUpdateLogicalResponse + | VirtualNetworksUpdateDefaultResponse + | VirtualNetworksDelete202Response + | VirtualNetworksDelete204Response + | VirtualNetworksDeleteLogicalResponse + | VirtualNetworksDeleteDefaultResponse + | VirtualNetworksListByResourceGroup200Response + | VirtualNetworksListByResourceGroupDefaultResponse + | VirtualNetworksListBySubscription200Response + | VirtualNetworksListBySubscriptionDefaultResponse + | VirtualMachineTemplatesGet200Response + | VirtualMachineTemplatesGetDefaultResponse + | VirtualMachineTemplatesCreateOrUpdate200Response + | VirtualMachineTemplatesCreateOrUpdate201Response + | VirtualMachineTemplatesCreateOrUpdateLogicalResponse + | VirtualMachineTemplatesCreateOrUpdateDefaultResponse + | VirtualMachineTemplatesUpdate200Response + | VirtualMachineTemplatesUpdate202Response + | VirtualMachineTemplatesUpdateLogicalResponse + | VirtualMachineTemplatesUpdateDefaultResponse + | VirtualMachineTemplatesDelete202Response + | VirtualMachineTemplatesDelete204Response + | VirtualMachineTemplatesDeleteLogicalResponse + | VirtualMachineTemplatesDeleteDefaultResponse + | VirtualMachineTemplatesListByResourceGroup200Response + | VirtualMachineTemplatesListByResourceGroupDefaultResponse + | VirtualMachineTemplatesListBySubscription200Response + | VirtualMachineTemplatesListBySubscriptionDefaultResponse + | AvailabilitySetsGet200Response + | AvailabilitySetsGetDefaultResponse + | AvailabilitySetsCreateOrUpdate200Response + | AvailabilitySetsCreateOrUpdate201Response + | AvailabilitySetsCreateOrUpdateLogicalResponse + | AvailabilitySetsCreateOrUpdateDefaultResponse + | AvailabilitySetsUpdate200Response + | AvailabilitySetsUpdate202Response + | AvailabilitySetsUpdateLogicalResponse + | AvailabilitySetsUpdateDefaultResponse + | AvailabilitySetsDelete202Response + | AvailabilitySetsDelete204Response + | AvailabilitySetsDeleteLogicalResponse + | AvailabilitySetsDeleteDefaultResponse + | AvailabilitySetsListByResourceGroup200Response + | AvailabilitySetsListByResourceGroupDefaultResponse + | AvailabilitySetsListBySubscription200Response + | AvailabilitySetsListBySubscriptionDefaultResponse + | InventoryItemsGet200Response + | InventoryItemsGetDefaultResponse + | InventoryItemsCreate200Response + | InventoryItemsCreate201Response + | InventoryItemsCreateDefaultResponse + | InventoryItemsDelete200Response + | InventoryItemsDelete204Response + | InventoryItemsDeleteDefaultResponse + | InventoryItemsListByVmmServer200Response + | InventoryItemsListByVmmServerDefaultResponse + | VirtualMachineInstancesGet200Response + | VirtualMachineInstancesGetDefaultResponse + | VirtualMachineInstancesCreateOrUpdate200Response + | VirtualMachineInstancesCreateOrUpdate201Response + | VirtualMachineInstancesCreateOrUpdateLogicalResponse + | VirtualMachineInstancesCreateOrUpdateDefaultResponse + | VirtualMachineInstancesUpdate200Response + | VirtualMachineInstancesUpdate202Response + | VirtualMachineInstancesUpdateLogicalResponse + | VirtualMachineInstancesUpdateDefaultResponse + | VirtualMachineInstancesDelete202Response + | VirtualMachineInstancesDelete204Response + | VirtualMachineInstancesDeleteLogicalResponse + | VirtualMachineInstancesDeleteDefaultResponse + | VirtualMachineInstancesList200Response + | VirtualMachineInstancesListDefaultResponse + | VirtualMachineInstancesStop202Response + | VirtualMachineInstancesStopLogicalResponse + | VirtualMachineInstancesStopDefaultResponse + | VirtualMachineInstancesStart202Response + | VirtualMachineInstancesStartLogicalResponse + | VirtualMachineInstancesStartDefaultResponse + | VirtualMachineInstancesRestart202Response + | VirtualMachineInstancesRestartLogicalResponse + | VirtualMachineInstancesRestartDefaultResponse + | VirtualMachineInstancesCreateCheckpoint202Response + | VirtualMachineInstancesCreateCheckpointLogicalResponse + | VirtualMachineInstancesCreateCheckpointDefaultResponse + | VirtualMachineInstancesDeleteCheckpoint202Response + | VirtualMachineInstancesDeleteCheckpointLogicalResponse + | VirtualMachineInstancesDeleteCheckpointDefaultResponse + | VirtualMachineInstancesRestoreCheckpoint202Response + | VirtualMachineInstancesRestoreCheckpointLogicalResponse + | VirtualMachineInstancesRestoreCheckpointDefaultResponse + | VmInstanceHybridIdentityMetadatasGet200Response + | VmInstanceHybridIdentityMetadatasGetDefaultResponse + | VmInstanceHybridIdentityMetadatasListByVirtualMachineInstance200Response + | VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceDefaultResponse + | GuestAgentsGet200Response + | GuestAgentsGetDefaultResponse + | GuestAgentsCreate200Response + | GuestAgentsCreate201Response + | GuestAgentsCreateLogicalResponse + | GuestAgentsCreateDefaultResponse + | GuestAgentsDelete200Response + | GuestAgentsDelete204Response + | GuestAgentsDeleteDefaultResponse + | GuestAgentsListByVirtualMachineInstance200Response + | GuestAgentsListByVirtualMachineInstanceDefaultResponse, +): response is + | OperationsListDefaultResponse + | VmmServersGetDefaultResponse + | VmmServersCreateOrUpdateDefaultResponse + | VmmServersUpdateDefaultResponse + | VmmServersDeleteDefaultResponse + | VmmServersListByResourceGroupDefaultResponse + | VmmServersListBySubscriptionDefaultResponse + | CloudsGetDefaultResponse + | CloudsCreateOrUpdateDefaultResponse + | CloudsUpdateDefaultResponse + | CloudsDeleteDefaultResponse + | CloudsListByResourceGroupDefaultResponse + | CloudsListBySubscriptionDefaultResponse + | VirtualNetworksGetDefaultResponse + | VirtualNetworksCreateOrUpdateDefaultResponse + | VirtualNetworksUpdateDefaultResponse + | VirtualNetworksDeleteDefaultResponse + | VirtualNetworksListByResourceGroupDefaultResponse + | VirtualNetworksListBySubscriptionDefaultResponse + | VirtualMachineTemplatesGetDefaultResponse + | VirtualMachineTemplatesCreateOrUpdateDefaultResponse + | VirtualMachineTemplatesUpdateDefaultResponse + | VirtualMachineTemplatesDeleteDefaultResponse + | VirtualMachineTemplatesListByResourceGroupDefaultResponse + | VirtualMachineTemplatesListBySubscriptionDefaultResponse + | AvailabilitySetsGetDefaultResponse + | AvailabilitySetsCreateOrUpdateDefaultResponse + | AvailabilitySetsUpdateDefaultResponse + | AvailabilitySetsDeleteDefaultResponse + | AvailabilitySetsListByResourceGroupDefaultResponse + | AvailabilitySetsListBySubscriptionDefaultResponse + | InventoryItemsGetDefaultResponse + | InventoryItemsCreateDefaultResponse + | InventoryItemsDeleteDefaultResponse + | InventoryItemsListByVmmServerDefaultResponse + | VirtualMachineInstancesGetDefaultResponse + | VirtualMachineInstancesCreateOrUpdateDefaultResponse + | VirtualMachineInstancesUpdateDefaultResponse + | VirtualMachineInstancesDeleteDefaultResponse + | VirtualMachineInstancesListDefaultResponse + | VirtualMachineInstancesStopDefaultResponse + | VirtualMachineInstancesStartDefaultResponse + | VirtualMachineInstancesRestartDefaultResponse + | VirtualMachineInstancesCreateCheckpointDefaultResponse + | VirtualMachineInstancesDeleteCheckpointDefaultResponse + | VirtualMachineInstancesRestoreCheckpointDefaultResponse + | VmInstanceHybridIdentityMetadatasGetDefaultResponse + | VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceDefaultResponse + | GuestAgentsGetDefaultResponse + | GuestAgentsCreateDefaultResponse + | GuestAgentsDeleteDefaultResponse + | GuestAgentsListByVirtualMachineInstanceDefaultResponse { + const lroOriginal = response.headers["x-ms-original-url"]; + const url = new URL(lroOriginal ?? response.request.url); + const method = response.request.method; + let pathDetails = responseMap[`${method} ${url.pathname}`]; + if (!pathDetails) { + pathDetails = getParametrizedPathSuccess(method, url.pathname); + } + return !pathDetails.includes(response.status); +} + +function getParametrizedPathSuccess(method: string, path: string): string[] { + const pathParts = path.split("/"); + + // Traverse list to match the longest candidate + // matchedLen: the length of candidate path + // matchedValue: the matched status code array + let matchedLen = -1, + matchedValue: string[] = []; + + // Iterate the responseMap to find a match + for (const [key, value] of Object.entries(responseMap)) { + // Extracting the path from the map key which is in format + // GET /path/foo + if (!key.startsWith(method)) { + continue; + } + const candidatePath = getPathFromMapKey(key); + // Get each part of the url path + const candidateParts = candidatePath.split("/"); + + // track if we have found a match to return the values found. + let found = true; + for ( + let i = candidateParts.length - 1, j = pathParts.length - 1; + i >= 1 && j >= 1; + i--, j-- + ) { + if ( + candidateParts[i]?.startsWith("{") && + candidateParts[i]?.indexOf("}") !== -1 + ) { + const start = candidateParts[i]!.indexOf("}") + 1, + end = candidateParts[i]?.length; + // If the current part of the candidate is a "template" part + // Try to use the suffix of pattern to match the path + // {guid} ==> $ + // {guid}:export ==> :export$ + const isMatched = new RegExp( + `${candidateParts[i]?.slice(start, end)}`, + ).test(pathParts[j] || ""); + + if (!isMatched) { + found = false; + break; + } + continue; + } + + // If the candidate part is not a template and + // the parts don't match mark the candidate as not found + // to move on with the next candidate path. + if (candidateParts[i] !== pathParts[j]) { + found = false; + break; + } + } + + // We finished evaluating the current candidate parts + // Update the matched value if and only if we found the longer pattern + if (found && candidatePath.length > matchedLen) { + matchedLen = candidatePath.length; + matchedValue = value; + } + } + + return matchedValue; +} + +function getPathFromMapKey(mapKey: string): string { + const pathStart = mapKey.indexOf("/"); + return mapKey.slice(pathStart); +} diff --git a/sdk/scvmm/arm-scvmm/src/rest/models.ts b/sdk/scvmm/arm-scvmm/src/rest/models.ts new file mode 100644 index 000000000000..8dc7762694f7 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/rest/models.ts @@ -0,0 +1,779 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +/** The VmmServers resource definition. */ +export interface VmmServer extends TrackedResource { + /** The resource-specific properties for this resource. */ + properties?: VmmServerProperties; + /** The extended location. */ + extendedLocation: ExtendedLocation; +} + +/** Defines the resource properties. */ +export interface VmmServerProperties { + /** Credentials to connect to VmmServer. */ + credentials?: VmmCredential; + /** Fqdn is the hostname/ip of the vmmServer. */ + fqdn: string; + /** Port is the port on which the vmmServer is listening. */ + port?: number; +} + +/** Credentials to connect to VmmServer. */ +export interface VmmCredential { + /** Username to use to connect to VmmServer. */ + username?: string; + /** Password to use to connect to VmmServer. */ + password?: string; +} + +/** The extended location. */ +export interface ExtendedLocation { + /** The extended location type. */ + type?: string; + /** The extended location name. */ + name?: string; +} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: Record; + /** The geo-location where the resource lives */ + location: string; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource {} + +/** 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. + * + * Possible values: "User", "Application", "ManagedIdentity", "Key" + */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date | string; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** + * The type of identity that last modified the resource. + * + * Possible values: "User", "Application", "ManagedIdentity", "Key" + */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date | string; +} + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + +/** Defines the inventory item. */ +export interface InventoryItem extends ProxyResource { + /** The resource-specific properties for this resource. */ + properties?: InventoryItemProperties; + /** 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; +} + +/** Defines the resource properties. */ +export interface InventoryItemPropertiesParent { + inventoryType: InventoryType; +} + +/** The Cloud inventory item. */ +export interface CloudInventoryItem extends InventoryItemPropertiesParent { + /** They inventory type. */ + inventoryType: "Cloud"; +} + +/** The Virtual network inventory item. */ +export interface VirtualNetworkInventoryItem + extends InventoryItemPropertiesParent { + /** They inventory type. */ + inventoryType: "VirtualNetwork"; +} + +/** The Virtual machine template inventory item. */ +export interface VirtualMachineTemplateInventoryItem + extends InventoryItemPropertiesParent { + /** They inventory type. */ + inventoryType: "VirtualMachineTemplate"; +} + +/** The Virtual machine inventory item. */ +export interface VirtualMachineInventoryItem + extends InventoryItemPropertiesParent { + /** Gets or sets the nic ip addresses. */ + ipAddresses?: string[]; + /** Cloud inventory resource details where the VM is present. */ + cloud?: InventoryItemDetails; + /** They inventory type. */ + inventoryType: "VirtualMachine"; +} + +/** Defines the resource properties. */ +export interface InventoryItemDetails { + /** Gets or sets the inventory Item ID for the resource. */ + inventoryItemId?: string; + /** Gets or sets the Managed Object name in Vmm for the resource. */ + inventoryItemName?: string; +} + +/** Defines the HybridIdentityMetadata. */ +export interface VmInstanceHybridIdentityMetadata extends ProxyResource { + /** The resource-specific properties for this resource. */ + properties?: VmInstanceHybridIdentityMetadataProperties; +} + +/** Describes the properties of Hybrid Identity Metadata for a Virtual Machine. */ +export interface VmInstanceHybridIdentityMetadataProperties { + /** The unique identifier for the resource. */ + resourceUid?: string; + /** Gets or sets the Public Key. */ + publicKey?: string; +} + +/** Defines the GuestAgent. */ +export interface GuestAgent extends ProxyResource { + /** The resource-specific properties for this resource. */ + properties?: GuestAgentProperties; +} + +/** Defines the resource properties. */ +export interface GuestAgentProperties { + /** 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. + * + * Possible values: "install", "uninstall", "repair" + */ + provisioningAction?: ProvisioningAction; + /** The resource id of the private link scope this machine is assigned to, if any. */ + privateLinkScopeResourceId?: 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; +} + +/** The base extension resource. */ +export interface ExtensionResource extends Resource {} + +/** Define the virtualMachineInstance. */ +export interface VirtualMachineInstance extends ExtensionResource { + /** The resource-specific properties for this resource. */ + properties?: VirtualMachineInstanceProperties; + /** Gets or sets the extended location. */ + extendedLocation: ExtendedLocation; +} + +/** Defines the resource properties. */ +export interface VirtualMachineInstanceProperties { + /** Availability Sets in vm. */ + availabilitySets?: Array; + /** OS properties. */ + osProfile?: OsProfileForVmInstance; + /** Hardware properties. */ + hardwareProfile?: HardwareProfile; + /** Network properties. */ + networkProfile?: NetworkProfile; + /** Storage properties. */ + storageProfile?: StorageProfile; + /** Gets the infrastructure profile. */ + infrastructureProfile?: InfrastructureProfile; +} + +/** Availability Set model */ +export interface AvailabilitySetListItem { + /** Gets the ARM Id of the microsoft.scvmm/availabilitySets resource. */ + id?: string; + /** Gets or sets the name of the availability set. */ + name?: string; +} + +/** Defines the resource properties. */ +export interface OsProfileForVmInstance { + /** Admin password of the virtual machine. */ + adminPassword?: string; + /** Gets or sets computer name. */ + computerName?: string; + /** Gets or sets the domain name. */ + domainName?: string; + /** Gets or sets the domain username. */ + domainUsername?: string; + /** Password of the domain the VM has to join. */ + domainPassword?: string; + /** Gets or sets the workgroup. */ + workgroup?: string; + /** Gets or sets the product key.Input format xxxxx-xxxxx-xxxxx-xxxxx-xxxxx */ + productKey?: string; + /** Gets or sets the index value of the timezone. */ + timezone?: number; + /** Get or sets the commands to be run once at the time of creation separated by semicolons. */ + runOnceCommands?: string; +} + +/** Defines the resource properties. */ +export interface HardwareProfile { + /** MemoryMB is the size of a virtual machine's memory, in MB. */ + memoryMB?: number; + /** Gets or sets the number of vCPUs for the vm. */ + cpuCount?: number; + /** + * Gets or sets a value indicating whether to enable processor compatibility mode for live migration of VMs. + * + * Possible values: "true", "false" + */ + limitCpuForMigration?: LimitCpuForMigration; + /** + * Gets or sets a value indicating whether to enable dynamic memory or not. + * + * Possible values: "true", "false" + */ + dynamicMemoryEnabled?: DynamicMemoryEnabled; + /** Gets or sets the max dynamic memory for the vm. */ + dynamicMemoryMaxMB?: number; + /** Gets or sets the min dynamic memory for the vm. */ + dynamicMemoryMinMB?: number; +} + +/** Defines the resource properties. */ +export interface NetworkProfile { + /** Gets or sets the list of network interfaces associated with the virtual machine. */ + networkInterfaces?: Array; +} + +/** Network Interface model */ +export interface NetworkInterface { + /** Gets or sets the name of the network interface. */ + name?: string; + /** Gets or sets the nic MAC address. */ + macAddress?: string; + /** Gets or sets the ARM Id of the Microsoft.ScVmm/virtualNetwork resource to connect the nic. */ + virtualNetworkId?: string; + /** + * Gets or sets the ipv4 address type. + * + * Possible values: "Dynamic", "Static" + */ + ipv4AddressType?: AllocationMethod; + /** + * Gets or sets the ipv6 address type. + * + * Possible values: "Dynamic", "Static" + */ + ipv6AddressType?: AllocationMethod; + /** + * Gets or sets the mac address type. + * + * Possible values: "Dynamic", "Static" + */ + macAddressType?: AllocationMethod; + /** Gets or sets the nic id. */ + nicId?: string; +} + +/** Defines the resource properties. */ +export interface StorageProfile { + /** Gets or sets the list of virtual disks associated with the virtual machine. */ + disks?: Array; +} + +/** Virtual disk model */ +export interface VirtualDisk { + /** Gets or sets the name of the disk. */ + name?: string; + /** Gets or sets the disk id. */ + diskId?: string; + /** Gets or sets the disk total size. */ + diskSizeGB?: number; + /** Gets or sets the disk bus. */ + bus?: number; + /** Gets or sets the disk lun. */ + lun?: number; + /** Gets or sets the disk bus type. */ + busType?: string; + /** Gets or sets the disk vhd type. */ + vhdType?: string; + /** Gets or sets the disk id in the template. */ + templateDiskId?: string; + /** The QoS policy for the disk. */ + storageQoSPolicy?: StorageQosPolicyDetails; + /** + * Gets or sets a value indicating diff disk. + * + * Possible values: "true", "false" + */ + createDiffDisk?: CreateDiffDisk; +} + +/** The StorageQoSPolicyDetails definition. */ +export interface StorageQosPolicyDetails { + /** The name of the policy. */ + name?: string; + /** The ID of the QoS policy. */ + id?: string; +} + +/** Specifies the vmmServer infrastructure specific settings for the virtual machine instance. */ +export interface InfrastructureProfile { + /** Gets or sets the inventory Item ID for the resource. */ + inventoryItemId?: string; + /** ARM Id of the vmmServer resource in which this resource resides. */ + vmmServerId?: string; + /** ARM Id of the cloud resource to use for deploying the vm. */ + cloudId?: string; + /** ARM Id of the template resource to use for deploying the vm. */ + templateId?: string; + /** VMName is the name of VM on the SCVmm server. */ + vmName?: string; + /** Unique ID of the virtual machine. */ + uuid?: string; + /** Type of checkpoint supported for the vm. */ + checkpointType?: string; + /** Gets or sets the generation for the vm. */ + generation?: number; + /** Gets or sets the bios guid for the vm. */ + biosGuid?: string; +} + +/** Defines the resource properties. */ +export interface Checkpoint { + /** Gets ID of parent of the checkpoint. */ + parentCheckpointID?: string; + /** Gets ID of the checkpoint. */ + checkpointID?: string; + /** Gets name of the checkpoint. */ + name?: string; + /** Gets description of the checkpoint. */ + description?: string; +} + +/** The resource model definition for an Azure Resource Manager resource with an etag. */ +export interface AzureEntityResource extends Resource {} + +/** A private link resource. */ +export interface PrivateLinkResource extends Resource { + /** Resource properties. */ + properties?: PrivateLinkResourceProperties; +} + +/** Properties of a private link resource. */ +export interface PrivateLinkResourceProperties { + /** The private link resource private link DNS zone name. */ + requiredZoneNames?: string[]; +} + +/** The private endpoint connection resource */ +export interface PrivateEndpointConnection extends Resource { + /** The private endpoint connection properties */ + properties?: PrivateEndpointConnectionProperties; +} + +/** Properties of the private endpoint connection. */ +export interface PrivateEndpointConnectionProperties { + /** The private endpoint resource. */ + privateEndpoint?: PrivateEndpoint; + /** A collection of information about the state of the connection between service consumer and provider. */ + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; +} + +/** The Private Endpoint resource. */ +export interface PrivateEndpoint {} + +/** A collection of information about the state of the connection between service consumer and provider. */ +export interface PrivateLinkServiceConnectionState { + /** + * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + * + * Possible values: "Pending", "Approved", "Rejected" + */ + status?: PrivateEndpointServiceConnectionStatus; + /** The reason for approval/rejection of the connection. */ + description?: string; + /** A message indicating if changes on the service provider require any updates on the consumer. */ + actionsRequired?: string; +} + +/** The Clouds resource definition. */ +export interface Cloud extends TrackedResource { + /** The resource-specific properties for this resource. */ + properties?: CloudProperties; + /** The extended location. */ + extendedLocation: ExtendedLocation; +} + +/** Defines the resource properties. */ +export interface CloudProperties { + /** Gets or sets the inventory Item ID for the resource. */ + inventoryItemId?: string; + /** Unique ID of the cloud. */ + uuid?: string; + /** ARM Id of the vmmServer resource in which this resource resides. */ + vmmServerId?: string; +} + +/** Cloud Capacity model */ +export interface CloudCapacity {} + +/** The StorageQoSPolicy definition. */ +export interface StorageQosPolicy { + /** The name of the policy. */ + name?: string; + /** The ID of the QoS policy. */ + id?: string; + /** The maximum IO operations per second. */ + iopsMaximum?: number; + /** The minimum IO operations per second. */ + iopsMinimum?: number; + /** The Bandwidth Limit for internet traffic. */ + bandwidthLimit?: number; + /** The underlying policy. */ + policyId?: string; +} + +/** The VirtualNetworks resource definition. */ +export interface VirtualNetwork extends TrackedResource { + /** The resource-specific properties for this resource. */ + properties?: VirtualNetworkProperties; + /** The extended location. */ + extendedLocation: ExtendedLocation; +} + +/** Defines the resource properties. */ +export interface VirtualNetworkProperties { + /** Gets or sets the inventory Item ID for the resource. */ + inventoryItemId?: string; + /** Unique ID of the virtual network. */ + uuid?: string; + /** ARM Id of the vmmServer resource in which this resource resides. */ + vmmServerId?: string; +} + +/** The VirtualMachineTemplates resource definition. */ +export interface VirtualMachineTemplate extends TrackedResource { + /** The resource-specific properties for this resource. */ + properties?: VirtualMachineTemplateProperties; + /** The extended location. */ + extendedLocation: ExtendedLocation; +} + +/** Defines the resource properties. */ +export interface VirtualMachineTemplateProperties { + /** Gets or sets the inventory Item ID for the resource. */ + inventoryItemId?: string; + /** Unique ID of the virtual machine template. */ + uuid?: string; + /** ARM Id of the vmmServer resource in which this resource resides. */ + vmmServerId?: string; +} + +/** The AvailabilitySets resource definition. */ +export interface AvailabilitySet extends TrackedResource { + /** The resource-specific properties for this resource. */ + properties?: AvailabilitySetProperties; + /** The extended location. */ + extendedLocation: ExtendedLocation; +} + +/** Defines the resource properties. */ +export interface AvailabilitySetProperties { + /** Name of the availability set. */ + availabilitySetName?: string; + /** ARM Id of the vmmServer resource in which this resource resides. */ + vmmServerId?: string; +} + +/** The resource model definition containing the full set of allowed properties for a resource. Except properties bag, there cannot be a top level property outside of this set. */ +export interface ResourceModelWithAllowedPropertySet extends TrackedResource { + /** + * The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. + * If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. + */ + managedBy?: 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 etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. + * Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), + * If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + */ + eTag?: string; + identity?: Identity; + sku?: Sku; + plan?: Plan; +} + +/** Identity for the resource. */ +export interface Identity { + /** The identity type. */ + type?: ResourceIdentityType; +} + +/** The resource model definition representing SKU */ +export interface Sku { + /** The name of the SKU. Ex - P3. It is typically a letter+number code */ + name: string; + /** This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. */ + tier?: SkuTier; + /** The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. */ + size?: string; + /** If the service has different generations of hardware, for the same SKU, then that can be captured here. */ + family?: string; + /** If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. */ + capacity?: number; +} + +/** Plan for the resource. */ +export interface Plan { + /** A user defined name of the 3rd Party Artifact that is being procured. */ + name: string; + /** The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic */ + publisher: string; + /** The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. */ + product: string; + /** A publisher provided promotion code as provisioned in Data Market for the said product/artifact. */ + promotionCode?: string; + /** The version of the desired product/artifact. */ + version?: string; +} + +/** The type used for updating tags in VmmServer resources. */ +export interface VmmServerTagsUpdate { + /** Resource tags. */ + tags?: Record; +} + +/** The type used for updating tags in Cloud resources. */ +export interface CloudTagsUpdate { + /** Resource tags. */ + tags?: Record; +} + +/** The type used for updating tags in VirtualNetwork resources. */ +export interface VirtualNetworkTagsUpdate { + /** Resource tags. */ + tags?: Record; +} + +/** The type used for updating tags in VirtualMachineTemplate resources. */ +export interface VirtualMachineTemplateTagsUpdate { + /** Resource tags. */ + tags?: Record; +} + +/** The type used for updating tags in AvailabilitySet resources. */ +export interface AvailabilitySetTagsUpdate { + /** Resource tags. */ + tags?: Record; +} + +/** The type used for update operations of the VirtualMachineInstance. */ +export interface VirtualMachineInstanceUpdate { + /** The update properties of the VirtualMachineInstance. */ + properties?: VirtualMachineInstanceUpdateProperties; +} + +/** Virtual Machine Instance Properties Update model */ +export interface VirtualMachineInstanceUpdateProperties { + /** Availability Sets in vm. */ + availabilitySets?: Array; + /** Hardware properties. */ + hardwareProfile?: HardwareProfileUpdate; + /** Network properties. */ + networkProfile?: NetworkProfileUpdate; + /** Storage properties. */ + storageProfile?: StorageProfileUpdate; + /** Gets the infrastructure profile. */ + infrastructureProfile?: InfrastructureProfileUpdate; +} + +/** Defines the resource update properties. */ +export interface HardwareProfileUpdate { + /** MemoryMB is the size of a virtual machine's memory, in MB. */ + memoryMB?: number; + /** Gets or sets the number of vCPUs for the vm. */ + cpuCount?: number; + /** + * Gets or sets a value indicating whether to enable processor compatibility mode for live migration of VMs. + * + * Possible values: "true", "false" + */ + limitCpuForMigration?: LimitCpuForMigration; + /** + * Gets or sets a value indicating whether to enable dynamic memory or not. + * + * Possible values: "true", "false" + */ + dynamicMemoryEnabled?: DynamicMemoryEnabled; + /** Gets or sets the max dynamic memory for the vm. */ + dynamicMemoryMaxMB?: number; + /** Gets or sets the min dynamic memory for the vm. */ + dynamicMemoryMinMB?: number; +} + +/** Defines the resource update properties. */ +export interface NetworkProfileUpdate { + /** Gets or sets the list of network interfaces associated with the virtual machine. */ + networkInterfaces?: Array; +} + +/** Network Interface Update model */ +export interface NetworkInterfaceUpdate { + /** Gets or sets the name of the network interface. */ + name?: string; + /** Gets or sets the nic MAC address. */ + macAddress?: string; + /** Gets or sets the ARM Id of the Microsoft.ScVmm/virtualNetwork resource to connect the nic. */ + virtualNetworkId?: string; + /** + * Gets or sets the ipv4 address type. + * + * Possible values: "Dynamic", "Static" + */ + ipv4AddressType?: AllocationMethod; + /** + * Gets or sets the ipv6 address type. + * + * Possible values: "Dynamic", "Static" + */ + ipv6AddressType?: AllocationMethod; + /** + * Gets or sets the mac address type. + * + * Possible values: "Dynamic", "Static" + */ + macAddressType?: AllocationMethod; + /** Gets or sets the nic id. */ + nicId?: string; +} + +/** Defines the resource update properties. */ +export interface StorageProfileUpdate { + /** Gets or sets the list of virtual disks associated with the virtual machine. */ + disks?: Array; +} + +/** Virtual Disk Update model */ +export interface VirtualDiskUpdate { + /** Gets or sets the name of the disk. */ + name?: string; + /** Gets or sets the disk id. */ + diskId?: string; + /** Gets or sets the disk total size. */ + diskSizeGB?: number; + /** Gets or sets the disk bus. */ + bus?: number; + /** Gets or sets the disk lun. */ + lun?: number; + /** Gets or sets the disk bus type. */ + busType?: string; + /** Gets or sets the disk vhd type. */ + vhdType?: string; + /** The QoS policy for the disk. */ + storageQoSPolicy?: StorageQosPolicyDetails; +} + +/** Specifies the vmmServer infrastructure specific update settings for the virtual machine instance. */ +export interface InfrastructureProfileUpdate { + /** Type of checkpoint supported for the vm. */ + checkpointType?: string; +} + +/** 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. + * + * Possible values: "true", "false" + */ + skipShutdown?: SkipShutdown; +} + +/** Defines the create checkpoint action properties. */ +export interface VirtualMachineCreateCheckpoint { + /** Name of the checkpoint. */ + name?: string; + /** Description of the checkpoint. */ + description?: string; +} + +/** Defines the delete checkpoint action properties. */ +export interface VirtualMachineDeleteCheckpoint { + /** ID of the checkpoint to be deleted. */ + id?: string; +} + +/** Defines the restore checkpoint action properties. */ +export interface VirtualMachineRestoreCheckpoint { + /** ID of the checkpoint to be restored to. */ + id?: string; +} + +/** Defines the resource properties. */ +export type InventoryItemProperties = + | InventoryItemPropertiesParent + | CloudInventoryItem + | VirtualNetworkInventoryItem + | VirtualMachineTemplateInventoryItem + | VirtualMachineInventoryItem; +/** Alias for ResourceProvisioningState */ +export type ResourceProvisioningState = string; +/** Alias for ProvisioningState */ +export type ProvisioningState = string; +/** Alias for CreatedByType */ +export type CreatedByType = string; +/** Alias for InventoryType */ +export type InventoryType = string; +/** Alias for OsType */ +export type OsType = string; +/** Alias for ProvisioningAction */ +export type ProvisioningAction = string; +/** Alias for LimitCpuForMigration */ +export type LimitCpuForMigration = string; +/** Alias for DynamicMemoryEnabled */ +export type DynamicMemoryEnabled = string; +/** Alias for IsHighlyAvailable */ +export type IsHighlyAvailable = string; +/** Alias for AllocationMethod */ +export type AllocationMethod = string; +/** Alias for CreateDiffDisk */ +export type CreateDiffDisk = string; +/** Alias for PrivateEndpointServiceConnectionStatus */ +export type PrivateEndpointServiceConnectionStatus = string; +/** Alias for PrivateEndpointConnectionProvisioningState */ +export type PrivateEndpointConnectionProvisioningState = string; +/** Alias for IsCustomizable */ +export type IsCustomizable = string; +/** Alias for ResourceIdentityType */ +export type ResourceIdentityType = "SystemAssigned"; +/** Alias for SkuTier */ +export type SkuTier = "Free" | "Basic" | "Standard" | "Premium"; +/** Alias for ForceDelete */ +export type ForceDelete = string; +/** Alias for DeleteFromHost */ +export type DeleteFromHost = string; +/** Alias for SkipShutdown */ +export type SkipShutdown = string; diff --git a/sdk/scvmm/arm-scvmm/src/rest/outputModels.ts b/sdk/scvmm/arm-scvmm/src/rest/outputModels.ts new file mode 100644 index 000000000000..c8a22a974fe8 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/rest/outputModels.ts @@ -0,0 +1,929 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { Paged } from "@azure/core-paging"; + +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface OperationOutput { + /** The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ + readonly name?: string; + /** Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure Resource Manager/control-plane operations. */ + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + readonly display?: OperationDisplayOutput; + /** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" + * + * Possible values: "user", "system", "user,system" + */ + readonly origin?: OriginOutput; + /** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * + * Possible values: "Internal" + */ + actionType?: ActionTypeOutput; +} + +/** Localized display information for and operation. */ +export interface OperationDisplayOutput { + /** The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". */ + readonly provider?: string; + /** The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". */ + readonly resource?: string; + /** The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". */ + readonly operation?: string; + /** The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ + readonly description?: string; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. */ +export interface ErrorResponseOutput { + /** The error object. */ + error?: ErrorDetailOutput; +} + +/** The error detail. */ +export interface ErrorDetailOutput { + /** The error code. */ + readonly code?: string; + /** The error message. */ + readonly message?: string; + /** The error target. */ + readonly target?: string; + /** The error details. */ + readonly details?: Array; + /** The error additional info. */ + readonly additionalInfo?: Array; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfoOutput { + /** The additional info type. */ + readonly type?: string; + /** The additional info. */ + readonly info?: Record; +} + +/** The VmmServers resource definition. */ +export interface VmmServerOutput extends TrackedResourceOutput { + /** The resource-specific properties for this resource. */ + properties?: VmmServerPropertiesOutput; + /** The extended location. */ + extendedLocation: ExtendedLocationOutput; +} + +/** Defines the resource properties. */ +export interface VmmServerPropertiesOutput { + /** Credentials to connect to VmmServer. */ + credentials?: VmmCredentialOutput; + /** Fqdn is the hostname/ip of the vmmServer. */ + fqdn: string; + /** Port is the port on which the vmmServer is listening. */ + port?: number; + /** Gets the connection status to the vmmServer. */ + readonly connectionStatus?: string; + /** Gets any error message if connection to vmmServer is having any issue. */ + readonly errorMessage?: string; + /** Unique ID of vmmServer. */ + readonly uuid?: string; + /** Version is the version of the vmmSever. */ + readonly version?: string; + /** + * Provisioning state of the resource. + * + * Possible values: "Provisioning", "Updating", "Deleting", "Accepted", "Created" + */ + readonly provisioningState?: ProvisioningStateOutput; +} + +/** Credentials to connect to VmmServer. */ +export interface VmmCredentialOutput { + /** Username to use to connect to VmmServer. */ + username?: string; + /** Password to use to connect to VmmServer. */ + password?: string; +} + +/** The extended location. */ +export interface ExtendedLocationOutput { + /** The extended location type. */ + type?: string; + /** The extended location name. */ + name?: string; +} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResourceOutput extends ResourceOutput { + /** Resource tags. */ + tags?: Record; + /** The geo-location where the resource lives */ + location: string; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface ResourceOutput { + /** Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} */ + readonly id?: string; + /** The name of the resource */ + readonly name?: string; + /** The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" */ + readonly type?: string; + /** Azure Resource Manager metadata containing createdBy and modifiedBy information. */ + readonly systemData?: SystemDataOutput; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemDataOutput { + /** The identity that created the resource. */ + createdBy?: string; + /** + * The type of identity that created the resource. + * + * Possible values: "User", "Application", "ManagedIdentity", "Key" + */ + createdByType?: CreatedByTypeOutput; + /** The timestamp of resource creation (UTC). */ + createdAt?: string; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** + * The type of identity that last modified the resource. + * + * Possible values: "User", "Application", "ManagedIdentity", "Key" + */ + lastModifiedByType?: CreatedByTypeOutput; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: string; +} + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResourceOutput extends ResourceOutput {} + +/** Defines the inventory item. */ +export interface InventoryItemOutput extends ProxyResourceOutput { + /** The resource-specific properties for this resource. */ + properties?: InventoryItemPropertiesOutput; + /** 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; +} + +/** Defines the resource properties. */ +export interface InventoryItemPropertiesOutputParent { + /** Gets the tracked resource id corresponding to the inventory resource. */ + readonly managedResourceId?: string; + /** Gets the UUID (which is assigned by Vmm) for the inventory item. */ + readonly uuid?: string; + /** Gets the Managed Object name in Vmm for the inventory item. */ + readonly inventoryItemName?: string; + /** + * Provisioning state of the resource. + * + * Possible values: "Provisioning", "Updating", "Deleting", "Accepted", "Created" + */ + readonly provisioningState?: ProvisioningStateOutput; + inventoryType: InventoryTypeOutput; +} + +/** The Cloud inventory item. */ +export interface CloudInventoryItemOutput + extends InventoryItemPropertiesOutputParent { + /** They inventory type. */ + inventoryType: "Cloud"; +} + +/** The Virtual network inventory item. */ +export interface VirtualNetworkInventoryItemOutput + extends InventoryItemPropertiesOutputParent { + /** They inventory type. */ + inventoryType: "VirtualNetwork"; +} + +/** The Virtual machine template inventory item. */ +export interface VirtualMachineTemplateInventoryItemOutput + extends InventoryItemPropertiesOutputParent { + /** Gets the desired number of vCPUs for the vm. */ + readonly cpuCount?: number; + /** MemoryMB is the desired size of a virtual machine's memory, in MB. */ + readonly memoryMB?: number; + /** + * Gets the type of the os. + * + * Possible values: "Windows", "Linux", "Other" + */ + readonly osType?: OsTypeOutput; + /** Gets os name. */ + readonly osName?: string; + /** They inventory type. */ + inventoryType: "VirtualMachineTemplate"; +} + +/** The Virtual machine inventory item. */ +export interface VirtualMachineInventoryItemOutput + extends InventoryItemPropertiesOutputParent { + /** + * Gets the type of the os. + * + * Possible values: "Windows", "Linux", "Other" + */ + readonly osType?: OsTypeOutput; + /** Gets os name. */ + readonly osName?: string; + /** Gets os version. */ + readonly osVersion?: string; + /** Gets the power state of the virtual machine. */ + readonly powerState?: string; + /** Gets or sets the nic ip addresses. */ + ipAddresses?: string[]; + /** Cloud inventory resource details where the VM is present. */ + cloud?: InventoryItemDetailsOutput; + /** Gets the bios guid. */ + readonly biosGuid?: string; + /** Gets the tracked resource id corresponding to the inventory resource. */ + readonly managedMachineResourceId?: string; + /** They inventory type. */ + inventoryType: "VirtualMachine"; +} + +/** Defines the resource properties. */ +export interface InventoryItemDetailsOutput { + /** Gets or sets the inventory Item ID for the resource. */ + inventoryItemId?: string; + /** Gets or sets the Managed Object name in Vmm for the resource. */ + inventoryItemName?: string; +} + +/** Defines the HybridIdentityMetadata. */ +export interface VmInstanceHybridIdentityMetadataOutput + extends ProxyResourceOutput { + /** The resource-specific properties for this resource. */ + properties?: VmInstanceHybridIdentityMetadataPropertiesOutput; +} + +/** Describes the properties of Hybrid Identity Metadata for a Virtual Machine. */ +export interface VmInstanceHybridIdentityMetadataPropertiesOutput { + /** The unique identifier for the resource. */ + resourceUid?: string; + /** Gets or sets the Public Key. */ + publicKey?: string; + /** + * Provisioning state of the resource. + * + * Possible values: "Provisioning", "Updating", "Deleting", "Accepted", "Created" + */ + readonly provisioningState?: ProvisioningStateOutput; +} + +/** Defines the GuestAgent. */ +export interface GuestAgentOutput extends ProxyResourceOutput { + /** The resource-specific properties for this resource. */ + properties?: GuestAgentPropertiesOutput; +} + +/** Defines the resource properties. */ +export interface GuestAgentPropertiesOutput { + /** Gets a unique identifier for this resource. */ + readonly uuid?: string; + /** Username / Password Credentials to provision guest agent. */ + credentials?: GuestCredentialOutput; + /** HTTP Proxy configuration for the VM. */ + httpProxyConfig?: HttpProxyConfigurationOutput; + /** + * Gets or sets the guest agent provisioning action. + * + * Possible values: "install", "uninstall", "repair" + */ + provisioningAction?: ProvisioningActionOutput; + /** Gets the guest agent status. */ + readonly status?: string; + /** Gets the name of the corresponding resource in Kubernetes. */ + readonly customResourceName?: string; + /** + * Provisioning state of the resource. + * + * Possible values: "Provisioning", "Updating", "Deleting", "Accepted", "Created" + */ + readonly provisioningState?: ProvisioningStateOutput; + /** The resource id of the private link scope this machine is assigned to, if any. */ + privateLinkScopeResourceId?: string; +} + +/** Username / Password Credentials to connect to guest. */ +export interface GuestCredentialOutput { + /** 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 HttpProxyConfigurationOutput { + /** Gets or sets httpsProxy url. */ + httpsProxy?: string; +} + +/** The base extension resource. */ +export interface ExtensionResourceOutput extends ResourceOutput {} + +/** Define the virtualMachineInstance. */ +export interface VirtualMachineInstanceOutput extends ExtensionResourceOutput { + /** The resource-specific properties for this resource. */ + properties?: VirtualMachineInstancePropertiesOutput; + /** Gets or sets the extended location. */ + extendedLocation: ExtendedLocationOutput; +} + +/** Defines the resource properties. */ +export interface VirtualMachineInstancePropertiesOutput { + /** Availability Sets in vm. */ + availabilitySets?: Array; + /** OS properties. */ + osProfile?: OsProfileForVmInstanceOutput; + /** Hardware properties. */ + hardwareProfile?: HardwareProfileOutput; + /** Network properties. */ + networkProfile?: NetworkProfileOutput; + /** Storage properties. */ + storageProfile?: StorageProfileOutput; + /** Gets the infrastructure profile. */ + infrastructureProfile?: InfrastructureProfileOutput; + /** Gets the power state of the virtual machine. */ + readonly powerState?: string; + /** + * Provisioning state of the resource. + * + * Possible values: "Provisioning", "Updating", "Deleting", "Accepted", "Created" + */ + readonly provisioningState?: ProvisioningStateOutput; +} + +/** Availability Set model */ +export interface AvailabilitySetListItemOutput { + /** Gets the ARM Id of the microsoft.scvmm/availabilitySets resource. */ + id?: string; + /** Gets or sets the name of the availability set. */ + name?: string; +} + +/** Defines the resource properties. */ +export interface OsProfileForVmInstanceOutput { + /** Admin password of the virtual machine. */ + adminPassword?: string; + /** Gets or sets computer name. */ + computerName?: string; + /** + * Gets the type of the os. + * + * Possible values: "Windows", "Linux", "Other" + */ + readonly osType?: OsTypeOutput; + /** Gets os sku. */ + readonly osSku?: string; + /** Gets os version. */ + readonly osVersion?: string; + /** Gets or sets the domain name. */ + domainName?: string; + /** Gets or sets the domain username. */ + domainUsername?: string; + /** Password of the domain the VM has to join. */ + domainPassword?: string; + /** Gets or sets the workgroup. */ + workgroup?: string; + /** Gets or sets the product key.Input format xxxxx-xxxxx-xxxxx-xxxxx-xxxxx */ + productKey?: string; + /** Gets or sets the index value of the timezone. */ + timezone?: number; + /** Get or sets the commands to be run once at the time of creation separated by semicolons. */ + runOnceCommands?: string; +} + +/** Defines the resource properties. */ +export interface HardwareProfileOutput { + /** MemoryMB is the size of a virtual machine's memory, in MB. */ + memoryMB?: number; + /** Gets or sets the number of vCPUs for the vm. */ + cpuCount?: number; + /** + * Gets or sets a value indicating whether to enable processor compatibility mode for live migration of VMs. + * + * Possible values: "true", "false" + */ + limitCpuForMigration?: LimitCpuForMigrationOutput; + /** + * Gets or sets a value indicating whether to enable dynamic memory or not. + * + * Possible values: "true", "false" + */ + dynamicMemoryEnabled?: DynamicMemoryEnabledOutput; + /** Gets or sets the max dynamic memory for the vm. */ + dynamicMemoryMaxMB?: number; + /** Gets or sets the min dynamic memory for the vm. */ + dynamicMemoryMinMB?: number; + /** + * Gets highly available property. + * + * Possible values: "true", "false" + */ + readonly isHighlyAvailable?: IsHighlyAvailableOutput; +} + +/** Defines the resource properties. */ +export interface NetworkProfileOutput { + /** Gets or sets the list of network interfaces associated with the virtual machine. */ + networkInterfaces?: Array; +} + +/** Network Interface model */ +export interface NetworkInterfaceOutput { + /** Gets or sets the name of the network interface. */ + name?: string; + /** Gets the display name of the network interface as shown in the vmmServer. This is the fallback label for a NIC when the name is not set. */ + readonly displayName?: string; + /** Gets the nic ipv4 addresses. */ + readonly ipv4Addresses?: string[]; + /** Gets the nic ipv6 addresses. */ + readonly ipv6Addresses?: string[]; + /** Gets or sets the nic MAC address. */ + macAddress?: string; + /** Gets or sets the ARM Id of the Microsoft.ScVmm/virtualNetwork resource to connect the nic. */ + virtualNetworkId?: string; + /** Gets the name of the virtual network in vmmServer that the nic is connected to. */ + readonly networkName?: string; + /** + * Gets or sets the ipv4 address type. + * + * Possible values: "Dynamic", "Static" + */ + ipv4AddressType?: AllocationMethodOutput; + /** + * Gets or sets the ipv6 address type. + * + * Possible values: "Dynamic", "Static" + */ + ipv6AddressType?: AllocationMethodOutput; + /** + * Gets or sets the mac address type. + * + * Possible values: "Dynamic", "Static" + */ + macAddressType?: AllocationMethodOutput; + /** Gets or sets the nic id. */ + nicId?: string; +} + +/** Defines the resource properties. */ +export interface StorageProfileOutput { + /** Gets or sets the list of virtual disks associated with the virtual machine. */ + disks?: Array; +} + +/** Virtual disk model */ +export interface VirtualDiskOutput { + /** Gets or sets the name of the disk. */ + name?: string; + /** Gets the display name of the virtual disk as shown in the vmmServer. This is the fallback label for a disk when the name is not set. */ + readonly displayName?: string; + /** Gets or sets the disk id. */ + diskId?: string; + /** Gets or sets the disk total size. */ + diskSizeGB?: number; + /** Gets the max disk size. */ + readonly maxDiskSizeGB?: number; + /** Gets or sets the disk bus. */ + bus?: number; + /** Gets or sets the disk lun. */ + lun?: number; + /** Gets or sets the disk bus type. */ + busType?: string; + /** Gets or sets the disk vhd type. */ + vhdType?: string; + /** Gets the disk volume type. */ + readonly volumeType?: string; + /** Gets the disk vhd format type. */ + readonly vhdFormatType?: string; + /** Gets or sets the disk id in the template. */ + templateDiskId?: string; + /** The QoS policy for the disk. */ + storageQoSPolicy?: StorageQosPolicyDetailsOutput; + /** + * Gets or sets a value indicating diff disk. + * + * Possible values: "true", "false" + */ + createDiffDisk?: CreateDiffDiskOutput; +} + +/** The StorageQoSPolicyDetails definition. */ +export interface StorageQosPolicyDetailsOutput { + /** The name of the policy. */ + name?: string; + /** The ID of the QoS policy. */ + id?: string; +} + +/** Specifies the vmmServer infrastructure specific settings for the virtual machine instance. */ +export interface InfrastructureProfileOutput { + /** Gets or sets the inventory Item ID for the resource. */ + inventoryItemId?: string; + /** ARM Id of the vmmServer resource in which this resource resides. */ + vmmServerId?: string; + /** ARM Id of the cloud resource to use for deploying the vm. */ + cloudId?: string; + /** ARM Id of the template resource to use for deploying the vm. */ + templateId?: string; + /** VMName is the name of VM on the SCVmm server. */ + vmName?: string; + /** Unique ID of the virtual machine. */ + uuid?: string; + /** Last restored checkpoint in the vm. */ + readonly lastRestoredVMCheckpoint?: CheckpointOutput; + /** Checkpoints in the vm. */ + readonly checkpoints?: Array; + /** Type of checkpoint supported for the vm. */ + checkpointType?: string; + /** Gets or sets the generation for the vm. */ + generation?: number; + /** Gets or sets the bios guid for the vm. */ + biosGuid?: string; +} + +/** Defines the resource properties. */ +export interface CheckpointOutput { + /** Gets ID of parent of the checkpoint. */ + parentCheckpointID?: string; + /** Gets ID of the checkpoint. */ + checkpointID?: string; + /** Gets name of the checkpoint. */ + name?: string; + /** Gets description of the checkpoint. */ + description?: string; +} + +/** The resource model definition for an Azure Resource Manager resource with an etag. */ +export interface AzureEntityResourceOutput extends ResourceOutput { + /** Resource Etag. */ + readonly etag?: string; +} + +/** A private link resource. */ +export interface PrivateLinkResourceOutput extends ResourceOutput { + /** Resource properties. */ + properties?: PrivateLinkResourcePropertiesOutput; +} + +/** Properties of a private link resource. */ +export interface PrivateLinkResourcePropertiesOutput { + /** The private link resource group id. */ + readonly groupId?: string; + /** The private link resource required member names. */ + readonly requiredMembers?: string[]; + /** The private link resource private link DNS zone name. */ + requiredZoneNames?: string[]; +} + +/** The private endpoint connection resource */ +export interface PrivateEndpointConnectionOutput extends ResourceOutput { + /** The private endpoint connection properties */ + properties?: PrivateEndpointConnectionPropertiesOutput; +} + +/** Properties of the private endpoint connection. */ +export interface PrivateEndpointConnectionPropertiesOutput { + /** The group ids for the private endpoint resource. */ + readonly groupIds?: string[]; + /** The private endpoint resource. */ + privateEndpoint?: PrivateEndpointOutput; + /** A collection of information about the state of the connection between service consumer and provider. */ + privateLinkServiceConnectionState: PrivateLinkServiceConnectionStateOutput; + /** + * The provisioning state of the private endpoint connection resource. + * + * Possible values: "Succeeded", "Creating", "Deleting", "Failed" + */ + readonly provisioningState?: PrivateEndpointConnectionProvisioningStateOutput; +} + +/** The Private Endpoint resource. */ +export interface PrivateEndpointOutput { + /** The resource identifier for private endpoint */ + readonly id?: string; +} + +/** A collection of information about the state of the connection between service consumer and provider. */ +export interface PrivateLinkServiceConnectionStateOutput { + /** + * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + * + * Possible values: "Pending", "Approved", "Rejected" + */ + status?: PrivateEndpointServiceConnectionStatusOutput; + /** The reason for approval/rejection of the connection. */ + description?: string; + /** A message indicating if changes on the service provider require any updates on the consumer. */ + actionsRequired?: string; +} + +/** The Clouds resource definition. */ +export interface CloudOutput extends TrackedResourceOutput { + /** The resource-specific properties for this resource. */ + properties?: CloudPropertiesOutput; + /** The extended location. */ + extendedLocation: ExtendedLocationOutput; +} + +/** Defines the resource properties. */ +export interface CloudPropertiesOutput { + /** Gets or sets the inventory Item ID for the resource. */ + inventoryItemId?: string; + /** Unique ID of the cloud. */ + uuid?: string; + /** ARM Id of the vmmServer resource in which this resource resides. */ + vmmServerId?: string; + /** Name of the cloud in VmmServer. */ + readonly cloudName?: string; + /** Capacity of the cloud. */ + readonly cloudCapacity?: CloudCapacityOutput; + /** List of QoS policies available for the cloud. */ + readonly storageQoSPolicies?: Array; + /** + * Provisioning state of the resource. + * + * Possible values: "Provisioning", "Updating", "Deleting", "Accepted", "Created" + */ + readonly provisioningState?: ProvisioningStateOutput; +} + +/** Cloud Capacity model */ +export interface CloudCapacityOutput { + /** CPUCount specifies the maximum number of CPUs that can be allocated in the cloud. */ + readonly cpuCount?: number; + /** MemoryMB specifies a memory usage limit in megabytes. */ + readonly memoryMB?: number; + /** VMCount gives the max number of VMs that can be deployed in the cloud. */ + readonly vmCount?: number; +} + +/** The StorageQoSPolicy definition. */ +export interface StorageQosPolicyOutput { + /** The name of the policy. */ + name?: string; + /** The ID of the QoS policy. */ + id?: string; + /** The maximum IO operations per second. */ + iopsMaximum?: number; + /** The minimum IO operations per second. */ + iopsMinimum?: number; + /** The Bandwidth Limit for internet traffic. */ + bandwidthLimit?: number; + /** The underlying policy. */ + policyId?: string; +} + +/** The VirtualNetworks resource definition. */ +export interface VirtualNetworkOutput extends TrackedResourceOutput { + /** The resource-specific properties for this resource. */ + properties?: VirtualNetworkPropertiesOutput; + /** The extended location. */ + extendedLocation: ExtendedLocationOutput; +} + +/** Defines the resource properties. */ +export interface VirtualNetworkPropertiesOutput { + /** Gets or sets the inventory Item ID for the resource. */ + inventoryItemId?: string; + /** Unique ID of the virtual network. */ + uuid?: string; + /** ARM Id of the vmmServer resource in which this resource resides. */ + vmmServerId?: string; + /** Name of the virtual network in vmmServer. */ + readonly networkName?: string; + /** + * Provisioning state of the resource. + * + * Possible values: "Provisioning", "Updating", "Deleting", "Accepted", "Created" + */ + readonly provisioningState?: ProvisioningStateOutput; +} + +/** The VirtualMachineTemplates resource definition. */ +export interface VirtualMachineTemplateOutput extends TrackedResourceOutput { + /** The resource-specific properties for this resource. */ + properties?: VirtualMachineTemplatePropertiesOutput; + /** The extended location. */ + extendedLocation: ExtendedLocationOutput; +} + +/** Defines the resource properties. */ +export interface VirtualMachineTemplatePropertiesOutput { + /** Gets or sets the inventory Item ID for the resource. */ + inventoryItemId?: string; + /** Unique ID of the virtual machine template. */ + uuid?: string; + /** ARM Id of the vmmServer resource in which this resource resides. */ + vmmServerId?: string; + /** + * Gets the type of the os. + * + * Possible values: "Windows", "Linux", "Other" + */ + readonly osType?: OsTypeOutput; + /** Gets os name. */ + readonly osName?: string; + /** Gets computer name. */ + readonly computerName?: string; + /** MemoryMB is the desired size of a virtual machine's memory, in MB. */ + readonly memoryMB?: number; + /** Gets the desired number of vCPUs for the vm. */ + readonly cpuCount?: number; + /** + * Gets a value indicating whether to enable processor compatibility mode for live migration of VMs. + * + * Possible values: "true", "false" + */ + readonly limitCpuForMigration?: LimitCpuForMigrationOutput; + /** + * Gets a value indicating whether to enable dynamic memory or not. + * + * Possible values: "true", "false" + */ + readonly dynamicMemoryEnabled?: DynamicMemoryEnabledOutput; + /** + * Gets a value indicating whether the vm template is customizable or not. + * + * Possible values: "true", "false" + */ + readonly isCustomizable?: IsCustomizableOutput; + /** Gets the max dynamic memory for the vm. */ + readonly dynamicMemoryMaxMB?: number; + /** Gets the min dynamic memory for the vm. */ + readonly dynamicMemoryMinMB?: number; + /** + * Gets highly available property. + * + * Possible values: "true", "false" + */ + readonly isHighlyAvailable?: IsHighlyAvailableOutput; + /** Gets the generation for the vm. */ + readonly generation?: number; + /** Gets the network interfaces of the template. */ + readonly networkInterfaces?: Array; + /** Gets the disks of the template. */ + readonly disks?: Array; + /** + * Provisioning state of the resource. + * + * Possible values: "Provisioning", "Updating", "Deleting", "Accepted", "Created" + */ + readonly provisioningState?: ProvisioningStateOutput; +} + +/** The AvailabilitySets resource definition. */ +export interface AvailabilitySetOutput extends TrackedResourceOutput { + /** The resource-specific properties for this resource. */ + properties?: AvailabilitySetPropertiesOutput; + /** The extended location. */ + extendedLocation: ExtendedLocationOutput; +} + +/** Defines the resource properties. */ +export interface AvailabilitySetPropertiesOutput { + /** Name of the availability set. */ + availabilitySetName?: string; + /** ARM Id of the vmmServer resource in which this resource resides. */ + vmmServerId?: string; + /** + * Provisioning state of the resource. + * + * Possible values: "Provisioning", "Updating", "Deleting", "Accepted", "Created" + */ + readonly provisioningState?: ProvisioningStateOutput; +} + +/** The resource model definition containing the full set of allowed properties for a resource. Except properties bag, there cannot be a top level property outside of this set. */ +export interface ResourceModelWithAllowedPropertySetOutput + extends TrackedResourceOutput { + /** + * The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. + * If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. + */ + managedBy?: 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 etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. + * Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), + * If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + */ + eTag?: string; + identity?: IdentityOutput; + sku?: SkuOutput; + plan?: PlanOutput; +} + +/** Identity for the resource. */ +export interface IdentityOutput { + /** The principal ID of resource identity. The value must be an UUID. */ + readonly principalId?: string; + /** The tenant ID of resource. The value must be an UUID. */ + readonly tenantId?: string; + /** The identity type. */ + type?: ResourceIdentityTypeOutput; +} + +/** The resource model definition representing SKU */ +export interface SkuOutput { + /** The name of the SKU. Ex - P3. It is typically a letter+number code */ + name: string; + /** This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. */ + tier?: SkuTierOutput; + /** The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. */ + size?: string; + /** If the service has different generations of hardware, for the same SKU, then that can be captured here. */ + family?: string; + /** If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. */ + capacity?: number; +} + +/** Plan for the resource. */ +export interface PlanOutput { + /** A user defined name of the 3rd Party Artifact that is being procured. */ + name: string; + /** The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic */ + publisher: string; + /** The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. */ + product: string; + /** A publisher provided promotion code as provisioned in Data Market for the said product/artifact. */ + promotionCode?: string; + /** The version of the desired product/artifact. */ + version?: string; +} + +/** Defines the resource properties. */ +export type InventoryItemPropertiesOutput = + | InventoryItemPropertiesOutputParent + | CloudInventoryItemOutput + | VirtualNetworkInventoryItemOutput + | VirtualMachineTemplateInventoryItemOutput + | VirtualMachineInventoryItemOutput; +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export type OperationListResultOutput = Paged; +/** Alias for OriginOutput */ +export type OriginOutput = string; +/** Alias for ActionTypeOutput */ +export type ActionTypeOutput = string; +/** Alias for ResourceProvisioningStateOutput */ +export type ResourceProvisioningStateOutput = string; +/** Alias for ProvisioningStateOutput */ +export type ProvisioningStateOutput = string; +/** Alias for CreatedByTypeOutput */ +export type CreatedByTypeOutput = string; +/** Alias for InventoryTypeOutput */ +export type InventoryTypeOutput = string; +/** Alias for OsTypeOutput */ +export type OsTypeOutput = string; +/** Alias for ProvisioningActionOutput */ +export type ProvisioningActionOutput = string; +/** Alias for LimitCpuForMigrationOutput */ +export type LimitCpuForMigrationOutput = string; +/** Alias for DynamicMemoryEnabledOutput */ +export type DynamicMemoryEnabledOutput = string; +/** Alias for IsHighlyAvailableOutput */ +export type IsHighlyAvailableOutput = string; +/** Alias for AllocationMethodOutput */ +export type AllocationMethodOutput = string; +/** Alias for CreateDiffDiskOutput */ +export type CreateDiffDiskOutput = string; +/** Alias for PrivateEndpointServiceConnectionStatusOutput */ +export type PrivateEndpointServiceConnectionStatusOutput = string; +/** Alias for PrivateEndpointConnectionProvisioningStateOutput */ +export type PrivateEndpointConnectionProvisioningStateOutput = string; +/** Alias for IsCustomizableOutput */ +export type IsCustomizableOutput = string; +/** Alias for ResourceIdentityTypeOutput */ +export type ResourceIdentityTypeOutput = "SystemAssigned"; +/** Alias for SkuTierOutput */ +export type SkuTierOutput = "Free" | "Basic" | "Standard" | "Premium"; +/** The response of a VmmServer list operation. */ +export type VmmServerListResultOutput = Paged; +/** The response of a Cloud list operation. */ +export type CloudListResultOutput = Paged; +/** The response of a VirtualNetwork list operation. */ +export type VirtualNetworkListResultOutput = Paged; +/** The response of a VirtualMachineTemplate list operation. */ +export type VirtualMachineTemplateListResultOutput = + Paged; +/** The response of a AvailabilitySet list operation. */ +export type AvailabilitySetListResultOutput = Paged; +/** The response of a InventoryItem list operation. */ +export type InventoryItemListResultOutput = Paged; +/** The response of a VirtualMachineInstance list operation. */ +export type VirtualMachineInstanceListResultOutput = + Paged; +/** The response of a VmInstanceHybridIdentityMetadata list operation. */ +export type VmInstanceHybridIdentityMetadataListResultOutput = + Paged; +/** The response of a GuestAgent list operation. */ +export type GuestAgentListResultOutput = Paged; diff --git a/sdk/scvmm/arm-scvmm/src/rest/paginateHelper.ts b/sdk/scvmm/arm-scvmm/src/rest/paginateHelper.ts new file mode 100644 index 000000000000..3aac141db0e7 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/rest/paginateHelper.ts @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { + getPagedAsyncIterator, + PagedAsyncIterableIterator, + PagedResult, +} from "@azure/core-paging"; +import { + Client, + createRestError, + PathUncheckedResponse, +} from "@azure-rest/core-client"; + +/** + * Helper type to extract the type of an array + */ +export type GetArrayType = T extends Array ? TData : never; + +/** + * The type of a custom function that defines how to get a page and a link to the next one if any. + */ +export type GetPage = ( + pageLink: string, + maxPageSize?: number, +) => Promise<{ + page: TPage; + nextPageLink?: string; +}>; + +/** + * Options for the paging helper + */ +export interface PagingOptions { + /** + * Custom function to extract pagination details for crating the PagedAsyncIterableIterator + */ + customGetPage?: GetPage[]>; +} + +/** + * Helper type to infer the Type of the paged elements from the response type + * This type is generated based on the swagger information for x-ms-pageable + * specifically on the itemName property which indicates the property of the response + * where the page items are found. The default value is `value`. + * This type will allow us to provide strongly typed Iterator based on the response we get as second parameter + */ +export type PaginateReturn = TResult extends { + body: { value?: infer TPage }; +} + ? GetArrayType + : Array; + +/** + * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension + * @param client - Client to use for sending the next page requests + * @param initialResponse - Initial response containing the nextLink and current page of elements + * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results + * @returns - PagedAsyncIterableIterator to iterate the elements + */ +export function paginate( + client: Client, + initialResponse: TResponse, + options: PagingOptions = {}, +): PagedAsyncIterableIterator> { + // Extract element type from initial response + type TElement = PaginateReturn; + let firstRun = true; + const itemName = "value"; + const nextLinkName = "nextLink"; + const { customGetPage } = options; + const pagedResult: PagedResult = { + firstPageLink: "", + getPage: + typeof customGetPage === "function" + ? customGetPage + : async (pageLink: string) => { + const result = firstRun + ? initialResponse + : await client.pathUnchecked(pageLink).get(); + firstRun = false; + checkPagingRequest(result); + const nextLink = getNextLink(result.body, nextLinkName); + const values = getElements(result.body, itemName); + return { + page: values, + nextPageLink: nextLink, + }; + }, + }; + + return getPagedAsyncIterator(pagedResult); +} + +/** + * Gets for the value of nextLink in the body + */ +function getNextLink(body: unknown, nextLinkName?: string): string | undefined { + if (!nextLinkName) { + return undefined; + } + + const nextLink = (body as Record)[nextLinkName]; + + if (typeof nextLink !== "string" && typeof nextLink !== "undefined") { + throw new Error( + `Body Property ${nextLinkName} should be a string or undefined`, + ); + } + + return nextLink; +} + +/** + * Gets the elements of the current request in the body. + */ +function getElements(body: unknown, itemName: string): T[] { + const value = (body as Record)[itemName] as T[]; + + // value has to be an array according to the x-ms-pageable extension. + // The fact that this must be an array is used above to calculate the + // type of elements in the page in PaginateReturn + if (!Array.isArray(value)) { + throw new Error( + `Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`, + ); + } + + return value ?? []; +} + +/** + * Checks if a request failed + */ +function checkPagingRequest(response: PathUncheckedResponse): void { + const Http2xxStatusCodes = [ + "200", + "201", + "202", + "203", + "204", + "205", + "206", + "207", + "208", + "226", + ]; + if (!Http2xxStatusCodes.includes(response.status)) { + throw createRestError( + `Pagination failed with unexpected statusCode ${response.status}`, + response, + ); + } +} diff --git a/sdk/scvmm/arm-scvmm/src/rest/parameters.ts b/sdk/scvmm/arm-scvmm/src/rest/parameters.ts new file mode 100644 index 000000000000..ef6953e88d73 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/rest/parameters.ts @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { RequestParameters } from "@azure-rest/core-client"; +import { + VmmServer, + VmmServerTagsUpdate, + ForceDelete, + Cloud, + CloudTagsUpdate, + VirtualNetwork, + VirtualNetworkTagsUpdate, + VirtualMachineTemplate, + VirtualMachineTemplateTagsUpdate, + AvailabilitySet, + AvailabilitySetTagsUpdate, + InventoryItem, + VirtualMachineInstance, + VirtualMachineInstanceUpdate, + DeleteFromHost, + StopVirtualMachineOptions, + VirtualMachineCreateCheckpoint, + VirtualMachineDeleteCheckpoint, + VirtualMachineRestoreCheckpoint, + GuestAgent, +} from "./models.js"; + +export type OperationsListParameters = RequestParameters; +export type VmmServersGetParameters = RequestParameters; + +export interface VmmServersCreateOrUpdateBodyParam { + /** Resource create parameters. */ + body: VmmServer; +} + +export type VmmServersCreateOrUpdateParameters = + VmmServersCreateOrUpdateBodyParam & RequestParameters; + +export interface VmmServersUpdateBodyParam { + /** The resource properties to be updated. */ + body: VmmServerTagsUpdate; +} + +export type VmmServersUpdateParameters = VmmServersUpdateBodyParam & + RequestParameters; + +export interface VmmServersDeleteQueryParamProperties { + /** + * Forces the resource to be deleted. + * + * Possible values: "true", "false" + */ + force?: ForceDelete; +} + +export interface VmmServersDeleteQueryParam { + queryParameters?: VmmServersDeleteQueryParamProperties; +} + +export type VmmServersDeleteParameters = VmmServersDeleteQueryParam & + RequestParameters; +export type VmmServersListByResourceGroupParameters = RequestParameters; +export type VmmServersListBySubscriptionParameters = RequestParameters; +export type CloudsGetParameters = RequestParameters; + +export interface CloudsCreateOrUpdateBodyParam { + /** Resource create parameters. */ + body: Cloud; +} + +export type CloudsCreateOrUpdateParameters = CloudsCreateOrUpdateBodyParam & + RequestParameters; + +export interface CloudsUpdateBodyParam { + /** The resource properties to be updated. */ + body: CloudTagsUpdate; +} + +export type CloudsUpdateParameters = CloudsUpdateBodyParam & RequestParameters; + +export interface CloudsDeleteQueryParamProperties { + /** + * Forces the resource to be deleted. + * + * Possible values: "true", "false" + */ + force?: ForceDelete; +} + +export interface CloudsDeleteQueryParam { + queryParameters?: CloudsDeleteQueryParamProperties; +} + +export type CloudsDeleteParameters = CloudsDeleteQueryParam & RequestParameters; +export type CloudsListByResourceGroupParameters = RequestParameters; +export type CloudsListBySubscriptionParameters = RequestParameters; +export type VirtualNetworksGetParameters = RequestParameters; + +export interface VirtualNetworksCreateOrUpdateBodyParam { + /** Resource create parameters. */ + body: VirtualNetwork; +} + +export type VirtualNetworksCreateOrUpdateParameters = + VirtualNetworksCreateOrUpdateBodyParam & RequestParameters; + +export interface VirtualNetworksUpdateBodyParam { + /** The resource properties to be updated. */ + body: VirtualNetworkTagsUpdate; +} + +export type VirtualNetworksUpdateParameters = VirtualNetworksUpdateBodyParam & + RequestParameters; + +export interface VirtualNetworksDeleteQueryParamProperties { + /** + * Forces the resource to be deleted. + * + * Possible values: "true", "false" + */ + force?: ForceDelete; +} + +export interface VirtualNetworksDeleteQueryParam { + queryParameters?: VirtualNetworksDeleteQueryParamProperties; +} + +export type VirtualNetworksDeleteParameters = VirtualNetworksDeleteQueryParam & + RequestParameters; +export type VirtualNetworksListByResourceGroupParameters = RequestParameters; +export type VirtualNetworksListBySubscriptionParameters = RequestParameters; +export type VirtualMachineTemplatesGetParameters = RequestParameters; + +export interface VirtualMachineTemplatesCreateOrUpdateBodyParam { + /** Resource create parameters. */ + body: VirtualMachineTemplate; +} + +export type VirtualMachineTemplatesCreateOrUpdateParameters = + VirtualMachineTemplatesCreateOrUpdateBodyParam & RequestParameters; + +export interface VirtualMachineTemplatesUpdateBodyParam { + /** The resource properties to be updated. */ + body: VirtualMachineTemplateTagsUpdate; +} + +export type VirtualMachineTemplatesUpdateParameters = + VirtualMachineTemplatesUpdateBodyParam & RequestParameters; + +export interface VirtualMachineTemplatesDeleteQueryParamProperties { + /** + * Forces the resource to be deleted. + * + * Possible values: "true", "false" + */ + force?: ForceDelete; +} + +export interface VirtualMachineTemplatesDeleteQueryParam { + queryParameters?: VirtualMachineTemplatesDeleteQueryParamProperties; +} + +export type VirtualMachineTemplatesDeleteParameters = + VirtualMachineTemplatesDeleteQueryParam & RequestParameters; +export type VirtualMachineTemplatesListByResourceGroupParameters = + RequestParameters; +export type VirtualMachineTemplatesListBySubscriptionParameters = + RequestParameters; +export type AvailabilitySetsGetParameters = RequestParameters; + +export interface AvailabilitySetsCreateOrUpdateBodyParam { + /** Resource create parameters. */ + body: AvailabilitySet; +} + +export type AvailabilitySetsCreateOrUpdateParameters = + AvailabilitySetsCreateOrUpdateBodyParam & RequestParameters; + +export interface AvailabilitySetsUpdateBodyParam { + /** The resource properties to be updated. */ + body: AvailabilitySetTagsUpdate; +} + +export type AvailabilitySetsUpdateParameters = AvailabilitySetsUpdateBodyParam & + RequestParameters; + +export interface AvailabilitySetsDeleteQueryParamProperties { + /** + * Forces the resource to be deleted. + * + * Possible values: "true", "false" + */ + force?: ForceDelete; +} + +export interface AvailabilitySetsDeleteQueryParam { + queryParameters?: AvailabilitySetsDeleteQueryParamProperties; +} + +export type AvailabilitySetsDeleteParameters = + AvailabilitySetsDeleteQueryParam & RequestParameters; +export type AvailabilitySetsListByResourceGroupParameters = RequestParameters; +export type AvailabilitySetsListBySubscriptionParameters = RequestParameters; +export type InventoryItemsGetParameters = RequestParameters; + +export interface InventoryItemsCreateBodyParam { + /** Resource create parameters. */ + body: InventoryItem; +} + +export type InventoryItemsCreateParameters = InventoryItemsCreateBodyParam & + RequestParameters; +export type InventoryItemsDeleteParameters = RequestParameters; +export type InventoryItemsListByVmmServerParameters = RequestParameters; +export type VirtualMachineInstancesGetParameters = RequestParameters; + +export interface VirtualMachineInstancesCreateOrUpdateBodyParam { + /** Resource create parameters. */ + body: VirtualMachineInstance; +} + +export type VirtualMachineInstancesCreateOrUpdateParameters = + VirtualMachineInstancesCreateOrUpdateBodyParam & RequestParameters; + +export interface VirtualMachineInstancesUpdateBodyParam { + /** The resource properties to be updated. */ + body: VirtualMachineInstanceUpdate; +} + +export type VirtualMachineInstancesUpdateParameters = + VirtualMachineInstancesUpdateBodyParam & RequestParameters; + +export interface VirtualMachineInstancesDeleteQueryParamProperties { + /** + * Forces the resource to be deleted. + * + * Possible values: "true", "false" + */ + force?: ForceDelete; + /** + * Whether to disable the VM from azure and also delete it from Vmm. + * + * Possible values: "true", "false" + */ + deleteFromHost?: DeleteFromHost; +} + +export interface VirtualMachineInstancesDeleteQueryParam { + queryParameters?: VirtualMachineInstancesDeleteQueryParamProperties; +} + +export type VirtualMachineInstancesDeleteParameters = + VirtualMachineInstancesDeleteQueryParam & RequestParameters; +export type VirtualMachineInstancesListParameters = RequestParameters; + +export interface VirtualMachineInstancesStopBodyParam { + /** The content of the action request */ + body: StopVirtualMachineOptions; +} + +export type VirtualMachineInstancesStopParameters = + VirtualMachineInstancesStopBodyParam & RequestParameters; +export type VirtualMachineInstancesStartParameters = RequestParameters; +export type VirtualMachineInstancesRestartParameters = RequestParameters; + +export interface VirtualMachineInstancesCreateCheckpointBodyParam { + /** The content of the action request */ + body: VirtualMachineCreateCheckpoint; +} + +export type VirtualMachineInstancesCreateCheckpointParameters = + VirtualMachineInstancesCreateCheckpointBodyParam & RequestParameters; + +export interface VirtualMachineInstancesDeleteCheckpointBodyParam { + /** The content of the action request */ + body: VirtualMachineDeleteCheckpoint; +} + +export type VirtualMachineInstancesDeleteCheckpointParameters = + VirtualMachineInstancesDeleteCheckpointBodyParam & RequestParameters; + +export interface VirtualMachineInstancesRestoreCheckpointBodyParam { + /** The content of the action request */ + body: VirtualMachineRestoreCheckpoint; +} + +export type VirtualMachineInstancesRestoreCheckpointParameters = + VirtualMachineInstancesRestoreCheckpointBodyParam & RequestParameters; +export type VmInstanceHybridIdentityMetadatasGetParameters = RequestParameters; +export type VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceParameters = + RequestParameters; +export type GuestAgentsGetParameters = RequestParameters; + +export interface GuestAgentsCreateBodyParam { + /** Resource create parameters. */ + body: GuestAgent; +} + +export type GuestAgentsCreateParameters = GuestAgentsCreateBodyParam & + RequestParameters; +export type GuestAgentsDeleteParameters = RequestParameters; +export type GuestAgentsListByVirtualMachineInstanceParameters = + RequestParameters; diff --git a/sdk/scvmm/arm-scvmm/src/rest/pollingHelper.ts b/sdk/scvmm/arm-scvmm/src/rest/pollingHelper.ts new file mode 100644 index 000000000000..e2dcec64f52d --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/rest/pollingHelper.ts @@ -0,0 +1,591 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { Client, HttpResponse } from "@azure-rest/core-client"; +import { AbortSignalLike } from "@azure/abort-controller"; +import { + CancelOnProgress, + CreateHttpPollerOptions, + RunningOperation, + OperationResponse, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { + VmmServersCreateOrUpdate200Response, + VmmServersCreateOrUpdate201Response, + VmmServersCreateOrUpdateDefaultResponse, + VmmServersCreateOrUpdateLogicalResponse, + VmmServersUpdate200Response, + VmmServersUpdate202Response, + VmmServersUpdateDefaultResponse, + VmmServersUpdateLogicalResponse, + VmmServersDelete202Response, + VmmServersDelete204Response, + VmmServersDeleteDefaultResponse, + VmmServersDeleteLogicalResponse, + CloudsCreateOrUpdate200Response, + CloudsCreateOrUpdate201Response, + CloudsCreateOrUpdateDefaultResponse, + CloudsCreateOrUpdateLogicalResponse, + CloudsUpdate200Response, + CloudsUpdate202Response, + CloudsUpdateDefaultResponse, + CloudsUpdateLogicalResponse, + CloudsDelete202Response, + CloudsDelete204Response, + CloudsDeleteDefaultResponse, + CloudsDeleteLogicalResponse, + VirtualNetworksCreateOrUpdate200Response, + VirtualNetworksCreateOrUpdate201Response, + VirtualNetworksCreateOrUpdateDefaultResponse, + VirtualNetworksCreateOrUpdateLogicalResponse, + VirtualNetworksUpdate200Response, + VirtualNetworksUpdate202Response, + VirtualNetworksUpdateDefaultResponse, + VirtualNetworksUpdateLogicalResponse, + VirtualNetworksDelete202Response, + VirtualNetworksDelete204Response, + VirtualNetworksDeleteDefaultResponse, + VirtualNetworksDeleteLogicalResponse, + VirtualMachineTemplatesCreateOrUpdate200Response, + VirtualMachineTemplatesCreateOrUpdate201Response, + VirtualMachineTemplatesCreateOrUpdateDefaultResponse, + VirtualMachineTemplatesCreateOrUpdateLogicalResponse, + VirtualMachineTemplatesUpdate200Response, + VirtualMachineTemplatesUpdate202Response, + VirtualMachineTemplatesUpdateDefaultResponse, + VirtualMachineTemplatesUpdateLogicalResponse, + VirtualMachineTemplatesDelete202Response, + VirtualMachineTemplatesDelete204Response, + VirtualMachineTemplatesDeleteDefaultResponse, + VirtualMachineTemplatesDeleteLogicalResponse, + AvailabilitySetsCreateOrUpdate200Response, + AvailabilitySetsCreateOrUpdate201Response, + AvailabilitySetsCreateOrUpdateDefaultResponse, + AvailabilitySetsCreateOrUpdateLogicalResponse, + AvailabilitySetsUpdate200Response, + AvailabilitySetsUpdate202Response, + AvailabilitySetsUpdateDefaultResponse, + AvailabilitySetsUpdateLogicalResponse, + AvailabilitySetsDelete202Response, + AvailabilitySetsDelete204Response, + AvailabilitySetsDeleteDefaultResponse, + AvailabilitySetsDeleteLogicalResponse, + VirtualMachineInstancesCreateOrUpdate200Response, + VirtualMachineInstancesCreateOrUpdate201Response, + VirtualMachineInstancesCreateOrUpdateDefaultResponse, + VirtualMachineInstancesCreateOrUpdateLogicalResponse, + VirtualMachineInstancesUpdate200Response, + VirtualMachineInstancesUpdate202Response, + VirtualMachineInstancesUpdateDefaultResponse, + VirtualMachineInstancesUpdateLogicalResponse, + VirtualMachineInstancesDelete202Response, + VirtualMachineInstancesDelete204Response, + VirtualMachineInstancesDeleteDefaultResponse, + VirtualMachineInstancesDeleteLogicalResponse, + VirtualMachineInstancesStop202Response, + VirtualMachineInstancesStopDefaultResponse, + VirtualMachineInstancesStopLogicalResponse, + VirtualMachineInstancesStart202Response, + VirtualMachineInstancesStartDefaultResponse, + VirtualMachineInstancesStartLogicalResponse, + VirtualMachineInstancesRestart202Response, + VirtualMachineInstancesRestartDefaultResponse, + VirtualMachineInstancesRestartLogicalResponse, + VirtualMachineInstancesCreateCheckpoint202Response, + VirtualMachineInstancesCreateCheckpointDefaultResponse, + VirtualMachineInstancesCreateCheckpointLogicalResponse, + VirtualMachineInstancesDeleteCheckpoint202Response, + VirtualMachineInstancesDeleteCheckpointDefaultResponse, + VirtualMachineInstancesDeleteCheckpointLogicalResponse, + VirtualMachineInstancesRestoreCheckpoint202Response, + VirtualMachineInstancesRestoreCheckpointDefaultResponse, + VirtualMachineInstancesRestoreCheckpointLogicalResponse, + GuestAgentsCreate200Response, + GuestAgentsCreate201Response, + GuestAgentsCreateDefaultResponse, + GuestAgentsCreateLogicalResponse, +} from "./responses.js"; + +/** + * A simple poller that can be used to poll a long running operation. + */ +export interface SimplePollerLike< + TState extends OperationState, + TResult, +> { + /** + * Returns true if the poller has finished polling. + */ + isDone(): boolean; + /** + * Returns the state of the operation. + */ + getOperationState(): TState; + /** + * Returns the result value of the operation, + * regardless of the state of the poller. + * It can return undefined or an incomplete form of the final TResult value + * depending on the implementation. + */ + getResult(): TResult | undefined; + /** + * Returns a promise that will resolve once a single polling request finishes. + * It does this by calling the update method of the Poller's operation. + */ + poll(options?: { abortSignal?: AbortSignalLike }): Promise; + /** + * Returns a promise that will resolve once the underlying operation is completed. + */ + pollUntilDone(pollOptions?: { + abortSignal?: AbortSignalLike; + }): Promise; + /** + * Invokes the provided callback after each polling is completed, + * sending the current state of the poller's operation. + * + * It returns a method that can be used to stop receiving updates on the given callback function. + */ + onProgress(callback: (state: TState) => void): CancelOnProgress; + + /** + * Returns a promise that could be used for serialized version of the poller's operation + * by invoking the operation's serialize method. + */ + serialize(): Promise; + + /** + * Wait the poller to be submitted. + */ + submitted(): Promise; + + /** + * Returns a string representation of the poller's operation. Similar to serialize but returns a string. + * @deprecated Use serialize() instead. + */ + toString(): string; + + /** + * Stops the poller from continuing to poll. Please note this will only stop the client-side polling + * @deprecated Use abortSignal to stop polling instead. + */ + stopPolling(): void; + + /** + * Returns true if the poller is stopped. + * @deprecated Use abortSignal status to track this instead. + */ + isStopped(): boolean; +} + +/** + * Helper function that builds a Poller object to help polling a long running operation. + * @param client - Client to use for sending the request to get additional pages. + * @param initialResponse - The initial response. + * @param options - Options to set a resume state or custom polling interval. + * @returns - A poller object to poll for operation state updates and eventually get the final response. + */ +export async function getLongRunningPoller< + TResult extends + | VmmServersCreateOrUpdateLogicalResponse + | VmmServersCreateOrUpdateDefaultResponse, +>( + client: Client, + initialResponse: + | VmmServersCreateOrUpdate200Response + | VmmServersCreateOrUpdate201Response + | VmmServersCreateOrUpdateDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | VmmServersUpdateLogicalResponse + | VmmServersUpdateDefaultResponse, +>( + client: Client, + initialResponse: + | VmmServersUpdate200Response + | VmmServersUpdate202Response + | VmmServersUpdateDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | VmmServersDeleteLogicalResponse + | VmmServersDeleteDefaultResponse, +>( + client: Client, + initialResponse: + | VmmServersDelete202Response + | VmmServersDelete204Response + | VmmServersDeleteDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | CloudsCreateOrUpdateLogicalResponse + | CloudsCreateOrUpdateDefaultResponse, +>( + client: Client, + initialResponse: + | CloudsCreateOrUpdate200Response + | CloudsCreateOrUpdate201Response + | CloudsCreateOrUpdateDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends CloudsUpdateLogicalResponse | CloudsUpdateDefaultResponse, +>( + client: Client, + initialResponse: + | CloudsUpdate200Response + | CloudsUpdate202Response + | CloudsUpdateDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends CloudsDeleteLogicalResponse | CloudsDeleteDefaultResponse, +>( + client: Client, + initialResponse: + | CloudsDelete202Response + | CloudsDelete204Response + | CloudsDeleteDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | VirtualNetworksCreateOrUpdateLogicalResponse + | VirtualNetworksCreateOrUpdateDefaultResponse, +>( + client: Client, + initialResponse: + | VirtualNetworksCreateOrUpdate200Response + | VirtualNetworksCreateOrUpdate201Response + | VirtualNetworksCreateOrUpdateDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | VirtualNetworksUpdateLogicalResponse + | VirtualNetworksUpdateDefaultResponse, +>( + client: Client, + initialResponse: + | VirtualNetworksUpdate200Response + | VirtualNetworksUpdate202Response + | VirtualNetworksUpdateDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | VirtualNetworksDeleteLogicalResponse + | VirtualNetworksDeleteDefaultResponse, +>( + client: Client, + initialResponse: + | VirtualNetworksDelete202Response + | VirtualNetworksDelete204Response + | VirtualNetworksDeleteDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | VirtualMachineTemplatesCreateOrUpdateLogicalResponse + | VirtualMachineTemplatesCreateOrUpdateDefaultResponse, +>( + client: Client, + initialResponse: + | VirtualMachineTemplatesCreateOrUpdate200Response + | VirtualMachineTemplatesCreateOrUpdate201Response + | VirtualMachineTemplatesCreateOrUpdateDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | VirtualMachineTemplatesUpdateLogicalResponse + | VirtualMachineTemplatesUpdateDefaultResponse, +>( + client: Client, + initialResponse: + | VirtualMachineTemplatesUpdate200Response + | VirtualMachineTemplatesUpdate202Response + | VirtualMachineTemplatesUpdateDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | VirtualMachineTemplatesDeleteLogicalResponse + | VirtualMachineTemplatesDeleteDefaultResponse, +>( + client: Client, + initialResponse: + | VirtualMachineTemplatesDelete202Response + | VirtualMachineTemplatesDelete204Response + | VirtualMachineTemplatesDeleteDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | AvailabilitySetsCreateOrUpdateLogicalResponse + | AvailabilitySetsCreateOrUpdateDefaultResponse, +>( + client: Client, + initialResponse: + | AvailabilitySetsCreateOrUpdate200Response + | AvailabilitySetsCreateOrUpdate201Response + | AvailabilitySetsCreateOrUpdateDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | AvailabilitySetsUpdateLogicalResponse + | AvailabilitySetsUpdateDefaultResponse, +>( + client: Client, + initialResponse: + | AvailabilitySetsUpdate200Response + | AvailabilitySetsUpdate202Response + | AvailabilitySetsUpdateDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | AvailabilitySetsDeleteLogicalResponse + | AvailabilitySetsDeleteDefaultResponse, +>( + client: Client, + initialResponse: + | AvailabilitySetsDelete202Response + | AvailabilitySetsDelete204Response + | AvailabilitySetsDeleteDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | VirtualMachineInstancesCreateOrUpdateLogicalResponse + | VirtualMachineInstancesCreateOrUpdateDefaultResponse, +>( + client: Client, + initialResponse: + | VirtualMachineInstancesCreateOrUpdate200Response + | VirtualMachineInstancesCreateOrUpdate201Response + | VirtualMachineInstancesCreateOrUpdateDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | VirtualMachineInstancesUpdateLogicalResponse + | VirtualMachineInstancesUpdateDefaultResponse, +>( + client: Client, + initialResponse: + | VirtualMachineInstancesUpdate200Response + | VirtualMachineInstancesUpdate202Response + | VirtualMachineInstancesUpdateDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | VirtualMachineInstancesDeleteLogicalResponse + | VirtualMachineInstancesDeleteDefaultResponse, +>( + client: Client, + initialResponse: + | VirtualMachineInstancesDelete202Response + | VirtualMachineInstancesDelete204Response + | VirtualMachineInstancesDeleteDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | VirtualMachineInstancesStopLogicalResponse + | VirtualMachineInstancesStopDefaultResponse, +>( + client: Client, + initialResponse: + | VirtualMachineInstancesStop202Response + | VirtualMachineInstancesStopDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | VirtualMachineInstancesStartLogicalResponse + | VirtualMachineInstancesStartDefaultResponse, +>( + client: Client, + initialResponse: + | VirtualMachineInstancesStart202Response + | VirtualMachineInstancesStartDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | VirtualMachineInstancesRestartLogicalResponse + | VirtualMachineInstancesRestartDefaultResponse, +>( + client: Client, + initialResponse: + | VirtualMachineInstancesRestart202Response + | VirtualMachineInstancesRestartDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | VirtualMachineInstancesCreateCheckpointLogicalResponse + | VirtualMachineInstancesCreateCheckpointDefaultResponse, +>( + client: Client, + initialResponse: + | VirtualMachineInstancesCreateCheckpoint202Response + | VirtualMachineInstancesCreateCheckpointDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | VirtualMachineInstancesDeleteCheckpointLogicalResponse + | VirtualMachineInstancesDeleteCheckpointDefaultResponse, +>( + client: Client, + initialResponse: + | VirtualMachineInstancesDeleteCheckpoint202Response + | VirtualMachineInstancesDeleteCheckpointDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | VirtualMachineInstancesRestoreCheckpointLogicalResponse + | VirtualMachineInstancesRestoreCheckpointDefaultResponse, +>( + client: Client, + initialResponse: + | VirtualMachineInstancesRestoreCheckpoint202Response + | VirtualMachineInstancesRestoreCheckpointDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller< + TResult extends + | GuestAgentsCreateLogicalResponse + | GuestAgentsCreateDefaultResponse, +>( + client: Client, + initialResponse: + | GuestAgentsCreate200Response + | GuestAgentsCreate201Response + | GuestAgentsCreateDefaultResponse, + options?: CreateHttpPollerOptions>, +): Promise, TResult>>; +export async function getLongRunningPoller( + client: Client, + initialResponse: TResult, + options: CreateHttpPollerOptions> = {}, +): Promise, TResult>> { + const abortController = new AbortController(); + const poller: RunningOperation = { + sendInitialRequest: async () => { + // In the case of Rest Clients we are building the LRO poller object from a response that's the reason + // we are not triggering the initial request here, just extracting the information from the + // response we were provided. + return getLroResponse(initialResponse); + }, + sendPollRequest: async ( + path: string, + pollOptions?: { abortSignal?: AbortSignalLike }, + ) => { + // This is the callback that is going to be called to poll the service + // to get the latest status. We use the client provided and the polling path + // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location + // depending on the lro pattern that the service implements. If non is provided we default to the initial path. + function abortListener(): void { + abortController.abort(); + } + const inputAbortSignal = pollOptions?.abortSignal; + const abortSignal = abortController.signal; + if (inputAbortSignal?.aborted) { + abortController.abort(); + } else if (!abortSignal.aborted) { + inputAbortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + } + let response; + try { + response = await client + .pathUnchecked(path ?? initialResponse.request.url) + .get({ abortSignal }); + } finally { + inputAbortSignal?.removeEventListener("abort", abortListener); + } + const lroResponse = getLroResponse(response as TResult); + lroResponse.rawResponse.headers["x-ms-original-url"] = + initialResponse.request.url; + return lroResponse; + }, + }; + + options.resolveOnUnsuccessful = options.resolveOnUnsuccessful ?? true; + const httpPoller = createHttpPoller(poller, options); + const simplePoller: SimplePollerLike, TResult> = { + isDone() { + return httpPoller.isDone; + }, + isStopped() { + return abortController.signal.aborted; + }, + getOperationState() { + if (!httpPoller.operationState) { + throw new Error( + "Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState().", + ); + } + return httpPoller.operationState; + }, + getResult() { + return httpPoller.result; + }, + toString() { + if (!httpPoller.operationState) { + throw new Error( + "Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState().", + ); + } + return JSON.stringify({ + state: httpPoller.operationState, + }); + }, + stopPolling() { + abortController.abort(); + }, + onProgress: httpPoller.onProgress, + poll: httpPoller.poll, + pollUntilDone: httpPoller.pollUntilDone, + serialize: httpPoller.serialize, + submitted: httpPoller.submitted, + }; + return simplePoller; +} + +/** + * Converts a Rest Client response to a response that the LRO implementation understands + * @param response - a rest client http response + * @returns - An LRO response that the LRO implementation understands + */ +function getLroResponse( + response: TResult, +): OperationResponse { + if (Number.isNaN(response.status)) { + throw new TypeError( + `Status code of the response is not a number. Value: ${response.status}`, + ); + } + + return { + flatResponse: response, + rawResponse: { + ...response, + statusCode: Number.parseInt(response.status), + body: response.body, + }, + }; +} diff --git a/sdk/scvmm/arm-scvmm/src/rest/responses.ts b/sdk/scvmm/arm-scvmm/src/rest/responses.ts new file mode 100644 index 000000000000..5b11208fdf26 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/rest/responses.ts @@ -0,0 +1,1093 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { RawHttpHeaders } from "@azure/core-rest-pipeline"; +import { HttpResponse } from "@azure-rest/core-client"; +import { + OperationListResultOutput, + ErrorResponseOutput, + VmmServerOutput, + VmmServerListResultOutput, + CloudOutput, + CloudListResultOutput, + VirtualNetworkOutput, + VirtualNetworkListResultOutput, + VirtualMachineTemplateOutput, + VirtualMachineTemplateListResultOutput, + AvailabilitySetOutput, + AvailabilitySetListResultOutput, + InventoryItemOutput, + InventoryItemListResultOutput, + VirtualMachineInstanceOutput, + VirtualMachineInstanceListResultOutput, + VmInstanceHybridIdentityMetadataOutput, + VmInstanceHybridIdentityMetadataListResultOutput, + GuestAgentOutput, + GuestAgentListResultOutput, +} from "./outputModels.js"; + +/** Azure operation completed successfully. */ +export interface OperationsList200Response extends HttpResponse { + status: "200"; + body: OperationListResultOutput; +} + +export interface OperationsListDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** Azure operation completed successfully. */ +export interface VmmServersGet200Response extends HttpResponse { + status: "200"; + body: VmmServerOutput; +} + +export interface VmmServersGetDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** Resource 'VmmServer' update operation succeeded */ +export interface VmmServersCreateOrUpdate200Response extends HttpResponse { + status: "200"; + body: VmmServerOutput; +} + +export interface VmmServersCreateOrUpdate201Headers { + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + "retry-after"?: number; +} + +/** Resource 'VmmServer' create operation succeeded */ +export interface VmmServersCreateOrUpdate201Response extends HttpResponse { + status: "201"; + body: VmmServerOutput; + headers: RawHttpHeaders & VmmServersCreateOrUpdate201Headers; +} + +export interface VmmServersCreateOrUpdateDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** The final response for long-running createOrUpdate operation */ +export interface VmmServersCreateOrUpdateLogicalResponse extends HttpResponse { + status: "200"; + body: VmmServerOutput; +} + +/** Azure operation completed successfully. */ +export interface VmmServersUpdate200Response extends HttpResponse { + status: "200"; + body: VmmServerOutput; +} + +export interface VmmServersUpdate202Headers { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + "retry-after"?: number; +} + +/** Resource update request accepted. */ +export interface VmmServersUpdate202Response extends HttpResponse { + status: "202"; + headers: RawHttpHeaders & VmmServersUpdate202Headers; +} + +export interface VmmServersUpdateDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** The final response for long-running update operation */ +export interface VmmServersUpdateLogicalResponse extends HttpResponse { + status: "200"; + body: VmmServerOutput; +} + +export interface VmmServersDelete202Headers { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + "retry-after"?: number; +} + +/** Resource deletion accepted. */ +export interface VmmServersDelete202Response extends HttpResponse { + status: "202"; + headers: RawHttpHeaders & VmmServersDelete202Headers; +} + +/** Resource does not exist. */ +export interface VmmServersDelete204Response extends HttpResponse { + status: "204"; +} + +export interface VmmServersDeleteDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** The final response for long-running delete operation */ +export interface VmmServersDeleteLogicalResponse extends HttpResponse { + status: "200"; +} + +/** Azure operation completed successfully. */ +export interface VmmServersListByResourceGroup200Response extends HttpResponse { + status: "200"; + body: VmmServerListResultOutput; +} + +export interface VmmServersListByResourceGroupDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** Azure operation completed successfully. */ +export interface VmmServersListBySubscription200Response extends HttpResponse { + status: "200"; + body: VmmServerListResultOutput; +} + +export interface VmmServersListBySubscriptionDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** Azure operation completed successfully. */ +export interface CloudsGet200Response extends HttpResponse { + status: "200"; + body: CloudOutput; +} + +export interface CloudsGetDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** Resource 'Cloud' update operation succeeded */ +export interface CloudsCreateOrUpdate200Response extends HttpResponse { + status: "200"; + body: CloudOutput; +} + +export interface CloudsCreateOrUpdate201Headers { + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + "retry-after"?: number; +} + +/** Resource 'Cloud' create operation succeeded */ +export interface CloudsCreateOrUpdate201Response extends HttpResponse { + status: "201"; + body: CloudOutput; + headers: RawHttpHeaders & CloudsCreateOrUpdate201Headers; +} + +export interface CloudsCreateOrUpdateDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** The final response for long-running createOrUpdate operation */ +export interface CloudsCreateOrUpdateLogicalResponse extends HttpResponse { + status: "200"; + body: CloudOutput; +} + +/** Azure operation completed successfully. */ +export interface CloudsUpdate200Response extends HttpResponse { + status: "200"; + body: CloudOutput; +} + +export interface CloudsUpdate202Headers { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + "retry-after"?: number; +} + +/** Resource update request accepted. */ +export interface CloudsUpdate202Response extends HttpResponse { + status: "202"; + headers: RawHttpHeaders & CloudsUpdate202Headers; +} + +export interface CloudsUpdateDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** The final response for long-running update operation */ +export interface CloudsUpdateLogicalResponse extends HttpResponse { + status: "200"; + body: CloudOutput; +} + +export interface CloudsDelete202Headers { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + "retry-after"?: number; +} + +/** Resource deletion accepted. */ +export interface CloudsDelete202Response extends HttpResponse { + status: "202"; + headers: RawHttpHeaders & CloudsDelete202Headers; +} + +/** Resource does not exist. */ +export interface CloudsDelete204Response extends HttpResponse { + status: "204"; +} + +export interface CloudsDeleteDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** The final response for long-running delete operation */ +export interface CloudsDeleteLogicalResponse extends HttpResponse { + status: "200"; +} + +/** Azure operation completed successfully. */ +export interface CloudsListByResourceGroup200Response extends HttpResponse { + status: "200"; + body: CloudListResultOutput; +} + +export interface CloudsListByResourceGroupDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** Azure operation completed successfully. */ +export interface CloudsListBySubscription200Response extends HttpResponse { + status: "200"; + body: CloudListResultOutput; +} + +export interface CloudsListBySubscriptionDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** Azure operation completed successfully. */ +export interface VirtualNetworksGet200Response extends HttpResponse { + status: "200"; + body: VirtualNetworkOutput; +} + +export interface VirtualNetworksGetDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** Resource 'VirtualNetwork' update operation succeeded */ +export interface VirtualNetworksCreateOrUpdate200Response extends HttpResponse { + status: "200"; + body: VirtualNetworkOutput; +} + +export interface VirtualNetworksCreateOrUpdate201Headers { + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + "retry-after"?: number; +} + +/** Resource 'VirtualNetwork' create operation succeeded */ +export interface VirtualNetworksCreateOrUpdate201Response extends HttpResponse { + status: "201"; + body: VirtualNetworkOutput; + headers: RawHttpHeaders & VirtualNetworksCreateOrUpdate201Headers; +} + +export interface VirtualNetworksCreateOrUpdateDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** The final response for long-running createOrUpdate operation */ +export interface VirtualNetworksCreateOrUpdateLogicalResponse + extends HttpResponse { + status: "200"; + body: VirtualNetworkOutput; +} + +/** Azure operation completed successfully. */ +export interface VirtualNetworksUpdate200Response extends HttpResponse { + status: "200"; + body: VirtualNetworkOutput; +} + +export interface VirtualNetworksUpdate202Headers { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + "retry-after"?: number; +} + +/** Resource update request accepted. */ +export interface VirtualNetworksUpdate202Response extends HttpResponse { + status: "202"; + headers: RawHttpHeaders & VirtualNetworksUpdate202Headers; +} + +export interface VirtualNetworksUpdateDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** The final response for long-running update operation */ +export interface VirtualNetworksUpdateLogicalResponse extends HttpResponse { + status: "200"; + body: VirtualNetworkOutput; +} + +export interface VirtualNetworksDelete202Headers { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + "retry-after"?: number; +} + +/** Resource deletion accepted. */ +export interface VirtualNetworksDelete202Response extends HttpResponse { + status: "202"; + headers: RawHttpHeaders & VirtualNetworksDelete202Headers; +} + +/** Resource does not exist. */ +export interface VirtualNetworksDelete204Response extends HttpResponse { + status: "204"; +} + +export interface VirtualNetworksDeleteDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** The final response for long-running delete operation */ +export interface VirtualNetworksDeleteLogicalResponse extends HttpResponse { + status: "200"; +} + +/** Azure operation completed successfully. */ +export interface VirtualNetworksListByResourceGroup200Response + extends HttpResponse { + status: "200"; + body: VirtualNetworkListResultOutput; +} + +export interface VirtualNetworksListByResourceGroupDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** Azure operation completed successfully. */ +export interface VirtualNetworksListBySubscription200Response + extends HttpResponse { + status: "200"; + body: VirtualNetworkListResultOutput; +} + +export interface VirtualNetworksListBySubscriptionDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** Azure operation completed successfully. */ +export interface VirtualMachineTemplatesGet200Response extends HttpResponse { + status: "200"; + body: VirtualMachineTemplateOutput; +} + +export interface VirtualMachineTemplatesGetDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** Resource 'VirtualMachineTemplate' update operation succeeded */ +export interface VirtualMachineTemplatesCreateOrUpdate200Response + extends HttpResponse { + status: "200"; + body: VirtualMachineTemplateOutput; +} + +export interface VirtualMachineTemplatesCreateOrUpdate201Headers { + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + "retry-after"?: number; +} + +/** Resource 'VirtualMachineTemplate' create operation succeeded */ +export interface VirtualMachineTemplatesCreateOrUpdate201Response + extends HttpResponse { + status: "201"; + body: VirtualMachineTemplateOutput; + headers: RawHttpHeaders & VirtualMachineTemplatesCreateOrUpdate201Headers; +} + +export interface VirtualMachineTemplatesCreateOrUpdateDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** The final response for long-running createOrUpdate operation */ +export interface VirtualMachineTemplatesCreateOrUpdateLogicalResponse + extends HttpResponse { + status: "200"; + body: VirtualMachineTemplateOutput; +} + +/** Azure operation completed successfully. */ +export interface VirtualMachineTemplatesUpdate200Response extends HttpResponse { + status: "200"; + body: VirtualMachineTemplateOutput; +} + +export interface VirtualMachineTemplatesUpdate202Headers { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + "retry-after"?: number; +} + +/** Resource update request accepted. */ +export interface VirtualMachineTemplatesUpdate202Response extends HttpResponse { + status: "202"; + headers: RawHttpHeaders & VirtualMachineTemplatesUpdate202Headers; +} + +export interface VirtualMachineTemplatesUpdateDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** The final response for long-running update operation */ +export interface VirtualMachineTemplatesUpdateLogicalResponse + extends HttpResponse { + status: "200"; + body: VirtualMachineTemplateOutput; +} + +export interface VirtualMachineTemplatesDelete202Headers { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + "retry-after"?: number; +} + +/** Resource deletion accepted. */ +export interface VirtualMachineTemplatesDelete202Response extends HttpResponse { + status: "202"; + headers: RawHttpHeaders & VirtualMachineTemplatesDelete202Headers; +} + +/** Resource does not exist. */ +export interface VirtualMachineTemplatesDelete204Response extends HttpResponse { + status: "204"; +} + +export interface VirtualMachineTemplatesDeleteDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** The final response for long-running delete operation */ +export interface VirtualMachineTemplatesDeleteLogicalResponse + extends HttpResponse { + status: "200"; +} + +/** Azure operation completed successfully. */ +export interface VirtualMachineTemplatesListByResourceGroup200Response + extends HttpResponse { + status: "200"; + body: VirtualMachineTemplateListResultOutput; +} + +export interface VirtualMachineTemplatesListByResourceGroupDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** Azure operation completed successfully. */ +export interface VirtualMachineTemplatesListBySubscription200Response + extends HttpResponse { + status: "200"; + body: VirtualMachineTemplateListResultOutput; +} + +export interface VirtualMachineTemplatesListBySubscriptionDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** Azure operation completed successfully. */ +export interface AvailabilitySetsGet200Response extends HttpResponse { + status: "200"; + body: AvailabilitySetOutput; +} + +export interface AvailabilitySetsGetDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** Resource 'AvailabilitySet' update operation succeeded */ +export interface AvailabilitySetsCreateOrUpdate200Response + extends HttpResponse { + status: "200"; + body: AvailabilitySetOutput; +} + +export interface AvailabilitySetsCreateOrUpdate201Headers { + /** A link to the status monitor */ + "azure-asyncoperation"?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + "retry-after"?: number; +} + +/** Resource 'AvailabilitySet' create operation succeeded */ +export interface AvailabilitySetsCreateOrUpdate201Response + extends HttpResponse { + status: "201"; + body: AvailabilitySetOutput; + headers: RawHttpHeaders & AvailabilitySetsCreateOrUpdate201Headers; +} + +export interface AvailabilitySetsCreateOrUpdateDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** The final response for long-running createOrUpdate operation */ +export interface AvailabilitySetsCreateOrUpdateLogicalResponse + extends HttpResponse { + status: "200"; + body: AvailabilitySetOutput; +} + +/** Azure operation completed successfully. */ +export interface AvailabilitySetsUpdate200Response extends HttpResponse { + status: "200"; + body: AvailabilitySetOutput; +} + +export interface AvailabilitySetsUpdate202Headers { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + "retry-after"?: number; +} + +/** Resource update request accepted. */ +export interface AvailabilitySetsUpdate202Response extends HttpResponse { + status: "202"; + headers: RawHttpHeaders & AvailabilitySetsUpdate202Headers; +} + +export interface AvailabilitySetsUpdateDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** The final response for long-running update operation */ +export interface AvailabilitySetsUpdateLogicalResponse extends HttpResponse { + status: "200"; + body: AvailabilitySetOutput; +} + +export interface AvailabilitySetsDelete202Headers { + /** A link to the status monitor */ + "azure-asyncoperation"?: string; + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + "retry-after"?: number; +} + +/** Resource deletion accepted. */ +export interface AvailabilitySetsDelete202Response extends HttpResponse { + status: "202"; + headers: RawHttpHeaders & AvailabilitySetsDelete202Headers; +} + +/** Resource does not exist. */ +export interface AvailabilitySetsDelete204Response extends HttpResponse { + status: "204"; +} + +export interface AvailabilitySetsDeleteDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** The final response for long-running delete operation */ +export interface AvailabilitySetsDeleteLogicalResponse extends HttpResponse { + status: "200"; +} + +/** Azure operation completed successfully. */ +export interface AvailabilitySetsListByResourceGroup200Response + extends HttpResponse { + status: "200"; + body: AvailabilitySetListResultOutput; +} + +export interface AvailabilitySetsListByResourceGroupDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** Azure operation completed successfully. */ +export interface AvailabilitySetsListBySubscription200Response + extends HttpResponse { + status: "200"; + body: AvailabilitySetListResultOutput; +} + +export interface AvailabilitySetsListBySubscriptionDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** Azure operation completed successfully. */ +export interface InventoryItemsGet200Response extends HttpResponse { + status: "200"; + body: InventoryItemOutput; +} + +export interface InventoryItemsGetDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** Resource 'InventoryItem' update operation succeeded */ +export interface InventoryItemsCreate200Response extends HttpResponse { + status: "200"; + body: InventoryItemOutput; +} + +/** Resource 'InventoryItem' create operation succeeded */ +export interface InventoryItemsCreate201Response extends HttpResponse { + status: "201"; + body: InventoryItemOutput; +} + +export interface InventoryItemsCreateDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** Resource deleted successfully. */ +export interface InventoryItemsDelete200Response extends HttpResponse { + status: "200"; +} + +/** Resource does not exist. */ +export interface InventoryItemsDelete204Response extends HttpResponse { + status: "204"; +} + +export interface InventoryItemsDeleteDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** Azure operation completed successfully. */ +export interface InventoryItemsListByVmmServer200Response extends HttpResponse { + status: "200"; + body: InventoryItemListResultOutput; +} + +export interface InventoryItemsListByVmmServerDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** Azure operation completed successfully. */ +export interface VirtualMachineInstancesGet200Response extends HttpResponse { + status: "200"; + body: VirtualMachineInstanceOutput; +} + +export interface VirtualMachineInstancesGetDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** Resource 'VirtualMachineInstance' update operation succeeded */ +export interface VirtualMachineInstancesCreateOrUpdate200Response + extends HttpResponse { + status: "200"; + body: VirtualMachineInstanceOutput; +} + +export interface VirtualMachineInstancesCreateOrUpdate201Headers { + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + "retry-after"?: number; +} + +/** Resource 'VirtualMachineInstance' create operation succeeded */ +export interface VirtualMachineInstancesCreateOrUpdate201Response + extends HttpResponse { + status: "201"; + body: VirtualMachineInstanceOutput; + headers: RawHttpHeaders & VirtualMachineInstancesCreateOrUpdate201Headers; +} + +export interface VirtualMachineInstancesCreateOrUpdateDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** The final response for long-running createOrUpdate operation */ +export interface VirtualMachineInstancesCreateOrUpdateLogicalResponse + extends HttpResponse { + status: "200"; + body: VirtualMachineInstanceOutput; +} + +/** Azure operation completed successfully. */ +export interface VirtualMachineInstancesUpdate200Response extends HttpResponse { + status: "200"; + body: VirtualMachineInstanceOutput; +} + +export interface VirtualMachineInstancesUpdate202Headers { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + "retry-after"?: number; +} + +/** Resource update request accepted. */ +export interface VirtualMachineInstancesUpdate202Response extends HttpResponse { + status: "202"; + headers: RawHttpHeaders & VirtualMachineInstancesUpdate202Headers; +} + +export interface VirtualMachineInstancesUpdateDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** The final response for long-running update operation */ +export interface VirtualMachineInstancesUpdateLogicalResponse + extends HttpResponse { + status: "200"; + body: VirtualMachineInstanceOutput; +} + +export interface VirtualMachineInstancesDelete202Headers { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + "retry-after"?: number; +} + +/** Resource deletion accepted. */ +export interface VirtualMachineInstancesDelete202Response extends HttpResponse { + status: "202"; + headers: RawHttpHeaders & VirtualMachineInstancesDelete202Headers; +} + +/** Resource does not exist. */ +export interface VirtualMachineInstancesDelete204Response extends HttpResponse { + status: "204"; +} + +export interface VirtualMachineInstancesDeleteDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** The final response for long-running delete operation */ +export interface VirtualMachineInstancesDeleteLogicalResponse + extends HttpResponse { + status: "200"; +} + +/** Azure operation completed successfully. */ +export interface VirtualMachineInstancesList200Response extends HttpResponse { + status: "200"; + body: VirtualMachineInstanceListResultOutput; +} + +export interface VirtualMachineInstancesListDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +export interface VirtualMachineInstancesStop202Headers { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + "retry-after"?: number; +} + +/** Resource operation accepted. */ +export interface VirtualMachineInstancesStop202Response extends HttpResponse { + status: "202"; + headers: RawHttpHeaders & VirtualMachineInstancesStop202Headers; +} + +export interface VirtualMachineInstancesStopDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** The final response for long-running stop operation */ +export interface VirtualMachineInstancesStopLogicalResponse + extends HttpResponse { + status: "200"; +} + +export interface VirtualMachineInstancesStart202Headers { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + "retry-after"?: number; +} + +/** Resource operation accepted. */ +export interface VirtualMachineInstancesStart202Response extends HttpResponse { + status: "202"; + headers: RawHttpHeaders & VirtualMachineInstancesStart202Headers; +} + +export interface VirtualMachineInstancesStartDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** The final response for long-running start operation */ +export interface VirtualMachineInstancesStartLogicalResponse + extends HttpResponse { + status: "200"; +} + +export interface VirtualMachineInstancesRestart202Headers { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + "retry-after"?: number; +} + +/** Resource operation accepted. */ +export interface VirtualMachineInstancesRestart202Response + extends HttpResponse { + status: "202"; + headers: RawHttpHeaders & VirtualMachineInstancesRestart202Headers; +} + +export interface VirtualMachineInstancesRestartDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** The final response for long-running restart operation */ +export interface VirtualMachineInstancesRestartLogicalResponse + extends HttpResponse { + status: "200"; +} + +export interface VirtualMachineInstancesCreateCheckpoint202Headers { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + "retry-after"?: number; +} + +/** Resource operation accepted. */ +export interface VirtualMachineInstancesCreateCheckpoint202Response + extends HttpResponse { + status: "202"; + headers: RawHttpHeaders & VirtualMachineInstancesCreateCheckpoint202Headers; +} + +export interface VirtualMachineInstancesCreateCheckpointDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** The final response for long-running createCheckpoint operation */ +export interface VirtualMachineInstancesCreateCheckpointLogicalResponse + extends HttpResponse { + status: "200"; +} + +export interface VirtualMachineInstancesDeleteCheckpoint202Headers { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + "retry-after"?: number; +} + +/** Resource operation accepted. */ +export interface VirtualMachineInstancesDeleteCheckpoint202Response + extends HttpResponse { + status: "202"; + headers: RawHttpHeaders & VirtualMachineInstancesDeleteCheckpoint202Headers; +} + +export interface VirtualMachineInstancesDeleteCheckpointDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** The final response for long-running deleteCheckpoint operation */ +export interface VirtualMachineInstancesDeleteCheckpointLogicalResponse + extends HttpResponse { + status: "200"; +} + +export interface VirtualMachineInstancesRestoreCheckpoint202Headers { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + "retry-after"?: number; +} + +/** Resource operation accepted. */ +export interface VirtualMachineInstancesRestoreCheckpoint202Response + extends HttpResponse { + status: "202"; + headers: RawHttpHeaders & VirtualMachineInstancesRestoreCheckpoint202Headers; +} + +export interface VirtualMachineInstancesRestoreCheckpointDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** The final response for long-running restoreCheckpoint operation */ +export interface VirtualMachineInstancesRestoreCheckpointLogicalResponse + extends HttpResponse { + status: "200"; +} + +/** Azure operation completed successfully. */ +export interface VmInstanceHybridIdentityMetadatasGet200Response + extends HttpResponse { + status: "200"; + body: VmInstanceHybridIdentityMetadataOutput; +} + +export interface VmInstanceHybridIdentityMetadatasGetDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** Azure operation completed successfully. */ +export interface VmInstanceHybridIdentityMetadatasListByVirtualMachineInstance200Response + extends HttpResponse { + status: "200"; + body: VmInstanceHybridIdentityMetadataListResultOutput; +} + +export interface VmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** Azure operation completed successfully. */ +export interface GuestAgentsGet200Response extends HttpResponse { + status: "200"; + body: GuestAgentOutput; +} + +export interface GuestAgentsGetDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** Resource 'GuestAgent' update operation succeeded */ +export interface GuestAgentsCreate200Response extends HttpResponse { + status: "200"; + body: GuestAgentOutput; +} + +export interface GuestAgentsCreate201Headers { + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + "retry-after"?: number; +} + +/** Resource 'GuestAgent' create operation succeeded */ +export interface GuestAgentsCreate201Response extends HttpResponse { + status: "201"; + body: GuestAgentOutput; + headers: RawHttpHeaders & GuestAgentsCreate201Headers; +} + +export interface GuestAgentsCreateDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** The final response for long-running create operation */ +export interface GuestAgentsCreateLogicalResponse extends HttpResponse { + status: "200"; + body: GuestAgentOutput; +} + +/** Resource deleted successfully. */ +export interface GuestAgentsDelete200Response extends HttpResponse { + status: "200"; +} + +/** Resource does not exist. */ +export interface GuestAgentsDelete204Response extends HttpResponse { + status: "204"; +} + +export interface GuestAgentsDeleteDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} + +/** Azure operation completed successfully. */ +export interface GuestAgentsListByVirtualMachineInstance200Response + extends HttpResponse { + status: "200"; + body: GuestAgentListResultOutput; +} + +export interface GuestAgentsListByVirtualMachineInstanceDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponseOutput; +} diff --git a/sdk/scvmm/arm-scvmm/src/rest/scVmmClient.ts b/sdk/scvmm/arm-scvmm/src/rest/scVmmClient.ts new file mode 100644 index 000000000000..dd06dfeaab37 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/rest/scVmmClient.ts @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { getClient, ClientOptions } from "@azure-rest/core-client"; +import { logger } from "../logger.js"; +import { TokenCredential } from "@azure/core-auth"; +import { ScVmmContext } from "./clientDefinitions.js"; + +/** The optional parameters for the client */ +export interface ScVmmContextOptions extends ClientOptions { + /** The api version option of the client */ + apiVersion?: string; +} + +/** + * Initialize a new instance of `ScVmmContext` + * @param credentials - uniquely identify client credential + * @param options - the parameter for all optional parameters + */ +export default function createClient( + credentials: TokenCredential, + { apiVersion = "2024-06-01", ...options }: ScVmmContextOptions = {}, +): ScVmmContext { + const endpointUrl = + options.endpoint ?? options.baseUrl ?? `https://management.azure.com`; + const userAgentInfo = `azsdk-js-arm-scvmm/1.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}` + : `${userAgentInfo}`; + options = { + ...options, + userAgentOptions: { + userAgentPrefix, + }, + loggingOptions: { + logger: options.loggingOptions?.logger ?? logger.info, + }, + credentials: { + scopes: options.credentials?.scopes ?? [`${endpointUrl}/.default`], + }, + }; + const client = getClient(endpointUrl, credentials, options) as ScVmmContext; + + client.pipeline.removePolicy({ name: "ApiVersionPolicy" }); + client.pipeline.addPolicy({ + name: "ClientApiVersionPolicy", + sendRequest: (req, next) => { + // Use the apiVersion defined in request url directly + // Append one if there is no apiVersion and we have one at client options + const url = new URL(req.url); + if (!url.searchParams.get("api-version") && apiVersion) { + req.url = `${req.url}${ + Array.from(url.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + + return next(req); + }, + }); + return client; +} diff --git a/sdk/scvmm/arm-scvmm/src/restorePollerHelpers.ts b/sdk/scvmm/arm-scvmm/src/restorePollerHelpers.ts new file mode 100644 index 000000000000..54c1cd493f32 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/restorePollerHelpers.ts @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { + PollerLike, + OperationState, + deserializeState, + ResourceLocationConfig, +} from "@azure/core-lro"; +import { ScVmmClient } from "./scVmmClient.js"; +import { getLongRunningPoller } from "./api/pollingHelpers.js"; +import { + _vmmServersCreateOrUpdateDeserialize, + _vmmServersUpdateDeserialize, + _vmmServersDeleteDeserialize, +} from "./api/vmmServers/index.js"; +import { + _cloudsCreateOrUpdateDeserialize, + _cloudsUpdateDeserialize, + _cloudsDeleteDeserialize, +} from "./api/clouds/index.js"; +import { + _virtualNetworksCreateOrUpdateDeserialize, + _virtualNetworksUpdateDeserialize, + _virtualNetworksDeleteDeserialize, +} from "./api/virtualNetworks/index.js"; +import { + _virtualMachineTemplatesCreateOrUpdateDeserialize, + _virtualMachineTemplatesUpdateDeserialize, + _virtualMachineTemplatesDeleteDeserialize, +} from "./api/virtualMachineTemplates/index.js"; +import { + _availabilitySetsCreateOrUpdateDeserialize, + _availabilitySetsUpdateDeserialize, + _availabilitySetsDeleteDeserialize, +} from "./api/availabilitySets/index.js"; +import { + _virtualMachineInstancesCreateOrUpdateDeserialize, + _virtualMachineInstancesUpdateDeserialize, + _virtualMachineInstancesDeleteDeserialize, + _virtualMachineInstancesStopDeserialize, + _virtualMachineInstancesStartDeserialize, + _virtualMachineInstancesRestartDeserialize, + _virtualMachineInstancesCreateCheckpointDeserialize, + _virtualMachineInstancesDeleteCheckpointDeserialize, + _virtualMachineInstancesRestoreCheckpointDeserialize, +} from "./api/virtualMachineInstances/index.js"; +import { _guestAgentsCreateDeserialize } from "./api/guestAgents/index.js"; +import { + PathUncheckedResponse, + OperationOptions, +} from "@azure-rest/core-client"; +import { AbortSignalLike } from "@azure/abort-controller"; + +export interface RestorePollerOptions< + TResult, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +> extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** Deserialization function for raw response body */ + processResponseBody?: (result: TResponse) => Promise; +} + +/** + * Creates a poller from the serialized state of another poller. This can be + * useful when you want to create pollers on a different host or a poller + * needs to be constructed after the original one is not in scope. + */ +export function restorePoller( + client: ScVmmClient, + serializedState: string, + sourceOperation: ( + ...args: any[] + ) => PollerLike, TResult>, + options?: RestorePollerOptions, +): PollerLike, TResult> { + const pollerConfig = deserializeState(serializedState).config; + const { initialRequestUrl, requestMethod, metadata } = pollerConfig; + if (!initialRequestUrl || !requestMethod) { + throw new Error( + `Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`, + ); + } + const resourceLocationConfig = metadata?.["resourceLocationConfig"] as + | ResourceLocationConfig + | undefined; + const deserializeHelper = + options?.processResponseBody ?? + getDeserializationHelper(initialRequestUrl, requestMethod); + if (!deserializeHelper) { + throw new Error( + `Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`, + ); + } + return getLongRunningPoller( + (client as any)["_client"] ?? client, + deserializeHelper as (result: TResponse) => Promise, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + resourceLocationConfig, + restoreFrom: serializedState, + initialRequestUrl, + }, + ); +} + +const deserializeMap: Record = { + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}": + _vmmServersCreateOrUpdateDeserialize, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}": + _vmmServersUpdateDeserialize, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}": + _vmmServersDeleteDeserialize, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds/{cloudResourceName}": + _cloudsCreateOrUpdateDeserialize, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds/{cloudResourceName}": + _cloudsUpdateDeserialize, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds/{cloudResourceName}": + _cloudsDeleteDeserialize, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualNetworks/{virtualNetworkName}": + _virtualNetworksCreateOrUpdateDeserialize, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualNetworks/{virtualNetworkName}": + _virtualNetworksUpdateDeserialize, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualNetworks/{virtualNetworkName}": + _virtualNetworksDeleteDeserialize, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachineTemplates/{virtualMachineTemplateName}": + _virtualMachineTemplatesCreateOrUpdateDeserialize, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachineTemplates/{virtualMachineTemplateName}": + _virtualMachineTemplatesUpdateDeserialize, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachineTemplates/{virtualMachineTemplateName}": + _virtualMachineTemplatesDeleteDeserialize, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets/{availabilitySetResourceName}": + _availabilitySetsCreateOrUpdateDeserialize, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets/{availabilitySetResourceName}": + _availabilitySetsUpdateDeserialize, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets/{availabilitySetResourceName}": + _availabilitySetsDeleteDeserialize, + "PUT /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default": + _virtualMachineInstancesCreateOrUpdateDeserialize, + "PATCH /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default": + _virtualMachineInstancesUpdateDeserialize, + "DELETE /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default": + _virtualMachineInstancesDeleteDeserialize, + "POST /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/stop": + _virtualMachineInstancesStopDeserialize, + "POST /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/start": + _virtualMachineInstancesStartDeserialize, + "POST /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/restart": + _virtualMachineInstancesRestartDeserialize, + "POST /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/createCheckpoint": + _virtualMachineInstancesCreateCheckpointDeserialize, + "POST /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/deleteCheckpoint": + _virtualMachineInstancesDeleteCheckpointDeserialize, + "POST /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/restoreCheckpoint": + _virtualMachineInstancesRestoreCheckpointDeserialize, + "PUT /{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default": + _guestAgentsCreateDeserialize, +}; + +function getDeserializationHelper( + urlStr: string, + method: string, +): ((result: unknown) => Promise) | undefined { + const path = new URL(urlStr).pathname; + const pathParts = path.split("/"); + + // Traverse list to match the longest candidate + // matchedLen: the length of candidate path + // matchedValue: the matched status code array + let matchedLen = -1, + matchedValue: ((result: unknown) => Promise) | undefined; + + // Iterate the responseMap to find a match + for (const [key, value] of Object.entries(deserializeMap)) { + // Extracting the path from the map key which is in format + // GET /path/foo + if (!key.startsWith(method)) { + continue; + } + const candidatePath = getPathFromMapKey(key); + // Get each part of the url path + const candidateParts = candidatePath.split("/"); + + // track if we have found a match to return the values found. + let found = true; + for ( + let i = candidateParts.length - 1, j = pathParts.length - 1; + i >= 1 && j >= 1; + i--, j-- + ) { + if ( + candidateParts[i]?.startsWith("{") && + candidateParts[i]?.indexOf("}") !== -1 + ) { + const start = candidateParts[i]!.indexOf("}") + 1, + end = candidateParts[i]?.length; + // If the current part of the candidate is a "template" part + // Try to use the suffix of pattern to match the path + // {guid} ==> $ + // {guid}:export ==> :export$ + const isMatched = new RegExp( + `${candidateParts[i]?.slice(start, end)}`, + ).test(pathParts[j] || ""); + + if (!isMatched) { + found = false; + break; + } + continue; + } + + // If the candidate part is not a template and + // the parts don't match mark the candidate as not found + // to move on with the next candidate path. + if (candidateParts[i] !== pathParts[j]) { + found = false; + break; + } + } + + // We finished evaluating the current candidate parts + // Update the matched value if and only if we found the longer pattern + if (found && candidatePath.length > matchedLen) { + matchedLen = candidatePath.length; + matchedValue = value as (result: unknown) => Promise; + } + } + + return matchedValue; +} + +function getPathFromMapKey(mapKey: string): string { + const pathStart = mapKey.indexOf("/"); + return mapKey.slice(pathStart); +} diff --git a/sdk/scvmm/arm-scvmm/src/scVmm.ts b/sdk/scvmm/arm-scvmm/src/scVmm.ts deleted file mode 100644 index fc2f02302875..000000000000 --- a/sdk/scvmm/arm-scvmm/src/scVmm.ts +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { - VirtualMachineInstancesImpl, - GuestAgentsImpl, - VmInstanceHybridIdentityMetadatasImpl, - OperationsImpl, - AvailabilitySetsImpl, - CloudsImpl, - VirtualMachineTemplatesImpl, - VirtualNetworksImpl, - VmmServersImpl, - InventoryItemsImpl, -} from "./operations"; -import { - VirtualMachineInstances, - GuestAgents, - VmInstanceHybridIdentityMetadatas, - Operations, - AvailabilitySets, - Clouds, - VirtualMachineTemplates, - VirtualNetworks, - VmmServers, - InventoryItems, -} from "./operationsInterfaces"; -import { ScVmmOptionalParams } from "./models"; - -export class ScVmm extends coreClient.ServiceClient { - $host: string; - apiVersion: string; - subscriptionId?: string; - - /** - * Initializes a new instance of the ScVmm class. - * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId The ID of the target subscription. The value must be an UUID. - * @param options The parameter options - */ - constructor( - credentials: coreAuth.TokenCredential, - subscriptionId: string, - options?: ScVmmOptionalParams, - ); - constructor( - credentials: coreAuth.TokenCredential, - options?: ScVmmOptionalParams, - ); - constructor( - credentials: coreAuth.TokenCredential, - subscriptionIdOrOptions?: ScVmmOptionalParams | string, - options?: ScVmmOptionalParams, - ) { - if (credentials === undefined) { - throw new Error("'credentials' cannot be null"); - } - - let subscriptionId: string | undefined; - - if (typeof subscriptionIdOrOptions === "string") { - subscriptionId = subscriptionIdOrOptions; - } else if (typeof subscriptionIdOrOptions === "object") { - options = subscriptionIdOrOptions; - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: ScVmmOptionalParams = { - requestContentType: "application/json; charset=utf-8", - credential: credentials, - }; - - const packageDetails = `azsdk-js-arm-scvmm/1.0.1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix, - }, - endpoint: - 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 ?? - `${optionsWithDefaults.endpoint}/.default`, - 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 || "2023-10-07"; - this.virtualMachineInstances = new VirtualMachineInstancesImpl(this); - this.guestAgents = new GuestAgentsImpl(this); - this.vmInstanceHybridIdentityMetadatas = - new VmInstanceHybridIdentityMetadatasImpl(this); - this.operations = new OperationsImpl(this); - this.availabilitySets = new AvailabilitySetsImpl(this); - this.clouds = new CloudsImpl(this); - this.virtualMachineTemplates = new VirtualMachineTemplatesImpl(this); - this.virtualNetworks = new VirtualNetworksImpl(this); - this.vmmServers = new VmmServersImpl(this); - this.inventoryItems = new InventoryItemsImpl(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); - } - - virtualMachineInstances: VirtualMachineInstances; - guestAgents: GuestAgents; - vmInstanceHybridIdentityMetadatas: VmInstanceHybridIdentityMetadatas; - operations: Operations; - availabilitySets: AvailabilitySets; - clouds: Clouds; - virtualMachineTemplates: VirtualMachineTemplates; - virtualNetworks: VirtualNetworks; - vmmServers: VmmServers; - inventoryItems: InventoryItems; -} diff --git a/sdk/scvmm/arm-scvmm/src/scVmmClient.ts b/sdk/scvmm/arm-scvmm/src/scVmmClient.ts new file mode 100644 index 000000000000..d1f8a136d79d --- /dev/null +++ b/sdk/scvmm/arm-scvmm/src/scVmmClient.ts @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { TokenCredential } from "@azure/core-auth"; +import { Pipeline } from "@azure/core-rest-pipeline"; +import { + getOperationsOperations, + OperationsOperations, +} from "./classic/operations/index.js"; +import { + getVmmServersOperations, + VmmServersOperations, +} from "./classic/vmmServers/index.js"; +import { + getCloudsOperations, + CloudsOperations, +} from "./classic/clouds/index.js"; +import { + getVirtualNetworksOperations, + VirtualNetworksOperations, +} from "./classic/virtualNetworks/index.js"; +import { + getVirtualMachineTemplatesOperations, + VirtualMachineTemplatesOperations, +} from "./classic/virtualMachineTemplates/index.js"; +import { + getAvailabilitySetsOperations, + AvailabilitySetsOperations, +} from "./classic/availabilitySets/index.js"; +import { + getInventoryItemsOperations, + InventoryItemsOperations, +} from "./classic/inventoryItems/index.js"; +import { + getVirtualMachineInstancesOperations, + VirtualMachineInstancesOperations, +} from "./classic/virtualMachineInstances/index.js"; +import { + getVmInstanceHybridIdentityMetadatasOperations, + VmInstanceHybridIdentityMetadatasOperations, +} from "./classic/vmInstanceHybridIdentityMetadatas/index.js"; +import { + getGuestAgentsOperations, + GuestAgentsOperations, +} from "./classic/guestAgents/index.js"; +import { + createScVmm, + ScVmmClientOptionalParams, + ScVmmContext, +} from "./api/index.js"; + +export { ScVmmClientOptionalParams } from "./api/scVmmContext.js"; + +export class ScVmmClient { + private _client: ScVmmContext; + /** The pipeline used by this client to make requests */ + public readonly pipeline: Pipeline; + + /** The Microsoft.ScVmm Rest API spec. */ + constructor( + credential: TokenCredential, + subscriptionId: string, + options: ScVmmClientOptionalParams = {}, + ) { + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-client` + : "azsdk-js-client"; + + this._client = createScVmm(credential, { + ...options, + userAgentOptions: { userAgentPrefix }, + }); + this.pipeline = this._client.pipeline; + this.operations = getOperationsOperations(this._client); + this.vmmServers = getVmmServersOperations(this._client, subscriptionId); + this.clouds = getCloudsOperations(this._client, subscriptionId); + this.virtualNetworks = getVirtualNetworksOperations( + this._client, + subscriptionId, + ); + this.virtualMachineTemplates = getVirtualMachineTemplatesOperations( + this._client, + subscriptionId, + ); + this.availabilitySets = getAvailabilitySetsOperations( + this._client, + subscriptionId, + ); + this.inventoryItems = getInventoryItemsOperations( + this._client, + subscriptionId, + ); + this.virtualMachineInstances = getVirtualMachineInstancesOperations( + this._client, + ); + this.vmInstanceHybridIdentityMetadatas = + getVmInstanceHybridIdentityMetadatasOperations(this._client); + this.guestAgents = getGuestAgentsOperations(this._client); + } + + /** The operation groups for Operations */ + public readonly operations: OperationsOperations; + /** The operation groups for VmmServers */ + public readonly vmmServers: VmmServersOperations; + /** The operation groups for Clouds */ + public readonly clouds: CloudsOperations; + /** The operation groups for VirtualNetworks */ + public readonly virtualNetworks: VirtualNetworksOperations; + /** The operation groups for VirtualMachineTemplates */ + public readonly virtualMachineTemplates: VirtualMachineTemplatesOperations; + /** The operation groups for AvailabilitySets */ + public readonly availabilitySets: AvailabilitySetsOperations; + /** The operation groups for InventoryItems */ + public readonly inventoryItems: InventoryItemsOperations; + /** The operation groups for VirtualMachineInstances */ + public readonly virtualMachineInstances: VirtualMachineInstancesOperations; + /** The operation groups for VmInstanceHybridIdentityMetadatas */ + public readonly vmInstanceHybridIdentityMetadatas: VmInstanceHybridIdentityMetadatasOperations; + /** The operation groups for GuestAgents */ + public readonly guestAgents: GuestAgentsOperations; +} diff --git a/sdk/scvmm/arm-scvmm/test/public/sampleTest.spec.ts b/sdk/scvmm/arm-scvmm/test/public/sampleTest.spec.ts new file mode 100644 index 000000000000..344657d6f17e --- /dev/null +++ b/sdk/scvmm/arm-scvmm/test/public/sampleTest.spec.ts @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { createRecorder } from "./utils/recordedClient.js"; +import { assert, beforeEach, afterEach, it, describe } from "vitest"; + +describe("My test", () => { + // let recorder: Recorder; + + beforeEach(async function () { + // recorder = await createRecorder(this); + }); + + afterEach(async function () { + // await recorder.stop(); + }); + + it("sample test", async function () { + assert.equal(1, 1); + }); +}); diff --git a/sdk/scvmm/arm-scvmm/test/public/utils/recordedClient.ts b/sdk/scvmm/arm-scvmm/test/public/utils/recordedClient.ts new file mode 100644 index 000000000000..a4d8acf86259 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/test/public/utils/recordedClient.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { + Recorder, + RecorderStartOptions, + VitestTestContext, +} from "@azure-tools/test-recorder"; + +const replaceableVariables: Record = { + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderEnvSetup: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +/** + * creates the recorder and reads the environment variables from the `.env` file. + * Should be called first in the test suite to make sure environment variables are + * read before they are being used. + */ +export async function createRecorder( + context: VitestTestContext, +): Promise { + const recorder = new Recorder(context); + await recorder.start(recorderEnvSetup); + return recorder; +} diff --git a/sdk/scvmm/arm-scvmm/test/scvmm_operations_test.spec.ts b/sdk/scvmm/arm-scvmm/test/scvmm_operations_test.spec.ts deleted file mode 100644 index 7392cc90b79e..000000000000 --- a/sdk/scvmm/arm-scvmm/test/scvmm_operations_test.spec.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - env, - Recorder, - RecorderStartOptions, - delay, - isPlaybackMode, -} from "@azure-tools/test-recorder"; -import { createTestCredential } from "@azure-tools/test-credential"; -import { assert } from "chai"; -import { Context } from "mocha"; -import { ScVmm } from "../src/scVmm"; - -const replaceableVariables: Record = { - SUBSCRIPTION_ID: "88888888-8888-8888-8888-888888888888" -}; - -const recorderOptions: RecorderStartOptions = { - envSetupForPlayback: replaceableVariables, - removeCentralSanitizers: [ - "AZSDK3493", // .name in the body is not a secret and is listed below in the beforeEach section - "AZSDK3430", // .id in the body is not a secret and is listed below in the beforeEach section - ], -}; - -export const testPollingOptions = { - updateIntervalInMs: isPlaybackMode() ? 0 : undefined, -}; - -describe("Scvmm test", () => { - let recorder: Recorder; - let subscriptionId: string; - let client: ScVmm; - let location: string; - let resourceGroup: string; - let resourcename: string; - - beforeEach(async function (this: Context) { - recorder = new Recorder(this.currentTest); - await recorder.start(recorderOptions); - subscriptionId = env.SUBSCRIPTION_ID || ''; - // This is an example of how the environment variables are used - const credential = createTestCredential(); - client = new ScVmm(credential, subscriptionId, recorder.configureClientOptions({})); - location = "eastus"; - resourceGroup = "myjstest"; - resourcename = "resourcetest"; - - }); - - afterEach(async function () { - await recorder.stop(); - }); - - it("operation list test", async function () { - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - assert.notEqual(resArray.length, 0); - }); -}) diff --git a/sdk/scvmm/arm-scvmm/tsconfig.browser.config.json b/sdk/scvmm/arm-scvmm/tsconfig.browser.config.json new file mode 100644 index 000000000000..1b37aebc5457 --- /dev/null +++ b/sdk/scvmm/arm-scvmm/tsconfig.browser.config.json @@ -0,0 +1,10 @@ +{ + "extends": "./.tshy/build.json", + "include": ["./src/**/*.ts", "./src/**/*.mts", "./test/**/*.spec.ts"], + "exclude": ["./test/**/node/**/*.ts"], + "compilerOptions": { + "outDir": "./dist-test/browser", + "rootDir": ".", + "skipLibCheck": true + } +} diff --git a/sdk/scvmm/arm-scvmm/tsconfig.json b/sdk/scvmm/arm-scvmm/tsconfig.json index dcb6754c3ab3..fa968e3bfdc6 100644 --- a/sdk/scvmm/arm-scvmm/tsconfig.json +++ b/sdk/scvmm/arm-scvmm/tsconfig.json @@ -1,33 +1,15 @@ { + "extends": "../../../tsconfig", "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-scvmm": [ - "./src/index" - ] - } + "module": "NodeNext", + "moduleResolution": "NodeNext", + "rootDir": "." }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" - ], - "exclude": [ - "node_modules" + "./src/**/*.mts", + "./src/**/*.cts", + "test/**/*.ts", + "./test/**/*.ts" ] } \ No newline at end of file diff --git a/sdk/scvmm/arm-scvmm/tsp-location.yaml b/sdk/scvmm/arm-scvmm/tsp-location.yaml new file mode 100644 index 000000000000..9f82c089de4e --- /dev/null +++ b/sdk/scvmm/arm-scvmm/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/scvmm/ScVmm.Management +commit: 8387ea3d827cb70dbfd8c4a6627e669d7598d5aa +repo: /mnt/vss/_work/1/s/azure-rest-api-specs +additionalDirectories: \ No newline at end of file diff --git a/sdk/scvmm/arm-scvmm/vitest.browser.config.ts b/sdk/scvmm/arm-scvmm/vitest.browser.config.ts new file mode 100644 index 000000000000..eda90c3ea96b --- /dev/null +++ b/sdk/scvmm/arm-scvmm/vitest.browser.config.ts @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { defineConfig } from "vitest/config"; +import { relativeRecordingsPath } from "@azure-tools/test-recorder"; + +process.env.RECORDINGS_RELATIVE_PATH = relativeRecordingsPath(); + +export default defineConfig({ + define: { + "process.env": process.env, + }, + test: { + reporters: ["basic", "junit"], + outputFile: { + junit: "test-results.browser.xml", + }, + browser: { + enabled: true, + headless: true, + name: "chromium", + provider: "playwright", + }, + fakeTimers: { + toFake: ["setTimeout", "Date"], + }, + watch: false, + include: ["dist-test/browser/**/*.spec.js"], + coverage: { + include: ["dist-test/browser/**/*.spec.js"], + provider: "istanbul", + reporter: ["text", "json", "html"], + reportsDirectory: "coverage-browser", + }, + testTimeout: 1200000, + }, +}); diff --git a/sdk/scvmm/arm-scvmm/vitest.config.ts b/sdk/scvmm/arm-scvmm/vitest.config.ts new file mode 100644 index 000000000000..7928f980b01c --- /dev/null +++ b/sdk/scvmm/arm-scvmm/vitest.config.ts @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { defineConfig } from "vitest/config"; +import { relativeRecordingsPath } from "@azure-tools/test-recorder"; + +export default defineConfig({ + test: { + reporters: ["basic", "junit"], + outputFile: { + junit: "test-results.browser.xml", + }, + fakeTimers: { + toFake: ["setTimeout", "Date"], + }, + watch: false, + include: ["test/**/*.spec.ts"], + exclude: ["test/**/browser/*.spec.ts"], + coverage: { + include: ["src/**/*.ts"], + exclude: [ + "src/**/*-browser.mts", + "src/**/*-react-native.mts", + "vitest*.config.ts", + "samples-dev/**/*.ts", + ], + provider: "istanbul", + reporter: ["text", "json", "html"], + reportsDirectory: "coverage", + }, + testTimeout: 1200000, + }, +}); diff --git a/sdk/scvmm/ci.yml b/sdk/scvmm/ci.yml new file mode 100644 index 000000000000..bee5cf85b72f --- /dev/null +++ b/sdk/scvmm/ci.yml @@ -0,0 +1,39 @@ +# 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/scvmm/ + exclude: + - sdk/scvmm/arm-scvmm + - sdk/scvmm/ci.mgmt.yml +pr: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/scvmm/ + exclude: + - sdk/scvmm/arm-scvmm + - sdk/scvmm/ci.mgmt.yml +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: scvmm + Artifacts: + - name: azure-arm-scvmm + safeName: azurearmscvmm