diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index fa1c499df303..ec198a39301e 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -615,6 +615,21 @@ packages: - supports-color dev: false + /@azure/arm-compute/17.2.0: + resolution: {integrity: sha512-tcKF04SeLcQyzFxzTlZN8dpyEU3GvRUYmhw3MYdsV7P3e6BJHibhJCL0pWLpB2Wa8GwVTv2ZLQ0UAzfKCtYerw==} + engines: {node: '>=12.0.0'} + dependencies: + '@azure/abort-controller': 1.0.4 + '@azure/core-auth': 1.3.2 + '@azure/core-client': 1.5.0 + '@azure/core-lro': 2.2.3 + '@azure/core-paging': 1.2.1 + '@azure/core-rest-pipeline': 1.5.0 + tslib: 2.3.1 + transitivePeerDependencies: + - supports-color + dev: false + /@azure/arm-storage/17.0.0: resolution: {integrity: sha512-WS9eT3/vDQ7a1z/8K5BkPhoAi0ilo94yCSws4KyWq6UIA3RaXBDpYYAlN0TOxad9rPeOnWXWcB9gLw3DmjZ4wg==} engines: {node: '>=12.0.0'} @@ -9703,27 +9718,28 @@ packages: dev: false file:projects/arm-compute.tgz: - resolution: {integrity: sha512-PMofmK9xvJaGzycv50HnFTu0lXAvJgFo0S1E7RrcPpzCPjhvKRxE5VyqDhxDi5pLPpobNGbyfuifoelcT5a39g==, tarball: file:projects/arm-compute.tgz} + resolution: {integrity: sha512-okUIINibMfByOcF/XtlGLbDsZYz05n1qBM0dA/a+Eo5/KabGmUsCDe+/Ycn2GigMHSPojpuMLGsAnhRaCqe1Rw==, tarball: file:projects/arm-compute.tgz} name: '@rush-temp/arm-compute' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 '@azure/identity': 2.0.4 '@microsoft/api-extractor': 7.19.4 - '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 - '@rollup/plugin-json': 4.1.0_rollup@1.32.1 - '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 - '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + '@rollup/plugin-commonjs': 21.0.1_rollup@2.67.1 + '@rollup/plugin-json': 4.1.0_rollup@2.67.1 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.67.1 + '@rollup/plugin-node-resolve': 13.1.3_rollup@2.67.1 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 rimraf: 3.0.2 - rollup: 1.32.1 - rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + rollup: 2.67.1 + rollup-plugin-sourcemaps: 0.6.3_rollup@2.67.1 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.15.1 transitivePeerDependencies: + - '@types/node' - debug - encoding - supports-color @@ -10679,11 +10695,12 @@ packages: dev: false file:projects/arm-imagebuilder.tgz: - resolution: {integrity: sha512-kyj4FpY8IBE52Ojym8PqCldNoyZMUgbMZDUTT7hn7Rd7WF3N843VdO2uiLxTz+CCpZfvC2WDGY+H+wiCQeCcHQ==, tarball: file:projects/arm-imagebuilder.tgz} + resolution: {integrity: sha512-rIvsXQJShRtBz5RlLlvfoBOrrvb868mMeR8rLaiV16gm2S6qWYfsMXPdZ8NQ4fTvw3k5oiKZ5t/3XgcJfd2fZA==, tarball: file:projects/arm-imagebuilder.tgz} name: '@rush-temp/arm-imagebuilder' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 + '@azure/arm-compute': 17.2.0 '@azure/identity': 2.0.4 '@microsoft/api-extractor': 7.19.4 '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 diff --git a/eng/ignore-links.txt b/eng/ignore-links.txt index 0a1647f01275..0a9788c764e2 100644 --- a/eng/ignore-links.txt +++ b/eng/ignore-links.txt @@ -10,3 +10,4 @@ https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storage/storage-blob-cha https://github.com/Azure/azure-digital-twins/blob/private-preview/Documentation/how-to-manage-routes.md https://docs.microsoft.com/javascript/api/@azure/arm-dnsresolver?view=azure-node-preview https://docs.microsoft.com/javascript/api/@azure/arm-mobilenetwork?view=azure-node-preview +https://docs.microsoft.com/en-us/azure/service-health/resource-health-overview diff --git a/sdk/compute/arm-compute/CHANGELOG.md b/sdk/compute/arm-compute/CHANGELOG.md index 6a4c34193718..a5b34595f6ce 100644 --- a/sdk/compute/arm-compute/CHANGELOG.md +++ b/sdk/compute/arm-compute/CHANGELOG.md @@ -1,5 +1,25 @@ # Release History +## 17.3.0 (2022-03-02) + +**Features** + + - Added Type Alias Architecture + - Added Type Alias ArchitectureTypes + - Added Type Alias DataAccessAuthMode + - Interface DiskUpdate has a new optional parameter dataAccessAuthMode + - Interface SnapshotUpdate has a new optional parameter dataAccessAuthMode + - Interface SupportedCapabilities has a new optional parameter architecture + - Type Alias Disk has a new parameter dataAccessAuthMode + - Type Alias GalleryImage has a new parameter architecture + - Type Alias GalleryImageUpdate has a new parameter architecture + - Type Alias Snapshot has a new parameter dataAccessAuthMode + - Type Alias VirtualMachineImage has a new parameter architecture + - Added Enum KnownArchitecture + - Added Enum KnownArchitectureTypes + - Added Enum KnownDataAccessAuthMode + + ## 17.2.0 (2022-02-14) **Features** diff --git a/sdk/compute/arm-compute/README.md b/sdk/compute/arm-compute/README.md index cb9f06fd0eac..9a5b8e7c17fc 100644 --- a/sdk/compute/arm-compute/README.md +++ b/sdk/compute/arm-compute/README.md @@ -16,6 +16,8 @@ Compute Client - [LTS versions of Node.js](https://nodejs.org/about/releases/) - Latest versions of Safari, Chrome, Edge and Firefox. +See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. + ### Prerequisites - An [Azure subscription][azure_sub]. @@ -49,8 +51,17 @@ For more information about how to create an Azure AD Application check out [this ```javascript const { ComputeManagementClient } = require("@azure/arm-compute"); 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 ComputeManagementClient(new DefaultAzureCredential(), subscriptionId); + +// For client-side applications running in the browser, use this code instead: +// const credential = new InteractiveBrowserCredential({ +// tenantId: "", +// clientId: "" +// }); +// const client = new ComputeManagementClient(credential, subscriptionId); ``` diff --git a/sdk/compute/arm-compute/_meta.json b/sdk/compute/arm-compute/_meta.json index ed991dab39f9..8f1be21afd12 100644 --- a/sdk/compute/arm-compute/_meta.json +++ b/sdk/compute/arm-compute/_meta.json @@ -1,7 +1,7 @@ { - "commit": "7c98de7664d4565c088350015ccd0cfc102eab49", + "commit": "4042a47cff72c950d35dd72149895b044ed79713", "readme": "specification/compute/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/compute/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220128.1 --generate-sample=true", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\compute\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220225.1 --generate-sample=true", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "use": "@autorest/typescript@6.0.0-alpha.16.20220128.1" + "use": "@autorest/typescript@6.0.0-alpha.16.20220225.1" } \ No newline at end of file diff --git a/sdk/compute/arm-compute/package.json b/sdk/compute/arm-compute/package.json index 4b1454af02c2..4882220e04d2 100644 --- a/sdk/compute/arm-compute/package.json +++ b/sdk/compute/arm-compute/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ComputeManagementClient.", - "version": "17.2.0", + "version": "17.3.0", "engines": { "node": ">=12.0.0" }, @@ -29,13 +29,13 @@ "types": "./types/arm-compute.d.ts", "devDependencies": { "@microsoft/api-extractor": "^7.18.11", - "@rollup/plugin-commonjs": "11.0.2", - "@rollup/plugin-json": "^4.0.0", - "@rollup/plugin-multi-entry": "^3.0.0", - "@rollup/plugin-node-resolve": "^8.0.0", + "@rollup/plugin-commonjs": "^21.0.1", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-multi-entry": "^4.1.0", + "@rollup/plugin-node-resolve": "^13.1.3", "mkdirp": "^1.0.4", - "rollup": "^1.16.3", - "rollup-plugin-sourcemaps": "^0.4.2", + "rollup": "^2.66.1", + "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "~4.2.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", @@ -44,6 +44,7 @@ "mocha": "^7.1.1", "cross-env": "^7.0.2", "@azure/arm-network": "^26.0.0" + }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/compute/arm-compute", "repository": { @@ -116,4 +117,4 @@ "disableDocsMs": true, "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-compute?view=azure-node-preview" } -} \ No newline at end of file +} diff --git a/sdk/compute/arm-compute/review/arm-compute.api.md b/sdk/compute/arm-compute/review/arm-compute.api.md index 77deb0d2719e..53ef7aaacaf7 100644 --- a/sdk/compute/arm-compute/review/arm-compute.api.md +++ b/sdk/compute/arm-compute/review/arm-compute.api.md @@ -64,6 +64,12 @@ export interface ApplicationProfile { galleryApplications?: VMGalleryApplication[]; } +// @public +export type Architecture = string; + +// @public +export type ArchitectureTypes = string; + // @public export interface AutomaticOSUpgradePolicy { disableAutomaticRollback?: boolean; @@ -1120,6 +1126,9 @@ export interface CreationData { uploadSizeBytes?: number; } +// @public +export type DataAccessAuthMode = string; + // @public export interface DataDisk { caching?: CachingTypes; @@ -1431,6 +1440,7 @@ export type Disk = Resource & { securityProfile?: DiskSecurityProfile; completionPercent?: number; publicNetworkAccess?: PublicNetworkAccess; + dataAccessAuthMode?: DataAccessAuthMode; }; // @public @@ -1936,6 +1946,7 @@ export type DisksUpdateResponse = Disk; // @public export interface DiskUpdate { burstingEnabled?: boolean; + dataAccessAuthMode?: DataAccessAuthMode; diskAccessId?: string; diskIopsReadOnly?: number; diskIopsReadWrite?: number; @@ -2345,6 +2356,7 @@ export type GalleryImage = Resource & { purchasePlan?: ImagePurchasePlan; readonly provisioningState?: GalleryImagePropertiesProvisioningState; features?: GalleryImageFeature[]; + architecture?: Architecture; }; // @public @@ -2442,6 +2454,7 @@ export type GalleryImageUpdate = UpdateResourceDefinition & { purchasePlan?: ImagePurchasePlan; readonly provisioningState?: GalleryImagePropertiesProvisioningState; features?: GalleryImageFeature[]; + architecture?: Architecture; }; // @public @@ -2852,6 +2865,22 @@ export enum KnownAggregatedReplicationState { Unknown = "Unknown" } +// @public +export enum KnownArchitecture { + // (undocumented) + Arm64 = "Arm64", + // (undocumented) + X64 = "x64" +} + +// @public +export enum KnownArchitectureTypes { + // (undocumented) + Arm64 = "Arm64", + // (undocumented) + X64 = "x64" +} + // @public export enum KnownAvailabilitySetSkuTypes { // (undocumented) @@ -2902,6 +2931,12 @@ export enum KnownConsistencyModeTypes { FileSystemConsistent = "FileSystemConsistent" } +// @public +export enum KnownDataAccessAuthMode { + AzureActiveDirectory = "AzureActiveDirectory", + None = "None" +} + // @public export enum KnownDeleteOptions { // (undocumented) @@ -5269,6 +5304,7 @@ export type Snapshot = Resource & { supportsHibernation?: boolean; publicNetworkAccess?: PublicNetworkAccess; completionPercent?: number; + dataAccessAuthMode?: DataAccessAuthMode; }; // @public @@ -5379,6 +5415,7 @@ export type SnapshotsUpdateResponse = Snapshot; // @public export interface SnapshotUpdate { + dataAccessAuthMode?: DataAccessAuthMode; diskAccessId?: string; diskSizeGB?: number; encryption?: Encryption; @@ -5555,6 +5592,7 @@ export type SubResourceWithColocationStatus = SubResource & { // @public export interface SupportedCapabilities { acceleratedNetwork?: boolean; + architecture?: Architecture; } // @public @@ -5961,6 +5999,7 @@ export type VirtualMachineImage = VirtualMachineImageResource & { hyperVGeneration?: HyperVGenerationTypes; disallowed?: DisallowedConfiguration; features?: VirtualMachineImageFeature[]; + architecture?: ArchitectureTypes; }; // @public diff --git a/sdk/compute/arm-compute/rollup.config.js b/sdk/compute/arm-compute/rollup.config.js index 9be1955eb7f1..3f89d7309da5 100644 --- a/sdk/compute/arm-compute/rollup.config.js +++ b/sdk/compute/arm-compute/rollup.config.js @@ -14,62 +14,14 @@ import json from "@rollup/plugin-json"; import nodeBuiltins from "builtin-modules"; -/** - * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. - * - * NOTE: this manual configuration is only needed because OpenTelemetry uses an - * __exportStar downleveled helper function to declare its exports which confuses - * rollup's automatic discovery mechanism. - * - * @returns an object reference that can be `...`'d into your cjs() configuration. - */ -export function openTelemetryCommonJs() { - const namedExports = {}; - - for (const key of [ - "@opentelemetry/api", - "@azure/core-tracing/node_modules/@opentelemetry/api" - ]) { - namedExports[key] = [ - "SpanKind", - "TraceFlags", - "getSpan", - "setSpan", - "SpanStatusCode", - "getSpanContext", - "setSpanContext" - ]; - } - - const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; - - for (const version of releasedOpenTelemetryVersions) { - namedExports[ - // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. - `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` - ] = [ - "SpanKind", - "TraceFlags", - "getSpan", - "setSpan", - "StatusCode", - "CanonicalCode", - "getSpanContext", - "setSpanContext" - ]; - } - - return namedExports; -} - // #region Warning Handler /** - * A function that can determine whether a rollupwarning should be ignored. If + * A function that can determine whether a rollup warning should be ignored. If * the function returns `true`, then the warning will not be displayed. */ -function ignoreNiseSinonEvalWarnings(warning) { +function ignoreNiseSinonEval(warning) { return ( warning.code === "EVAL" && warning.id && @@ -78,17 +30,14 @@ function ignoreNiseSinonEvalWarnings(warning) { ); } -function ignoreChaiCircularDependencyWarnings(warning) { +function ignoreChaiCircularDependency(warning) { return ( warning.code === "CIRCULAR_DEPENDENCY" && warning.importer && warning.importer.includes("node_modules/chai") === true ); } -const warningInhibitors = [ - ignoreChaiCircularDependencyWarnings, - ignoreNiseSinonEvalWarnings -]; +const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval]; /** * Construct a warning handler for the shared rollup configuration @@ -122,22 +71,7 @@ function makeBrowserTestConfig() { nodeResolve({ mainFields: ["module", "browser"] }), - cjs({ - namedExports: { - // Chai's strange internal architecture makes it impossible to statically - // analyze its exports. - chai: [ - "version", - "use", - "util", - "config", - "expect", - "should", - "assert" - ], - ...openTelemetryCommonJs() - } - }), + cjs(), json(), sourcemaps() //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) @@ -173,7 +107,7 @@ export function makeConfig(pkg, options) { ], output: { file: "dist/index.js", format: "cjs", sourcemap: true }, preserveSymlinks: false, - plugins: [sourcemaps(), nodeResolve(), cjs()] + plugins: [sourcemaps(), nodeResolve()] }; const config = [baseConfig]; diff --git a/sdk/compute/arm-compute/samples-dev/availabilitySetsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/availabilitySetsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..d8ab1cc23673 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/availabilitySetsCreateOrUpdateSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AvailabilitySet, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update an availability set. + * + * @summary Create or update an availability set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnAvailabilitySet.json + */ +async function createAnAvailabilitySet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const availabilitySetName = "myAvailabilitySet"; + const parameters: AvailabilitySet = { + location: "westus", + platformFaultDomainCount: 2, + platformUpdateDomainCount: 20 + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.createOrUpdate( + resourceGroupName, + availabilitySetName, + parameters + ); + console.log(result); +} + +createAnAvailabilitySet().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/availabilitySetsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/availabilitySetsDeleteSample.ts new file mode 100644 index 000000000000..1f75affa45d7 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/availabilitySetsDeleteSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete an availability set. + * + * @summary Delete an availability set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Delete_MaximumSet_Gen.json + */ +async function availabilitySetsDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const availabilitySetName = "aaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.delete( + resourceGroupName, + availabilitySetName + ); + console.log(result); +} + +availabilitySetsDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Delete an availability set. + * + * @summary Delete an availability set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Delete_MinimumSet_Gen.json + */ +async function availabilitySetsDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const availabilitySetName = "aaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.delete( + resourceGroupName, + availabilitySetName + ); + console.log(result); +} + +availabilitySetsDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/availabilitySetsGetSample.ts b/sdk/compute/arm-compute/samples-dev/availabilitySetsGetSample.ts new file mode 100644 index 000000000000..35f6dbf90809 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/availabilitySetsGetSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Retrieves information about an availability set. + * + * @summary Retrieves information about an availability set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Get_MaximumSet_Gen.json + */ +async function availabilitySetsGetMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const availabilitySetName = "aaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.get( + resourceGroupName, + availabilitySetName + ); + console.log(result); +} + +availabilitySetsGetMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about an availability set. + * + * @summary Retrieves information about an availability set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Get_MinimumSet_Gen.json + */ +async function availabilitySetsGetMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const availabilitySetName = "aaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.get( + resourceGroupName, + availabilitySetName + ); + console.log(result); +} + +availabilitySetsGetMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/availabilitySetsListAvailableSizesSample.ts b/sdk/compute/arm-compute/samples-dev/availabilitySetsListAvailableSizesSample.ts new file mode 100644 index 000000000000..3a8368a9ff88 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/availabilitySetsListAvailableSizesSample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. + * + * @summary Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_ListAvailableSizes_MaximumSet_Gen.json + */ +async function availabilitySetsListAvailableSizesMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const availabilitySetName = "aaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.availabilitySets.listAvailableSizes( + resourceGroupName, + availabilitySetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +availabilitySetsListAvailableSizesMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. + * + * @summary Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_ListAvailableSizes_MinimumSet_Gen.json + */ +async function availabilitySetsListAvailableSizesMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const availabilitySetName = "aa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.availabilitySets.listAvailableSizes( + resourceGroupName, + availabilitySetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +availabilitySetsListAvailableSizesMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/availabilitySetsListBySubscriptionSample.ts b/sdk/compute/arm-compute/samples-dev/availabilitySetsListBySubscriptionSample.ts new file mode 100644 index 000000000000..78b9f9c10cbe --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/availabilitySetsListBySubscriptionSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AvailabilitySetsListBySubscriptionOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all availability sets in a subscription. + * + * @summary Lists all availability sets in a subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListAvailabilitySetsInASubscription.json + */ +async function listAvailabilitySetsInASubscription() { + const subscriptionId = "{subscriptionId}"; + const expand = "virtualMachines$ref"; + const options: AvailabilitySetsListBySubscriptionOptionalParams = { expand }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.availabilitySets.listBySubscription(options)) { + resArray.push(item); + } + console.log(resArray); +} + +listAvailabilitySetsInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/availabilitySetsListSample.ts b/sdk/compute/arm-compute/samples-dev/availabilitySetsListSample.ts new file mode 100644 index 000000000000..c6574f3fe425 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/availabilitySetsListSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all availability sets in a resource group. + * + * @summary Lists all availability sets in a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_List_MaximumSet_Gen.json + */ +async function availabilitySetsListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.availabilitySets.list(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +availabilitySetsListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Lists all availability sets in a resource group. + * + * @summary Lists all availability sets in a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_List_MinimumSet_Gen.json + */ +async function availabilitySetsListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.availabilitySets.list(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +availabilitySetsListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/availabilitySetsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/availabilitySetsUpdateSample.ts new file mode 100644 index 000000000000..48f6641b051d --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/availabilitySetsUpdateSample.ts @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + AvailabilitySetUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update an availability set. + * + * @summary Update an availability set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Update_MaximumSet_Gen.json + */ +async function availabilitySetsUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const availabilitySetName = "aaaaaaaaaaaaaaaaaaa"; + const parameters: AvailabilitySetUpdate = { + platformFaultDomainCount: 2, + platformUpdateDomainCount: 20, + proximityPlacementGroup: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + }, + sku: { name: "DSv3-Type1", capacity: 7, tier: "aaa" }, + tags: { key2574: "aaaaaaaa" }, + virtualMachines: [ + { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + } + ] + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.update( + resourceGroupName, + availabilitySetName, + parameters + ); + console.log(result); +} + +availabilitySetsUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Update an availability set. + * + * @summary Update an availability set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Update_MinimumSet_Gen.json + */ +async function availabilitySetsUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const availabilitySetName = "aaaaaaaaaaaaaaaaaaaa"; + const parameters: AvailabilitySetUpdate = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.update( + resourceGroupName, + availabilitySetName, + parameters + ); + console.log(result); +} + +availabilitySetsUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..c8f2b720bdef --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsCreateOrUpdateSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CapacityReservationGroup, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateACapacityReservationGroup.json + */ +async function createOrUpdateACapacityReservationGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const capacityReservationGroupName = "myCapacityReservationGroup"; + const parameters: CapacityReservationGroup = { + location: "westus", + tags: { department: "finance" }, + zones: ["1", "2"] + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.createOrUpdate( + resourceGroupName, + capacityReservationGroupName, + parameters + ); + console.log(result); +} + +createOrUpdateACapacityReservationGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsDeleteSample.ts new file mode 100644 index 000000000000..08592d6a93b6 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsDeleteSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Delete_MaximumSet_Gen.json + */ +async function capacityReservationGroupsDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const capacityReservationGroupName = "a"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.delete( + resourceGroupName, + capacityReservationGroupName + ); + console.log(result); +} + +capacityReservationGroupsDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Delete_MinimumSet_Gen.json + */ +async function capacityReservationGroupsDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const capacityReservationGroupName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.delete( + resourceGroupName, + capacityReservationGroupName + ); + console.log(result); +} + +capacityReservationGroupsDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsGetSample.ts b/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsGetSample.ts new file mode 100644 index 000000000000..1335ae08c3af --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation that retrieves information about a capacity reservation group. + * + * @summary The operation that retrieves information about a capacity reservation group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetACapacityReservationGroup.json + */ +async function getACapacityReservationGroup() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const capacityReservationGroupName = "myCapacityReservationGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.get( + resourceGroupName, + capacityReservationGroupName + ); + console.log(result); +} + +getACapacityReservationGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsListByResourceGroupSample.ts new file mode 100644 index 000000000000..620bd2a55af5 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsListByResourceGroupSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CapacityReservationGroupsListByResourceGroupOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups. + * + * @summary Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListCapacityReservationGroupsInResourceGroup.json + */ +async function listCapacityReservationGroupsInResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const expand = "virtualMachines/$ref"; + const options: CapacityReservationGroupsListByResourceGroupOptionalParams = { + expand + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.capacityReservationGroups.listByResourceGroup( + resourceGroupName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +listCapacityReservationGroupsInResourceGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsListBySubscriptionSample.ts b/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsListBySubscriptionSample.ts new file mode 100644 index 000000000000..5af5c6cd72c9 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsListBySubscriptionSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + CapacityReservationGroupsListBySubscriptionOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. + * + * @summary Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListCapacityReservationGroupsInSubscription.json + */ +async function listCapacityReservationGroupsInSubscription() { + const subscriptionId = "{subscription-id}"; + const expand = "virtualMachines/$ref"; + const options: CapacityReservationGroupsListBySubscriptionOptionalParams = { + expand + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.capacityReservationGroups.listBySubscription( + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +listCapacityReservationGroupsInSubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsUpdateSample.ts new file mode 100644 index 000000000000..fdec70b83509 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsUpdateSample.ts @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + CapacityReservationGroupUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may be modified. + * + * @summary The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may be modified. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Update_MaximumSet_Gen.json + */ +async function capacityReservationGroupsUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const capacityReservationGroupName = "aaaaaaaaaaaaaaaaaaaaaa"; + const parameters: CapacityReservationGroupUpdate = { + instanceView: {}, + tags: { key5355: "aaa" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.update( + resourceGroupName, + capacityReservationGroupName, + parameters + ); + console.log(result); +} + +capacityReservationGroupsUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may be modified. + * + * @summary The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may be modified. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Update_MinimumSet_Gen.json + */ +async function capacityReservationGroupsUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const capacityReservationGroupName = "aaaaaaaaaaaaaaaaaaaaaa"; + const parameters: CapacityReservationGroupUpdate = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.update( + resourceGroupName, + capacityReservationGroupName, + parameters + ); + console.log(result); +} + +capacityReservationGroupsUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/capacityReservationsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/capacityReservationsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..24a939aa50d2 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/capacityReservationsCreateOrUpdateSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CapacityReservation, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateACapacityReservation.json + */ +async function createOrUpdateACapacityReservation() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const capacityReservationGroupName = "myCapacityReservationGroup"; + const capacityReservationName = "myCapacityReservation"; + const parameters: CapacityReservation = { + location: "westus", + sku: { name: "Standard_DS1_v2", capacity: 4 }, + tags: { department: "HR" }, + zones: ["1"] + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.beginCreateOrUpdateAndWait( + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + parameters + ); + console.log(result); +} + +createOrUpdateACapacityReservation().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/capacityReservationsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/capacityReservationsDeleteSample.ts new file mode 100644 index 000000000000..0420bbf13169 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/capacityReservationsDeleteSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Delete_MaximumSet_Gen.json + */ +async function capacityReservationsDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const capacityReservationGroupName = "aaaaaaaaaaa"; + const capacityReservationName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.beginDeleteAndWait( + resourceGroupName, + capacityReservationGroupName, + capacityReservationName + ); + console.log(result); +} + +capacityReservationsDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Delete_MinimumSet_Gen.json + */ +async function capacityReservationsDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const capacityReservationGroupName = "aaa"; + const capacityReservationName = "aaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.beginDeleteAndWait( + resourceGroupName, + capacityReservationGroupName, + capacityReservationName + ); + console.log(result); +} + +capacityReservationsDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/capacityReservationsGetSample.ts b/sdk/compute/arm-compute/samples-dev/capacityReservationsGetSample.ts new file mode 100644 index 000000000000..f29a425b3d70 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/capacityReservationsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation that retrieves information about the capacity reservation. + * + * @summary The operation that retrieves information about the capacity reservation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetACapacityReservation.json + */ +async function getACapacityReservation() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const capacityReservationGroupName = "myCapacityReservationGroup"; + const capacityReservationName = "myCapacityReservation"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.get( + resourceGroupName, + capacityReservationGroupName, + capacityReservationName + ); + console.log(result); +} + +getACapacityReservation().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/capacityReservationsListByCapacityReservationGroupSample.ts b/sdk/compute/arm-compute/samples-dev/capacityReservationsListByCapacityReservationGroupSample.ts new file mode 100644 index 000000000000..ca1112c7c874 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/capacityReservationsListByCapacityReservationGroupSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. + * + * @summary Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListCapacityReservationsInReservationGroup.json + */ +async function listCapacityReservationsInReservationGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const capacityReservationGroupName = "myCapacityReservationGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.capacityReservations.listByCapacityReservationGroup( + resourceGroupName, + capacityReservationGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listCapacityReservationsInReservationGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/capacityReservationsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/capacityReservationsUpdateSample.ts new file mode 100644 index 000000000000..1e3ac50fdaed --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/capacityReservationsUpdateSample.ts @@ -0,0 +1,80 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + CapacityReservationUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update a capacity reservation. + * + * @summary The operation to update a capacity reservation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Update_MaximumSet_Gen.json + */ +async function capacityReservationsUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const capacityReservationGroupName = "aaaaaaaaaa"; + const capacityReservationName = "aaaaaaaaaaaaaaaaaaa"; + const parameters: CapacityReservationUpdate = { + instanceView: { + statuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z") + } + ], + utilizationInfo: {} + }, + sku: { name: "DSv3-Type1", capacity: 7, tier: "aaa" }, + tags: { key4974: "aaaaaaaaaaaaaaaa" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.beginUpdateAndWait( + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + parameters + ); + console.log(result); +} + +capacityReservationsUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to update a capacity reservation. + * + * @summary The operation to update a capacity reservation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Update_MinimumSet_Gen.json + */ +async function capacityReservationsUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const capacityReservationGroupName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const capacityReservationName = "aaa"; + const parameters: CapacityReservationUpdate = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.beginUpdateAndWait( + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + parameters + ); + console.log(result); +} + +capacityReservationsUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsGetOSFamilySample.ts b/sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsGetOSFamilySample.ts new file mode 100644 index 000000000000..7303242eaea6 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsGetOSFamilySample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets properties of a guest operating system family that can be specified in the XML service configuration (.cscfg) for a cloud service. + * + * @summary Gets properties of a guest operating system family that can be specified in the XML service configuration (.cscfg) for a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceOSFamily.json + */ +async function getCloudServiceOSFamily() { + const subscriptionId = "{subscription-id}"; + const location = "westus2"; + const osFamilyName = "3"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServiceOperatingSystems.getOSFamily( + location, + osFamilyName + ); + console.log(result); +} + +getCloudServiceOSFamily().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsGetOSVersionSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsGetOSVersionSample.ts new file mode 100644 index 000000000000..942efead48fe --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsGetOSVersionSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets properties of a guest operating system version that can be specified in the XML service configuration (.cscfg) for a cloud service. + * + * @summary Gets properties of a guest operating system version that can be specified in the XML service configuration (.cscfg) for a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceOSVersion.json + */ +async function getCloudServiceOSVersion() { + const subscriptionId = "{subscription-id}"; + const location = "westus2"; + const osVersionName = "WA-GUEST-OS-3.90_202010-02"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServiceOperatingSystems.getOSVersion( + location, + osVersionName + ); + console.log(result); +} + +getCloudServiceOSVersion().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsListOSFamiliesSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsListOSFamiliesSample.ts new file mode 100644 index 000000000000..1a94753a9157 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsListOSFamiliesSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of all guest operating system families available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this till nextLink is null to fetch all the OS Families. + * + * @summary Gets a list of all guest operating system families available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this till nextLink is null to fetch all the OS Families. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceOSFamilies.json + */ +async function listCloudServiceOSFamiliesInASubscription() { + const subscriptionId = "{subscription-id}"; + const location = "westus2"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudServiceOperatingSystems.listOSFamilies( + location + )) { + resArray.push(item); + } + console.log(resArray); +} + +listCloudServiceOSFamiliesInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsListOSVersionsSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsListOSVersionsSample.ts new file mode 100644 index 000000000000..fd887a48f283 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsListOSVersionsSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of all guest operating system versions available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this till nextLink is null to fetch all the OS versions. + * + * @summary Gets a list of all guest operating system versions available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this till nextLink is null to fetch all the OS versions. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceOSVersions.json + */ +async function listCloudServiceOSVersionsInASubscription() { + const subscriptionId = "{subscription-id}"; + const location = "westus2"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudServiceOperatingSystems.listOSVersions( + location + )) { + resArray.push(item); + } + console.log(resArray); +} + +listCloudServiceOSVersionsInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesDeleteSample.ts new file mode 100644 index 000000000000..d12d75cbe235 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes a role instance from a cloud service. + * + * @summary Deletes a role instance from a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/DeleteCloudServiceRoleInstance.json + */ +async function deleteCloudServiceRoleInstance() { + const subscriptionId = "{subscription-id}"; + const roleInstanceName = "{roleInstance-name}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServiceRoleInstances.beginDeleteAndWait( + roleInstanceName, + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +deleteCloudServiceRoleInstance().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesGetInstanceViewSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesGetInstanceViewSample.ts new file mode 100644 index 000000000000..29dde7020336 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesGetInstanceViewSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Retrieves information about the run-time state of a role instance in a cloud service. + * + * @summary Retrieves information about the run-time state of a role instance in a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetInstanceViewOfCloudServiceRoleInstance.json + */ +async function getInstanceViewOfCloudServiceRoleInstance() { + const subscriptionId = "{subscription-id}"; + const roleInstanceName = "{roleInstance-name}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServiceRoleInstances.getInstanceView( + roleInstanceName, + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +getInstanceViewOfCloudServiceRoleInstance().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesGetSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesGetSample.ts new file mode 100644 index 000000000000..ad9cf89bc0d0 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a role instance from a cloud service. + * + * @summary Gets a role instance from a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceRoleInstance.json + */ +async function getCloudServiceRoleInstance() { + const subscriptionId = "{subscription-id}"; + const roleInstanceName = "{roleInstance-name}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServiceRoleInstances.get( + roleInstanceName, + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +getCloudServiceRoleInstance().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesListSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesListSample.ts new file mode 100644 index 000000000000..f0982c570d4b --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next page of role instances. Do this till nextLink is null to fetch all the role instances. + * + * @summary Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next page of role instances. Do this till nextLink is null to fetch all the role instances. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceRolesInstances.json + */ +async function listRoleInstancesInACloudService() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudServiceRoleInstances.list( + resourceGroupName, + cloudServiceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listRoleInstancesInACloudService().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesRebuildSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesRebuildSample.ts new file mode 100644 index 000000000000..c4bca9550654 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesRebuildSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instance. + * + * @summary The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instance. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RebuildCloudServiceRoleInstance.json + */ +async function rebuildCloudServiceRoleInstance() { + const subscriptionId = "{subscription-id}"; + const roleInstanceName = "{roleInstance-name}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServiceRoleInstances.beginRebuildAndWait( + roleInstanceName, + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +rebuildCloudServiceRoleInstance().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesReimageSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesReimageSample.ts new file mode 100644 index 000000000000..2f139fab570b --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesReimageSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @summary The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ReimageCloudServiceRoleInstance.json + */ +async function reimageCloudServiceRoleInstance() { + const subscriptionId = "{subscription-id}"; + const roleInstanceName = "{roleInstance-name}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServiceRoleInstances.beginReimageAndWait( + roleInstanceName, + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +reimageCloudServiceRoleInstance().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesRestartSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesRestartSample.ts new file mode 100644 index 000000000000..4adca254441b --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesRestartSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @summary The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RestartCloudServiceRoleInstance.json + */ +async function restartCloudServiceRoleInstance() { + const subscriptionId = "{subscription-id}"; + const roleInstanceName = "{roleInstance-name}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServiceRoleInstances.beginRestartAndWait( + roleInstanceName, + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +restartCloudServiceRoleInstance().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServiceRolesGetSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServiceRolesGetSample.ts new file mode 100644 index 000000000000..11e9a7c6ee1c --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServiceRolesGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a role from a cloud service. + * + * @summary Gets a role from a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceRole.json + */ +async function getCloudServiceRole() { + const subscriptionId = "{subscription-id}"; + const roleName = "{role-name}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServiceRoles.get( + roleName, + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +getCloudServiceRole().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServiceRolesListSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServiceRolesListSample.ts new file mode 100644 index 000000000000..76dad03f9061 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServiceRolesListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. Do this till nextLink is null to fetch all the roles. + * + * @summary Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. Do this till nextLink is null to fetch all the roles. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceRoles.json + */ +async function listRolesInACloudService() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudServiceRoles.list( + resourceGroupName, + cloudServiceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listRolesInACloudService().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..61b54f135395 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServicesCreateOrUpdateSample.ts @@ -0,0 +1,291 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + CloudService, + CloudServicesCreateOrUpdateOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/CreateCloudServiceWithMultiRole.json + */ +async function createNewCloudServiceWithMultipleRoles() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const parameters: CloudService = { + location: "westus", + properties: { + configuration: "{ServiceConfiguration}", + networkProfile: { + loadBalancerConfigurations: [ + { + name: "contosolb", + properties: { + frontendIPConfigurations: [ + { + name: "contosofe", + properties: { + publicIPAddress: { + id: + "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip" + } + } + } + ] + } + } + ] + }, + packageUrl: "{PackageUrl}", + roleProfile: { + roles: [ + { + name: "ContosoFrontend", + sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" } + }, + { + name: "ContosoBackend", + sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" } + } + ] + }, + upgradeMode: "Auto" + } + }; + const options: CloudServicesCreateOrUpdateOptionalParams = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginCreateOrUpdateAndWait( + resourceGroupName, + cloudServiceName, + options + ); + console.log(result); +} + +createNewCloudServiceWithMultipleRoles().catch(console.error); + +/** + * This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/CreateCloudServiceWithSingleRole.json + */ +async function createNewCloudServiceWithSingleRole() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const parameters: CloudService = { + location: "westus", + properties: { + configuration: "{ServiceConfiguration}", + networkProfile: { + loadBalancerConfigurations: [ + { + name: "myLoadBalancer", + properties: { + frontendIPConfigurations: [ + { + name: "myfe", + properties: { + publicIPAddress: { + id: + "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP" + } + } + } + ] + } + } + ] + }, + packageUrl: "{PackageUrl}", + roleProfile: { + roles: [ + { + name: "ContosoFrontend", + sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" } + } + ] + }, + upgradeMode: "Auto" + } + }; + const options: CloudServicesCreateOrUpdateOptionalParams = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginCreateOrUpdateAndWait( + resourceGroupName, + cloudServiceName, + options + ); + console.log(result); +} + +createNewCloudServiceWithSingleRole().catch(console.error); + +/** + * This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/CreateCloudServiceWithSingleRoleAndCertificate.json + */ +async function createNewCloudServiceWithSingleRoleAndCertificateFromKeyVault() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const parameters: CloudService = { + location: "westus", + properties: { + configuration: "{ServiceConfiguration}", + networkProfile: { + loadBalancerConfigurations: [ + { + name: "contosolb", + properties: { + frontendIPConfigurations: [ + { + name: "contosofe", + properties: { + publicIPAddress: { + id: + "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip" + } + } + } + ] + } + } + ] + }, + osProfile: { + secrets: [ + { + sourceVault: { + id: + "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}" + }, + vaultCertificates: [ + { + certificateUrl: + "https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}" + } + ] + } + ] + }, + packageUrl: "{PackageUrl}", + roleProfile: { + roles: [ + { + name: "ContosoFrontend", + sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" } + } + ] + }, + upgradeMode: "Auto" + } + }; + const options: CloudServicesCreateOrUpdateOptionalParams = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginCreateOrUpdateAndWait( + resourceGroupName, + cloudServiceName, + options + ); + console.log(result); +} + +createNewCloudServiceWithSingleRoleAndCertificateFromKeyVault().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/CreateCloudServiceWithSingleRoleAndRDP.json + */ +async function createNewCloudServiceWithSingleRoleAndRdpExtension() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const parameters: CloudService = { + location: "westus", + properties: { + configuration: "{ServiceConfiguration}", + extensionProfile: { + extensions: [ + { + name: "RDPExtension", + properties: { + type: "RDP", + autoUpgradeMinorVersion: false, + protectedSettings: + "{password}", + publisher: "Microsoft.Windows.Azure.Extensions", + settings: + "UserAzure10/22/2021 15:05:45", + typeHandlerVersion: "1.2.1" + } + } + ] + }, + networkProfile: { + loadBalancerConfigurations: [ + { + name: "contosolb", + properties: { + frontendIPConfigurations: [ + { + name: "contosofe", + properties: { + publicIPAddress: { + id: + "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip" + } + } + } + ] + } + } + ] + }, + packageUrl: "{PackageUrl}", + roleProfile: { + roles: [ + { + name: "ContosoFrontend", + sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" } + } + ] + }, + upgradeMode: "Auto" + } + }; + const options: CloudServicesCreateOrUpdateOptionalParams = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginCreateOrUpdateAndWait( + resourceGroupName, + cloudServiceName, + options + ); + console.log(result); +} + +createNewCloudServiceWithSingleRoleAndRdpExtension().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesDeleteInstancesSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesDeleteInstancesSample.ts new file mode 100644 index 000000000000..eea25b6aef18 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServicesDeleteInstancesSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleInstances, + CloudServicesDeleteInstancesOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes role instances in a cloud service. + * + * @summary Deletes role instances in a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/DeleteCloudServiceRoleInstances.json + */ +async function deleteCloudServiceRoleInstances() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const parameters: RoleInstances = { + roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"] + }; + const options: CloudServicesDeleteInstancesOptionalParams = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginDeleteInstancesAndWait( + resourceGroupName, + cloudServiceName, + options + ); + console.log(result); +} + +deleteCloudServiceRoleInstances().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesDeleteSample.ts new file mode 100644 index 000000000000..963effacd472 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServicesDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes a cloud service. + * + * @summary Deletes a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/DeleteCloudService.json + */ +async function deleteCloudService() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginDeleteAndWait( + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +deleteCloudService().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesGetInstanceViewSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesGetInstanceViewSample.ts new file mode 100644 index 000000000000..f0c480bbd3fa --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServicesGetInstanceViewSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the status of a cloud service. + * + * @summary Gets the status of a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceInstanceViewWithMultiRole.json + */ +async function getCloudServiceInstanceViewWithMultipleRoles() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.getInstanceView( + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +getCloudServiceInstanceViewWithMultipleRoles().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesGetSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesGetSample.ts new file mode 100644 index 000000000000..62013e2868dd --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServicesGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Display information about a cloud service. + * + * @summary Display information about a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceWithMultiRoleAndRDP.json + */ +async function getCloudServiceWithMultipleRolesAndRdpExtension() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.get( + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +getCloudServiceWithMultipleRolesAndRdpExtension().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesListAllSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesListAllSample.ts new file mode 100644 index 000000000000..07ba26444b1c --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServicesListAllSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * + * @summary Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServicesInSubscription.json + */ +async function listCloudServicesInASubscription() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudServices.listAll()) { + resArray.push(item); + } + console.log(resArray); +} + +listCloudServicesInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesListSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesListSample.ts new file mode 100644 index 000000000000..cc6338f6d446 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServicesListSample.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * + * @summary Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServicesInResourceGroup.json + */ +async function listCloudServicesInAResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudServices.list(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listCloudServicesInAResourceGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesPowerOffSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesPowerOffSample.ts new file mode 100644 index 000000000000..a5708506b2e5 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServicesPowerOffSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Power off the cloud service. Note that resources are still attached and you are getting charged for the resources. + * + * @summary Power off the cloud service. Note that resources are still attached and you are getting charged for the resources. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/PowerOffCloudService.json + */ +async function stopOrPowerOffCloudService() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginPowerOffAndWait( + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +stopOrPowerOffCloudService().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesRebuildSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesRebuildSample.ts new file mode 100644 index 000000000000..405f4d92cd04 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServicesRebuildSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleInstances, + CloudServicesRebuildOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instances. + * + * @summary Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instances. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RebuildCloudServiceRoleInstances.json + */ +async function rebuildCloudServiceRoleInstances() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const parameters: RoleInstances = { + roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"] + }; + const options: CloudServicesRebuildOptionalParams = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginRebuildAndWait( + resourceGroupName, + cloudServiceName, + options + ); + console.log(result); +} + +rebuildCloudServiceRoleInstances().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesReimageSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesReimageSample.ts new file mode 100644 index 000000000000..5eaaa3c310e5 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServicesReimageSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleInstances, + CloudServicesReimageOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @summary Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ReimageCloudServiceRoleInstances.json + */ +async function reimageCloudServiceRoleInstances() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const parameters: RoleInstances = { + roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"] + }; + const options: CloudServicesReimageOptionalParams = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginReimageAndWait( + resourceGroupName, + cloudServiceName, + options + ); + console.log(result); +} + +reimageCloudServiceRoleInstances().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesRestartSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesRestartSample.ts new file mode 100644 index 000000000000..a76422935df1 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServicesRestartSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleInstances, + CloudServicesRestartOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Restarts one or more role instances in a cloud service. + * + * @summary Restarts one or more role instances in a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RestartCloudServiceRoleInstances.json + */ +async function restartCloudServiceRoleInstances() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const parameters: RoleInstances = { + roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"] + }; + const options: CloudServicesRestartOptionalParams = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginRestartAndWait( + resourceGroupName, + cloudServiceName, + options + ); + console.log(result); +} + +restartCloudServiceRoleInstances().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesStartSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesStartSample.ts new file mode 100644 index 000000000000..1ea93fc235f5 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServicesStartSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Starts the cloud service. + * + * @summary Starts the cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/StartCloudService.json + */ +async function startCloudService() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginStartAndWait( + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +startCloudService().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesUpdateDomainGetUpdateDomainSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesUpdateDomainGetUpdateDomainSample.ts new file mode 100644 index 000000000000..15d318fa94eb --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServicesUpdateDomainGetUpdateDomainSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page of update domains. Do this till nextLink is null to fetch all the update domains. + * + * @summary Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page of update domains. Do this till nextLink is null to fetch all the update domains. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceUpdateDomain.json + */ +async function getCloudServiceUpdateDomain() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const updateDomain = 1; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServicesUpdateDomain.getUpdateDomain( + resourceGroupName, + cloudServiceName, + updateDomain + ); + console.log(result); +} + +getCloudServiceUpdateDomain().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesUpdateDomainListUpdateDomainsSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesUpdateDomainListUpdateDomainsSample.ts new file mode 100644 index 000000000000..4228ca0634eb --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServicesUpdateDomainListUpdateDomainsSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of all update domains in a cloud service. + * + * @summary Gets a list of all update domains in a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceUpdateDomains.json + */ +async function listUpdateDomainsInCloudService() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudServicesUpdateDomain.listUpdateDomains( + resourceGroupName, + cloudServiceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listUpdateDomainsInCloudService().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesUpdateDomainWalkUpdateDomainSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesUpdateDomainWalkUpdateDomainSample.ts new file mode 100644 index 000000000000..c54794b70d3a --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServicesUpdateDomainWalkUpdateDomainSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Updates the role instances in the specified update domain. + * + * @summary Updates the role instances in the specified update domain. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/UpdateCloudServiceUpdateDomain.json + */ +async function updateCloudServiceToSpecifiedDomain() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const updateDomain = 1; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServicesUpdateDomain.beginWalkUpdateDomainAndWait( + resourceGroupName, + cloudServiceName, + updateDomain + ); + console.log(result); +} + +updateCloudServiceToSpecifiedDomain().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesUpdateSample.ts new file mode 100644 index 000000000000..c761147681df --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/cloudServicesUpdateSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + CloudServiceUpdate, + CloudServicesUpdateOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update a cloud service. + * + * @summary Update a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/UpdateCloudServiceToIncludeTags.json + */ +async function updateExistingCloudServiceToAddTags() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const parameters: CloudServiceUpdate = { tags: { documentation: "RestAPI" } }; + const options: CloudServicesUpdateOptionalParams = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginUpdateAndWait( + resourceGroupName, + cloudServiceName, + options + ); + console.log(result); +} + +updateExistingCloudServiceToAddTags().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/communityGalleriesGetSample.ts b/sdk/compute/arm-compute/samples-dev/communityGalleriesGetSample.ts new file mode 100644 index 000000000000..604fb888c06f --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/communityGalleriesGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a community gallery by gallery public name. + * + * @summary Get a community gallery by gallery public name. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/communityGallery/GetACommunityGallery.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const location = "myLocation"; + const publicGalleryName = "publicGalleryName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.communityGalleries.get( + location, + publicGalleryName + ); + console.log(result); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/communityGalleryImageVersionsGetSample.ts b/sdk/compute/arm-compute/samples-dev/communityGalleryImageVersionsGetSample.ts new file mode 100644 index 000000000000..ceb7d71eb209 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/communityGalleryImageVersionsGetSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a community gallery image version. + * + * @summary Get a community gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/communityGallery/GetACommunityGalleryImageVersion.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const location = "myLocation"; + const publicGalleryName = "publicGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "myGalleryImageVersionName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.communityGalleryImageVersions.get( + location, + publicGalleryName, + galleryImageName, + galleryImageVersionName + ); + console.log(result); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/communityGalleryImagesGetSample.ts b/sdk/compute/arm-compute/samples-dev/communityGalleryImagesGetSample.ts new file mode 100644 index 000000000000..7b5d9f9f2b58 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/communityGalleryImagesGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a community gallery image. + * + * @summary Get a community gallery image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/communityGallery/GetACommunityGalleryImage.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const location = "myLocation"; + const publicGalleryName = "publicGalleryName"; + const galleryImageName = "myGalleryImageName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.communityGalleryImages.get( + location, + publicGalleryName, + galleryImageName + ); + console.log(result); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..009218f00f9a --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsCreateOrUpdateSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + DedicatedHostGroup, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) + * + * @summary Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateADedicatedHostGroup.json + */ +async function createOrUpdateADedicatedHostGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const hostGroupName = "myDedicatedHostGroup"; + const parameters: DedicatedHostGroup = { + location: "westus", + platformFaultDomainCount: 3, + supportAutomaticPlacement: true, + tags: { department: "finance" }, + zones: ["1"] + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.createOrUpdate( + resourceGroupName, + hostGroupName, + parameters + ); + console.log(result); +} + +createOrUpdateADedicatedHostGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsDeleteSample.ts new file mode 100644 index 000000000000..1c3ae824cfb5 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsDeleteSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a dedicated host group. + * + * @summary Delete a dedicated host group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Delete_MaximumSet_Gen.json + */ +async function dedicatedHostGroupsDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "a"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.delete( + resourceGroupName, + hostGroupName + ); + console.log(result); +} + +dedicatedHostGroupsDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Delete a dedicated host group. + * + * @summary Delete a dedicated host group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Delete_MinimumSet_Gen.json + */ +async function dedicatedHostGroupsDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "aaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.delete( + resourceGroupName, + hostGroupName + ); + console.log(result); +} + +dedicatedHostGroupsDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsGetSample.ts b/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsGetSample.ts new file mode 100644 index 000000000000..ec6d32acc5a3 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Retrieves information about a dedicated host group. + * + * @summary Retrieves information about a dedicated host group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetADedicatedHostGroup.json + */ +async function createADedicatedHostGroup() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const hostGroupName = "myDedicatedHostGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.get( + resourceGroupName, + hostGroupName + ); + console.log(result); +} + +createADedicatedHostGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsListByResourceGroupSample.ts new file mode 100644 index 000000000000..825f790164b1 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsListByResourceGroupSample.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. + * + * @summary Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListByResourceGroup_MaximumSet_Gen.json + */ +async function dedicatedHostGroupsListByResourceGroupMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.dedicatedHostGroups.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +dedicatedHostGroupsListByResourceGroupMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. + * + * @summary Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListByResourceGroup_MinimumSet_Gen.json + */ +async function dedicatedHostGroupsListByResourceGroupMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.dedicatedHostGroups.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +dedicatedHostGroupsListByResourceGroupMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsListBySubscriptionSample.ts b/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsListBySubscriptionSample.ts new file mode 100644 index 000000000000..b79c63eacfde --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsListBySubscriptionSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. + * + * @summary Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListBySubscription_MaximumSet_Gen.json + */ +async function dedicatedHostGroupsListBySubscriptionMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.dedicatedHostGroups.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +dedicatedHostGroupsListBySubscriptionMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. + * + * @summary Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListBySubscription_MinimumSet_Gen.json + */ +async function dedicatedHostGroupsListBySubscriptionMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.dedicatedHostGroups.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +dedicatedHostGroupsListBySubscriptionMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsUpdateSample.ts new file mode 100644 index 000000000000..55436283b934 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsUpdateSample.ts @@ -0,0 +1,84 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + DedicatedHostGroupUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update an dedicated host group. + * + * @summary Update an dedicated host group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Update_MaximumSet_Gen.json + */ +async function dedicatedHostGroupsUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "aaaa"; + const parameters: DedicatedHostGroupUpdate = { + instanceView: { + hosts: [ + { + availableCapacity: { + allocatableVMs: [{ count: 26, vmSize: "aaaaaaaaaaaaaaaaaaaa" }] + }, + statuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z") + } + ] + } + ] + }, + platformFaultDomainCount: 3, + supportAutomaticPlacement: true, + tags: { key9921: "aaaaaaaaaa" }, + zones: ["aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"] + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.update( + resourceGroupName, + hostGroupName, + parameters + ); + console.log(result); +} + +dedicatedHostGroupsUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Update an dedicated host group. + * + * @summary Update an dedicated host group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Update_MinimumSet_Gen.json + */ +async function dedicatedHostGroupsUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "aaaaaaaaaaa"; + const parameters: DedicatedHostGroupUpdate = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.update( + resourceGroupName, + hostGroupName, + parameters + ); + console.log(result); +} + +dedicatedHostGroupsUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/dedicatedHostsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/dedicatedHostsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..2ad0c1c6bbf9 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/dedicatedHostsCreateOrUpdateSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { DedicatedHost, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a dedicated host . + * + * @summary Create or update a dedicated host . + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateADedicatedHost.json + */ +async function createOrUpdateADedicatedHost() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const hostGroupName = "myDedicatedHostGroup"; + const hostName = "myDedicatedHost"; + const parameters: DedicatedHost = { + location: "westus", + platformFaultDomain: 1, + sku: { name: "DSv3-Type1" }, + tags: { department: "HR" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.beginCreateOrUpdateAndWait( + resourceGroupName, + hostGroupName, + hostName, + parameters + ); + console.log(result); +} + +createOrUpdateADedicatedHost().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/dedicatedHostsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/dedicatedHostsDeleteSample.ts new file mode 100644 index 000000000000..b79d8ea85299 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/dedicatedHostsDeleteSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a dedicated host. + * + * @summary Delete a dedicated host. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Delete_MaximumSet_Gen.json + */ +async function dedicatedHostsDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "aaaaaa"; + const hostName = "aaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.beginDeleteAndWait( + resourceGroupName, + hostGroupName, + hostName + ); + console.log(result); +} + +dedicatedHostsDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Delete a dedicated host. + * + * @summary Delete a dedicated host. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Delete_MinimumSet_Gen.json + */ +async function dedicatedHostsDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "aaaaaaaaaaaaaaa"; + const hostName = "aaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.beginDeleteAndWait( + resourceGroupName, + hostGroupName, + hostName + ); + console.log(result); +} + +dedicatedHostsDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/dedicatedHostsGetSample.ts b/sdk/compute/arm-compute/samples-dev/dedicatedHostsGetSample.ts new file mode 100644 index 000000000000..16ccf14a72aa --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/dedicatedHostsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Retrieves information about a dedicated host. + * + * @summary Retrieves information about a dedicated host. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetADedicatedHost.json + */ +async function getADedicatedHost() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const hostGroupName = "myDedicatedHostGroup"; + const hostName = "myHost"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.get( + resourceGroupName, + hostGroupName, + hostName + ); + console.log(result); +} + +getADedicatedHost().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/dedicatedHostsListByHostGroupSample.ts b/sdk/compute/arm-compute/samples-dev/dedicatedHostsListByHostGroupSample.ts new file mode 100644 index 000000000000..d0b0be3104d7 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/dedicatedHostsListByHostGroupSample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + * + * @summary Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_ListByHostGroup_MaximumSet_Gen.json + */ +async function dedicatedHostsListByHostGroupMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.dedicatedHosts.listByHostGroup( + resourceGroupName, + hostGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +dedicatedHostsListByHostGroupMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + * + * @summary Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_ListByHostGroup_MinimumSet_Gen.json + */ +async function dedicatedHostsListByHostGroupMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "aaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.dedicatedHosts.listByHostGroup( + resourceGroupName, + hostGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +dedicatedHostsListByHostGroupMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/dedicatedHostsRestartSample.ts b/sdk/compute/arm-compute/samples-dev/dedicatedHostsRestartSample.ts new file mode 100644 index 000000000000..d4472203528c --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/dedicatedHostsRestartSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/en-us/azure/service-health/resource-health-overview for more details. + * + * @summary Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/en-us/azure/service-health/resource-health-overview for more details. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostRestart.json + */ +async function restartDedicatedHost() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const hostGroupName = "myDedicatedHostGroup"; + const hostName = "myHost"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.beginRestartAndWait( + resourceGroupName, + hostGroupName, + hostName + ); + console.log(result); +} + +restartDedicatedHost().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/dedicatedHostsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/dedicatedHostsUpdateSample.ts new file mode 100644 index 000000000000..55382dbd8075 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/dedicatedHostsUpdateSample.ts @@ -0,0 +1,84 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + DedicatedHostUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update an dedicated host . + * + * @summary Update an dedicated host . + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Update_MaximumSet_Gen.json + */ +async function dedicatedHostsUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "aaaaaaaaa"; + const hostName = "aaaaaaaaaaaaaaaaaaaaa"; + const parameters: DedicatedHostUpdate = { + autoReplaceOnFailure: true, + instanceView: { + availableCapacity: { + allocatableVMs: [{ count: 26, vmSize: "aaaaaaaaaaaaaaaaaaaa" }] + }, + statuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z") + } + ] + }, + licenseType: "Windows_Server_Hybrid", + platformFaultDomain: 1, + tags: { key8813: "aaaaaaaaaaaaaaaaaaaaaaaaaaa" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.beginUpdateAndWait( + resourceGroupName, + hostGroupName, + hostName, + parameters + ); + console.log(result); +} + +dedicatedHostsUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Update an dedicated host . + * + * @summary Update an dedicated host . + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Update_MinimumSet_Gen.json + */ +async function dedicatedHostsUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "aa"; + const hostName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const parameters: DedicatedHostUpdate = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.beginUpdateAndWait( + resourceGroupName, + hostGroupName, + hostName, + parameters + ); + console.log(result); +} + +dedicatedHostsUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/diskAccessesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/diskAccessesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..de15f4b1c771 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/diskAccessesCreateOrUpdateSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { DiskAccess, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates or updates a disk access resource + * + * @summary Creates or updates a disk access resource + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateADiskAccess.json + */ +async function createADiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const diskAccess: DiskAccess = { location: "West US" }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.beginCreateOrUpdateAndWait( + resourceGroupName, + diskAccessName, + diskAccess + ); + console.log(result); +} + +createADiskAccessResource().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/diskAccessesDeleteAPrivateEndpointConnectionSample.ts b/sdk/compute/arm-compute/samples-dev/diskAccessesDeleteAPrivateEndpointConnectionSample.ts new file mode 100644 index 000000000000..407b138eff48 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/diskAccessesDeleteAPrivateEndpointConnectionSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes a private endpoint connection under a disk access resource. + * + * @summary Deletes a private endpoint connection under a disk access resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteAPrivateEndpointConnection.json + */ +async function deleteAPrivateEndpointConnectionUnderADiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const privateEndpointConnectionName = "myPrivateEndpointConnection"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.beginDeleteAPrivateEndpointConnectionAndWait( + resourceGroupName, + diskAccessName, + privateEndpointConnectionName + ); + console.log(result); +} + +deleteAPrivateEndpointConnectionUnderADiskAccessResource().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/diskAccessesDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/diskAccessesDeleteSample.ts new file mode 100644 index 000000000000..da32f1908c8f --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/diskAccessesDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes a disk access resource. + * + * @summary Deletes a disk access resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteADiskAccess.json + */ +async function deleteADiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.beginDeleteAndWait( + resourceGroupName, + diskAccessName + ); + console.log(result); +} + +deleteADiskAccessResource().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/diskAccessesGetAPrivateEndpointConnectionSample.ts b/sdk/compute/arm-compute/samples-dev/diskAccessesGetAPrivateEndpointConnectionSample.ts new file mode 100644 index 000000000000..8d1edadb75cd --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/diskAccessesGetAPrivateEndpointConnectionSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets information about a private endpoint connection under a disk access resource. + * + * @summary Gets information about a private endpoint connection under a disk access resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutAPrivateEndpointConnection.json + */ +async function getInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const privateEndpointConnectionName = "myPrivateEndpointConnection"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.getAPrivateEndpointConnection( + resourceGroupName, + diskAccessName, + privateEndpointConnectionName + ); + console.log(result); +} + +getInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples-dev/diskAccessesGetPrivateLinkResourcesSample.ts b/sdk/compute/arm-compute/samples-dev/diskAccessesGetPrivateLinkResourcesSample.ts new file mode 100644 index 000000000000..2a5abc59ee94 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/diskAccessesGetPrivateLinkResourcesSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the private link resources possible under disk access resource + * + * @summary Gets the private link resources possible under disk access resource + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetDiskAccessPrivateLinkResources.json + */ +async function listAllPossiblePrivateLinkResourcesUnderDiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.getPrivateLinkResources( + resourceGroupName, + diskAccessName + ); + console.log(result); +} + +listAllPossiblePrivateLinkResourcesUnderDiskAccessResource().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples-dev/diskAccessesGetSample.ts b/sdk/compute/arm-compute/samples-dev/diskAccessesGetSample.ts new file mode 100644 index 000000000000..ec50ce9d989e --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/diskAccessesGetSample.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets information about a disk access resource. + * + * @summary Gets information about a disk access resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutADiskAccessWithPrivateEndpoints.json + */ +async function getInformationAboutADiskAccessResourceWithPrivateEndpoints() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.get( + resourceGroupName, + diskAccessName + ); + console.log(result); +} + +getInformationAboutADiskAccessResourceWithPrivateEndpoints().catch( + console.error +); + +/** + * This sample demonstrates how to Gets information about a disk access resource. + * + * @summary Gets information about a disk access resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutADiskAccess.json + */ +async function getInformationAboutADiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.get( + resourceGroupName, + diskAccessName + ); + console.log(result); +} + +getInformationAboutADiskAccessResource().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/diskAccessesListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples-dev/diskAccessesListByResourceGroupSample.ts new file mode 100644 index 000000000000..e272df593a6c --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/diskAccessesListByResourceGroupSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all the disk access resources under a resource group. + * + * @summary Lists all the disk access resources under a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskAccessesInAResourceGroup.json + */ +async function listAllDiskAccessResourcesInAResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.diskAccesses.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listAllDiskAccessResourcesInAResourceGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/diskAccessesListPrivateEndpointConnectionsSample.ts b/sdk/compute/arm-compute/samples-dev/diskAccessesListPrivateEndpointConnectionsSample.ts new file mode 100644 index 000000000000..27c02d86c9e1 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/diskAccessesListPrivateEndpointConnectionsSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List information about private endpoint connections under a disk access resource + * + * @summary List information about private endpoint connections under a disk access resource + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListPrivateEndpointConnectionsInADiskAccess.json + */ +async function getInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.diskAccesses.listPrivateEndpointConnections( + resourceGroupName, + diskAccessName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples-dev/diskAccessesListSample.ts b/sdk/compute/arm-compute/samples-dev/diskAccessesListSample.ts new file mode 100644 index 000000000000..a101e7ff94b2 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/diskAccessesListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all the disk access resources under a subscription. + * + * @summary Lists all the disk access resources under a subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskAccessesInASubscription.json + */ +async function listAllDiskAccessResourcesInASubscription() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.diskAccesses.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listAllDiskAccessResourcesInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/diskAccessesUpdateAPrivateEndpointConnectionSample.ts b/sdk/compute/arm-compute/samples-dev/diskAccessesUpdateAPrivateEndpointConnectionSample.ts new file mode 100644 index 000000000000..debecb5004a2 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/diskAccessesUpdateAPrivateEndpointConnectionSample.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + PrivateEndpointConnection, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. + * + * @summary Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ApprovePrivateEndpointConnection.json + */ +async function approveAPrivateEndpointConnectionUnderADiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const privateEndpointConnectionName = "myPrivateEndpointConnection"; + const privateEndpointConnection: PrivateEndpointConnection = { + privateLinkServiceConnectionState: { + description: "Approving myPrivateEndpointConnection", + status: "Approved" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.beginUpdateAPrivateEndpointConnectionAndWait( + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + privateEndpointConnection + ); + console.log(result); +} + +approveAPrivateEndpointConnectionUnderADiskAccessResource().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples-dev/diskAccessesUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/diskAccessesUpdateSample.ts new file mode 100644 index 000000000000..52533c527b6b --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/diskAccessesUpdateSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { DiskAccessUpdate, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Updates (patches) a disk access resource. + * + * @summary Updates (patches) a disk access resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateADiskAccess.json + */ +async function updateADiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const diskAccess: DiskAccessUpdate = { + tags: { department: "Development", project: "PrivateEndpoints" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.beginUpdateAndWait( + resourceGroupName, + diskAccessName, + diskAccess + ); + console.log(result); +} + +updateADiskAccessResource().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..3d125dd86d7c --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsCreateOrUpdateSample.ts @@ -0,0 +1,78 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { DiskEncryptionSet, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates or updates a disk encryption set + * + * @summary Creates or updates a disk encryption set + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateADiskEncryptionSetWithKeyVaultFromADifferentSubscription.json + */ +async function createADiskEncryptionSetWithKeyVaultFromADifferentSubscription() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskEncryptionSetName = "myDiskEncryptionSet"; + const diskEncryptionSet: DiskEncryptionSet = { + activeKey: { + keyUrl: "https://myvaultdifferentsub.vault-int.azure-int.net/keys/{key}" + }, + encryptionType: "EncryptionAtRestWithCustomerKey", + identity: { type: "SystemAssigned" }, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.beginCreateOrUpdateAndWait( + resourceGroupName, + diskEncryptionSetName, + diskEncryptionSet + ); + console.log(result); +} + +createADiskEncryptionSetWithKeyVaultFromADifferentSubscription().catch( + console.error +); + +/** + * This sample demonstrates how to Creates or updates a disk encryption set + * + * @summary Creates or updates a disk encryption set + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateADiskEncryptionSet.json + */ +async function createADiskEncryptionSet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskEncryptionSetName = "myDiskEncryptionSet"; + const diskEncryptionSet: DiskEncryptionSet = { + activeKey: { + keyUrl: "https://myvmvault.vault-int.azure-int.net/keys/{key}", + sourceVault: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault" + } + }, + encryptionType: "EncryptionAtRestWithCustomerKey", + identity: { type: "SystemAssigned" }, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.beginCreateOrUpdateAndWait( + resourceGroupName, + diskEncryptionSetName, + diskEncryptionSet + ); + console.log(result); +} + +createADiskEncryptionSet().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsDeleteSample.ts new file mode 100644 index 000000000000..492b4ab2ecc1 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes a disk encryption set. + * + * @summary Deletes a disk encryption set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteADiskEncryptionSet.json + */ +async function deleteADiskEncryptionSet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskEncryptionSetName = "myDiskEncryptionSet"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.beginDeleteAndWait( + resourceGroupName, + diskEncryptionSetName + ); + console.log(result); +} + +deleteADiskEncryptionSet().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsGetSample.ts b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsGetSample.ts new file mode 100644 index 000000000000..04c58351b5cd --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsGetSample.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets information about a disk encryption set. + * + * @summary Gets information about a disk encryption set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutADiskEncryptionSetWithAutoKeyRotationError.json + */ +async function getInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskEncryptionSetName = "myDiskEncryptionSet"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.get( + resourceGroupName, + diskEncryptionSetName + ); + console.log(result); +} + +getInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed().catch( + console.error +); + +/** + * This sample demonstrates how to Gets information about a disk encryption set. + * + * @summary Gets information about a disk encryption set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutADiskEncryptionSet.json + */ +async function getInformationAboutADiskEncryptionSet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskEncryptionSetName = "myDiskEncryptionSet"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.get( + resourceGroupName, + diskEncryptionSetName + ); + console.log(result); +} + +getInformationAboutADiskEncryptionSet().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsListAssociatedResourcesSample.ts b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsListAssociatedResourcesSample.ts new file mode 100644 index 000000000000..560370473ad9 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsListAssociatedResourcesSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all resources that are encrypted with this disk encryption set. + * + * @summary Lists all resources that are encrypted with this disk encryption set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskEncryptionSetAssociatedResources.json + */ +async function listAllResourcesThatAreEncryptedWithThisDiskEncryptionSet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskEncryptionSetName = "myDiskEncryptionSet"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.diskEncryptionSets.listAssociatedResources( + resourceGroupName, + diskEncryptionSetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listAllResourcesThatAreEncryptedWithThisDiskEncryptionSet().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsListByResourceGroupSample.ts new file mode 100644 index 000000000000..140ec28c1346 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsListByResourceGroupSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all the disk encryption sets under a resource group. + * + * @summary Lists all the disk encryption sets under a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskEncryptionSetsInAResourceGroup.json + */ +async function listAllDiskEncryptionSetsInAResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.diskEncryptionSets.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listAllDiskEncryptionSetsInAResourceGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsListSample.ts b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsListSample.ts new file mode 100644 index 000000000000..2a36961168e8 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all the disk encryption sets under a subscription. + * + * @summary Lists all the disk encryption sets under a subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskEncryptionSetsInASubscription.json + */ +async function listAllDiskEncryptionSetsInASubscription() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.diskEncryptionSets.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listAllDiskEncryptionSetsInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsUpdateSample.ts new file mode 100644 index 000000000000..5733c9fa3309 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsUpdateSample.ts @@ -0,0 +1,115 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + DiskEncryptionSetUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Updates (patches) a disk encryption set. + * + * @summary Updates (patches) a disk encryption set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateADiskEncryptionSetWithRotationToLatestKeyVersionEnabled.json + */ +async function updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueSucceeded() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskEncryptionSetName = "myDiskEncryptionSet"; + const diskEncryptionSet: DiskEncryptionSetUpdate = { + activeKey: { + keyUrl: + "https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion1" + }, + encryptionType: "EncryptionAtRestWithCustomerKey", + identity: { type: "SystemAssigned" }, + rotationToLatestKeyVersionEnabled: true + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.beginUpdateAndWait( + resourceGroupName, + diskEncryptionSetName, + diskEncryptionSet + ); + console.log(result); +} + +updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueSucceeded().catch( + console.error +); + +/** + * This sample demonstrates how to Updates (patches) a disk encryption set. + * + * @summary Updates (patches) a disk encryption set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledInProgress.json + */ +async function updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueUpdating() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskEncryptionSetName = "myDiskEncryptionSet"; + const diskEncryptionSet: DiskEncryptionSetUpdate = { + activeKey: { + keyUrl: + "https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion1" + }, + encryptionType: "EncryptionAtRestWithCustomerKey", + identity: { type: "SystemAssigned" }, + rotationToLatestKeyVersionEnabled: true + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.beginUpdateAndWait( + resourceGroupName, + diskEncryptionSetName, + diskEncryptionSet + ); + console.log(result); +} + +updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueUpdating().catch( + console.error +); + +/** + * This sample demonstrates how to Updates (patches) a disk encryption set. + * + * @summary Updates (patches) a disk encryption set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateADiskEncryptionSet.json + */ +async function updateADiskEncryptionSet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskEncryptionSetName = "myDiskEncryptionSet"; + const diskEncryptionSet: DiskEncryptionSetUpdate = { + activeKey: { + keyUrl: + "https://myvmvault.vault-int.azure-int.net/keys/keyName/keyVersion", + sourceVault: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault" + } + }, + encryptionType: "EncryptionAtRestWithCustomerKey", + tags: { department: "Development", project: "Encryption" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.beginUpdateAndWait( + resourceGroupName, + diskEncryptionSetName, + diskEncryptionSet + ); + console.log(result); +} + +updateADiskEncryptionSet().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/diskRestorePointGetSample.ts b/sdk/compute/arm-compute/samples-dev/diskRestorePointGetSample.ts new file mode 100644 index 000000000000..71ce9f0901a4 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/diskRestorePointGetSample.ts @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get disk restorePoint resource + * + * @summary Get disk restorePoint resource + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetDiskRestorePointResources.json + */ +async function getAnIncrementalDiskRestorePointResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpc"; + const vmRestorePointName = "vmrp"; + const diskRestorePointName = + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskRestorePointOperations.get( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName + ); + console.log(result); +} + +getAnIncrementalDiskRestorePointResource().catch(console.error); + +/** + * This sample demonstrates how to Get disk restorePoint resource + * + * @summary Get disk restorePoint resource + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetDiskRestorePointWhenSourceResourceIsFromDifferentRegion.json + */ +async function getAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpc"; + const vmRestorePointName = "vmrp"; + const diskRestorePointName = + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskRestorePointOperations.get( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName + ); + console.log(result); +} + +getAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples-dev/diskRestorePointGrantAccessSample.ts b/sdk/compute/arm-compute/samples-dev/diskRestorePointGrantAccessSample.ts new file mode 100644 index 000000000000..bc13fb771a09 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/diskRestorePointGrantAccessSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { GrantAccessData, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Grants access to a diskRestorePoint. + * + * @summary Grants access to a diskRestorePoint. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/BeginGetAccessDiskRestorePoint.json + */ +async function grantsAccessToADiskRestorePoint() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpc"; + const vmRestorePointName = "vmrp"; + const diskRestorePointName = + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"; + const grantAccessData: GrantAccessData = { + access: "Read", + durationInSeconds: 300 + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskRestorePointOperations.beginGrantAccessAndWait( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData + ); + console.log(result); +} + +grantsAccessToADiskRestorePoint().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/diskRestorePointListByRestorePointSample.ts b/sdk/compute/arm-compute/samples-dev/diskRestorePointListByRestorePointSample.ts new file mode 100644 index 000000000000..4a652dee31e8 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/diskRestorePointListByRestorePointSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists diskRestorePoints under a vmRestorePoint. + * + * @summary Lists diskRestorePoints under a vmRestorePoint. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskRestorePointsInVmRestorePoint.json + */ +async function getAnIncrementalDiskRestorePointResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpc"; + const vmRestorePointName = "vmrp"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.diskRestorePointOperations.listByRestorePoint( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAnIncrementalDiskRestorePointResource().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/diskRestorePointRevokeAccessSample.ts b/sdk/compute/arm-compute/samples-dev/diskRestorePointRevokeAccessSample.ts new file mode 100644 index 000000000000..313218e59a41 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/diskRestorePointRevokeAccessSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Revokes access to a diskRestorePoint. + * + * @summary Revokes access to a diskRestorePoint. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/EndGetAccessDiskRestorePoint.json + */ +async function revokesAccessToADiskRestorePoint() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpc"; + const vmRestorePointName = "vmrp"; + const diskRestorePointName = + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskRestorePointOperations.beginRevokeAccessAndWait( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName + ); + console.log(result); +} + +revokesAccessToADiskRestorePoint().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/disksCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/disksCreateOrUpdateSample.ts new file mode 100644 index 000000000000..1b37b06ee90b --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/disksCreateOrUpdateSample.ts @@ -0,0 +1,542 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { Disk, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAConfidentialVMDiskEncryptedWithCMK.json + */ +async function createAConfidentialVMSupportedDiskEncryptedWithCustomerManagedKey() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { + createOption: "FromImage", + imageReference: { + id: + "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0" + } + }, + location: "West US", + osType: "Windows", + securityProfile: { + secureVMDiskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", + securityType: "ConfidentialVM_DiskEncryptedWithCustomerKey" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAConfidentialVMSupportedDiskEncryptedWithCustomerManagedKey().catch( + console.error +); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskWithDiskAccess.json + */ +async function createAManagedDiskAndAssociateWithDiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { createOption: "Empty" }, + diskAccessId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/{existing-diskAccess-name}", + diskSizeGB: 200, + location: "West US", + networkAccessPolicy: "AllowPrivate" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAManagedDiskAndAssociateWithDiskAccessResource().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskWithDiskEncryptionSet.json + */ +async function createAManagedDiskAndAssociateWithDiskEncryptionSet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + encryption: { + diskEncryptionSetId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}" + }, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAManagedDiskAndAssociateWithDiskEncryptionSet().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskByCopyingASnapshot.json + */ +async function createAManagedDiskByCopyingASnapshot() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { + createOption: "Copy", + sourceResourceId: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot" + }, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAManagedDiskByCopyingASnapshot().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription.json + */ +async function createAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { + createOption: "Import", + sourceUri: + "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + storageAccountId: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount" + }, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription().catch( + console.error +); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription.json + */ +async function createAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { + createOption: "Import", + sourceUri: + "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd" + }, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription().catch( + console.error +); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskFromImportSecure.json + */ +async function createAManagedDiskFromImportSecureCreateOption() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { + createOption: "ImportSecure", + securityDataUri: + "https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd", + sourceUri: + "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + storageAccountId: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount" + }, + location: "West US", + osType: "Windows", + securityProfile: { + securityType: "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAManagedDiskFromImportSecureCreateOption().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskFromUploadPreparedSecure.json + */ +async function createAManagedDiskFromUploadPreparedSecureCreateOption() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { + createOption: "UploadPreparedSecure", + uploadSizeBytes: 10737418752 + }, + location: "West US", + osType: "Windows", + securityProfile: { securityType: "TrustedLaunch" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAManagedDiskFromUploadPreparedSecureCreateOption().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskFromAPlatformImage.json + */ +async function createAManagedDiskFromAPlatformImage() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { + createOption: "FromImage", + imageReference: { + id: + "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0" + } + }, + location: "West US", + osType: "Windows" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAManagedDiskFromAPlatformImage().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskFromAnExistingManagedDisk.json + */ +async function createAManagedDiskFromAnExistingManagedDiskInTheSameOrDifferentSubscription() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk2"; + const disk: Disk = { + creationData: { + createOption: "Copy", + sourceResourceId: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk1" + }, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAManagedDiskFromAnExistingManagedDiskInTheSameOrDifferentSubscription().catch( + console.error +); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskWithDataAccessAuthMode.json + */ +async function createAManagedDiskWithDataAccessAuthMode() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { createOption: "Empty" }, + dataAccessAuthMode: "AzureActiveDirectory", + diskSizeGB: 200, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAManagedDiskWithDataAccessAuthMode().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskWithSecurityProfile.json + */ +async function createAManagedDiskWithSecurityProfile() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { + createOption: "FromImage", + imageReference: { + id: + "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/uswest/Publishers/Microsoft/ArtifactTypes/VMImage/Offers/{offer}" + } + }, + location: "North Central US", + osType: "Windows", + securityProfile: { securityType: "TrustedLaunch" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAManagedDiskWithSecurityProfile().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskWithSSDZRSAccountType.json + */ +async function createAManagedDiskWithSsdZrsAccountType() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + location: "West US", + sku: { name: "Premium_ZRS" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAManagedDiskWithSsdZrsAccountType().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedUploadDisk.json + */ +async function createAManagedUploadDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { createOption: "Upload", uploadSizeBytes: 10737418752 }, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAManagedUploadDisk().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAnEmptyManagedDiskInExtendedLocation.json + */ +async function createAnEmptyManagedDiskInExtendedLocation() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + extendedLocation: { name: "{edge-zone-id}", type: "EdgeZone" }, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAnEmptyManagedDiskInExtendedLocation().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAnEmptyManagedDisk.json + */ +async function createAnEmptyManagedDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAnEmptyManagedDisk().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskWithLogicalSectorSize.json + */ +async function createAnUltraManagedDiskWithLogicalSectorSize512E() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { createOption: "Empty", logicalSectorSize: 512 }, + diskSizeGB: 200, + location: "West US", + sku: { name: "UltraSSD_LRS" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAnUltraManagedDiskWithLogicalSectorSize512E().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/disksDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/disksDeleteSample.ts new file mode 100644 index 000000000000..a496a65c4970 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/disksDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes a disk. + * + * @summary Deletes a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteAManagedDisk.json + */ +async function deleteAManagedDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginDeleteAndWait( + resourceGroupName, + diskName + ); + console.log(result); +} + +deleteAManagedDisk().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/disksGetSample.ts b/sdk/compute/arm-compute/samples-dev/disksGetSample.ts new file mode 100644 index 000000000000..a79272455306 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/disksGetSample.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets information about a disk. + * + * @summary Gets information about a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutAManagedDisk.json + */ +async function getInformationAboutAManagedDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myManagedDisk"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.get(resourceGroupName, diskName); + console.log(result); +} + +getInformationAboutAManagedDisk().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/disksGrantAccessSample.ts b/sdk/compute/arm-compute/samples-dev/disksGrantAccessSample.ts new file mode 100644 index 000000000000..b1c2adef02ae --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/disksGrantAccessSample.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { GrantAccessData, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Grants access to a disk. + * + * @summary Grants access to a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/BeginGetAccessManagedDisk.json + */ +async function getASasOnAManagedDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const grantAccessData: GrantAccessData = { + access: "Read", + durationInSeconds: 300 + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginGrantAccessAndWait( + resourceGroupName, + diskName, + grantAccessData + ); + console.log(result); +} + +getASasOnAManagedDisk().catch(console.error); + +/** + * This sample demonstrates how to Grants access to a disk. + * + * @summary Grants access to a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/BeginGetAccessManagedDiskWithVMGuestState.json + */ +async function getSasOnManagedDiskAndVMGuestState() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const grantAccessData: GrantAccessData = { + access: "Read", + durationInSeconds: 300, + getSecureVMGuestStateSAS: true + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginGrantAccessAndWait( + resourceGroupName, + diskName, + grantAccessData + ); + console.log(result); +} + +getSasOnManagedDiskAndVMGuestState().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/disksListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples-dev/disksListByResourceGroupSample.ts new file mode 100644 index 000000000000..70176d30dd08 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/disksListByResourceGroupSample.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all the disks under a resource group. + * + * @summary Lists all the disks under a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListManagedDisksInAResourceGroup.json + */ +async function listAllManagedDisksInAResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.disks.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listAllManagedDisksInAResourceGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/disksListSample.ts b/sdk/compute/arm-compute/samples-dev/disksListSample.ts new file mode 100644 index 000000000000..b4e769c1c94e --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/disksListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all the disks under a subscription. + * + * @summary Lists all the disks under a subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListManagedDisksInASubscription.json + */ +async function listAllManagedDisksInASubscription() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.disks.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listAllManagedDisksInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/disksRevokeAccessSample.ts b/sdk/compute/arm-compute/samples-dev/disksRevokeAccessSample.ts new file mode 100644 index 000000000000..39c6c7bacd42 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/disksRevokeAccessSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Revokes access to a disk. + * + * @summary Revokes access to a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/EndGetAccessManagedDisk.json + */ +async function revokeAccessToAManagedDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginRevokeAccessAndWait( + resourceGroupName, + diskName + ); + console.log(result); +} + +revokeAccessToAManagedDisk().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/disksUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/disksUpdateSample.ts new file mode 100644 index 000000000000..821f1ecb9b07 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/disksUpdateSample.ts @@ -0,0 +1,205 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { DiskUpdate, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Updates (patches) a disk. + * + * @summary Updates (patches) a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateOrUpdateABurstingEnabledManagedDisk.json + */ +async function createOrUpdateABurstingEnabledManagedDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: DiskUpdate = { burstingEnabled: true, diskSizeGB: 1024 }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createOrUpdateABurstingEnabledManagedDisk().catch(console.error); + +/** + * This sample demonstrates how to Updates (patches) a disk. + * + * @summary Updates (patches) a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateAManagedDiskToAddAcceleratedNetworking.json + */ +async function updateAManagedDiskToAddAcceleratedNetworking() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: DiskUpdate = { + supportedCapabilities: { acceleratedNetwork: false } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +updateAManagedDiskToAddAcceleratedNetworking().catch(console.error); + +/** + * This sample demonstrates how to Updates (patches) a disk. + * + * @summary Updates (patches) a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateAManagedDiskToAddArchitecture.json + */ +async function updateAManagedDiskToAddArchitecture() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: DiskUpdate = { supportedCapabilities: { architecture: "Arm64" } }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +updateAManagedDiskToAddArchitecture().catch(console.error); + +/** + * This sample demonstrates how to Updates (patches) a disk. + * + * @summary Updates (patches) a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateAManagedDiskToAddPurchasePlan.json + */ +async function updateAManagedDiskToAddPurchasePlan() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: DiskUpdate = { + purchasePlan: { + name: "myPurchasePlanName", + product: "myPurchasePlanProduct", + promotionCode: "myPurchasePlanPromotionCode", + publisher: "myPurchasePlanPublisher" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +updateAManagedDiskToAddPurchasePlan().catch(console.error); + +/** + * This sample demonstrates how to Updates (patches) a disk. + * + * @summary Updates (patches) a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateAManagedDiskToAddSupportsHibernation.json + */ +async function updateAManagedDiskToAddSupportsHibernation() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: DiskUpdate = { supportsHibernation: true }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +updateAManagedDiskToAddSupportsHibernation().catch(console.error); + +/** + * This sample demonstrates how to Updates (patches) a disk. + * + * @summary Updates (patches) a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateAManagedDiskToChangeTier.json + */ +async function updateAManagedDiskToChangeTier() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: DiskUpdate = { tier: "P30" }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +updateAManagedDiskToChangeTier().catch(console.error); + +/** + * This sample demonstrates how to Updates (patches) a disk. + * + * @summary Updates (patches) a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateAManagedDiskToDisableBursting.json + */ +async function updateAManagedDiskToDisableBursting() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: DiskUpdate = { burstingEnabled: false }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +updateAManagedDiskToDisableBursting().catch(console.error); + +/** + * This sample demonstrates how to Updates (patches) a disk. + * + * @summary Updates (patches) a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateAManagedDiskToRemoveDiskAccess.json + */ +async function updateManagedDiskToRemoveDiskAccessResourceAssociation() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: DiskUpdate = { networkAccessPolicy: "AllowAll" }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +updateManagedDiskToRemoveDiskAccessResourceAssociation().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleriesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleriesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..29bee9d11a67 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/galleriesCreateOrUpdateSample.ts @@ -0,0 +1,127 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { Gallery, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a Shared Image Gallery. + * + * @summary Create or update a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateACommunityGallery.json + */ +async function createACommunityGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const gallery: Gallery = { + description: "This is the gallery description.", + location: "West US", + sharingProfile: { + communityGalleryInfo: { + eula: "eula", + publicNamePrefix: "PirPublic", + publisherContact: "pir@microsoft.com", + publisherUri: "uri" + }, + permissions: "Community" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + gallery + ); + console.log(result); +} + +createACommunityGallery().catch(console.error); + +/** + * This sample demonstrates how to Create or update a Shared Image Gallery. + * + * @summary Create or update a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryWithSharingProfile.json + */ +async function createOrUpdateASimpleGalleryWithSharingProfile() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const gallery: Gallery = { + description: "This is the gallery description.", + location: "West US", + sharingProfile: { permissions: "Groups" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + gallery + ); + console.log(result); +} + +createOrUpdateASimpleGalleryWithSharingProfile().catch(console.error); + +/** + * This sample demonstrates how to Create or update a Shared Image Gallery. + * + * @summary Create or update a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryWithSoftDeletionEnabled.json + */ +async function createOrUpdateASimpleGalleryWithSoftDeletionEnabled() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const gallery: Gallery = { + description: "This is the gallery description.", + location: "West US", + softDeletePolicy: { isSoftDeleteEnabled: true } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + gallery + ); + console.log(result); +} + +createOrUpdateASimpleGalleryWithSoftDeletionEnabled().catch(console.error); + +/** + * This sample demonstrates how to Create or update a Shared Image Gallery. + * + * @summary Create or update a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGallery.json + */ +async function createOrUpdateASimpleGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const gallery: Gallery = { + description: "This is the gallery description.", + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + gallery + ); + console.log(result); +} + +createOrUpdateASimpleGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleriesDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/galleriesDeleteSample.ts new file mode 100644 index 000000000000..62da9bf5b8f3 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/galleriesDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a Shared Image Gallery. + * + * @summary Delete a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGallery.json + */ +async function deleteAGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.beginDeleteAndWait( + resourceGroupName, + galleryName + ); + console.log(result); +} + +deleteAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleriesGetSample.ts b/sdk/compute/arm-compute/samples-dev/galleriesGetSample.ts new file mode 100644 index 000000000000..cb761d6898da --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/galleriesGetSample.ts @@ -0,0 +1,99 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + GalleriesGetOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Retrieves information about a Shared Image Gallery. + * + * @summary Retrieves information about a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetACommunityGallery.json + */ +async function getACommunityGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.get(resourceGroupName, galleryName); + console.log(result); +} + +getACommunityGallery().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about a Shared Image Gallery. + * + * @summary Retrieves information about a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryWithExpandSharingProfileGroups.json + */ +async function getAGalleryWithExpandSharingProfileGroups() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const expand = "SharingProfile/Groups"; + const options: GalleriesGetOptionalParams = { expand }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.get( + resourceGroupName, + galleryName, + options + ); + console.log(result); +} + +getAGalleryWithExpandSharingProfileGroups().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about a Shared Image Gallery. + * + * @summary Retrieves information about a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryWithSelectPermissions.json + */ +async function getAGalleryWithSelectPermissions() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const select = "Permissions"; + const options: GalleriesGetOptionalParams = { select }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.get( + resourceGroupName, + galleryName, + options + ); + console.log(result); +} + +getAGalleryWithSelectPermissions().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about a Shared Image Gallery. + * + * @summary Retrieves information about a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGallery.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.get(resourceGroupName, galleryName); + console.log(result); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleriesListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples-dev/galleriesListByResourceGroupSample.ts new file mode 100644 index 000000000000..66f6109f54fd --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/galleriesListByResourceGroupSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List galleries under a resource group. + * + * @summary List galleries under a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleriesInAResourceGroup.json + */ +async function listGalleriesInAResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.galleries.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listGalleriesInAResourceGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleriesListSample.ts b/sdk/compute/arm-compute/samples-dev/galleriesListSample.ts new file mode 100644 index 000000000000..3733afce354b --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/galleriesListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List galleries under a subscription. + * + * @summary List galleries under a subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleriesInASubscription.json + */ +async function listGalleriesInASubscription() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.galleries.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listGalleriesInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleriesUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleriesUpdateSample.ts new file mode 100644 index 000000000000..eb4ae84a7b46 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/galleriesUpdateSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { GalleryUpdate, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update a Shared Image Gallery. + * + * @summary Update a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGallery.json + */ +async function updateASimpleGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const gallery: GalleryUpdate = { + description: "This is the gallery description." + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.beginUpdateAndWait( + resourceGroupName, + galleryName, + gallery + ); + console.log(result); +} + +updateASimpleGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..570975798522 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsCreateOrUpdateSample.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + GalleryApplicationVersion, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a gallery Application Version. + * + * @summary Create or update a gallery Application Version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryApplicationVersion.json + */ +async function createOrUpdateASimpleGalleryApplicationVersion() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const galleryApplicationVersionName = "1.0.0"; + const galleryApplicationVersion: GalleryApplicationVersion = { + location: "West US", + publishingProfile: { + endOfLifeDate: new Date("2019-07-01T07:00:00Z"), + manageActions: { + install: + 'powershell -command "Expand-Archive -Path package.zip -DestinationPath C:package"', + remove: "del C:package " + }, + replicaCount: 1, + source: { + mediaLink: + "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}" + }, + storageAccountType: "Standard_LRS", + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + storageAccountType: "Standard_LRS" + } + ] + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplicationVersions.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion + ); + console.log(result); +} + +createOrUpdateASimpleGalleryApplicationVersion().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsDeleteSample.ts new file mode 100644 index 000000000000..ae168a1dec6d --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a gallery Application Version. + * + * @summary Delete a gallery Application Version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGalleryApplicationVersion.json + */ +async function deleteAGalleryApplicationVersion() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const galleryApplicationVersionName = "1.0.0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplicationVersions.beginDeleteAndWait( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName + ); + console.log(result); +} + +deleteAGalleryApplicationVersion().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsGetSample.ts b/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsGetSample.ts new file mode 100644 index 000000000000..3f3e3113430a --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsGetSample.ts @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + GalleryApplicationVersionsGetOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Retrieves information about a gallery Application Version. + * + * @summary Retrieves information about a gallery Application Version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryApplicationVersionWithReplicationStatus.json + */ +async function getAGalleryApplicationVersionWithReplicationStatus() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const galleryApplicationVersionName = "1.0.0"; + const expand = "ReplicationStatus"; + const options: GalleryApplicationVersionsGetOptionalParams = { expand }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplicationVersions.get( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + options + ); + console.log(result); +} + +getAGalleryApplicationVersionWithReplicationStatus().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about a gallery Application Version. + * + * @summary Retrieves information about a gallery Application Version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryApplicationVersion.json + */ +async function getAGalleryApplicationVersion() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const galleryApplicationVersionName = "1.0.0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplicationVersions.get( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName + ); + console.log(result); +} + +getAGalleryApplicationVersion().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsListByGalleryApplicationSample.ts b/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsListByGalleryApplicationSample.ts new file mode 100644 index 000000000000..84ce99e2fcd8 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsListByGalleryApplicationSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List gallery Application Versions in a gallery Application Definition. + * + * @summary List gallery Application Versions in a gallery Application Definition. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleryApplicationVersionsInAGalleryApplication.json + */ +async function listGalleryApplicationVersionsInAGalleryApplicationDefinition() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.galleryApplicationVersions.listByGalleryApplication( + resourceGroupName, + galleryName, + galleryApplicationName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listGalleryApplicationVersionsInAGalleryApplicationDefinition().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsUpdateSample.ts new file mode 100644 index 000000000000..08ca33c5ff91 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsUpdateSample.ts @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + GalleryApplicationVersionUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update a gallery Application Version. + * + * @summary Update a gallery Application Version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGalleryApplicationVersion.json + */ +async function updateASimpleGalleryApplicationVersion() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const galleryApplicationVersionName = "1.0.0"; + const galleryApplicationVersion: GalleryApplicationVersionUpdate = { + publishingProfile: { + endOfLifeDate: new Date("2019-07-01T07:00:00Z"), + manageActions: { + install: + 'powershell -command "Expand-Archive -Path package.zip -DestinationPath C:package"', + remove: "del C:package " + }, + replicaCount: 1, + source: { + mediaLink: + "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}" + }, + storageAccountType: "Standard_LRS", + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + storageAccountType: "Standard_LRS" + } + ] + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplicationVersions.beginUpdateAndWait( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion + ); + console.log(result); +} + +updateASimpleGalleryApplicationVersion().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleryApplicationsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleryApplicationsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..6a098a336346 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/galleryApplicationsCreateOrUpdateSample.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + GalleryApplication, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a gallery Application Definition. + * + * @summary Create or update a gallery Application Definition. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryApplication.json + */ +async function createOrUpdateASimpleGalleryApplication() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const galleryApplication: GalleryApplication = { + description: "This is the gallery application description.", + eula: "This is the gallery application EULA.", + location: "West US", + privacyStatementUri: "myPrivacyStatementUri}", + releaseNoteUri: "myReleaseNoteUri", + supportedOSType: "Windows" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplications.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplication + ); + console.log(result); +} + +createOrUpdateASimpleGalleryApplication().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleryApplicationsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/galleryApplicationsDeleteSample.ts new file mode 100644 index 000000000000..80e94a463d69 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/galleryApplicationsDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a gallery Application. + * + * @summary Delete a gallery Application. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGalleryApplication.json + */ +async function deleteAGalleryApplication() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplications.beginDeleteAndWait( + resourceGroupName, + galleryName, + galleryApplicationName + ); + console.log(result); +} + +deleteAGalleryApplication().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleryApplicationsGetSample.ts b/sdk/compute/arm-compute/samples-dev/galleryApplicationsGetSample.ts new file mode 100644 index 000000000000..aab0946b632a --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/galleryApplicationsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Retrieves information about a gallery Application Definition. + * + * @summary Retrieves information about a gallery Application Definition. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryApplication.json + */ +async function getAGalleryApplication() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplications.get( + resourceGroupName, + galleryName, + galleryApplicationName + ); + console.log(result); +} + +getAGalleryApplication().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleryApplicationsListByGallerySample.ts b/sdk/compute/arm-compute/samples-dev/galleryApplicationsListByGallerySample.ts new file mode 100644 index 000000000000..cdadaedeeced --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/galleryApplicationsListByGallerySample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List gallery Application Definitions in a gallery. + * + * @summary List gallery Application Definitions in a gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleryApplicationsInAGallery.json + */ +async function listGalleryApplicationsInAGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.galleryApplications.listByGallery( + resourceGroupName, + galleryName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listGalleryApplicationsInAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleryApplicationsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleryApplicationsUpdateSample.ts new file mode 100644 index 000000000000..2493e0eb4afd --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/galleryApplicationsUpdateSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + GalleryApplicationUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update a gallery Application Definition. + * + * @summary Update a gallery Application Definition. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGalleryApplication.json + */ +async function updateASimpleGalleryApplication() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const galleryApplication: GalleryApplicationUpdate = { + description: "This is the gallery application description.", + eula: "This is the gallery application EULA.", + privacyStatementUri: "myPrivacyStatementUri}", + releaseNoteUri: "myReleaseNoteUri", + supportedOSType: "Windows" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplications.beginUpdateAndWait( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplication + ); + console.log(result); +} + +updateASimpleGalleryApplication().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleryImageVersionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleryImageVersionsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..82d3fb697128 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/galleryImageVersionsCreateOrUpdateSample.ts @@ -0,0 +1,656 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + GalleryImageVersion, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a gallery image version. + * + * @summary Create or update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithVMAsSource.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingVMAsSource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion: GalleryImageVersion = { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + lun: 0 + }, + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + lun: 1 + } + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet" + } + }, + regionalReplicaCount: 1 + }, + { + name: "East US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + lun: 0 + }, + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + lun: 1 + } + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet" + } + }, + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS" + } + ] + }, + storageProfile: { + source: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{vmName}" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +createOrUpdateASimpleGalleryImageVersionUsingVMAsSource().catch(console.error); + +/** + * This sample demonstrates how to Create or update a gallery image version. + * + * @summary Create or update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersion.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingManagedImageAsSource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion: GalleryImageVersion = { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + lun: 0 + }, + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + lun: 1 + } + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet" + } + }, + regionalReplicaCount: 1 + }, + { + name: "East US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + lun: 0 + }, + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + lun: 1 + } + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet" + } + }, + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS" + } + ] + }, + storageProfile: { + source: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +createOrUpdateASimpleGalleryImageVersionUsingManagedImageAsSource().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update a gallery image version. + * + * @summary Create or update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithSnapshotsAsSource.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingMixOfDisksAndSnapshotsAsASource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion: GalleryImageVersion = { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + lun: 1 + } + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet" + } + }, + regionalReplicaCount: 1 + }, + { + name: "East US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + lun: 1 + } + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet" + } + }, + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS" + } + ] + }, + storageProfile: { + dataDiskImages: [ + { + hostCaching: "None", + lun: 1, + source: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{dataDiskName}" + } + } + ], + osDiskImage: { + hostCaching: "ReadOnly", + source: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{osSnapshotName}" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +createOrUpdateASimpleGalleryImageVersionUsingMixOfDisksAndSnapshotsAsASource().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update a gallery image version. + * + * @summary Create or update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithShallowReplicationMode.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingShallowReplicationMode() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion: GalleryImageVersion = { + location: "West US", + publishingProfile: { + replicationMode: "Shallow", + targetRegions: [{ name: "West US", regionalReplicaCount: 1 }] + }, + storageProfile: { + source: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +createOrUpdateASimpleGalleryImageVersionUsingShallowReplicationMode().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update a gallery image version. + * + * @summary Create or update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithImageVersionAsSource.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingSharedImageAsSource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion: GalleryImageVersion = { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + lun: 0 + }, + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + lun: 1 + } + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet" + } + }, + regionalReplicaCount: 1 + }, + { + name: "East US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + lun: 0 + }, + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + lun: 1 + } + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet" + } + }, + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS" + } + ] + }, + storageProfile: { + source: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{versionName}" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +createOrUpdateASimpleGalleryImageVersionUsingSharedImageAsSource().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update a gallery image version. + * + * @summary Create or update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithSnapshotsAsSource.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingSnapshotsAsASource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion: GalleryImageVersion = { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + lun: 1 + } + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet" + } + }, + regionalReplicaCount: 1 + }, + { + name: "East US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + lun: 1 + } + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet" + } + }, + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS" + } + ] + }, + storageProfile: { + dataDiskImages: [ + { + hostCaching: "None", + lun: 1, + source: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{dataDiskName}" + } + } + ], + osDiskImage: { + hostCaching: "ReadOnly", + source: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{osSnapshotName}" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +createOrUpdateASimpleGalleryImageVersionUsingSnapshotsAsASource().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update a gallery image version. + * + * @summary Create or update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithVHD.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingVhdAsASource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion: GalleryImageVersion = { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet", + lun: 1 + } + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet" + } + }, + regionalReplicaCount: 1 + }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS" + } + ] + }, + storageProfile: { + dataDiskImages: [ + { + hostCaching: "None", + lun: 1, + source: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", + uri: + "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd" + } + } + ], + osDiskImage: { + hostCaching: "ReadOnly", + source: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", + uri: + "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +createOrUpdateASimpleGalleryImageVersionUsingVhdAsASource().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update a gallery image version. + * + * @summary Create or update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithTargetExtendedLocations.json + */ +async function createOrUpdateASimpleGalleryImageVersionWithTargetExtendedLocationsSpecified() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion: GalleryImageVersion = { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + lun: 0 + }, + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + lun: 1 + } + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet" + } + }, + regionalReplicaCount: 1 + }, + { + name: "East US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + lun: 0 + }, + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + lun: 1 + } + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet" + } + }, + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS" + } + ] + }, + storageProfile: { + source: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +createOrUpdateASimpleGalleryImageVersionWithTargetExtendedLocationsSpecified().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples-dev/galleryImageVersionsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/galleryImageVersionsDeleteSample.ts new file mode 100644 index 000000000000..39b2c4eadb2c --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/galleryImageVersionsDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a gallery image version. + * + * @summary Delete a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGalleryImageVersion.json + */ +async function deleteAGalleryImageVersion() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginDeleteAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName + ); + console.log(result); +} + +deleteAGalleryImageVersion().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleryImageVersionsGetSample.ts b/sdk/compute/arm-compute/samples-dev/galleryImageVersionsGetSample.ts new file mode 100644 index 000000000000..6173ba957d00 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/galleryImageVersionsGetSample.ts @@ -0,0 +1,118 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + GalleryImageVersionsGetOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Retrieves information about a gallery image version. + * + * @summary Retrieves information about a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryImageVersionWithReplicationStatus.json + */ +async function getAGalleryImageVersionWithReplicationStatus() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const expand = "ReplicationStatus"; + const options: GalleryImageVersionsGetOptionalParams = { expand }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.get( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + options + ); + console.log(result); +} + +getAGalleryImageVersionWithReplicationStatus().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about a gallery image version. + * + * @summary Retrieves information about a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryImageVersionWithSnapshotsAsSource.json + */ +async function getAGalleryImageVersionWithSnapshotsAsASource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.get( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName + ); + console.log(result); +} + +getAGalleryImageVersionWithSnapshotsAsASource().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about a gallery image version. + * + * @summary Retrieves information about a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryImageVersionWithVhdAsSource.json + */ +async function getAGalleryImageVersionWithVhdAsASource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.get( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName + ); + console.log(result); +} + +getAGalleryImageVersionWithVhdAsASource().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about a gallery image version. + * + * @summary Retrieves information about a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryImageVersion.json + */ +async function getAGalleryImageVersion() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.get( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName + ); + console.log(result); +} + +getAGalleryImageVersion().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleryImageVersionsListByGalleryImageSample.ts b/sdk/compute/arm-compute/samples-dev/galleryImageVersionsListByGalleryImageSample.ts new file mode 100644 index 000000000000..d62316ebf261 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/galleryImageVersionsListByGalleryImageSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List gallery image versions in a gallery image definition. + * + * @summary List gallery image versions in a gallery image definition. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleryImageVersionsInAGalleryImage.json + */ +async function listGalleryImageVersionsInAGalleryImageDefinition() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.galleryImageVersions.listByGalleryImage( + resourceGroupName, + galleryName, + galleryImageName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listGalleryImageVersionsInAGalleryImageDefinition().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleryImageVersionsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleryImageVersionsUpdateSample.ts new file mode 100644 index 000000000000..e97a5f5f74f0 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/galleryImageVersionsUpdateSample.ts @@ -0,0 +1,98 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + GalleryImageVersionUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update a gallery image version. + * + * @summary Update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGalleryImageVersion.json + */ +async function updateASimpleGalleryImageVersionManagedImageAsSource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion: GalleryImageVersionUpdate = { + publishingProfile: { + targetRegions: [ + { name: "West US", regionalReplicaCount: 1 }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS" + } + ] + }, + storageProfile: { + source: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +updateASimpleGalleryImageVersionManagedImageAsSource().catch(console.error); + +/** + * This sample demonstrates how to Update a gallery image version. + * + * @summary Update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGalleryImageVersionWithoutSourceId.json + */ +async function updateASimpleGalleryImageVersionWithoutSourceId() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion: GalleryImageVersionUpdate = { + publishingProfile: { + targetRegions: [ + { name: "West US", regionalReplicaCount: 1 }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS" + } + ] + }, + storageProfile: {} + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +updateASimpleGalleryImageVersionWithoutSourceId().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleryImagesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleryImagesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..08c9d4782be3 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/galleryImagesCreateOrUpdateSample.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { GalleryImage, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a gallery image definition. + * + * @summary Create or update a gallery image definition. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImage.json + */ +async function createOrUpdateASimpleGalleryImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImage: GalleryImage = { + hyperVGeneration: "V1", + identifier: { + offer: "myOfferName", + publisher: "myPublisherName", + sku: "mySkuName" + }, + location: "West US", + osState: "Generalized", + osType: "Windows" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImages.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImage + ); + console.log(result); +} + +createOrUpdateASimpleGalleryImage().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleryImagesDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/galleryImagesDeleteSample.ts new file mode 100644 index 000000000000..d96d1f87a2c1 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/galleryImagesDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a gallery image. + * + * @summary Delete a gallery image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGalleryImage.json + */ +async function deleteAGalleryImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImages.beginDeleteAndWait( + resourceGroupName, + galleryName, + galleryImageName + ); + console.log(result); +} + +deleteAGalleryImage().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleryImagesGetSample.ts b/sdk/compute/arm-compute/samples-dev/galleryImagesGetSample.ts new file mode 100644 index 000000000000..991374111a3e --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/galleryImagesGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Retrieves information about a gallery image definition. + * + * @summary Retrieves information about a gallery image definition. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryImage.json + */ +async function getAGalleryImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImages.get( + resourceGroupName, + galleryName, + galleryImageName + ); + console.log(result); +} + +getAGalleryImage().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleryImagesListByGallerySample.ts b/sdk/compute/arm-compute/samples-dev/galleryImagesListByGallerySample.ts new file mode 100644 index 000000000000..f1a06e696573 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/galleryImagesListByGallerySample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List gallery image definitions in a gallery. + * + * @summary List gallery image definitions in a gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleryImagesInAGallery.json + */ +async function listGalleryImagesInAGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.galleryImages.listByGallery( + resourceGroupName, + galleryName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listGalleryImagesInAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleryImagesUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleryImagesUpdateSample.ts new file mode 100644 index 000000000000..6ff2814858aa --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/galleryImagesUpdateSample.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + GalleryImageUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update a gallery image definition. + * + * @summary Update a gallery image definition. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGalleryImage.json + */ +async function updateASimpleGalleryImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImage: GalleryImageUpdate = { + hyperVGeneration: "V1", + identifier: { + offer: "myOfferName", + publisher: "myPublisherName", + sku: "mySkuName" + }, + osState: "Generalized", + osType: "Windows" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImages.beginUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImage + ); + console.log(result); +} + +updateASimpleGalleryImage().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/gallerySharingProfileUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/gallerySharingProfileUpdateSample.ts new file mode 100644 index 000000000000..b87f7b7d12d9 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/gallerySharingProfileUpdateSample.ts @@ -0,0 +1,93 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { SharingUpdate, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update sharing profile of a gallery. + * + * @summary Update sharing profile of a gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/AddToSharingProfileInAGallery.json + */ +async function addSharingIdToTheSharingProfileOfAGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const sharingUpdate: SharingUpdate = { + groups: [ + { + type: "Subscriptions", + ids: [ + "34a4ab42-0d72-47d9-bd1a-aed207386dac", + "380fd389-260b-41aa-bad9-0a83108c370b" + ] + }, + { type: "AADTenants", ids: ["c24c76aa-8897-4027-9b03-8f7928b54ff6"] } + ], + operationType: "Add" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.gallerySharingProfile.beginUpdateAndWait( + resourceGroupName, + galleryName, + sharingUpdate + ); + console.log(result); +} + +addSharingIdToTheSharingProfileOfAGallery().catch(console.error); + +/** + * This sample demonstrates how to Update sharing profile of a gallery. + * + * @summary Update sharing profile of a gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ResetSharingProfileInAGallery.json + */ +async function resetSharingProfileOfAGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const sharingUpdate: SharingUpdate = { operationType: "Reset" }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.gallerySharingProfile.beginUpdateAndWait( + resourceGroupName, + galleryName, + sharingUpdate + ); + console.log(result); +} + +resetSharingProfileOfAGallery().catch(console.error); + +/** + * This sample demonstrates how to Update sharing profile of a gallery. + * + * @summary Update sharing profile of a gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/EnableACommunityGallery.json + */ +async function shareAGalleryToCommunity() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const sharingUpdate: SharingUpdate = { operationType: "EnableCommunity" }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.gallerySharingProfile.beginUpdateAndWait( + resourceGroupName, + galleryName, + sharingUpdate + ); + console.log(result); +} + +shareAGalleryToCommunity().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/imagesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/imagesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..94e2fd820d35 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/imagesCreateOrUpdateSample.ts @@ -0,0 +1,403 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { Image, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromABlobWithDiskEncryptionSet.json + */ +async function createAVirtualMachineImageFromABlobWithDiskEncryptionSetResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters: Image = { + location: "West US", + storageProfile: { + osDisk: { + blobUri: + "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + diskEncryptionSet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}" + }, + osState: "Generalized", + osType: "Linux" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageFromABlobWithDiskEncryptionSetResource().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromABlob.json + */ +async function createAVirtualMachineImageFromABlob() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters: Image = { + location: "West US", + storageProfile: { + osDisk: { + blobUri: + "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + osState: "Generalized", + osType: "Linux" + }, + zoneResilient: true + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageFromABlob().catch(console.error); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromAManagedDiskWithDiskEncryptionSet.json + */ +async function createAVirtualMachineImageFromAManagedDiskWithDiskEncryptionSetResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters: Image = { + location: "West US", + storageProfile: { + osDisk: { + diskEncryptionSet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}" + }, + managedDisk: { + id: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk" + }, + osState: "Generalized", + osType: "Linux" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageFromAManagedDiskWithDiskEncryptionSetResource().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromAManagedDisk.json + */ +async function createAVirtualMachineImageFromAManagedDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters: Image = { + location: "West US", + storageProfile: { + osDisk: { + managedDisk: { + id: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk" + }, + osState: "Generalized", + osType: "Linux" + }, + zoneResilient: true + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageFromAManagedDisk().catch(console.error); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromASnapshotWithDiskEncryptionSet.json + */ +async function createAVirtualMachineImageFromASnapshotWithDiskEncryptionSetResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters: Image = { + location: "West US", + storageProfile: { + osDisk: { + diskEncryptionSet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}" + }, + osState: "Generalized", + osType: "Linux", + snapshot: { + id: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageFromASnapshotWithDiskEncryptionSetResource().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromASnapshot.json + */ +async function createAVirtualMachineImageFromASnapshot() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters: Image = { + location: "West US", + storageProfile: { + osDisk: { + osState: "Generalized", + osType: "Linux", + snapshot: { + id: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot" + } + }, + zoneResilient: false + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageFromASnapshot().catch(console.error); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromAVM.json + */ +async function createAVirtualMachineImageFromAnExistingVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters: Image = { + location: "West US", + sourceVirtualMachine: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageFromAnExistingVirtualMachine().catch(console.error); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageThatIncludesADataDiskFromABlob.json + */ +async function createAVirtualMachineImageThatIncludesADataDiskFromABlob() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters: Image = { + location: "West US", + storageProfile: { + dataDisks: [ + { + blobUri: + "https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd", + lun: 1 + } + ], + osDisk: { + blobUri: + "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + osState: "Generalized", + osType: "Linux" + }, + zoneResilient: false + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageThatIncludesADataDiskFromABlob().catch(console.error); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageThatIncludesADataDiskFromAManagedDisk.json + */ +async function createAVirtualMachineImageThatIncludesADataDiskFromAManagedDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters: Image = { + location: "West US", + storageProfile: { + dataDisks: [ + { + lun: 1, + managedDisk: { + id: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk2" + } + } + ], + osDisk: { + managedDisk: { + id: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk" + }, + osState: "Generalized", + osType: "Linux" + }, + zoneResilient: false + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageThatIncludesADataDiskFromAManagedDisk().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageThatIncludesADataDiskFromASnapshot.json + */ +async function createAVirtualMachineImageThatIncludesADataDiskFromASnapshot() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters: Image = { + location: "West US", + storageProfile: { + dataDisks: [ + { + lun: 1, + snapshot: { + id: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2" + } + } + ], + osDisk: { + osState: "Generalized", + osType: "Linux", + snapshot: { + id: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot" + } + }, + zoneResilient: true + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageThatIncludesADataDiskFromASnapshot().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples-dev/imagesDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/imagesDeleteSample.ts new file mode 100644 index 000000000000..7b764d869e9b --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/imagesDeleteSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes an Image. + * + * @summary Deletes an Image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Images_Delete_MaximumSet_Gen.json + */ +async function imagesDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const imageName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginDeleteAndWait( + resourceGroupName, + imageName + ); + console.log(result); +} + +imagesDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Deletes an Image. + * + * @summary Deletes an Image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Images_Delete_MinimumSet_Gen.json + */ +async function imagesDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const imageName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginDeleteAndWait( + resourceGroupName, + imageName + ); + console.log(result); +} + +imagesDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/imagesGetSample.ts b/sdk/compute/arm-compute/samples-dev/imagesGetSample.ts new file mode 100644 index 000000000000..08c83ce68c85 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/imagesGetSample.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets an image. + * + * @summary Gets an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetInformationAboutAnImage.json + */ +async function getInformationAboutAVirtualMachineImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.get(resourceGroupName, imageName); + console.log(result); +} + +getInformationAboutAVirtualMachineImage().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/imagesListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples-dev/imagesListByResourceGroupSample.ts new file mode 100644 index 000000000000..68395b74716b --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/imagesListByResourceGroupSample.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of images under a resource group. + * + * @summary Gets the list of images under a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListImagesInAResourceGroup.json + */ +async function listAllVirtualMachineImagesInAResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.images.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listAllVirtualMachineImagesInAResourceGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/imagesListSample.ts b/sdk/compute/arm-compute/samples-dev/imagesListSample.ts new file mode 100644 index 000000000000..eef5642addb0 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/imagesListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. + * + * @summary Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListImagesInASubscription.json + */ +async function listAllVirtualMachineImagesInASubscription() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.images.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listAllVirtualMachineImagesInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/imagesUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/imagesUpdateSample.ts new file mode 100644 index 000000000000..c4de4ad0dced --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/imagesUpdateSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ImageUpdate, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update an image. + * + * @summary Update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateImage.json + */ +async function updatesTagsOfAnImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters: ImageUpdate = { + hyperVGeneration: "V1", + sourceVirtualMachine: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM" + }, + tags: { department: "HR" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +updatesTagsOfAnImage().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/logAnalyticsExportRequestRateByIntervalSample.ts b/sdk/compute/arm-compute/samples-dev/logAnalyticsExportRequestRateByIntervalSample.ts new file mode 100644 index 000000000000..6877c36c4c5d --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/logAnalyticsExportRequestRateByIntervalSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RequestRateByIntervalInput, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Export logs that show Api requests made by this subscription in the given time window to show throttling activities. + * + * @summary Export logs that show Api requests made by this subscription in the given time window to show throttling activities. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/LogAnalyticsRequestRateByInterval.json + */ +async function exportLogsWhichContainAllApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriodBrokenDownByIntervals() { + const subscriptionId = "{subscription-id}"; + const location = "westus"; + const parameters: RequestRateByIntervalInput = { + blobContainerSasUri: "https://somesasuri", + fromTime: new Date("2018-01-21T01:54:06.862601Z"), + groupByResourceName: true, + intervalLength: "FiveMins", + toTime: new Date("2018-01-23T01:54:06.862601Z") + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.logAnalytics.beginExportRequestRateByIntervalAndWait( + location, + parameters + ); + console.log(result); +} + +exportLogsWhichContainAllApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriodBrokenDownByIntervals().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples-dev/logAnalyticsExportThrottledRequestsSample.ts b/sdk/compute/arm-compute/samples-dev/logAnalyticsExportThrottledRequestsSample.ts new file mode 100644 index 000000000000..5acaa5ad0a92 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/logAnalyticsExportThrottledRequestsSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + ThrottledRequestsInput, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @summary Export logs that show total throttled Api requests for this subscription in the given time window. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/LogAnalyticsThrottledRequests.json + */ +async function exportLogsWhichContainAllThrottledApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriod() { + const subscriptionId = "{subscription-id}"; + const location = "westus"; + const parameters: ThrottledRequestsInput = { + blobContainerSasUri: "https://somesasuri", + fromTime: new Date("2018-01-21T01:54:06.862601Z"), + groupByClientApplicationId: false, + groupByOperationName: true, + groupByResourceName: false, + groupByUserAgent: false, + toTime: new Date("2018-01-23T01:54:06.862601Z") + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.logAnalytics.beginExportThrottledRequestsAndWait( + location, + parameters + ); + console.log(result); +} + +exportLogsWhichContainAllThrottledApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriod().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples-dev/operationsListSample.ts b/sdk/compute/arm-compute/samples-dev/operationsListSample.ts new file mode 100644 index 000000000000..9f61666e374c --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/operationsListSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of compute operations. + * + * @summary Gets a list of compute operations. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Operations_List_MaximumSet_Gen.json + */ +async function operationsListMaximumSetGen() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +operationsListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of compute operations. + * + * @summary Gets a list of compute operations. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Operations_List_MinimumSet_Gen.json + */ +async function operationsListMinimumSetGen() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +operationsListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..4781dda42344 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsCreateOrUpdateSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ProximityPlacementGroup, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a proximity placement group. + * + * @summary Create or update a proximity placement group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAProximityPlacementGroup.json + */ +async function createOrUpdateAProximityPlacementGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const proximityPlacementGroupName = "myProximityPlacementGroup"; + const parameters: ProximityPlacementGroup = { + location: "westus", + proximityPlacementGroupType: "Standard" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.proximityPlacementGroups.createOrUpdate( + resourceGroupName, + proximityPlacementGroupName, + parameters + ); + console.log(result); +} + +createOrUpdateAProximityPlacementGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsDeleteSample.ts new file mode 100644 index 000000000000..707c718f4ed9 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a proximity placement group. + * + * @summary Delete a proximity placement group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DeleteAProximityPlacementGroup.json + */ +async function createAProximityPlacementGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const proximityPlacementGroupName = "myProximityPlacementGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.proximityPlacementGroups.delete( + resourceGroupName, + proximityPlacementGroupName + ); + console.log(result); +} + +createAProximityPlacementGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsGetSample.ts b/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsGetSample.ts new file mode 100644 index 000000000000..b39874460ee1 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Retrieves information about a proximity placement group . + * + * @summary Retrieves information about a proximity placement group . + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetAProximityPlacementGroup.json + */ +async function createAProximityPlacementGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const proximityPlacementGroupName = "myProximityPlacementGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.proximityPlacementGroups.get( + resourceGroupName, + proximityPlacementGroupName + ); + console.log(result); +} + +createAProximityPlacementGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsListByResourceGroupSample.ts new file mode 100644 index 000000000000..0b27e0845435 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsListByResourceGroupSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all proximity placement groups in a resource group. + * + * @summary Lists all proximity placement groups in a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListProximityPlacementGroupsInAResourceGroup.json + */ +async function createAProximityPlacementGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.proximityPlacementGroups.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +createAProximityPlacementGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsListBySubscriptionSample.ts b/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsListBySubscriptionSample.ts new file mode 100644 index 000000000000..d1a01a5755d3 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsListBySubscriptionSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all proximity placement groups in a subscription. + * + * @summary Lists all proximity placement groups in a subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListProximityPlacementGroupsInASubscription.json + */ +async function createAProximityPlacementGroup() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.proximityPlacementGroups.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +createAProximityPlacementGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsUpdateSample.ts new file mode 100644 index 000000000000..e0fd0ba4d9d9 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsUpdateSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + ProximityPlacementGroupUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update a proximity placement group. + * + * @summary Update a proximity placement group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/PatchAProximityPlacementGroup.json + */ +async function createAProximityPlacementGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const proximityPlacementGroupName = "myProximityPlacementGroup"; + const parameters: ProximityPlacementGroupUpdate = { + tags: { additionalProp1: "string" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.proximityPlacementGroups.update( + resourceGroupName, + proximityPlacementGroupName, + parameters + ); + console.log(result); +} + +createAProximityPlacementGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/resourceSkusListSample.ts b/sdk/compute/arm-compute/samples-dev/resourceSkusListSample.ts new file mode 100644 index 000000000000..31e00ad70c4b --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/resourceSkusListSample.ts @@ -0,0 +1,78 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + ResourceSkusListOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @summary Gets the list of Microsoft.Compute SKUs available for your Subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/skus/ListAvailableResourceSkus.json + */ +async function listsAllAvailableResourceSkUs() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.resourceSkus.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listsAllAvailableResourceSkUs().catch(console.error); + +/** + * This sample demonstrates how to Gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @summary Gets the list of Microsoft.Compute SKUs available for your Subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/skus/ListAvailableResourceSkusForARegion.json + */ +async function listsAllAvailableResourceSkUsForTheSpecifiedRegion() { + const subscriptionId = "{subscription-id}"; + const filter = "location eq 'westus'"; + const options: ResourceSkusListOptionalParams = { filter }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.resourceSkus.list(options)) { + resArray.push(item); + } + console.log(resArray); +} + +listsAllAvailableResourceSkUsForTheSpecifiedRegion().catch(console.error); + +/** + * This sample demonstrates how to Gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @summary Gets the list of Microsoft.Compute SKUs available for your Subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/skus/ListAvailableResourceSkusWithExtendedLocations.json + */ +async function listsAllAvailableResourceSkUsWithExtendedLocationInformation() { + const subscriptionId = "{subscription-id}"; + const includeExtendedLocations = "true"; + const options: ResourceSkusListOptionalParams = { includeExtendedLocations }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.resourceSkus.list(options)) { + resArray.push(item); + } + console.log(resArray); +} + +listsAllAvailableResourceSkUsWithExtendedLocationInformation().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples-dev/restorePointCollectionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/restorePointCollectionsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..16f73ab964b4 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/restorePointCollectionsCreateOrUpdateSample.ts @@ -0,0 +1,75 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + RestorePointCollection, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. + * + * @summary The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateARestorePointCollectionForCrossRegionCopy.json + */ +async function createOrUpdateARestorePointCollectionForCrossRegionCopy() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "myRpc"; + const parameters: RestorePointCollection = { + location: "norwayeast", + source: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/sourceRpcName" + }, + tags: { myTag1: "tagValue1" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.createOrUpdate( + resourceGroupName, + restorePointCollectionName, + parameters + ); + console.log(result); +} + +createOrUpdateARestorePointCollectionForCrossRegionCopy().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. + * + * @summary The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateARestorePointCollection.json + */ +async function createOrUpdateARestorePointCollection() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "myRpc"; + const parameters: RestorePointCollection = { + location: "norwayeast", + source: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM" + }, + tags: { myTag1: "tagValue1" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.createOrUpdate( + resourceGroupName, + restorePointCollectionName, + parameters + ); + console.log(result); +} + +createOrUpdateARestorePointCollection().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/restorePointCollectionsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/restorePointCollectionsDeleteSample.ts new file mode 100644 index 000000000000..239f2a942ec5 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/restorePointCollectionsDeleteSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete the restore point collection. This operation will also delete all the contained restore points. + * + * @summary The operation to delete the restore point collection. This operation will also delete all the contained restore points. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Delete_MaximumSet_Gen.json + */ +async function restorePointCollectionsDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const restorePointCollectionName = "aaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.beginDeleteAndWait( + resourceGroupName, + restorePointCollectionName + ); + console.log(result); +} + +restorePointCollectionsDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to delete the restore point collection. This operation will also delete all the contained restore points. + * + * @summary The operation to delete the restore point collection. This operation will also delete all the contained restore points. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Delete_MinimumSet_Gen.json + */ +async function restorePointCollectionsDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const restorePointCollectionName = "aaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.beginDeleteAndWait( + resourceGroupName, + restorePointCollectionName + ); + console.log(result); +} + +restorePointCollectionsDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/restorePointCollectionsGetSample.ts b/sdk/compute/arm-compute/samples-dev/restorePointCollectionsGetSample.ts new file mode 100644 index 000000000000..2e6b3b765cc1 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/restorePointCollectionsGetSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get the restore point collection. + * + * @summary The operation to get the restore point collection. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointCollection.json + */ +async function getARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "myRpc"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.get( + resourceGroupName, + restorePointCollectionName + ); + console.log(result); +} + +getARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to get the restore point collection. + * + * @summary The operation to get the restore point collection. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointCollectionWithContainedRestorePoints.json + */ +async function getARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpcName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.get( + resourceGroupName, + restorePointCollectionName + ); + console.log(result); +} + +getARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples-dev/restorePointCollectionsListAllSample.ts b/sdk/compute/arm-compute/samples-dev/restorePointCollectionsListAllSample.ts new file mode 100644 index 000000000000..8bca8068a75f --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/restorePointCollectionsListAllSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. + * + * @summary Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointCollectionsInASubscription.json + */ +async function getsTheListOfRestorePointCollectionsInASubscription() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.restorePointCollections.listAll()) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfRestorePointCollectionsInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/restorePointCollectionsListSample.ts b/sdk/compute/arm-compute/samples-dev/restorePointCollectionsListSample.ts new file mode 100644 index 000000000000..c594bdd449af --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/restorePointCollectionsListSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of restore point collections in a resource group. + * + * @summary Gets the list of restore point collections in a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointCollectionsInAResourceGroup.json + */ +async function getsTheListOfRestorePointCollectionsInAResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.restorePointCollections.list( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfRestorePointCollectionsInAResourceGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/restorePointCollectionsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/restorePointCollectionsUpdateSample.ts new file mode 100644 index 000000000000..31878417ed01 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/restorePointCollectionsUpdateSample.ts @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + RestorePointCollectionUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update the restore point collection. + * + * @summary The operation to update the restore point collection. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Update_MaximumSet_Gen.json + */ +async function restorePointCollectionsUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const restorePointCollectionName = "aaaaaaaaaaaaaaaaaaaa"; + const parameters: RestorePointCollectionUpdate = { + source: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM" + }, + tags: { key8536: "aaaaaaaaaaaaaaaaaaa" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.update( + resourceGroupName, + restorePointCollectionName, + parameters + ); + console.log(result); +} + +restorePointCollectionsUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to update the restore point collection. + * + * @summary The operation to update the restore point collection. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Update_MinimumSet_Gen.json + */ +async function restorePointCollectionsUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const restorePointCollectionName = "aaaaaaaaaaaaaaaaaa"; + const parameters: RestorePointCollectionUpdate = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.update( + resourceGroupName, + restorePointCollectionName, + parameters + ); + console.log(result); +} + +restorePointCollectionsUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/restorePointsCreateSample.ts b/sdk/compute/arm-compute/samples-dev/restorePointsCreateSample.ts new file mode 100644 index 000000000000..a38b9421fcbe --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/restorePointsCreateSample.ts @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { RestorePoint, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create the restore point. Updating properties of an existing restore point is not allowed + * + * @summary The operation to create the restore point. Updating properties of an existing restore point is not allowed + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CopyRestorePointBetweenRegions.json + */ +async function copyARestorePointToADifferentRegion() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpcName"; + const restorePointName = "rpName"; + const parameters: RestorePoint = { + sourceRestorePoint: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/sourceRpcName/restorePoints/sourceRpName" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.beginCreateAndWait( + resourceGroupName, + restorePointCollectionName, + restorePointName, + parameters + ); + console.log(result); +} + +copyARestorePointToADifferentRegion().catch(console.error); + +/** + * This sample demonstrates how to The operation to create the restore point. Updating properties of an existing restore point is not allowed + * + * @summary The operation to create the restore point. Updating properties of an existing restore point is not allowed + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateARestorePoint.json + */ +async function createARestorePoint() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpcName"; + const restorePointName = "rpName"; + const parameters: RestorePoint = { + excludeDisks: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123" + } + ] + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.beginCreateAndWait( + resourceGroupName, + restorePointCollectionName, + restorePointName, + parameters + ); + console.log(result); +} + +createARestorePoint().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/restorePointsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/restorePointsDeleteSample.ts new file mode 100644 index 000000000000..9c35853972ac --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/restorePointsDeleteSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete the restore point. + * + * @summary The operation to delete the restore point. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePoints_Delete_MaximumSet_Gen.json + */ +async function restorePointsDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const restorePointCollectionName = "aaaaaaaaaaaaaaaaaaaaaa"; + const restorePointName = "a"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.beginDeleteAndWait( + resourceGroupName, + restorePointCollectionName, + restorePointName + ); + console.log(result); +} + +restorePointsDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to delete the restore point. + * + * @summary The operation to delete the restore point. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePoints_Delete_MinimumSet_Gen.json + */ +async function restorePointsDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const restorePointCollectionName = "aaaaaaaaaaaaaaaaa"; + const restorePointName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.beginDeleteAndWait( + resourceGroupName, + restorePointCollectionName, + restorePointName + ); + console.log(result); +} + +restorePointsDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/restorePointsGetSample.ts b/sdk/compute/arm-compute/samples-dev/restorePointsGetSample.ts new file mode 100644 index 000000000000..96f3de3fafcf --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/restorePointsGetSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get the restore point. + * + * @summary The operation to get the restore point. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePoint.json + */ +async function getARestorePoint() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpcName"; + const restorePointName = "rpName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.get( + resourceGroupName, + restorePointCollectionName, + restorePointName + ); + console.log(result); +} + +getARestorePoint().catch(console.error); + +/** + * This sample demonstrates how to The operation to get the restore point. + * + * @summary The operation to get the restore point. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointWithInstanceView.json + */ +async function getRestorePointWithInstanceView() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpcName"; + const restorePointName = "rpName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.get( + resourceGroupName, + restorePointCollectionName, + restorePointName + ); + console.log(result); +} + +getRestorePointWithInstanceView().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/sharedGalleriesGetSample.ts b/sdk/compute/arm-compute/samples-dev/sharedGalleriesGetSample.ts new file mode 100644 index 000000000000..ea613af712da --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/sharedGalleriesGetSample.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a shared gallery by subscription id or tenant id. + * + * @summary Get a shared gallery by subscription id or tenant id. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/GetASharedGallery.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const location = "myLocation"; + const galleryUniqueName = "galleryUniqueName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sharedGalleries.get(location, galleryUniqueName); + console.log(result); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/sharedGalleriesListSample.ts b/sdk/compute/arm-compute/samples-dev/sharedGalleriesListSample.ts new file mode 100644 index 000000000000..6574087be7c5 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/sharedGalleriesListSample.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List shared galleries by subscription id or tenant id. + * + * @summary List shared galleries by subscription id or tenant id. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/ListSharedGalleries.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const location = "myLocation"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.sharedGalleries.list(location)) { + resArray.push(item); + } + console.log(resArray); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/sharedGalleryImageVersionsGetSample.ts b/sdk/compute/arm-compute/samples-dev/sharedGalleryImageVersionsGetSample.ts new file mode 100644 index 000000000000..4459cec1f32d --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/sharedGalleryImageVersionsGetSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a shared gallery image version by subscription id or tenant id. + * + * @summary Get a shared gallery image version by subscription id or tenant id. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/GetASharedGalleryImageVersion.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const location = "myLocation"; + const galleryUniqueName = "galleryUniqueName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "myGalleryImageVersionName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sharedGalleryImageVersions.get( + location, + galleryUniqueName, + galleryImageName, + galleryImageVersionName + ); + console.log(result); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/sharedGalleryImageVersionsListSample.ts b/sdk/compute/arm-compute/samples-dev/sharedGalleryImageVersionsListSample.ts new file mode 100644 index 000000000000..c48b2c724085 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/sharedGalleryImageVersionsListSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List shared gallery image versions by subscription id or tenant id. + * + * @summary List shared gallery image versions by subscription id or tenant id. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/ListSharedGalleryImageVersions.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const location = "myLocation"; + const galleryUniqueName = "galleryUniqueName"; + const galleryImageName = "myGalleryImageName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.sharedGalleryImageVersions.list( + location, + galleryUniqueName, + galleryImageName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/sharedGalleryImagesGetSample.ts b/sdk/compute/arm-compute/samples-dev/sharedGalleryImagesGetSample.ts new file mode 100644 index 000000000000..678635cb5e88 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/sharedGalleryImagesGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a shared gallery image by subscription id or tenant id. + * + * @summary Get a shared gallery image by subscription id or tenant id. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/GetASharedGalleryImage.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const location = "myLocation"; + const galleryUniqueName = "galleryUniqueName"; + const galleryImageName = "myGalleryImageName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sharedGalleryImages.get( + location, + galleryUniqueName, + galleryImageName + ); + console.log(result); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/sharedGalleryImagesListSample.ts b/sdk/compute/arm-compute/samples-dev/sharedGalleryImagesListSample.ts new file mode 100644 index 000000000000..12598847b5a4 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/sharedGalleryImagesListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List shared gallery images by subscription id or tenant id. + * + * @summary List shared gallery images by subscription id or tenant id. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/ListSharedGalleryImages.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const location = "myLocation"; + const galleryUniqueName = "galleryUniqueName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.sharedGalleryImages.list( + location, + galleryUniqueName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/snapshotsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/snapshotsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..700a9979bffd --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/snapshotsCreateOrUpdateSample.ts @@ -0,0 +1,142 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { Snapshot, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates or updates a snapshot. + * + * @summary Creates or updates a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription.json + */ +async function createASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot1"; + const snapshot: Snapshot = { + creationData: { + createOption: "Import", + sourceUri: + "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + storageAccountId: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount" + }, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginCreateOrUpdateAndWait( + resourceGroupName, + snapshotName, + snapshot + ); + console.log(result); +} + +createASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription().catch( + console.error +); + +/** + * This sample demonstrates how to Creates or updates a snapshot. + * + * @summary Creates or updates a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription.json + */ +async function createASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot1"; + const snapshot: Snapshot = { + creationData: { + createOption: "Import", + sourceUri: + "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd" + }, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginCreateOrUpdateAndWait( + resourceGroupName, + snapshotName, + snapshot + ); + console.log(result); +} + +createASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription().catch( + console.error +); + +/** + * This sample demonstrates how to Creates or updates a snapshot. + * + * @summary Creates or updates a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateASnapshotFromAnExistingSnapshotInDifferentRegion.json + */ +async function createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegion() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot2"; + const snapshot: Snapshot = { + creationData: { + createOption: "CopyStart", + sourceResourceId: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1" + }, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginCreateOrUpdateAndWait( + resourceGroupName, + snapshotName, + snapshot + ); + console.log(result); +} + +createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegion().catch( + console.error +); + +/** + * This sample demonstrates how to Creates or updates a snapshot. + * + * @summary Creates or updates a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateASnapshotFromAnExistingSnapshot.json + */ +async function createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscription() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot2"; + const snapshot: Snapshot = { + creationData: { + createOption: "Copy", + sourceResourceId: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1" + }, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginCreateOrUpdateAndWait( + resourceGroupName, + snapshotName, + snapshot + ); + console.log(result); +} + +createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscription().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples-dev/snapshotsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/snapshotsDeleteSample.ts new file mode 100644 index 000000000000..1966a2782321 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/snapshotsDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes a snapshot. + * + * @summary Deletes a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteASnapshot.json + */ +async function deleteASnapshot() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginDeleteAndWait( + resourceGroupName, + snapshotName + ); + console.log(result); +} + +deleteASnapshot().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/snapshotsGetSample.ts b/sdk/compute/arm-compute/samples-dev/snapshotsGetSample.ts new file mode 100644 index 000000000000..92e46d1ef5bd --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/snapshotsGetSample.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets information about a snapshot. + * + * @summary Gets information about a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutASnapshot.json + */ +async function getInformationAboutASnapshot() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.get(resourceGroupName, snapshotName); + console.log(result); +} + +getInformationAboutASnapshot().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/snapshotsGrantAccessSample.ts b/sdk/compute/arm-compute/samples-dev/snapshotsGrantAccessSample.ts new file mode 100644 index 000000000000..d9dc5a0c85f4 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/snapshotsGrantAccessSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { GrantAccessData, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Grants access to a snapshot. + * + * @summary Grants access to a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/BeginGetAccessSnapshot.json + */ +async function getASasOnASnapshot() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot"; + const grantAccessData: GrantAccessData = { + access: "Read", + durationInSeconds: 300 + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginGrantAccessAndWait( + resourceGroupName, + snapshotName, + grantAccessData + ); + console.log(result); +} + +getASasOnASnapshot().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/snapshotsListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples-dev/snapshotsListByResourceGroupSample.ts new file mode 100644 index 000000000000..ce99623fbf1c --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/snapshotsListByResourceGroupSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists snapshots under a resource group. + * + * @summary Lists snapshots under a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListSnapshotsInAResourceGroup.json + */ +async function listAllSnapshotsInAResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.snapshots.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listAllSnapshotsInAResourceGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/snapshotsListSample.ts b/sdk/compute/arm-compute/samples-dev/snapshotsListSample.ts new file mode 100644 index 000000000000..7a8cb771da3c --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/snapshotsListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists snapshots under a subscription. + * + * @summary Lists snapshots under a subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListSnapshotsInASubscription.json + */ +async function listAllSnapshotsInASubscription() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.snapshots.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listAllSnapshotsInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/snapshotsRevokeAccessSample.ts b/sdk/compute/arm-compute/samples-dev/snapshotsRevokeAccessSample.ts new file mode 100644 index 000000000000..50c6f34e8aac --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/snapshotsRevokeAccessSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Revokes access to a snapshot. + * + * @summary Revokes access to a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/EndGetAccessSnapshot.json + */ +async function revokeAccessToASnapshot() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginRevokeAccessAndWait( + resourceGroupName, + snapshotName + ); + console.log(result); +} + +revokeAccessToASnapshot().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/snapshotsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/snapshotsUpdateSample.ts new file mode 100644 index 000000000000..50e372adedc2 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/snapshotsUpdateSample.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { SnapshotUpdate, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Updates (patches) a snapshot. + * + * @summary Updates (patches) a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateASnapshotWithAcceleratedNetwork.json + */ +async function updateASnapshotWithAcceleratedNetworking() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot"; + const snapshot: SnapshotUpdate = { + diskSizeGB: 20, + supportedCapabilities: { acceleratedNetwork: false }, + tags: { department: "Development", project: "UpdateSnapshots" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginUpdateAndWait( + resourceGroupName, + snapshotName, + snapshot + ); + console.log(result); +} + +updateASnapshotWithAcceleratedNetworking().catch(console.error); + +/** + * This sample demonstrates how to Updates (patches) a snapshot. + * + * @summary Updates (patches) a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateASnapshot.json + */ +async function updateASnapshot() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot"; + const snapshot: SnapshotUpdate = { + diskSizeGB: 20, + tags: { department: "Development", project: "UpdateSnapshots" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginUpdateAndWait( + resourceGroupName, + snapshotName, + snapshot + ); + console.log(result); +} + +updateASnapshot().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/sshPublicKeysCreateSample.ts b/sdk/compute/arm-compute/samples-dev/sshPublicKeysCreateSample.ts new file mode 100644 index 000000000000..bd487b8465ab --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/sshPublicKeysCreateSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + SshPublicKeyResource, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates a new SSH public key resource. + * + * @summary Creates a new SSH public key resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnSshPublicKey.json + */ +async function createANewSshPublicKeyResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const sshPublicKeyName = "mySshPublicKeyName"; + const parameters: SshPublicKeyResource = { + location: "westus", + publicKey: "{ssh-rsa public key}" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.create( + resourceGroupName, + sshPublicKeyName, + parameters + ); + console.log(result); +} + +createANewSshPublicKeyResource().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/sshPublicKeysDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/sshPublicKeysDeleteSample.ts new file mode 100644 index 000000000000..1d162d183d65 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/sshPublicKeysDeleteSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete an SSH public key. + * + * @summary Delete an SSH public key. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Delete_MaximumSet_Gen.json + */ +async function sshPublicKeysDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const sshPublicKeyName = "aaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.delete( + resourceGroupName, + sshPublicKeyName + ); + console.log(result); +} + +sshPublicKeysDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Delete an SSH public key. + * + * @summary Delete an SSH public key. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Delete_MinimumSet_Gen.json + */ +async function sshPublicKeysDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const sshPublicKeyName = "aaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.delete( + resourceGroupName, + sshPublicKeyName + ); + console.log(result); +} + +sshPublicKeysDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/sshPublicKeysGenerateKeyPairSample.ts b/sdk/compute/arm-compute/samples-dev/sshPublicKeysGenerateKeyPairSample.ts new file mode 100644 index 000000000000..5f915ddb80b7 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/sshPublicKeysGenerateKeyPairSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * + * @summary Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GenerateSshKeyPair.json + */ +async function generateAnSshKeyPair() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const sshPublicKeyName = "mySshPublicKeyName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.generateKeyPair( + resourceGroupName, + sshPublicKeyName + ); + console.log(result); +} + +generateAnSshKeyPair().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/sshPublicKeysGetSample.ts b/sdk/compute/arm-compute/samples-dev/sshPublicKeysGetSample.ts new file mode 100644 index 000000000000..dd269807a158 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/sshPublicKeysGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Retrieves information about an SSH public key. + * + * @summary Retrieves information about an SSH public key. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetAnSshPublicKey.json + */ +async function getAnSshPublicKey() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const sshPublicKeyName = "mySshPublicKeyName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.get( + resourceGroupName, + sshPublicKeyName + ); + console.log(result); +} + +getAnSshPublicKey().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/sshPublicKeysListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples-dev/sshPublicKeysListByResourceGroupSample.ts new file mode 100644 index 000000000000..d2eb8c647e60 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/sshPublicKeysListByResourceGroupSample.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. + * + * @summary Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListByResourceGroup_MaximumSet_Gen.json + */ +async function sshPublicKeysListByResourceGroupMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.sshPublicKeys.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +sshPublicKeysListByResourceGroupMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. + * + * @summary Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListByResourceGroup_MinimumSet_Gen.json + */ +async function sshPublicKeysListByResourceGroupMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.sshPublicKeys.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +sshPublicKeysListByResourceGroupMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/sshPublicKeysListBySubscriptionSample.ts b/sdk/compute/arm-compute/samples-dev/sshPublicKeysListBySubscriptionSample.ts new file mode 100644 index 000000000000..8daad97d40cd --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/sshPublicKeysListBySubscriptionSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. + * + * @summary Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListBySubscription_MaximumSet_Gen.json + */ +async function sshPublicKeysListBySubscriptionMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.sshPublicKeys.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +sshPublicKeysListBySubscriptionMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. + * + * @summary Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListBySubscription_MinimumSet_Gen.json + */ +async function sshPublicKeysListBySubscriptionMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.sshPublicKeys.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +sshPublicKeysListBySubscriptionMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/sshPublicKeysUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/sshPublicKeysUpdateSample.ts new file mode 100644 index 000000000000..028194a5128d --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/sshPublicKeysUpdateSample.ts @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + SshPublicKeyUpdateResource, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Updates a new SSH public key resource. + * + * @summary Updates a new SSH public key resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Update_MaximumSet_Gen.json + */ +async function sshPublicKeysUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const sshPublicKeyName = "aaaaaaaaaaaa"; + const parameters: SshPublicKeyUpdateResource = { + publicKey: "{ssh-rsa public key}", + tags: { key2854: "a" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.update( + resourceGroupName, + sshPublicKeyName, + parameters + ); + console.log(result); +} + +sshPublicKeysUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Updates a new SSH public key resource. + * + * @summary Updates a new SSH public key resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Update_MinimumSet_Gen.json + */ +async function sshPublicKeysUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const sshPublicKeyName = "aaaaaaaaaaa"; + const parameters: SshPublicKeyUpdateResource = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.update( + resourceGroupName, + sshPublicKeyName, + parameters + ); + console.log(result); +} + +sshPublicKeysUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/usageListSample.ts b/sdk/compute/arm-compute/samples-dev/usageListSample.ts new file mode 100644 index 000000000000..46c32c318167 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/usageListSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. + * + * @summary Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Usage_List_MaximumSet_Gen.json + */ +async function usageListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "4_."; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.usageOperations.list(location)) { + resArray.push(item); + } + console.log(resArray); +} + +usageListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. + * + * @summary Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Usage_List_MinimumSet_Gen.json + */ +async function usageListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "_--"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.usageOperations.list(location)) { + resArray.push(item); + } + console.log(resArray); +} + +usageListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionImagesGetSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionImagesGetSample.ts new file mode 100644 index 000000000000..1bed0c49623b --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionImagesGetSample.ts @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a virtual machine extension image. + * + * @summary Gets a virtual machine extension image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_Get_MaximumSet_Gen.json + */ +async function virtualMachineExtensionImagesGetMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaa"; + const typeParam = "aaaaaaaaaaaaaaaaaa"; + const version = "aaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.get( + location, + publisherName, + typeParam, + version + ); + console.log(result); +} + +virtualMachineExtensionImagesGetMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a virtual machine extension image. + * + * @summary Gets a virtual machine extension image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_Get_MinimumSet_Gen.json + */ +async function virtualMachineExtensionImagesGetMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const typeParam = "aa"; + const version = "aaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.get( + location, + publisherName, + typeParam, + version + ); + console.log(result); +} + +virtualMachineExtensionImagesGetMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionImagesListTypesSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionImagesListTypesSample.ts new file mode 100644 index 000000000000..bb871104f16d --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionImagesListTypesSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of virtual machine extension image types. + * + * @summary Gets a list of virtual machine extension image types. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListTypes_MaximumSet_Gen.json + */ +async function virtualMachineExtensionImagesListTypesMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.listTypes( + location, + publisherName + ); + console.log(result); +} + +virtualMachineExtensionImagesListTypesMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of virtual machine extension image types. + * + * @summary Gets a list of virtual machine extension image types. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListTypes_MinimumSet_Gen.json + */ +async function virtualMachineExtensionImagesListTypesMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaa"; + const publisherName = "aa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.listTypes( + location, + publisherName + ); + console.log(result); +} + +virtualMachineExtensionImagesListTypesMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionImagesListVersionsSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionImagesListVersionsSample.ts new file mode 100644 index 000000000000..f35d74b4c0d1 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionImagesListVersionsSample.ts @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineExtensionImagesListVersionsOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of virtual machine extension image versions. + * + * @summary Gets a list of virtual machine extension image versions. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListVersions_MaximumSet_Gen.json + */ +async function virtualMachineExtensionImagesListVersionsMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaa"; + const typeParam = "aaaaaaaaaaaaaaaaaa"; + const filter = "aaaaaaaaaaaaaaaaaaaaaaaaa"; + const top = 22; + const orderby = "a"; + const options: VirtualMachineExtensionImagesListVersionsOptionalParams = { + filter, + top, + orderby + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.listVersions( + location, + publisherName, + typeParam, + options + ); + console.log(result); +} + +virtualMachineExtensionImagesListVersionsMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of virtual machine extension image versions. + * + * @summary Gets a list of virtual machine extension image versions. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListVersions_MinimumSet_Gen.json + */ +async function virtualMachineExtensionImagesListVersionsMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const typeParam = "aaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.listVersions( + location, + publisherName, + typeParam + ); + console.log(result); +} + +virtualMachineExtensionImagesListVersionsMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..3336b8cd47b8 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsCreateOrUpdateSample.ts @@ -0,0 +1,100 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineExtension, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create or update the extension. + * + * @summary The operation to create or update the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_CreateOrUpdate_MaximumSet_Gen.json + */ +async function virtualMachineExtensionsCreateOrUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const vmExtensionName = "aaaaaaaaaaaaa"; + const extensionParameters: VirtualMachineExtension = { + typePropertiesType: "extType", + autoUpgradeMinorVersion: true, + enableAutomaticUpgrade: true, + forceUpdateTag: "a", + instanceView: { + name: "aaaaaaaaaaaaaaaaa", + type: "aaaaaaaaa", + statuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z") + } + ], + substatuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z") + } + ], + typeHandlerVersion: "aaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + location: "westus", + protectedSettings: {}, + publisher: "extPublisher", + settings: {}, + suppressFailures: true, + tags: { key9183: "aa" }, + typeHandlerVersion: "1.2" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + vmExtensionName, + extensionParameters + ); + console.log(result); +} + +virtualMachineExtensionsCreateOrUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update the extension. + * + * @summary The operation to create or update the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_CreateOrUpdate_MinimumSet_Gen.json + */ +async function virtualMachineExtensionsCreateOrUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaa"; + const vmExtensionName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const extensionParameters: VirtualMachineExtension = { location: "westus" }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + vmExtensionName, + extensionParameters + ); + console.log(result); +} + +virtualMachineExtensionsCreateOrUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsDeleteSample.ts new file mode 100644 index 000000000000..f5cc2e0d982e --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsDeleteSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete the extension. + * + * @summary The operation to delete the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Delete_MaximumSet_Gen.json + */ +async function virtualMachineExtensionsDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaa"; + const vmExtensionName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.beginDeleteAndWait( + resourceGroupName, + vmName, + vmExtensionName + ); + console.log(result); +} + +virtualMachineExtensionsDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to delete the extension. + * + * @summary The operation to delete the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Delete_MinimumSet_Gen.json + */ +async function virtualMachineExtensionsDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmExtensionName = "aa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.beginDeleteAndWait( + resourceGroupName, + vmName, + vmExtensionName + ); + console.log(result); +} + +virtualMachineExtensionsDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsGetSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsGetSample.ts new file mode 100644 index 000000000000..6d9635e1f4db --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsGetSample.ts @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineExtensionsGetOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get the extension. + * + * @summary The operation to get the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Get_MaximumSet_Gen.json + */ +async function virtualMachineExtensionsGetMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmExtensionName = "aaaaaaa"; + const expand = "aaaaaa"; + const options: VirtualMachineExtensionsGetOptionalParams = { expand }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.get( + resourceGroupName, + vmName, + vmExtensionName, + options + ); + console.log(result); +} + +virtualMachineExtensionsGetMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to get the extension. + * + * @summary The operation to get the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Get_MinimumSet_Gen.json + */ +async function virtualMachineExtensionsGetMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "a"; + const vmExtensionName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.get( + resourceGroupName, + vmName, + vmExtensionName + ); + console.log(result); +} + +virtualMachineExtensionsGetMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsListSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsListSample.ts new file mode 100644 index 000000000000..add31895f74d --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsListSample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineExtensionsListOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get all extensions of a Virtual Machine. + * + * @summary The operation to get all extensions of a Virtual Machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_List_MaximumSet_Gen.json + */ +async function virtualMachineExtensionsListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaa"; + const expand = "aaaaaaaaaaaaaaaaa"; + const options: VirtualMachineExtensionsListOptionalParams = { expand }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.list( + resourceGroupName, + vmName, + options + ); + console.log(result); +} + +virtualMachineExtensionsListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to get all extensions of a Virtual Machine. + * + * @summary The operation to get all extensions of a Virtual Machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_List_MinimumSet_Gen.json + */ +async function virtualMachineExtensionsListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.list( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachineExtensionsListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsUpdateSample.ts new file mode 100644 index 000000000000..6c2ff2fd1e56 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsUpdateSample.ts @@ -0,0 +1,55 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineExtensionUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update the extension. + * + * @summary The operation to update the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateVMExtension.json + */ +async function updateVMExtension() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const vmExtensionName = "myVMExtension"; + const extensionParameters: VirtualMachineExtensionUpdate = { + type: "extType", + autoUpgradeMinorVersion: true, + protectedSettingsFromKeyVault: { + secretUrl: + "https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e", + sourceVault: { + id: + "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName" + } + }, + publisher: "extPublisher", + settings: { UserName: "xyz@microsoft.com" }, + suppressFailures: true, + typeHandlerVersion: "1.2" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.beginUpdateAndWait( + resourceGroupName, + vmName, + vmExtensionName, + extensionParameters + ); + console.log(result); +} + +updateVMExtension().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneGetSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneGetSample.ts new file mode 100644 index 000000000000..155e7b17bff9 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneGetSample.ts @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a virtual machine image in an edge zone. + * + * @summary Gets a virtual machine image in an edge zone. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneGetMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const edgeZone = "aaaaaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaaaaa"; + const offer = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const skus = "aaaaaaaaaa"; + const version = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.get( + location, + edgeZone, + publisherName, + offer, + skus, + version + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneGetMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a virtual machine image in an edge zone. + * + * @summary Gets a virtual machine image in an edge zone. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_Get_MinimumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneGetMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaaaaaaaaaa"; + const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const offer = "aaaaaaaaaaa"; + const skus = "aaaaaaaaaaaaaaaaaa"; + const version = "aa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.get( + location, + edgeZone, + publisherName, + offer, + skus, + version + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneGetMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListOffersSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListOffersSample.ts new file mode 100644 index 000000000000..f899bec05fcc --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListOffersSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * + * @summary Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListOffersMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaaaaa"; + const edgeZone = "aaaaaaaaaaaaaaaaaaa"; + const publisherName = "aaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.listOffers( + location, + edgeZone, + publisherName + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneListOffersMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * + * @summary Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListOffers_MinimumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListOffersMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaa"; + const edgeZone = "aaaaaaaaaaaaaaaaaaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.listOffers( + location, + edgeZone, + publisherName + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneListOffersMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListPublishersSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListPublishersSample.ts new file mode 100644 index 000000000000..4f3daffe1ba0 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListPublishersSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * + * @summary Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListPublishersMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaa"; + const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.listPublishers( + location, + edgeZone + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneListPublishersMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * + * @summary Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListPublishers_MinimumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListPublishersMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaa"; + const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.listPublishers( + location, + edgeZone + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneListPublishersMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListSample.ts new file mode 100644 index 000000000000..740ca646643c --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListSample.ts @@ -0,0 +1,78 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineImagesEdgeZoneListOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. + * + * @summary Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaa"; + const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaaaa"; + const publisherName = "aaaa"; + const offer = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const skus = "aaaaaaaaaaaaaaaaaaaaaaa"; + const expand = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const top = 12; + const orderby = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const options: VirtualMachineImagesEdgeZoneListOptionalParams = { + expand, + top, + orderby + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.list( + location, + edgeZone, + publisherName, + offer, + skus, + options + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. + * + * @summary Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_List_MinimumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const edgeZone = "aaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaa"; + const offer = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const skus = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.list( + location, + edgeZone, + publisherName, + offer, + skus + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListSkusSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListSkusSample.ts new file mode 100644 index 000000000000..17de38322abf --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListSkusSample.ts @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * + * @summary Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListSkusMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaa"; + const edgeZone = "aaaaa"; + const publisherName = "aaaaaaaaaaaa"; + const offer = "aaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.listSkus( + location, + edgeZone, + publisherName, + offer + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneListSkusMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * + * @summary Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListSkus_MinimumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListSkusMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaaaaaaa"; + const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const publisherName = "aaaaaaaaa"; + const offer = "aaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.listSkus( + location, + edgeZone, + publisherName, + offer + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneListSkusMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesGetSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesGetSample.ts new file mode 100644 index 000000000000..69c8109aa383 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesGetSample.ts @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a virtual machine image. + * + * @summary Gets a virtual machine image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_Get_MaximumSet_Gen.json + */ +async function virtualMachineImagesGetMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaa"; + const publisherName = "aaa"; + const offer = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const skus = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const version = "aaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.get( + location, + publisherName, + offer, + skus, + version + ); + console.log(result); +} + +virtualMachineImagesGetMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a virtual machine image. + * + * @summary Gets a virtual machine image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_Get_MinimumSet_Gen.json + */ +async function virtualMachineImagesGetMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaa"; + const publisherName = "aaaaaaaaaaa"; + const offer = "aa"; + const skus = "aaaaaaaaa"; + const version = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.get( + location, + publisherName, + offer, + skus, + version + ); + console.log(result); +} + +virtualMachineImagesGetMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListOffersSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListOffersSample.ts new file mode 100644 index 000000000000..6a002ba248e6 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListOffersSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of virtual machine image offers for the specified location and publisher. + * + * @summary Gets a list of virtual machine image offers for the specified location and publisher. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListOffers_MaximumSet_Gen.json + */ +async function virtualMachineImagesListOffersMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaa"; + const publisherName = "aaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listOffers( + location, + publisherName + ); + console.log(result); +} + +virtualMachineImagesListOffersMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of virtual machine image offers for the specified location and publisher. + * + * @summary Gets a list of virtual machine image offers for the specified location and publisher. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListOffers_MinimumSet_Gen.json + */ +async function virtualMachineImagesListOffersMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listOffers( + location, + publisherName + ); + console.log(result); +} + +virtualMachineImagesListOffersMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListPublishersSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListPublishersSample.ts new file mode 100644 index 000000000000..b30370da5192 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListPublishersSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of virtual machine image publishers for the specified Azure location. + * + * @summary Gets a list of virtual machine image publishers for the specified Azure location. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListPublishers_MaximumSet_Gen.json + */ +async function virtualMachineImagesListPublishersMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listPublishers(location); + console.log(result); +} + +virtualMachineImagesListPublishersMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of virtual machine image publishers for the specified Azure location. + * + * @summary Gets a list of virtual machine image publishers for the specified Azure location. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListPublishers_MinimumSet_Gen.json + */ +async function virtualMachineImagesListPublishersMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listPublishers(location); + console.log(result); +} + +virtualMachineImagesListPublishersMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListSample.ts new file mode 100644 index 000000000000..4addbfb4d73f --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListSample.ts @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineImagesListOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * + * @summary Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_List_MaximumSet_Gen.json + */ +async function virtualMachineImagesListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaa"; + const publisherName = "aaaaaa"; + const offer = "aaaaaaaaaaaaaaaa"; + const skus = "aaaaaaaaaaaaaaaaaaaaaaa"; + const expand = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const top = 18; + const orderby = "aa"; + const options: VirtualMachineImagesListOptionalParams = { + expand, + top, + orderby + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.list( + location, + publisherName, + offer, + skus, + options + ); + console.log(result); +} + +virtualMachineImagesListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * + * @summary Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_List_MinimumSet_Gen.json + */ +async function virtualMachineImagesListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaa"; + const publisherName = "aaaaaaaaaaa"; + const offer = "aaaaaaaaaa"; + const skus = "aaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.list( + location, + publisherName, + offer, + skus + ); + console.log(result); +} + +virtualMachineImagesListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListSkusSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListSkusSample.ts new file mode 100644 index 000000000000..87d27949cc2c --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListSkusSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * + * @summary Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListSkus_MaximumSet_Gen.json + */ +async function virtualMachineImagesListSkusMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const offer = "aaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listSkus( + location, + publisherName, + offer + ); + console.log(result); +} + +virtualMachineImagesListSkusMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * + * @summary Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListSkus_MinimumSet_Gen.json + */ +async function virtualMachineImagesListSkusMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaa"; + const publisherName = "aaaaaaaaaaaaa"; + const offer = "aaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listSkus( + location, + publisherName, + offer + ); + console.log(result); +} + +virtualMachineImagesListSkusMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..68649279a6ca --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsCreateOrUpdateSample.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineRunCommand, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create or update the run command. + * + * @summary The operation to create or update the run command. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/CreateOrUpdateRunCommand.json + */ +async function createOrUpdateARunCommand() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const runCommandName = "myRunCommand"; + const runCommand: VirtualMachineRunCommand = { + asyncExecution: false, + location: "West US", + parameters: [ + { name: "param1", value: "value1" }, + { name: "param2", value: "value2" } + ], + runAsPassword: "", + runAsUser: "user1", + source: { script: "Write-Host Hello World!" }, + timeoutInSeconds: 3600 + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineRunCommands.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + runCommandName, + runCommand + ); + console.log(result); +} + +createOrUpdateARunCommand().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsDeleteSample.ts new file mode 100644 index 000000000000..57dc92dc51f2 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete the run command. + * + * @summary The operation to delete the run command. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/DeleteRunCommand.json + */ +async function deleteARunCommand() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const runCommandName = "myRunCommand"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineRunCommands.beginDeleteAndWait( + resourceGroupName, + vmName, + runCommandName + ); + console.log(result); +} + +deleteARunCommand().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsGetByVirtualMachineSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsGetByVirtualMachineSample.ts new file mode 100644 index 000000000000..b8de17c9aa1d --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsGetByVirtualMachineSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get the run command. + * + * @summary The operation to get the run command. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/GetRunCommand.json + */ +async function getARunCommand() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const runCommandName = "myRunCommand"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineRunCommands.getByVirtualMachine( + resourceGroupName, + vmName, + runCommandName + ); + console.log(result); +} + +getARunCommand().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsGetSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsGetSample.ts new file mode 100644 index 000000000000..23bacdecdaee --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets specific run command for a subscription in a location. + * + * @summary Gets specific run command for a subscription in a location. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VirtualMachineRunCommandGet.json + */ +async function virtualMachineRunCommandGet() { + const subscriptionId = "24fb23e3-6ba3-41f0-9b6e-e41131d5d61e"; + const location = "SoutheastAsia"; + const commandId = "RunPowerShellScript"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineRunCommands.get( + location, + commandId + ); + console.log(result); +} + +virtualMachineRunCommandGet().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsListByVirtualMachineSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsListByVirtualMachineSample.ts new file mode 100644 index 000000000000..a7e0fad411da --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsListByVirtualMachineSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get all run commands of a Virtual Machine. + * + * @summary The operation to get all run commands of a Virtual Machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/ListRunCommandsInVM.json + */ +async function listRunCommandsInAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineRunCommands.listByVirtualMachine( + resourceGroupName, + vmName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listRunCommandsInAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsListSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsListSample.ts new file mode 100644 index 000000000000..00af68205fa7 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsListSample.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all available run commands for a subscription in a location. + * + * @summary Lists all available run commands for a subscription in a location. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VirtualMachineRunCommandList.json + */ +async function virtualMachineRunCommandList() { + const subscriptionId = "subid"; + const location = "SoutheastAsia"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineRunCommands.list(location)) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineRunCommandList().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsUpdateSample.ts new file mode 100644 index 000000000000..10d77d7ffe21 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsUpdateSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineRunCommandUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update the run command. + * + * @summary The operation to update the run command. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/UpdateRunCommand.json + */ +async function updateARunCommand() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const runCommandName = "myRunCommand"; + const runCommand: VirtualMachineRunCommandUpdate = { + source: { script: "Write-Host Script Source Updated!" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineRunCommands.beginUpdateAndWait( + resourceGroupName, + vmName, + runCommandName, + runCommand + ); + console.log(result); +} + +updateARunCommand().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..cedf83b64b45 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsCreateOrUpdateSample.ts @@ -0,0 +1,81 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetExtension, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create or update an extension. + * + * @summary The operation to create or update an extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_CreateOrUpdate_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsCreateOrUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaa"; + const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaaa"; + const extensionParameters: VirtualMachineScaleSetExtension = { + name: "{extension-name}", + typePropertiesType: "{extension-Type}", + autoUpgradeMinorVersion: true, + enableAutomaticUpgrade: true, + forceUpdateTag: "aaaaaaaaa", + protectedSettings: {}, + provisionAfterExtensions: ["aa"], + publisher: "{extension-Publisher}", + settings: {}, + suppressFailures: true, + typeHandlerVersion: "{handler-version}" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + extensionParameters + ); + console.log(result); +} + +virtualMachineScaleSetExtensionsCreateOrUpdateMaximumSetGen().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update an extension. + * + * @summary The operation to create or update an extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_CreateOrUpdate_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsCreateOrUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaa"; + const vmssExtensionName = "aaaaaaaaaaa"; + const extensionParameters: VirtualMachineScaleSetExtension = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + extensionParameters + ); + console.log(result); +} + +virtualMachineScaleSetExtensionsCreateOrUpdateMinimumSetGen().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsDeleteSample.ts new file mode 100644 index 000000000000..018ea2b824aa --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsDeleteSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete the extension. + * + * @summary The operation to delete the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Delete_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.beginDeleteAndWait( + resourceGroupName, + vmScaleSetName, + vmssExtensionName + ); + console.log(result); +} + +virtualMachineScaleSetExtensionsDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to delete the extension. + * + * @summary The operation to delete the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Delete_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaa"; + const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.beginDeleteAndWait( + resourceGroupName, + vmScaleSetName, + vmssExtensionName + ); + console.log(result); +} + +virtualMachineScaleSetExtensionsDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsGetSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsGetSample.ts new file mode 100644 index 000000000000..f5a12418222b --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsGetSample.ts @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetExtensionsGetOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get the extension. + * + * @summary The operation to get the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Get_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsGetMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaa"; + const expand = "aaaaaaa"; + const options: VirtualMachineScaleSetExtensionsGetOptionalParams = { expand }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.get( + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + options + ); + console.log(result); +} + +virtualMachineScaleSetExtensionsGetMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to get the extension. + * + * @summary The operation to get the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Get_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsGetMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "a"; + const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.get( + resourceGroupName, + vmScaleSetName, + vmssExtensionName + ); + console.log(result); +} + +virtualMachineScaleSetExtensionsGetMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsListSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsListSample.ts new file mode 100644 index 000000000000..0c313f5c963a --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsListSample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of all extensions in a VM scale set. + * + * @summary Gets a list of all extensions in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_List_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSetExtensions.list( + resourceGroupName, + vmScaleSetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetExtensionsListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of all extensions in a VM scale set. + * + * @summary Gets a list of all extensions in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_List_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSetExtensions.list( + resourceGroupName, + vmScaleSetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetExtensionsListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsUpdateSample.ts new file mode 100644 index 000000000000..ff3a3317e151 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsUpdateSample.ts @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetExtensionUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update an extension. + * + * @summary The operation to update an extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Update_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmssExtensionName = "aaaa"; + const extensionParameters: VirtualMachineScaleSetExtensionUpdate = { + typePropertiesType: "{extension-Type}", + autoUpgradeMinorVersion: true, + enableAutomaticUpgrade: true, + forceUpdateTag: "aaaaaaaaa", + protectedSettings: {}, + provisionAfterExtensions: ["aa"], + publisher: "{extension-Publisher}", + settings: {}, + suppressFailures: true, + typeHandlerVersion: "{handler-version}" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.beginUpdateAndWait( + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + extensionParameters + ); + console.log(result); +} + +virtualMachineScaleSetExtensionsUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to update an extension. + * + * @summary The operation to update an extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Update_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmssExtensionName = "aa"; + const extensionParameters: VirtualMachineScaleSetExtensionUpdate = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.beginUpdateAndWait( + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + extensionParameters + ); + console.log(result); +} + +virtualMachineScaleSetExtensionsUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesCancelSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesCancelSample.ts new file mode 100644 index 000000000000..9565766f0f01 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesCancelSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Cancels the current virtual machine scale set rolling upgrade. + * + * @summary Cancels the current virtual machine scale set rolling upgrade. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_Cancel_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetRollingUpgradesCancelMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetRollingUpgrades.beginCancelAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetRollingUpgradesCancelMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Cancels the current virtual machine scale set rolling upgrade. + * + * @summary Cancels the current virtual machine scale set rolling upgrade. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_Cancel_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetRollingUpgradesCancelMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetRollingUpgrades.beginCancelAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetRollingUpgradesCancelMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesGetLatestSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesGetLatestSample.ts new file mode 100644 index 000000000000..58048a23360a --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesGetLatestSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the status of the latest virtual machine scale set rolling upgrade. + * + * @summary Gets the status of the latest virtual machine scale set rolling upgrade. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_GetLatest_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetRollingUpgradesGetLatestMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetRollingUpgrades.getLatest( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetRollingUpgradesGetLatestMaximumSetGen().catch( + console.error +); + +/** + * This sample demonstrates how to Gets the status of the latest virtual machine scale set rolling upgrade. + * + * @summary Gets the status of the latest virtual machine scale set rolling upgrade. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_GetLatest_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetRollingUpgradesGetLatestMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetRollingUpgrades.getLatest( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetRollingUpgradesGetLatestMinimumSetGen().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.ts new file mode 100644 index 000000000000..40de1cd2bc21 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. + * + * @summary Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VMScaleSetExtensionRollingUpgrade.json + */ +async function startAnExtensionRollingUpgrade() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetRollingUpgrades.beginStartExtensionUpgradeAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +startAnExtensionRollingUpgrade().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.ts new file mode 100644 index 000000000000..dc5737a61e78 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. + * + * @summary Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_StartOSUpgrade_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetRollingUpgradesStartOSUpgradeMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetRollingUpgrades.beginStartOSUpgradeAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetRollingUpgradesStartOSUpgradeMaximumSetGen().catch( + console.error +); + +/** + * This sample demonstrates how to Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. + * + * @summary Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_StartOSUpgrade_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetRollingUpgradesStartOSUpgradeMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetRollingUpgrades.beginStartOSUpgradeAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetRollingUpgradesStartOSUpgradeMinimumSetGen().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..057f3f421b13 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineScaleSetVMExtension, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create or update the VMSS VM extension. + * + * @summary The operation to create or update the VMSS VM extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateVirtualMachineScaleSetVMExtensions.json + */ +async function createVirtualMachineScaleSetVMExtension() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const vmExtensionName = "myVMExtension"; + const extensionParameters: VirtualMachineScaleSetVMExtension = { + typePropertiesType: "extType", + autoUpgradeMinorVersion: true, + publisher: "extPublisher", + settings: { UserName: "xyz@microsoft.com" }, + typeHandlerVersion: "1.2" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMExtensions.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + extensionParameters + ); + console.log(result); +} + +createVirtualMachineScaleSetVMExtension().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsDeleteSample.ts new file mode 100644 index 000000000000..f8a9a1d3af62 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete the VMSS VM extension. + * + * @summary The operation to delete the VMSS VM extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DeleteVirtualMachineScaleSetVMExtensions.json + */ +async function deleteVirtualMachineScaleSetVMExtension() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const vmExtensionName = "myVMExtension"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMExtensions.beginDeleteAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName + ); + console.log(result); +} + +deleteVirtualMachineScaleSetVMExtension().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsGetSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsGetSample.ts new file mode 100644 index 000000000000..016aca1f340f --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsGetSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get the VMSS VM extension. + * + * @summary The operation to get the VMSS VM extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetVMExtensions.json + */ +async function getVirtualMachineScaleSetVMExtension() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const vmExtensionName = "myVMExtension"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMExtensions.get( + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName + ); + console.log(result); +} + +getVirtualMachineScaleSetVMExtension().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsListSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsListSample.ts new file mode 100644 index 000000000000..01ca02ce45d5 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsListSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get all extensions of an instance in Virtual Machine Scaleset. + * + * @summary The operation to get all extensions of an instance in Virtual Machine Scaleset. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListVirtualMachineScaleSetVMExtensions.json + */ +async function listExtensionsInVmssInstance() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMExtensions.list( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +listExtensionsInVmssInstance().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsUpdateSample.ts new file mode 100644 index 000000000000..27ae8f7f0a8b --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsUpdateSample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineScaleSetVMExtensionUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update the VMSS VM extension. + * + * @summary The operation to update the VMSS VM extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateVirtualMachineScaleSetVMExtensions.json + */ +async function updateVirtualMachineScaleSetVMExtension() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const vmExtensionName = "myVMExtension"; + const extensionParameters: VirtualMachineScaleSetVMExtensionUpdate = { + typePropertiesType: "extType", + autoUpgradeMinorVersion: true, + publisher: "extPublisher", + settings: { UserName: "xyz@microsoft.com" }, + typeHandlerVersion: "1.2" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMExtensions.beginUpdateAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + extensionParameters + ); + console.log(result); +} + +updateVirtualMachineScaleSetVMExtension().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..ce13d7221ba0 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineRunCommand, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create or update the VMSS VM run command. + * + * @summary The operation to create or update the VMSS VM run command. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/CreateOrUpdateVirtualMachineScaleSetVMRunCommands.json + */ +async function createVirtualMachineScaleSetVMRunCommand() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const runCommandName = "myRunCommand"; + const runCommand: VirtualMachineRunCommand = { + asyncExecution: false, + location: "West US", + parameters: [ + { name: "param1", value: "value1" }, + { name: "param2", value: "value2" } + ], + runAsPassword: "", + runAsUser: "user1", + source: { script: "Write-Host Hello World!" }, + timeoutInSeconds: 3600 + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMRunCommands.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + runCommand + ); + console.log(result); +} + +createVirtualMachineScaleSetVMRunCommand().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsDeleteSample.ts new file mode 100644 index 000000000000..b1132faf2882 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete the VMSS VM run command. + * + * @summary The operation to delete the VMSS VM run command. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/DeleteVirtualMachineScaleSetVMRunCommands.json + */ +async function deleteVirtualMachineScaleSetVMRunCommand() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const runCommandName = "myRunCommand"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMRunCommands.beginDeleteAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName + ); + console.log(result); +} + +deleteVirtualMachineScaleSetVMRunCommand().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsGetSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsGetSample.ts new file mode 100644 index 000000000000..75419a001425 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsGetSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get the VMSS VM run command. + * + * @summary The operation to get the VMSS VM run command. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/GetVirtualMachineScaleSetVMRunCommands.json + */ +async function getVirtualMachineScaleSetVMRunCommands() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const runCommandName = "myRunCommand"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMRunCommands.get( + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName + ); + console.log(result); +} + +getVirtualMachineScaleSetVMRunCommands().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsListSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsListSample.ts new file mode 100644 index 000000000000..ec19161d1048 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsListSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @summary The operation to get all run commands of an instance in Virtual Machine Scaleset. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/ListVirtualMachineScaleSetVMRunCommands.json + */ +async function listRunCommandsInVmssInstance() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSetVMRunCommands.list( + resourceGroupName, + vmScaleSetName, + instanceId + )) { + resArray.push(item); + } + console.log(resArray); +} + +listRunCommandsInVmssInstance().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsUpdateSample.ts new file mode 100644 index 000000000000..c1d26113b76f --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsUpdateSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineRunCommandUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update the VMSS VM run command. + * + * @summary The operation to update the VMSS VM run command. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/UpdateVirtualMachineScaleSetVMRunCommands.json + */ +async function updateVirtualMachineScaleSetVMRunCommand() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const runCommandName = "myRunCommand"; + const runCommand: VirtualMachineRunCommandUpdate = { + source: { script: "Write-Host Script Source Updated!" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMRunCommands.beginUpdateAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + runCommand + ); + console.log(result); +} + +updateVirtualMachineScaleSetVMRunCommand().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSDeallocateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSDeallocateSample.ts new file mode 100644 index 000000000000..13f042e60ce4 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSDeallocateSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * + * @summary Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Deallocate_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSDeallocateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginDeallocateAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSDeallocateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * + * @summary Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Deallocate_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSDeallocateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const instanceId = "aaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginDeallocateAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSDeallocateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSDeleteSample.ts new file mode 100644 index 000000000000..a50b1ccc9022 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSDeleteSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineScaleSetVMsDeleteOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes a virtual machine from a VM scale set. + * + * @summary Deletes a virtual machine from a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ForceDeleteVirtualMachineScaleSetVM.json + */ +async function forceDeleteAVirtualMachineFromAVMScaleSet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const forceDeletion = true; + const options: VirtualMachineScaleSetVMsDeleteOptionalParams = { + forceDeletion + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginDeleteAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + options + ); + console.log(result); +} + +forceDeleteAVirtualMachineFromAVMScaleSet().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSGetInstanceViewSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSGetInstanceViewSample.ts new file mode 100644 index 000000000000..0126c9abc4dc --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSGetInstanceViewSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the status of a virtual machine from a VM scale set. + * + * @summary Gets the status of a virtual machine from a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetVMInstanceViewAutoPlacedOnDedicatedHostGroup.json + */ +async function getInstanceViewOfAVirtualMachineFromAVMScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myVirtualMachineScaleSet"; + const instanceId = "0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.getInstanceView( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +getInstanceViewOfAVirtualMachineFromAVMScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSGetSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSGetSample.ts new file mode 100644 index 000000000000..200e7e5e8a8f --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSGetSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a virtual machine from a VM scale set. + * + * @summary Gets a virtual machine from a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetVMWithUserData.json + */ +async function getVMScaleSetVMWithUserData() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const instanceId = "0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.get( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +getVMScaleSetVMWithUserData().catch(console.error); + +/** + * This sample demonstrates how to Gets a virtual machine from a VM scale set. + * + * @summary Gets a virtual machine from a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetVMWithVMSizeProperties.json + */ +async function getVMScaleSetVMWithVMSizeProperties() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const instanceId = "0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.get( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +getVMScaleSetVMWithVMSizeProperties().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSListSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSListSample.ts new file mode 100644 index 000000000000..49999ac2d7f0 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSListSample.ts @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetVMsListOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of all virtual machines in a VM scale sets. + * + * @summary Gets a list of all virtual machines in a VM scale sets. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_List_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const virtualMachineScaleSetName = "aaaaaaaaaaaaaaaaaaaaaa"; + const filter = "aaaaaaaaaaaaaa"; + const select = "aaaaaaaaaaaaaaaaaaaaa"; + const expand = "aaaaaaaaaaaaa"; + const options: VirtualMachineScaleSetVMsListOptionalParams = { + filter, + select, + expand + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSetVMs.list( + resourceGroupName, + virtualMachineScaleSetName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetVMSListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of all virtual machines in a VM scale sets. + * + * @summary Gets a list of all virtual machines in a VM scale sets. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_List_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const virtualMachineScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSetVMs.list( + resourceGroupName, + virtualMachineScaleSetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetVMSListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSPerformMaintenanceSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSPerformMaintenanceSample.ts new file mode 100644 index 000000000000..1d7477b5e95b --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSPerformMaintenanceSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Performs maintenance on a virtual machine in a VM scale set. + * + * @summary Performs maintenance on a virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PerformMaintenance_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSPerformMaintenanceMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginPerformMaintenanceAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSPerformMaintenanceMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Performs maintenance on a virtual machine in a VM scale set. + * + * @summary Performs maintenance on a virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PerformMaintenance_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSPerformMaintenanceMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaa"; + const instanceId = "aaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginPerformMaintenanceAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSPerformMaintenanceMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSPowerOffSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSPowerOffSample.ts new file mode 100644 index 000000000000..3ad5be723322 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSPowerOffSample.ts @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetVMsPowerOffOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @summary Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PowerOff_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSPowerOffMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaa"; + const instanceId = "aaaaaaaaa"; + const skipShutdown = true; + const options: VirtualMachineScaleSetVMsPowerOffOptionalParams = { + skipShutdown + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginPowerOffAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + options + ); + console.log(result); +} + +virtualMachineScaleSetVMSPowerOffMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @summary Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PowerOff_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSPowerOffMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginPowerOffAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSPowerOffMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRedeploySample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRedeploySample.ts new file mode 100644 index 000000000000..13cee85ededb --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRedeploySample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @summary Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Redeploy_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSRedeployMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginRedeployAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSRedeployMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @summary Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Redeploy_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSRedeployMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginRedeployAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSRedeployMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSReimageAllSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSReimageAllSample.ts new file mode 100644 index 000000000000..d459d3f9228b --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSReimageAllSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. + * + * @summary Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_ReimageAll_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSReimageAllMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginReimageAllAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSReimageAllMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. + * + * @summary Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_ReimageAll_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSReimageAllMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginReimageAllAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSReimageAllMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSReimageSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSReimageSample.ts new file mode 100644 index 000000000000..8c7936248be5 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSReimageSample.ts @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetVMReimageParameters, + VirtualMachineScaleSetVMsReimageOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @summary Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Reimage_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSReimageMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmScaleSetVMReimageInput: VirtualMachineScaleSetVMReimageParameters = { + tempDisk: true + }; + const options: VirtualMachineScaleSetVMsReimageOptionalParams = { + vmScaleSetVMReimageInput + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginReimageAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + options + ); + console.log(result); +} + +virtualMachineScaleSetVMSReimageMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @summary Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Reimage_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSReimageMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaa"; + const instanceId = "aaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginReimageAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSReimageMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRestartSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRestartSample.ts new file mode 100644 index 000000000000..3514f8320138 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRestartSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Restarts a virtual machine in a VM scale set. + * + * @summary Restarts a virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Restart_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSRestartMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aa"; + const instanceId = "aaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginRestartAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSRestartMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Restarts a virtual machine in a VM scale set. + * + * @summary Restarts a virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Restart_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSRestartMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaa"; + const instanceId = "aaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginRestartAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSRestartMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.ts new file mode 100644 index 000000000000..74c623ebc860 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. + * + * @summary The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RetrieveBootDiagnosticsDataVMScaleSetVM.json + */ +async function retrieveBootDiagnosticsDataOfAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const sasUriExpirationTimeInMinutes = 60; + const options: VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams = { + sasUriExpirationTimeInMinutes + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.retrieveBootDiagnosticsData( + resourceGroupName, + vmScaleSetName, + instanceId, + options + ); + console.log(result); +} + +retrieveBootDiagnosticsDataOfAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRunCommandSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRunCommandSample.ts new file mode 100644 index 000000000000..af764bbc07fa --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRunCommandSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { RunCommandInput, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Run command on a virtual machine in a VM scale set. + * + * @summary Run command on a virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VMScaleSetRunCommand.json + */ +async function virtualMachineScaleSetVMSRunCommand() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myVirtualMachineScaleSet"; + const instanceId = "0"; + const parameters: RunCommandInput = { + commandId: "RunPowerShellScript", + script: ["Write-Host Hello World!"] + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginRunCommandAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + parameters + ); + console.log(result); +} + +virtualMachineScaleSetVMSRunCommand().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSSimulateEvictionSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSSimulateEvictionSample.ts new file mode 100644 index 000000000000..2c36d474c5d3 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSSimulateEvictionSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to simulate the eviction of spot virtual machine in a VM scale set. + * + * @summary The operation to simulate the eviction of spot virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SimulateEvictionOfVmssVM.json + */ +async function simulateEvictionAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ResourceGroup"; + const vmScaleSetName = "VmScaleSetName"; + const instanceId = "InstanceId"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.simulateEviction( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +simulateEvictionAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSStartSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSStartSample.ts new file mode 100644 index 000000000000..1bb5ca5c5bea --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSStartSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Starts a virtual machine in a VM scale set. + * + * @summary Starts a virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Start_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSStartMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginStartAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSStartMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Starts a virtual machine in a VM scale set. + * + * @summary Starts a virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Start_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSStartMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginStartAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSStartMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSUpdateSample.ts new file mode 100644 index 000000000000..ea2378b18925 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSUpdateSample.ts @@ -0,0 +1,489 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetVM, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Updates a virtual machine of a VM scale set. + * + * @summary Updates a virtual machine of a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Update_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const parameters: VirtualMachineScaleSetVM = { + additionalCapabilities: { hibernationEnabled: true, ultraSSDEnabled: true }, + availabilitySet: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + }, + diagnosticsProfile: { + bootDiagnostics: { enabled: true, storageUri: "aaaaaaaaaaaaa" } + }, + hardwareProfile: { + vmSize: "Basic_A0", + vmSizeProperties: { vCPUsAvailable: 9, vCPUsPerCore: 12 } + }, + instanceView: { + bootDiagnostics: { + status: { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z") + } + }, + disks: [ + { + name: "aaaaaaaaaaa", + encryptionSettings: [ + { + diskEncryptionKey: { + secretUrl: "aaaaaaaa", + sourceVault: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + } + }, + enabled: true, + keyEncryptionKey: { + keyUrl: "aaaaaaaaaaaaaa", + sourceVault: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + } + } + } + ], + statuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z") + } + ] + } + ], + maintenanceRedeployStatus: { + isCustomerInitiatedMaintenanceAllowed: true, + lastOperationMessage: "aaaaaa", + lastOperationResultCode: "None", + maintenanceWindowEndTime: new Date("2021-11-30T12:58:26.531Z"), + maintenanceWindowStartTime: new Date("2021-11-30T12:58:26.531Z"), + preMaintenanceWindowEndTime: new Date("2021-11-30T12:58:26.531Z"), + preMaintenanceWindowStartTime: new Date("2021-11-30T12:58:26.531Z") + }, + placementGroupId: "aaa", + platformFaultDomain: 14, + platformUpdateDomain: 23, + rdpThumbPrint: "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + statuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z") + } + ], + vmAgent: { + extensionHandlers: [ + { + type: "aaaaaaaaaaaaa", + status: { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z") + }, + typeHandlerVersion: "aaaaa" + } + ], + statuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z") + } + ], + vmAgentVersion: "aaaaaaaaaaaaaaaaaaaaaaa" + }, + vmHealth: { + status: { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z") + } + }, + extensions: [ + { + name: "aaaaaaaaaaaaaaaaa", + type: "aaaaaaaaa", + statuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z") + } + ], + substatuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z") + } + ], + typeHandlerVersion: "aaaaaaaaaaaaaaaaaaaaaaaaaa" + } + ] + }, + licenseType: "aaaaaaaaaa", + location: "westus", + networkProfile: { + networkApiVersion: "2020-11-01", + networkInterfaceConfigurations: [ + { + name: "aaaaaaaaaaa", + deleteOption: "Delete", + dnsSettings: { dnsServers: ["aaaaaa"] }, + dscpConfiguration: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + }, + enableAcceleratedNetworking: true, + enableFpga: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "aa", + applicationGatewayBackendAddressPools: [ + { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + } + ], + applicationSecurityGroups: [ + { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + } + ], + loadBalancerBackendAddressPools: [ + { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + } + ], + primary: true, + privateIPAddressVersion: "IPv4", + publicIPAddressConfiguration: { + name: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + deleteOption: "Delete", + dnsSettings: { domainNameLabel: "aaaaaaaaaaaaaaaaaaaaaaaaa" }, + idleTimeoutInMinutes: 2, + ipTags: [ + { + ipTagType: "aaaaaaaaaaaaaaaaaaaaaaaaa", + tag: "aaaaaaaaaaaaaaaaaaaa" + } + ], + publicIPAddressVersion: "IPv4", + publicIPAllocationMethod: "Dynamic", + publicIPPrefix: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + }, + sku: { name: "Basic", tier: "Regional" } + }, + subnet: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + } + } + ], + networkSecurityGroup: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + }, + primary: true + } + ], + networkInterfaces: [ + { + deleteOption: "Delete", + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0/networkInterfaces/vmsstestnetconfig5415", + primary: true + } + ] + }, + networkProfileConfiguration: { + networkInterfaceConfigurations: [ + { + name: "vmsstestnetconfig5415", + deleteOption: "Delete", + dnsSettings: { dnsServers: [] }, + enableAcceleratedNetworking: true, + enableFpga: true, + enableIPForwarding: true, + id: "aaaaaaaa", + ipConfigurations: [ + { + name: "vmsstestnetconfig9693", + applicationGatewayBackendAddressPools: [ + { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + } + ], + applicationSecurityGroups: [ + { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + } + ], + id: "aaaaaaaaa", + loadBalancerBackendAddressPools: [ + { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + } + ], + loadBalancerInboundNatPools: [ + { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + } + ], + primary: true, + privateIPAddressVersion: "IPv4", + publicIPAddressConfiguration: { + name: "aaaaaaaaaaaaaaaaaa", + deleteOption: "Delete", + dnsSettings: { domainNameLabel: "aaaaaaaaaaaaaaaaaa" }, + idleTimeoutInMinutes: 18, + ipTags: [ + { ipTagType: "aaaaaaa", tag: "aaaaaaaaaaaaaaaaaaaaaaaaaaa" } + ], + publicIPAddressVersion: "IPv4", + publicIPPrefix: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + }, + sku: { name: "Basic", tier: "Regional" } + }, + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vn4071/subnets/sn5503" + } + } + ], + networkSecurityGroup: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + }, + primary: true + } + ] + }, + osProfile: { + adminPassword: "aaaaaaaaaaaaaaaa", + adminUsername: "Foo12", + allowExtensionOperations: true, + computerName: "test000000", + customData: "aaaa", + linuxConfiguration: { + disablePasswordAuthentication: true, + patchSettings: { + assessmentMode: "ImageDefault", + patchMode: "ImageDefault" + }, + provisionVMAgent: true, + ssh: { publicKeys: [{ path: "aaa", keyData: "aaaaaa" }] } + }, + requireGuestProvisionSignal: true, + secrets: [], + windowsConfiguration: { + additionalUnattendContent: [ + { + componentName: "Microsoft-Windows-Shell-Setup", + content: "aaaaaaaaaaaaaaaaaaaa", + passName: "OobeSystem", + settingName: "AutoLogon" + } + ], + enableAutomaticUpdates: true, + patchSettings: { + assessmentMode: "ImageDefault", + enableHotpatching: true, + patchMode: "Manual" + }, + provisionVMAgent: true, + timeZone: "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + winRM: { + listeners: [ + { certificateUrl: "aaaaaaaaaaaaaaaaaaaaaa", protocol: "Http" } + ] + } + } + }, + plan: { + name: "aaaaaaaaaa", + product: "aaaaaaaaaaaaaaaaaaaa", + promotionCode: "aaaaaaaaaaaaaaaaaaaa", + publisher: "aaaaaaaaaaaaaaaaaaaaaa" + }, + protectionPolicy: { + protectFromScaleIn: true, + protectFromScaleSetActions: true + }, + securityProfile: { + encryptionAtHost: true, + securityType: "TrustedLaunch", + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true } + }, + sku: { name: "Classic", capacity: 29, tier: "aaaaaaaaaaaaaa" }, + storageProfile: { + dataDisks: [ + { + name: "vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", + caching: "None", + createOption: "Empty", + deleteOption: "Delete", + detachOption: "ForceDetach", + diskSizeGB: 128, + image: { + uri: + "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd" + }, + lun: 1, + managedDisk: { + diskEncryptionSet: { id: "aaaaaaaaaaaa" }, + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", + storageAccountType: "Standard_LRS" + }, + toBeDetached: true, + vhd: { + uri: + "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd" + }, + writeAcceleratorEnabled: true + } + ], + imageReference: { + id: "a", + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sharedGalleryImageId: "aaaaaaaaaaaaaaaaaaaa", + sku: "2012-R2-Datacenter", + version: "4.127.20180315" + }, + osDisk: { + name: "vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc", + caching: "None", + createOption: "FromImage", + deleteOption: "Delete", + diffDiskSettings: { option: "Local", placement: "CacheDisk" }, + diskSizeGB: 127, + encryptionSettings: { + diskEncryptionKey: { + secretUrl: "aaaaaaaa", + sourceVault: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + } + }, + enabled: true, + keyEncryptionKey: { + keyUrl: "aaaaaaaaaaaaaa", + sourceVault: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + } + } + }, + image: { + uri: + "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd" + }, + managedDisk: { + diskEncryptionSet: { id: "aaaaaaaaaaaa" }, + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc", + storageAccountType: "Standard_LRS" + }, + osType: "Windows", + vhd: { + uri: + "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd" + }, + writeAcceleratorEnabled: true + } + }, + tags: {}, + userData: "RXhhbXBsZSBVc2VyRGF0YQ==" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginUpdateAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + parameters + ); + console.log(result); +} + +virtualMachineScaleSetVMSUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Updates a virtual machine of a VM scale set. + * + * @summary Updates a virtual machine of a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Update_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaaaaa"; + const parameters: VirtualMachineScaleSetVM = { location: "westus" }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginUpdateAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + parameters + ); + console.log(result); +} + +virtualMachineScaleSetVMSUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.ts new file mode 100644 index 000000000000..d0faa1c81458 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.ts @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VMScaleSetConvertToSinglePlacementGroupInput, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * + * @summary Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ConvertToSinglePlacementGroup_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsConvertToSinglePlacementGroupMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const parameters: VMScaleSetConvertToSinglePlacementGroupInput = { + activePlacementGroupId: "aaaaaaaaaaaaaaaaaaaaaaaaaaa" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.convertToSinglePlacementGroup( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +virtualMachineScaleSetsConvertToSinglePlacementGroupMaximumSetGen().catch( + console.error +); + +/** + * This sample demonstrates how to Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * + * @summary Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ConvertToSinglePlacementGroup_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsConvertToSinglePlacementGroupMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaa"; + const parameters: VMScaleSetConvertToSinglePlacementGroupInput = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.convertToSinglePlacementGroup( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +virtualMachineScaleSetsConvertToSinglePlacementGroupMinimumSetGen().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..7847acc7e40c --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsCreateOrUpdateSample.ts @@ -0,0 +1,2421 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSet, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithExtensionsSuppressFailuresEnabled.json + */ +async function createAVmssWithAnExtensionThatHasSuppressFailuresEnabled() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: + "http://{existing-storage-account-name}.blob.core.windows.net" + } + }, + extensionProfile: { + extensions: [ + { + name: "{extension-name}", + typePropertiesType: "{extension-Type}", + autoUpgradeMinorVersion: false, + publisher: "{extension-Publisher}", + settings: {}, + suppressFailures: true, + typeHandlerVersion: "{handler-version}" + } + ] + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAVmssWithAnExtensionThatHasSuppressFailuresEnabled().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithProtectedSettingsFromKeyVault.json + */ +async function createAVmssWithAnExtensionWithProtectedSettingsFromKeyVault() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: + "http://{existing-storage-account-name}.blob.core.windows.net" + } + }, + extensionProfile: { + extensions: [ + { + name: "{extension-name}", + typePropertiesType: "{extension-Type}", + autoUpgradeMinorVersion: false, + protectedSettingsFromKeyVault: { + secretUrl: + "https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e", + sourceVault: { + id: + "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName" + } + }, + publisher: "{extension-Publisher}", + settings: {}, + typeHandlerVersion: "{handler-version}" + } + ] + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAVmssWithAnExtensionWithProtectedSettingsFromKeyVault().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateACustomImageScaleSetFromAnUnmanagedGeneralizedOsImage.json + */ +async function createACustomImageScaleSetFromAnUnmanagedGeneralizedOSImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + osDisk: { + name: "osDisk", + caching: "ReadWrite", + createOption: "FromImage", + image: { + uri: + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd" + } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createACustomImageScaleSetFromAnUnmanagedGeneralizedOSImage().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAPlatformImageScaleSetWithUnmanagedOsDisks.json + */ +async function createAPlatformImageScaleSetWithUnmanagedOSDisks() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "osDisk", + caching: "ReadWrite", + createOption: "FromImage", + vhdContainers: [ + "http://{existing-storage-account-name-0}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-1}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-2}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-3}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-4}.blob.core.windows.net/vhdContainer" + ] + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAPlatformImageScaleSetWithUnmanagedOSDisks().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetFromACustomImage.json + */ +async function createAScaleSetFromACustomImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetFromACustomImage().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetFromAGeneralizedSharedImage.json + */ +async function createAScaleSetFromAGeneralizedSharedImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetFromAGeneralizedSharedImage().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetFromASpecializedSharedImage.json + */ +async function createAScaleSetFromASpecializedSharedImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + storageProfile: { + imageReference: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetFromASpecializedSharedImage().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithApplicationProfile.json + */ +async function createAScaleSetWithApplicationProfile() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + applicationProfile: { + galleryApplications: [ + { + configurationReference: + "https://mystorageaccount.blob.core.windows.net/configurations/settings.config", + order: 1, + packageReferenceId: + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0", + tags: "myTag1" + }, + { + packageReferenceId: + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1" + } + ] + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithApplicationProfile().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScalesetWithDiskEncryptionSetResource.json + */ +async function createAScaleSetWithDiskEncryptionSetResourceInOSDiskAndDataDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + dataDisks: [ + { + caching: "ReadWrite", + createOption: "Empty", + diskSizeGB: 1023, + lun: 0, + managedDisk: { + diskEncryptionSet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}" + }, + storageAccountType: "Standard_LRS" + } + } + ], + imageReference: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { + diskEncryptionSet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}" + }, + storageAccountType: "Standard_LRS" + } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithDiskEncryptionSetResourceInOSDiskAndDataDisk().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetFromWithFpgaNetworkInterface.json + */ +async function createAScaleSetWithFpgaNetworkInterfaces() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + }, + { + name: "{fpgaNic-Name}", + enableAcceleratedNetworking: false, + enableFpga: true, + enableIPForwarding: false, + ipConfigurations: [ + { + name: "{fpgaNic-Name}", + primary: true, + privateIPAddressVersion: "IPv4", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name}" + } + } + ], + primary: false + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithFpgaNetworkInterfaces().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithEncryptionAtHost.json + */ +async function createAScaleSetWithHostEncryptionUsingEncryptionAtHostProperty() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads" + }, + sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + securityProfile: { encryptionAtHost: true }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest" + }, + osDisk: { + caching: "ReadOnly", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithHostEncryptionUsingEncryptionAtHostProperty().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithSecurityTypeConfidentialVM.json + */ +async function createAScaleSetWithSecurityTypeAsConfidentialVM() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_DC2as_v5", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + securityProfile: { + securityType: "ConfidentialVM", + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true } + }, + storageProfile: { + imageReference: { + offer: "2019-datacenter-cvm", + publisher: "MicrosoftWindowsServer", + sku: "windows-cvm", + version: "17763.2183.2109130127" + }, + osDisk: { + caching: "ReadOnly", + createOption: "FromImage", + managedDisk: { + securityProfile: { securityEncryptionType: "VMGuestStateOnly" }, + storageAccountType: "StandardSSD_LRS" + } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithSecurityTypeAsConfidentialVM().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithUefiSettings.json + */ +async function createAScaleSetWithUefiSettingsOfSecureBootAndVTpm() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D2s_v3", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + securityProfile: { + securityType: "TrustedLaunch", + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true } + }, + storageProfile: { + imageReference: { + offer: "windowsserver-gen2preview-preview", + publisher: "MicrosoftWindowsServer", + sku: "windows10-tvm", + version: "18363.592.2001092016" + }, + osDisk: { + caching: "ReadOnly", + createOption: "FromImage", + managedDisk: { storageAccountType: "StandardSSD_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithUefiSettingsOfSecureBootAndVTpm().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithAMarketplaceImagePlan.json + */ +async function createAScaleSetWithAMarketplaceImagePlan() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads" + }, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithAMarketplaceImagePlan().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithAnAzureApplicationGateway.json + */ +async function createAScaleSetWithAnAzureApplicationGateway() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + applicationGatewayBackendAddressPools: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/applicationGateways/{existing-application-gateway-name}/backendAddressPools/{existing-backend-address-pool-name}" + } + ], + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithAnAzureApplicationGateway().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithAnAzureLoadBalancer.json + */ +async function createAScaleSetWithAnAzureLoadBalancer() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + loadBalancerBackendAddressPools: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/backendAddressPools/{existing-backend-address-pool-name}" + } + ], + loadBalancerInboundNatPools: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/inboundNatPools/{existing-nat-pool-name}" + } + ], + publicIPAddressConfiguration: { + name: "{vmss-name}", + publicIPAddressVersion: "IPv4" + }, + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithAnAzureLoadBalancer().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithAutomaticRepairs.json + */ +async function createAScaleSetWithAutomaticRepairsEnabled() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + automaticRepairsPolicy: { enabled: true, gracePeriod: "PT10M" }, + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithAutomaticRepairsEnabled().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithBootDiagnostics.json + */ +async function createAScaleSetWithBootDiagnostics() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: + "http://{existing-storage-account-name}.blob.core.windows.net" + } + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithBootDiagnostics().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithEmptyDataDisksOnEachVm.json + */ +async function createAScaleSetWithEmptyDataDisksOnEachVM() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D2_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + dataDisks: [ + { createOption: "Empty", diskSizeGB: 1023, lun: 0 }, + { createOption: "Empty", diskSizeGB: 1023, lun: 1 } + ], + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + diskSizeGB: 512, + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithEmptyDataDisksOnEachVM().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithDiffOsDiskUsingDiffDiskPlacement.json + */ +async function createAScaleSetWithEphemeralOSDisksUsingPlacementProperty() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads" + }, + sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest" + }, + osDisk: { + caching: "ReadOnly", + createOption: "FromImage", + diffDiskSettings: { option: "Local", placement: "ResourceDisk" }, + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithEphemeralOSDisksUsingPlacementProperty().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithDiffOsDisk.json + */ +async function createAScaleSetWithEphemeralOSDisks() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads" + }, + sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest" + }, + osDisk: { + caching: "ReadOnly", + createOption: "FromImage", + diffDiskSettings: { option: "Local" }, + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithEphemeralOSDisks().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithExtensionsTimeBudget.json + */ +async function createAScaleSetWithExtensionTimeBudget() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: + "http://{existing-storage-account-name}.blob.core.windows.net" + } + }, + extensionProfile: { + extensionsTimeBudget: "PT1H20M", + extensions: [ + { + name: "{extension-name}", + typePropertiesType: "{extension-Type}", + autoUpgradeMinorVersion: false, + publisher: "{extension-Publisher}", + settings: {}, + typeHandlerVersion: "{handler-version}" + } + ] + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithExtensionTimeBudget().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithManagedBootDiagnostics.json + */ +async function createAScaleSetWithManagedBootDiagnostics() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + diagnosticsProfile: { bootDiagnostics: { enabled: true } }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithManagedBootDiagnostics().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithPasswordAuthentication.json + */ +async function createAScaleSetWithPasswordAuthentication() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithPasswordAuthentication().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithPremiumStorage.json + */ +async function createAScaleSetWithPremiumStorage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithPremiumStorage().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithScaleInPolicy.json + */ +async function createAScaleSetWithScaleInPolicy() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + scaleInPolicy: { forceDeletion: true, rules: ["OldestVM"] }, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithScaleInPolicy().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithSpotRestorePolicy.json + */ +async function createAScaleSetWithSpotRestorePolicy() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_A8m_v2", capacity: 2, tier: "Standard" }, + spotRestorePolicy: { enabled: true, restoreTimeout: "PT1H" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + billingProfile: { maxPrice: -1 }, + evictionPolicy: "Deallocate", + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + priority: "Spot", + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithSpotRestorePolicy().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithSshAuthentication.json + */ +async function createAScaleSetWithSshAuthentication() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + linuxConfiguration: { + disablePasswordAuthentication: true, + ssh: { + publicKeys: [ + { + path: "/home/{your-username}/.ssh/authorized_keys", + keyData: + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1" + } + ] + } + } + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithSshAuthentication().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithTerminateScheduledEventEnabled.json + */ +async function createAScaleSetWithTerminateScheduledEventsEnabled() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + scheduledEventsProfile: { + terminateNotificationProfile: { enable: true, notBeforeTimeout: "PT5M" } + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithTerminateScheduledEventsEnabled().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAScaleSetWithUserData.json + */ +async function createAScaleSetWithUserData() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + }, + userData: "RXhhbXBsZSBVc2VyRGF0YQ==" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithUserData().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithVMsInDifferentZones.json + */ +async function createAScaleSetWithVirtualMachinesInDifferentZones() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "centralus", + overprovision: true, + sku: { name: "Standard_A1_v2", capacity: 2, tier: "Standard" }, + upgradePolicy: { mode: "Automatic" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + dataDisks: [ + { createOption: "Empty", diskSizeGB: 1023, lun: 0 }, + { createOption: "Empty", diskSizeGB: 1023, lun: 1 } + ], + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + diskSizeGB: 512, + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }, + zones: ["1", "3"] + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithVirtualMachinesInDifferentZones().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAScaleSetWithVMSizeProperties.json + */ +async function createAScaleSetWithVMSizeProperties() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + hardwareProfile: { + vmSizeProperties: { vCPUsAvailable: 1, vCPUsPerCore: 1 } + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + }, + userData: "RXhhbXBsZSBVc2VyRGF0YQ==" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithVMSizeProperties().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAScaleSetWithCapacityReservation.json + */ +async function createOrUpdateAScaleSetWithCapacityReservation() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + capacityReservation: { + capacityReservationGroup: { + id: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}" + } + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createOrUpdateAScaleSetWithCapacityReservation().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsDeallocateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsDeallocateSample.ts new file mode 100644 index 000000000000..d32d704143d9 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsDeallocateSample.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetVMInstanceIDs, + VirtualMachineScaleSetsDeallocateOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @summary Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Deallocate_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsDeallocateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaa"] + }; + const options: VirtualMachineScaleSetsDeallocateOptionalParams = { + vmInstanceIDs + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginDeallocateAndWait( + resourceGroupName, + vmScaleSetName, + options + ); + console.log(result); +} + +virtualMachineScaleSetsDeallocateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @summary Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Deallocate_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsDeallocateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginDeallocateAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsDeallocateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsDeleteInstancesSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsDeleteInstancesSample.ts new file mode 100644 index 000000000000..6c895d4d3632 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsDeleteInstancesSample.ts @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetVMInstanceRequiredIDs, + VirtualMachineScaleSetsDeleteInstancesOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes virtual machines in a VM scale set. + * + * @summary Deletes virtual machines in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_DeleteInstances_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsDeleteInstancesMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaa"; + const forceDeletion = true; + const vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"] + }; + const options: VirtualMachineScaleSetsDeleteInstancesOptionalParams = { + forceDeletion + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginDeleteInstancesAndWait( + resourceGroupName, + vmScaleSetName, + vmInstanceIDs, + options + ); + console.log(result); +} + +virtualMachineScaleSetsDeleteInstancesMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Deletes virtual machines in a VM scale set. + * + * @summary Deletes virtual machines in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_DeleteInstances_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsDeleteInstancesMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaa"; + const vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"] + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginDeleteInstancesAndWait( + resourceGroupName, + vmScaleSetName, + vmInstanceIDs + ); + console.log(result); +} + +virtualMachineScaleSetsDeleteInstancesMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsDeleteSample.ts new file mode 100644 index 000000000000..d8436549e0a3 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsDeleteSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineScaleSetsDeleteOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes a VM scale set. + * + * @summary Deletes a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ForceDeleteVirtualMachineScaleSets.json + */ +async function forceDeleteAVMScaleSet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const forceDeletion = true; + const options: VirtualMachineScaleSetsDeleteOptionalParams = { + forceDeletion + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginDeleteAndWait( + resourceGroupName, + vmScaleSetName, + options + ); + console.log(result); +} + +forceDeleteAVMScaleSet().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.ts new file mode 100644 index 000000000000..76581bd5d5f6 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.ts @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * + * @summary Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaa"; + const platformUpdateDomain = 30; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.forceRecoveryServiceFabricPlatformUpdateDomainWalk( + resourceGroupName, + vmScaleSetName, + platformUpdateDomain + ); + console.log(result); +} + +virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkMaximumSetGen().catch( + console.error +); + +/** + * This sample demonstrates how to Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * + * @summary Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaa"; + const platformUpdateDomain = 9; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.forceRecoveryServiceFabricPlatformUpdateDomainWalk( + resourceGroupName, + vmScaleSetName, + platformUpdateDomain + ); + console.log(result); +} + +virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkMinimumSetGen().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsGetInstanceViewSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsGetInstanceViewSample.ts new file mode 100644 index 000000000000..360f0aef82a4 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsGetInstanceViewSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the status of a VM scale set instance. + * + * @summary Gets the status of a VM scale set instance. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetInstanceView_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsGetInstanceViewMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.getInstanceView( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsGetInstanceViewMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets the status of a VM scale set instance. + * + * @summary Gets the status of a VM scale set instance. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetInstanceView_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsGetInstanceViewMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.getInstanceView( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsGetInstanceViewMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsGetOSUpgradeHistorySample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsGetOSUpgradeHistorySample.ts new file mode 100644 index 000000000000..8c6d50ae7b5f --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsGetOSUpgradeHistorySample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets list of OS upgrades on a VM scale set instance. + * + * @summary Gets list of OS upgrades on a VM scale set instance. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetOSUpgradeHistory_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsGetOSUpgradeHistoryMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSets.listOSUpgradeHistory( + resourceGroupName, + vmScaleSetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetsGetOSUpgradeHistoryMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets list of OS upgrades on a VM scale set instance. + * + * @summary Gets list of OS upgrades on a VM scale set instance. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetOSUpgradeHistory_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsGetOSUpgradeHistoryMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSets.listOSUpgradeHistory( + resourceGroupName, + vmScaleSetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetsGetOSUpgradeHistoryMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsGetSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsGetSample.ts new file mode 100644 index 000000000000..f81cdd815830 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsGetSample.ts @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Display information about a virtual machine scale set. + * + * @summary Display information about a virtual machine scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSet.json + */ +async function getAVirtualMachineScaleSet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myVirtualMachineScaleSet"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.get( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +getAVirtualMachineScaleSet().catch(console.error); + +/** + * This sample demonstrates how to Display information about a virtual machine scale set. + * + * @summary Display information about a virtual machine scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetAutoPlacedOnDedicatedHostGroup.json + */ +async function getAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myVirtualMachineScaleSet"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.get( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +getAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement().catch( + console.error +); + +/** + * This sample demonstrates how to Display information about a virtual machine scale set. + * + * @summary Display information about a virtual machine scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetWithUserData.json + */ +async function getAVirtualMachineScaleSetWithUserData() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myVirtualMachineScaleSet"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.get( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +getAVirtualMachineScaleSetWithUserData().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListAllSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListAllSample.ts new file mode 100644 index 000000000000..73aea06ea081 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListAllSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. + * + * @summary Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListAll_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsListAllMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSets.listAll()) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetsListAllMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. + * + * @summary Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListAll_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsListAllMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSets.listAll()) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetsListAllMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListByLocationSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListByLocationSample.ts new file mode 100644 index 000000000000..f099d9414ed9 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListByLocationSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets all the VM scale sets under the specified subscription for the specified location. + * + * @summary Gets all the VM scale sets under the specified subscription for the specified location. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListVirtualMachineScaleSetsInASubscriptionByLocation.json + */ +async function listsAllTheVMScaleSetsUnderTheSpecifiedSubscriptionForTheSpecifiedLocation() { + const subscriptionId = "{subscription-id}"; + const location = "eastus"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSets.listByLocation( + location + )) { + resArray.push(item); + } + console.log(resArray); +} + +listsAllTheVMScaleSetsUnderTheSpecifiedSubscriptionForTheSpecifiedLocation().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListSample.ts new file mode 100644 index 000000000000..89457ab9cf80 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListSample.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of all VM scale sets under a resource group. + * + * @summary Gets a list of all VM scale sets under a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_List_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSets.list( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetsListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of all VM scale sets under a resource group. + * + * @summary Gets a list of all VM scale sets under a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_List_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSets.list( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetsListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListSkusSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListSkusSample.ts new file mode 100644 index 000000000000..f30409a2e132 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListSkusSample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. + * + * @summary Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListSkus_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsListSkusMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSets.listSkus( + resourceGroupName, + vmScaleSetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetsListSkusMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. + * + * @summary Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListSkus_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsListSkusMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSets.listSkus( + resourceGroupName, + vmScaleSetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetsListSkusMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsPerformMaintenanceSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsPerformMaintenanceSample.ts new file mode 100644 index 000000000000..da92f944c988 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsPerformMaintenanceSample.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetVMInstanceIDs, + VirtualMachineScaleSetsPerformMaintenanceOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + * + * @summary Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PerformMaintenance_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsPerformMaintenanceMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaa"; + const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaa"] + }; + const options: VirtualMachineScaleSetsPerformMaintenanceOptionalParams = { + vmInstanceIDs + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginPerformMaintenanceAndWait( + resourceGroupName, + vmScaleSetName, + options + ); + console.log(result); +} + +virtualMachineScaleSetsPerformMaintenanceMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + * + * @summary Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PerformMaintenance_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsPerformMaintenanceMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginPerformMaintenanceAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsPerformMaintenanceMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsPowerOffSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsPowerOffSample.ts new file mode 100644 index 000000000000..3bc149b4bd93 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsPowerOffSample.ts @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetVMInstanceIDs, + VirtualMachineScaleSetsPowerOffOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @summary Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PowerOff_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsPowerOffMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaa"; + const skipShutdown = true; + const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaa"] + }; + const options: VirtualMachineScaleSetsPowerOffOptionalParams = { + skipShutdown, + vmInstanceIDs + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginPowerOffAndWait( + resourceGroupName, + vmScaleSetName, + options + ); + console.log(result); +} + +virtualMachineScaleSetsPowerOffMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @summary Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PowerOff_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsPowerOffMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "a"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginPowerOffAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsPowerOffMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsRedeploySample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsRedeploySample.ts new file mode 100644 index 000000000000..157c63c1a51e --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsRedeploySample.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetVMInstanceIDs, + VirtualMachineScaleSetsRedeployOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. + * + * @summary Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Redeploy_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsRedeployMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaa"] + }; + const options: VirtualMachineScaleSetsRedeployOptionalParams = { + vmInstanceIDs + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginRedeployAndWait( + resourceGroupName, + vmScaleSetName, + options + ); + console.log(result); +} + +virtualMachineScaleSetsRedeployMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. + * + * @summary Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Redeploy_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsRedeployMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginRedeployAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsRedeployMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsReimageAllSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsReimageAllSample.ts new file mode 100644 index 000000000000..a09e9fcf54f3 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsReimageAllSample.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetVMInstanceIDs, + VirtualMachineScaleSetsReimageAllOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * + * @summary Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ReimageAll_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsReimageAllMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaa"; + const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaa"] + }; + const options: VirtualMachineScaleSetsReimageAllOptionalParams = { + vmInstanceIDs + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginReimageAllAndWait( + resourceGroupName, + vmScaleSetName, + options + ); + console.log(result); +} + +virtualMachineScaleSetsReimageAllMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * + * @summary Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ReimageAll_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsReimageAllMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginReimageAllAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsReimageAllMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsReimageSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsReimageSample.ts new file mode 100644 index 000000000000..44fd6b36938f --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsReimageSample.ts @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetReimageParameters, + VirtualMachineScaleSetsReimageOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. + * + * @summary Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Reimage_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsReimageMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmScaleSetReimageInput: VirtualMachineScaleSetReimageParameters = { + instanceIds: ["aaaaaaaaaa"], + tempDisk: true + }; + const options: VirtualMachineScaleSetsReimageOptionalParams = { + vmScaleSetReimageInput + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginReimageAndWait( + resourceGroupName, + vmScaleSetName, + options + ); + console.log(result); +} + +virtualMachineScaleSetsReimageMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. + * + * @summary Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Reimage_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsReimageMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginReimageAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsReimageMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsRestartSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsRestartSample.ts new file mode 100644 index 000000000000..9e4583010dad --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsRestartSample.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetVMInstanceIDs, + VirtualMachineScaleSetsRestartOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Restarts one or more virtual machines in a VM scale set. + * + * @summary Restarts one or more virtual machines in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Restart_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsRestartMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaa"; + const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaa"] + }; + const options: VirtualMachineScaleSetsRestartOptionalParams = { + vmInstanceIDs + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginRestartAndWait( + resourceGroupName, + vmScaleSetName, + options + ); + console.log(result); +} + +virtualMachineScaleSetsRestartMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Restarts one or more virtual machines in a VM scale set. + * + * @summary Restarts one or more virtual machines in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Restart_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsRestartMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginRestartAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsRestartMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsSetOrchestrationServiceStateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsSetOrchestrationServiceStateSample.ts new file mode 100644 index 000000000000..bd7a00685130 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsSetOrchestrationServiceStateSample.ts @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + OrchestrationServiceStateInput, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Changes ServiceState property for a given service + * + * @summary Changes ServiceState property for a given service + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_SetOrchestrationServiceState_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsSetOrchestrationServiceStateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaa"; + const parameters: OrchestrationServiceStateInput = { + action: "Resume", + serviceName: "AutomaticRepairs" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginSetOrchestrationServiceStateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +virtualMachineScaleSetsSetOrchestrationServiceStateMaximumSetGen().catch( + console.error +); + +/** + * This sample demonstrates how to Changes ServiceState property for a given service + * + * @summary Changes ServiceState property for a given service + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_SetOrchestrationServiceState_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsSetOrchestrationServiceStateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const parameters: OrchestrationServiceStateInput = { + action: "Resume", + serviceName: "AutomaticRepairs" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginSetOrchestrationServiceStateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +virtualMachineScaleSetsSetOrchestrationServiceStateMinimumSetGen().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsStartSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsStartSample.ts new file mode 100644 index 000000000000..db299ba398ba --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsStartSample.ts @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetVMInstanceIDs, + VirtualMachineScaleSetsStartOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Starts one or more virtual machines in a VM scale set. + * + * @summary Starts one or more virtual machines in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Start_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsStartMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaa"] + }; + const options: VirtualMachineScaleSetsStartOptionalParams = { vmInstanceIDs }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginStartAndWait( + resourceGroupName, + vmScaleSetName, + options + ); + console.log(result); +} + +virtualMachineScaleSetsStartMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Starts one or more virtual machines in a VM scale set. + * + * @summary Starts one or more virtual machines in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Start_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsStartMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginStartAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsStartMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsUpdateInstancesSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsUpdateInstancesSample.ts new file mode 100644 index 000000000000..efe53a6ffb4f --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsUpdateInstancesSample.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetVMInstanceRequiredIDs, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @summary Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_UpdateInstances_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsUpdateInstancesMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"] + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginUpdateInstancesAndWait( + resourceGroupName, + vmScaleSetName, + vmInstanceIDs + ); + console.log(result); +} + +virtualMachineScaleSetsUpdateInstancesMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @summary Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_UpdateInstances_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsUpdateInstancesMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"] + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginUpdateInstancesAndWait( + resourceGroupName, + vmScaleSetName, + vmInstanceIDs + ); + console.log(result); +} + +virtualMachineScaleSetsUpdateInstancesMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsUpdateSample.ts new file mode 100644 index 000000000000..dc1cdc9626b1 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsUpdateSample.ts @@ -0,0 +1,302 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update a VM scale set. + * + * @summary Update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Update_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaa"; + const parameters: VirtualMachineScaleSetUpdate = { + additionalCapabilities: { hibernationEnabled: true, ultraSSDEnabled: true }, + automaticRepairsPolicy: { enabled: true, gracePeriod: "PT30M" }, + doNotRunExtensionsOnOverprovisionedVMs: true, + identity: { + type: "SystemAssigned", + userAssignedIdentities: { key3951: {} } + }, + overprovision: true, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + promotionCode: "aaaaaaaaaa", + publisher: "microsoft-ads" + }, + proximityPlacementGroup: { + id: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot" + }, + scaleInPolicy: { forceDeletion: true, rules: ["OldestVM"] }, + singlePlacementGroup: true, + sku: { name: "DSv3-Type1", capacity: 7, tier: "aaa" }, + tags: { key246: "aaaaaaaaaaaaaaaaaaaaaaaa" }, + upgradePolicy: { + automaticOSUpgradePolicy: { + disableAutomaticRollback: true, + enableAutomaticOSUpgrade: true + }, + mode: "Manual", + rollingUpgradePolicy: { + enableCrossZoneUpgrade: true, + maxBatchInstancePercent: 49, + maxUnhealthyInstancePercent: 81, + maxUnhealthyUpgradedInstancePercent: 98, + pauseTimeBetweenBatches: "aaaaaaaaaaaaaaa", + prioritizeUnhealthyInstances: true + } + }, + virtualMachineProfile: { + billingProfile: { maxPrice: -1 }, + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: + "http://{existing-storage-account-name}.blob.core.windows.net" + } + }, + extensionProfile: { + extensionsTimeBudget: "PT1H20M", + extensions: [ + { + name: "{extension-name}", + typePropertiesType: "{extension-Type}", + autoUpgradeMinorVersion: true, + enableAutomaticUpgrade: true, + forceUpdateTag: "aaaaaaaaa", + protectedSettings: {}, + provisionAfterExtensions: ["aa"], + publisher: "{extension-Publisher}", + settings: {}, + suppressFailures: true, + typeHandlerVersion: "{handler-version}" + } + ] + }, + licenseType: "aaaaaaaaaaaa", + networkProfile: { + healthProbe: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123" + }, + networkApiVersion: "2020-11-01", + networkInterfaceConfigurations: [ + { + name: "aaaaaaaa", + deleteOption: "Delete", + dnsSettings: { dnsServers: [] }, + enableAcceleratedNetworking: true, + enableFpga: true, + enableIPForwarding: true, + id: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + ipConfigurations: [ + { + name: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + applicationGatewayBackendAddressPools: [ + { + id: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot" + } + ], + applicationSecurityGroups: [ + { + id: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot" + } + ], + id: "aaaaaaaaaaaaaaaa", + loadBalancerBackendAddressPools: [ + { + id: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot" + } + ], + loadBalancerInboundNatPools: [ + { + id: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot" + } + ], + primary: true, + privateIPAddressVersion: "IPv4", + publicIPAddressConfiguration: { + name: "a", + deleteOption: "Delete", + dnsSettings: { domainNameLabel: "aaaaaaaaaaaaaaaaaa" }, + idleTimeoutInMinutes: 3 + }, + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123" + } + } + ], + networkSecurityGroup: { + id: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot" + }, + primary: true + } + ] + }, + osProfile: { + customData: "aaaaaaaaaaaaaaaaaaaaaaaaaa", + linuxConfiguration: { + disablePasswordAuthentication: true, + patchSettings: { + assessmentMode: "ImageDefault", + patchMode: "ImageDefault" + }, + provisionVMAgent: true, + ssh: { + publicKeys: [ + { + path: "/home/{your-username}/.ssh/authorized_keys", + keyData: + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1" + } + ] + } + }, + secrets: [ + { + sourceVault: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + }, + vaultCertificates: [ + { + certificateStore: "aaaaaaaaaaaaaaaaaaaaaaaaa", + certificateUrl: "aaaaaaa" + } + ] + } + ], + windowsConfiguration: { + additionalUnattendContent: [ + { + componentName: "Microsoft-Windows-Shell-Setup", + content: "aaaaaaaaaaaaaaaaaaaa", + passName: "OobeSystem", + settingName: "AutoLogon" + } + ], + enableAutomaticUpdates: true, + patchSettings: { + assessmentMode: "ImageDefault", + enableHotpatching: true, + patchMode: "AutomaticByOS" + }, + provisionVMAgent: true, + timeZone: "aaaaaaaaaaaaaaaa", + winRM: { + listeners: [ + { certificateUrl: "aaaaaaaaaaaaaaaaaaaaaa", protocol: "Http" } + ] + } + } + }, + scheduledEventsProfile: { + terminateNotificationProfile: { + enable: true, + notBeforeTimeout: "PT10M" + } + }, + securityProfile: { + encryptionAtHost: true, + securityType: "TrustedLaunch", + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true } + }, + storageProfile: { + dataDisks: [ + { + name: "aaaaaaaaaaaaaaaaaaaaaaaaaa", + caching: "None", + createOption: "Empty", + diskIopsReadWrite: 28, + diskMBpsReadWrite: 15, + diskSizeGB: 1023, + lun: 26, + managedDisk: { + diskEncryptionSet: { id: "aaaaaaaaaaaa" }, + storageAccountType: "Standard_LRS" + }, + writeAcceleratorEnabled: true + } + ], + imageReference: { + id: "aaaaaaaaaaaaaaaaaaa", + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sharedGalleryImageId: "aaaaaa", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + diskSizeGB: 6, + image: { + uri: + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd" + }, + managedDisk: { + diskEncryptionSet: { id: "aaaaaaaaaaaa" }, + storageAccountType: "Standard_LRS" + }, + vhdContainers: ["aa"], + writeAcceleratorEnabled: true + } + }, + userData: "aaaaaaaaaaaaa" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +virtualMachineScaleSetsUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Update a VM scale set. + * + * @summary Update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Update_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaa"; + const parameters: VirtualMachineScaleSetUpdate = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +virtualMachineScaleSetsUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineSizesListSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineSizesListSample.ts new file mode 100644 index 000000000000..db96db0e8cfa --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineSizesListSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) + * + * @summary This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineSizes_List_MaximumSet_Gen.json + */ +async function virtualMachineSizesListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "-e"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineSizes.list(location)) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineSizesListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) + * + * @summary This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineSizes_List_MinimumSet_Gen.json + */ +async function virtualMachineSizesListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "._.."; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineSizes.list(location)) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineSizesListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesAssessPatchesSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesAssessPatchesSample.ts new file mode 100644 index 000000000000..f118e41f0225 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesAssessPatchesSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Assess patches on the VM. + * + * @summary Assess patches on the VM. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineAssessPatches.json + */ +async function assessPatchStateOfAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroupName"; + const vmName = "myVMName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginAssessPatchesAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +assessPatchStateOfAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesCaptureSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesCaptureSample.ts new file mode 100644 index 000000000000..57e9b6916e99 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesCaptureSample.ts @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineCaptureParameters, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. + * + * @summary Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Capture_MaximumSet_Gen.json + */ +async function virtualMachinesCaptureMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaaaaaa"; + const parameters: VirtualMachineCaptureParameters = { + destinationContainerName: "aaaaaaa", + overwriteVhds: true, + vhdPrefix: "aaaaaaaaa" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCaptureAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +virtualMachinesCaptureMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. + * + * @summary Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Capture_MinimumSet_Gen.json + */ +async function virtualMachinesCaptureMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaa"; + const parameters: VirtualMachineCaptureParameters = { + destinationContainerName: "aaaaaaa", + overwriteVhds: true, + vhdPrefix: "aaaaaaaaa" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCaptureAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +virtualMachinesCaptureMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesConvertToManagedDisksSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesConvertToManagedDisksSample.ts new file mode 100644 index 000000000000..ff28265090c8 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesConvertToManagedDisksSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * + * @summary Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ConvertToManagedDisks_MaximumSet_Gen.json + */ +async function virtualMachinesConvertToManagedDisksMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginConvertToManagedDisksAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesConvertToManagedDisksMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * + * @summary Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ConvertToManagedDisks_MinimumSet_Gen.json + */ +async function virtualMachinesConvertToManagedDisksMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginConvertToManagedDisksAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesConvertToManagedDisksMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..d53dcd71c033 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesCreateOrUpdateSample.ts @@ -0,0 +1,2456 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { VirtualMachine, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateALinuxVmWithPatchSettingAssessmentModeOfImageDefault.json + */ +async function createALinuxVMWithAPatchSettingAssessmentModeOfImageDefault() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + linuxConfiguration: { + patchSettings: { assessmentMode: "ImageDefault" }, + provisionVMAgent: true + } + }, + storageProfile: { + imageReference: { + offer: "UbuntuServer", + publisher: "Canonical", + sku: "16.04-LTS", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createALinuxVMWithAPatchSettingAssessmentModeOfImageDefault().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateALinuxVmWithPatchSettingModeOfImageDefault.json + */ +async function createALinuxVMWithAPatchSettingPatchModeOfImageDefault() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + linuxConfiguration: { + patchSettings: { patchMode: "ImageDefault" }, + provisionVMAgent: true + } + }, + storageProfile: { + imageReference: { + offer: "UbuntuServer", + publisher: "Canonical", + sku: "16.04-LTS", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createALinuxVMWithAPatchSettingPatchModeOfImageDefault().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateALinuxVmWithPatchSettingModesOfAutomaticByPlatform.json + */ +async function createALinuxVMWithAPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + linuxConfiguration: { + patchSettings: { + assessmentMode: "AutomaticByPlatform", + patchMode: "AutomaticByPlatform" + }, + provisionVMAgent: true + } + }, + storageProfile: { + imageReference: { + offer: "UbuntuServer", + publisher: "Canonical", + sku: "16.04-LTS", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createALinuxVMWithAPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmFromACommunityGalleryImage.json + */ +async function createAVMFromACommunityGalleryImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + imageReference: { + communityGalleryImageId: + "/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMFromACommunityGalleryImage().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmFromASharedGalleryImage.json + */ +async function createAVMFromASharedGalleryImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + imageReference: { + sharedGalleryImageId: + "/SharedGalleries/sharedGalleryName/Images/sharedGalleryImageName/Versions/sharedGalleryImageVersionName" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMFromASharedGalleryImage().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAVmWithHibernationEnabled.json + */ +async function createAVMWithHibernationEnabled() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "{vm-name}"; + const parameters: VirtualMachine = { + additionalCapabilities: { hibernationEnabled: true }, + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: + "http://{existing-storage-account-name}.blob.core.windows.net" + } + }, + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + location: "eastus2euap", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "{vm-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2019-Datacenter", + version: "latest" + }, + osDisk: { + name: "vmOSdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithHibernationEnabled().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithUefiSettings.json + */ +async function createAVMWithUefiSettingsOfSecureBootAndVTpm() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + securityProfile: { + securityType: "TrustedLaunch", + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true } + }, + storageProfile: { + imageReference: { + offer: "windowsserver-gen2preview-preview", + publisher: "MicrosoftWindowsServer", + sku: "windows10-tvm", + version: "18363.592.2001092016" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadOnly", + createOption: "FromImage", + managedDisk: { storageAccountType: "StandardSSD_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithUefiSettingsOfSecureBootAndVTpm().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAVmWithUserData.json + */ +async function createAVMWithUserData() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "{vm-name}"; + const parameters: VirtualMachine = { + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: + "http://{existing-storage-account-name}.blob.core.windows.net" + } + }, + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "{vm-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "vmOSdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + }, + userData: "RXhhbXBsZSBVc2VyRGF0YQ==" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithUserData().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAVmWithVMSizeProperties.json + */ +async function createAVMWithVMSizeProperties() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: + "http://{existing-storage-account-name}.blob.core.windows.net" + } + }, + hardwareProfile: { + vmSize: "Standard_D4_v3", + vmSizeProperties: { vCPUsAvailable: 1, vCPUsPerCore: 1 } + }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + }, + userData: "U29tZSBDdXN0b20gRGF0YQ==" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithVMSizeProperties().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithNetworkInterfaceConfiguration.json + */ +async function createAVMWithNetworkInterfaceConfiguration() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkApiVersion: "2020-11-01", + networkInterfaceConfigurations: [ + { + name: "{nic-config-name}", + deleteOption: "Delete", + ipConfigurations: [ + { + name: "{ip-config-name}", + primary: true, + publicIPAddressConfiguration: { + name: "{publicIP-config-name}", + deleteOption: "Detach", + publicIPAllocationMethod: "Static", + sku: { name: "Basic", tier: "Global" } + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithNetworkInterfaceConfiguration().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithSecurityTypeConfidentialVMWithCustomerManagedKeys.json + */ +async function createAVMWithSecurityTypeConfidentialVMWithCustomerManagedKeys() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_DC2as_v5" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + securityProfile: { + securityType: "ConfidentialVM", + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true } + }, + storageProfile: { + imageReference: { + offer: "2019-datacenter-cvm", + publisher: "MicrosoftWindowsServer", + sku: "windows-cvm", + version: "17763.2183.2109130127" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadOnly", + createOption: "FromImage", + managedDisk: { + securityProfile: { + diskEncryptionSet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}" + }, + securityEncryptionType: "DiskWithVMGuestState" + }, + storageAccountType: "StandardSSD_LRS" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithSecurityTypeConfidentialVMWithCustomerManagedKeys().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithSecurityTypeConfidentialVM.json + */ +async function createAVMWithSecurityTypeConfidentialVMWithPlatformManagedKeys() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_DC2as_v5" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + securityProfile: { + securityType: "ConfidentialVM", + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true } + }, + storageProfile: { + imageReference: { + offer: "2019-datacenter-cvm", + publisher: "MicrosoftWindowsServer", + sku: "windows-cvm", + version: "17763.2183.2109130127" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadOnly", + createOption: "FromImage", + managedDisk: { + securityProfile: { securityEncryptionType: "DiskWithVMGuestState" }, + storageAccountType: "StandardSSD_LRS" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithSecurityTypeConfidentialVMWithPlatformManagedKeys().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAWindowsVmWithPatchSettingAssessmentModeOfImageDefault.json + */ +async function createAWindowsVMWithAPatchSettingAssessmentModeOfImageDefault() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + windowsConfiguration: { + enableAutomaticUpdates: true, + patchSettings: { assessmentMode: "ImageDefault" }, + provisionVMAgent: true + } + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAWindowsVMWithAPatchSettingAssessmentModeOfImageDefault().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAWindowsVmWithPatchSettingModeOfAutomaticByOS.json + */ +async function createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByOS() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + windowsConfiguration: { + enableAutomaticUpdates: true, + patchSettings: { patchMode: "AutomaticByOS" }, + provisionVMAgent: true + } + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByOS().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAWindowsVmWithPatchSettingModeOfAutomaticByPlatformAndEnableHotPatchingTrue.json + */ +async function createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + windowsConfiguration: { + enableAutomaticUpdates: true, + patchSettings: { + enableHotpatching: true, + patchMode: "AutomaticByPlatform" + }, + provisionVMAgent: true + } + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAWindowsVmWithPatchSettingModeOfManual.json + */ +async function createAWindowsVMWithAPatchSettingPatchModeOfManual() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + windowsConfiguration: { + enableAutomaticUpdates: true, + patchSettings: { patchMode: "Manual" }, + provisionVMAgent: true + } + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAWindowsVMWithAPatchSettingPatchModeOfManual().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAWindowsVmWithPatchSettingModesOfAutomaticByPlatform.json + */ +async function createAWindowsVMWithPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + windowsConfiguration: { + enableAutomaticUpdates: true, + patchSettings: { + assessmentMode: "AutomaticByPlatform", + patchMode: "AutomaticByPlatform" + }, + provisionVMAgent: true + } + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAWindowsVMWithPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateACustomImageVmFromAnUnmanagedGeneralizedOsImage.json + */ +async function createACustomImageVMFromAnUnmanagedGeneralizedOSImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "{vm-name}"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + image: { + uri: + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd" + }, + osType: "Windows", + vhd: { + uri: + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createACustomImageVMFromAnUnmanagedGeneralizedOSImage().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAPlatformImageVmWithUnmanagedOsAndDataDisks.json + */ +async function createAPlatformImageVMWithUnmanagedOSAndDataDisks() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "{vm-name}"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D2_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + dataDisks: [ + { + createOption: "Empty", + diskSizeGB: 1023, + lun: 0, + vhd: { + uri: + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk0.vhd" + } + }, + { + createOption: "Empty", + diskSizeGB: 1023, + lun: 1, + vhd: { + uri: + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk1.vhd" + } + } + ], + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + vhd: { + uri: + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAPlatformImageVMWithUnmanagedOSAndDataDisks().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmFromACustomImage.json + */ +async function createAVMFromACustomImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + imageReference: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMFromACustomImage().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmFromAGeneralizedSharedImage.json + */ +async function createAVMFromAGeneralizedSharedImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + imageReference: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMFromAGeneralizedSharedImage().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmFromASpecializedSharedImage.json + */ +async function createAVMFromASpecializedSharedImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + storageProfile: { + imageReference: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMFromASpecializedSharedImage().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain.json + */ +async function createAVMInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + platformFaultDomain: 1, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + }, + virtualMachineScaleSet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{existing-flex-vmss-name-with-platformFaultDomainCount-greater-than-1}" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmInAnAvailabilitySet.json + */ +async function createAVMInAnAvailabilitySet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + availabilitySet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/{existing-availability-set-name}" + }, + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMInAnAvailabilitySet().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithApplicationProfile.json + */ +async function createAVMWithApplicationProfile() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + applicationProfile: { + galleryApplications: [ + { + configurationReference: + "https://mystorageaccount.blob.core.windows.net/configurations/settings.config", + order: 1, + packageReferenceId: + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0", + tags: "myTag1" + }, + { + packageReferenceId: + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1" + } + ] + }, + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + imageReference: { + offer: "{image_offer}", + publisher: "{image_publisher}", + sku: "{image_sku}", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithApplicationProfile().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithDiskEncryptionSetResource.json + */ +async function createAVMWithDiskEncryptionSetResourceIdInTheOSDiskAndDataDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + dataDisks: [ + { + caching: "ReadWrite", + createOption: "Empty", + diskSizeGB: 1023, + lun: 0, + managedDisk: { + diskEncryptionSet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}" + }, + storageAccountType: "Standard_LRS" + } + }, + { + caching: "ReadWrite", + createOption: "Attach", + diskSizeGB: 1023, + lun: 1, + managedDisk: { + diskEncryptionSet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}" + }, + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-managed-disk-name}", + storageAccountType: "Standard_LRS" + } + } + ], + imageReference: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { + diskEncryptionSet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}" + }, + storageAccountType: "Standard_LRS" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithDiskEncryptionSetResourceIdInTheOSDiskAndDataDisk().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithEncryptionAtHost.json + */ +async function createAVMWithHostEncryptionUsingEncryptionAtHostProperty() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_DS1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads" + }, + securityProfile: { encryptionAtHost: true }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadOnly", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithHostEncryptionUsingEncryptionAtHostProperty().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithScheduledEventsProfile.json + */ +async function createAVMWithScheduledEventsProfile() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: + "http://{existing-storage-account-name}.blob.core.windows.net" + } + }, + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + scheduledEventsProfile: { + terminateNotificationProfile: { enable: true, notBeforeTimeout: "PT10M" } + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithScheduledEventsProfile().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithAMarketplaceImagePlan.json + */ +async function createAVMWithAMarketplaceImagePlan() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads" + }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithAMarketplaceImagePlan().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithExtensionsTimeBudget.json + */ +async function createAVMWithAnExtensionsTimeBudget() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: + "http://{existing-storage-account-name}.blob.core.windows.net" + } + }, + extensionsTimeBudget: "PT30M", + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithAnExtensionsTimeBudget().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithBootDiagnostics.json + */ +async function createAVMWithBootDiagnostics() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: + "http://{existing-storage-account-name}.blob.core.windows.net" + } + }, + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithBootDiagnostics().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithEmptyDataDisks.json + */ +async function createAVMWithEmptyDataDisks() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D2_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + dataDisks: [ + { createOption: "Empty", diskSizeGB: 1023, lun: 0 }, + { createOption: "Empty", diskSizeGB: 1023, lun: 1 } + ], + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithEmptyDataDisks().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithADiffOsDiskUsingDiffDiskPlacementAsCacheDisk.json + */ +async function createAVMWithEphemeralOSDiskProvisioningInCacheDiskUsingPlacementProperty() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_DS1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads" + }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadOnly", + createOption: "FromImage", + diffDiskSettings: { option: "Local", placement: "CacheDisk" }, + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithEphemeralOSDiskProvisioningInCacheDiskUsingPlacementProperty().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithADiffOsDiskUsingDiffDiskPlacementAsResourceDisk.json + */ +async function createAVMWithEphemeralOSDiskProvisioningInResourceDiskUsingPlacementProperty() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_DS1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads" + }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadOnly", + createOption: "FromImage", + diffDiskSettings: { option: "Local", placement: "ResourceDisk" }, + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithEphemeralOSDiskProvisioningInResourceDiskUsingPlacementProperty().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithADiffOsDisk.json + */ +async function createAVMWithEphemeralOSDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_DS1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads" + }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadOnly", + createOption: "FromImage", + diffDiskSettings: { option: "Local" }, + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithEphemeralOSDisk().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithManagedBootDiagnostics.json + */ +async function createAVMWithManagedBootDiagnostics() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + diagnosticsProfile: { bootDiagnostics: { enabled: true } }, + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithManagedBootDiagnostics().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithPasswordAuthentication.json + */ +async function createAVMWithPasswordAuthentication() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithPasswordAuthentication().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithPremiumStorage.json + */ +async function createAVMWithPremiumStorage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithPremiumStorage().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithSshAuthentication.json + */ +async function createAVMWithSshAuthentication() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + linuxConfiguration: { + disablePasswordAuthentication: true, + ssh: { + publicKeys: [ + { + path: "/home/{your-username}/.ssh/authorized_keys", + keyData: + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1" + } + ] + } + } + }, + storageProfile: { + imageReference: { + offer: "{image_offer}", + publisher: "{image_publisher}", + sku: "{image_sku}", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithSshAuthentication().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAVmWithCapacityReservation.json + */ +async function createOrUpdateAVMWithCapacityReservation() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + capacityReservation: { + capacityReservationGroup: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}" + } + }, + hardwareProfile: { vmSize: "Standard_DS1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads" + }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadOnly", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createOrUpdateAVMWithCapacityReservation().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesDeallocateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesDeallocateSample.ts new file mode 100644 index 000000000000..b777f113cd58 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesDeallocateSample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachinesDeallocateOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * + * @summary Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Deallocate_MaximumSet_Gen.json + */ +async function virtualMachinesDeallocateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaa"; + const hibernate = true; + const options: VirtualMachinesDeallocateOptionalParams = { hibernate }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginDeallocateAndWait( + resourceGroupName, + vmName, + options + ); + console.log(result); +} + +virtualMachinesDeallocateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * + * @summary Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Deallocate_MinimumSet_Gen.json + */ +async function virtualMachinesDeallocateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginDeallocateAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesDeallocateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesDeleteSample.ts new file mode 100644 index 000000000000..de69b3160191 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesDeleteSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachinesDeleteOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete a virtual machine. + * + * @summary The operation to delete a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ForceDeleteVirtualMachine.json + */ +async function forceDeleteAVM() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const forceDeletion = true; + const options: VirtualMachinesDeleteOptionalParams = { forceDeletion }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginDeleteAndWait( + resourceGroupName, + vmName, + options + ); + console.log(result); +} + +forceDeleteAVM().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesGeneralizeSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesGeneralizeSample.ts new file mode 100644 index 000000000000..c1462ef25e6c --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesGeneralizeSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation.
For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource).
For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * + * @summary Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation.
For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource).
For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GeneralizeVirtualMachine.json + */ +async function generalizeAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVMName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.generalize( + resourceGroupName, + vmName + ); + console.log(result); +} + +generalizeAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesGetSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesGetSample.ts new file mode 100644 index 000000000000..c5238b229396 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesGetSample.ts @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Retrieves information about the model view or the instance view of a virtual machine. + * + * @summary Retrieves information about the model view or the instance view of a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachine.json + */ +async function getAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.get(resourceGroupName, vmName); + console.log(result); +} + +getAVirtualMachine().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about the model view or the instance view of a virtual machine. + * + * @summary Retrieves information about the model view or the instance view of a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineAutoPlacedOnDedicatedHostGroup.json + */ +async function getAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.get(resourceGroupName, vmName); + console.log(result); +} + +getAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement().catch( + console.error +); + +/** + * This sample demonstrates how to Retrieves information about the model view or the instance view of a virtual machine. + * + * @summary Retrieves information about the model view or the instance view of a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineWithVMSizeProperties.json + */ +async function getAVirtualMachineWithVMSizeProperties() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.get(resourceGroupName, vmName); + console.log(result); +} + +getAVirtualMachineWithVMSizeProperties().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesInstallPatchesSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesInstallPatchesSample.ts new file mode 100644 index 000000000000..53cbea757362 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesInstallPatchesSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineInstallPatchesParameters, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Installs patches on the VM. + * + * @summary Installs patches on the VM. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineInstallPatches.json + */ +async function installPatchStateOfAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroupName"; + const vmName = "myVMName"; + const installPatchesInput: VirtualMachineInstallPatchesParameters = { + maximumDuration: "PT4H", + rebootSetting: "IfRequired", + windowsParameters: { + classificationsToInclude: ["Critical", "Security"], + maxPatchPublishDate: new Date("2020-11-19T02:36:43.0539904+00:00") + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginInstallPatchesAndWait( + resourceGroupName, + vmName, + installPatchesInput + ); + console.log(result); +} + +installPatchStateOfAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesInstanceViewSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesInstanceViewSample.ts new file mode 100644 index 000000000000..2b35f68928e5 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesInstanceViewSample.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Retrieves information about the run-time state of a virtual machine. + * + * @summary Retrieves information about the run-time state of a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineInstanceView.json + */ +async function getVirtualMachineInstanceView() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.instanceView( + resourceGroupName, + vmName + ); + console.log(result); +} + +getVirtualMachineInstanceView().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about the run-time state of a virtual machine. + * + * @summary Retrieves information about the run-time state of a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineInstanceViewAutoPlacedOnDedicatedHostGroup.json + */ +async function getInstanceViewOfAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.instanceView( + resourceGroupName, + vmName + ); + console.log(result); +} + +getInstanceViewOfAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesListAllSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesListAllSample.ts new file mode 100644 index 000000000000..04df95761858 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesListAllSample.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachinesListAllOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. + * + * @summary Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ListAll_MaximumSet_Gen.json + */ +async function virtualMachinesListAllMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const statusOnly = "aaaaaa"; + const filter = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const options: VirtualMachinesListAllOptionalParams = { statusOnly, filter }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachines.listAll(options)) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachinesListAllMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. + * + * @summary Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ListAll_MinimumSet_Gen.json + */ +async function virtualMachinesListAllMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachines.listAll()) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachinesListAllMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesListAvailableSizesSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesListAvailableSizesSample.ts new file mode 100644 index 000000000000..5140c7ecc1cb --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesListAvailableSizesSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * + * @summary Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListAvailableVmSizes_VirtualMachines.json + */ +async function listsAllAvailableVirtualMachineSizesToWhichTheSpecifiedVirtualMachineCanBeResized() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVmName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachines.listAvailableSizes( + resourceGroupName, + vmName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listsAllAvailableVirtualMachineSizesToWhichTheSpecifiedVirtualMachineCanBeResized().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesListByLocationSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesListByLocationSample.ts new file mode 100644 index 000000000000..06c7c707fda6 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesListByLocationSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets all the virtual machines under the specified subscription for the specified location. + * + * @summary Gets all the virtual machines under the specified subscription for the specified location. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListVirtualMachinesInASubscriptionByLocation.json + */ +async function listsAllTheVirtualMachinesUnderTheSpecifiedSubscriptionForTheSpecifiedLocation() { + const subscriptionId = "{subscriptionId}"; + const location = "eastus"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachines.listByLocation(location)) { + resArray.push(item); + } + console.log(resArray); +} + +listsAllTheVirtualMachinesUnderTheSpecifiedSubscriptionForTheSpecifiedLocation().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesListSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesListSample.ts new file mode 100644 index 000000000000..b529ce24e8da --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesListSample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachinesListOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. + * + * @summary Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_List_MaximumSet_Gen.json + */ +async function virtualMachinesListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const filter = "aaaaaaaaaaaaaaaaaaaaaaa"; + const options: VirtualMachinesListOptionalParams = { filter }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachines.list( + resourceGroupName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachinesListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. + * + * @summary Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_List_MinimumSet_Gen.json + */ +async function virtualMachinesListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachines.list(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachinesListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesPerformMaintenanceSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesPerformMaintenanceSample.ts new file mode 100644 index 000000000000..6f09d1f9ac09 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesPerformMaintenanceSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to perform maintenance on a virtual machine. + * + * @summary The operation to perform maintenance on a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PerformMaintenance_MaximumSet_Gen.json + */ +async function virtualMachinesPerformMaintenanceMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginPerformMaintenanceAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesPerformMaintenanceMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to perform maintenance on a virtual machine. + * + * @summary The operation to perform maintenance on a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PerformMaintenance_MinimumSet_Gen.json + */ +async function virtualMachinesPerformMaintenanceMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginPerformMaintenanceAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesPerformMaintenanceMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesPowerOffSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesPowerOffSample.ts new file mode 100644 index 000000000000..84a514159ecd --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesPowerOffSample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachinesPowerOffOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. + * + * @summary The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PowerOff_MaximumSet_Gen.json + */ +async function virtualMachinesPowerOffMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const skipShutdown = true; + const options: VirtualMachinesPowerOffOptionalParams = { skipShutdown }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginPowerOffAndWait( + resourceGroupName, + vmName, + options + ); + console.log(result); +} + +virtualMachinesPowerOffMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. + * + * @summary The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PowerOff_MinimumSet_Gen.json + */ +async function virtualMachinesPowerOffMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginPowerOffAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesPowerOffMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesReapplySample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesReapplySample.ts new file mode 100644 index 000000000000..2c82c1c07314 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesReapplySample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to reapply a virtual machine's state. + * + * @summary The operation to reapply a virtual machine's state. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ReapplyVirtualMachine.json + */ +async function reapplyTheStateOfAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ResourceGroup"; + const vmName = "VMName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginReapplyAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +reapplyTheStateOfAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesRedeploySample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesRedeploySample.ts new file mode 100644 index 000000000000..77ef28ff2edc --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesRedeploySample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @summary Shuts down the virtual machine, moves it to a new node, and powers it back on. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Redeploy_MaximumSet_Gen.json + */ +async function virtualMachinesRedeployMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "a"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginRedeployAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesRedeployMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @summary Shuts down the virtual machine, moves it to a new node, and powers it back on. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Redeploy_MinimumSet_Gen.json + */ +async function virtualMachinesRedeployMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginRedeployAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesRedeployMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesReimageSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesReimageSample.ts new file mode 100644 index 000000000000..db8b1595b25d --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesReimageSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineReimageParameters, + VirtualMachinesReimageOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @summary Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ReimageVirtualMachine.json + */ +async function reimageAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVMName"; + const parameters: VirtualMachineReimageParameters = { tempDisk: true }; + const options: VirtualMachinesReimageOptionalParams = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginReimageAndWait( + resourceGroupName, + vmName, + options + ); + console.log(result); +} + +reimageAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesRestartSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesRestartSample.ts new file mode 100644 index 000000000000..d8ff5884d744 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesRestartSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to restart a virtual machine. + * + * @summary The operation to restart a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Restart_MaximumSet_Gen.json + */ +async function virtualMachinesRestartMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginRestartAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesRestartMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to restart a virtual machine. + * + * @summary The operation to restart a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Restart_MinimumSet_Gen.json + */ +async function virtualMachinesRestartMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginRestartAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesRestartMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesRetrieveBootDiagnosticsDataSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesRetrieveBootDiagnosticsDataSample.ts new file mode 100644 index 000000000000..04f569c8f448 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesRetrieveBootDiagnosticsDataSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachinesRetrieveBootDiagnosticsDataOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + * + * @summary The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RetrieveBootDiagnosticsDataVirtualMachine.json + */ +async function retrieveBootDiagnosticsDataOfAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ResourceGroup"; + const vmName = "VMName"; + const sasUriExpirationTimeInMinutes = 60; + const options: VirtualMachinesRetrieveBootDiagnosticsDataOptionalParams = { + sasUriExpirationTimeInMinutes + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.retrieveBootDiagnosticsData( + resourceGroupName, + vmName, + options + ); + console.log(result); +} + +retrieveBootDiagnosticsDataOfAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesRunCommandSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesRunCommandSample.ts new file mode 100644 index 000000000000..a63a90b43b3b --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesRunCommandSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { RunCommandInput, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Run command on the VM. + * + * @summary Run command on the VM. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VirtualMachineRunCommand.json + */ +async function virtualMachineRunCommand() { + const subscriptionId = "24fb23e3-6ba3-41f0-9b6e-e41131d5d61e"; + const resourceGroupName = "crptestar98131"; + const vmName = "vm3036"; + const parameters: RunCommandInput = { commandId: "RunPowerShellScript" }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginRunCommandAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +virtualMachineRunCommand().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesSimulateEvictionSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesSimulateEvictionSample.ts new file mode 100644 index 000000000000..a9221dc440ef --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesSimulateEvictionSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to simulate the eviction of spot virtual machine. + * + * @summary The operation to simulate the eviction of spot virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SimulateEvictionOfVM.json + */ +async function simulateEvictionAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ResourceGroup"; + const vmName = "VMName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.simulateEviction( + resourceGroupName, + vmName + ); + console.log(result); +} + +simulateEvictionAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesStartSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesStartSample.ts new file mode 100644 index 000000000000..e5384fe4470b --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesStartSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to start a virtual machine. + * + * @summary The operation to start a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Start_MaximumSet_Gen.json + */ +async function virtualMachinesStartMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginStartAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesStartMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to start a virtual machine. + * + * @summary The operation to start a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Start_MinimumSet_Gen.json + */ +async function virtualMachinesStartMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginStartAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesStartMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesUpdateSample.ts new file mode 100644 index 000000000000..1948b5afbf6f --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesUpdateSample.ts @@ -0,0 +1,135 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update a virtual machine. + * + * @summary The operation to update a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateVMDetachDataDiskUsingToBeDetachedProperty.json + */ +async function updateAVMByDetachingDataDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachineUpdate = { + hardwareProfile: { vmSize: "Standard_D2_v2" }, + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + dataDisks: [ + { createOption: "Empty", diskSizeGB: 1023, lun: 0, toBeDetached: true }, + { createOption: "Empty", diskSizeGB: 1023, lun: 1, toBeDetached: false } + ], + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +updateAVMByDetachingDataDisk().catch(console.error); + +/** + * This sample demonstrates how to The operation to update a virtual machine. + * + * @summary The operation to update a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateVMForceDetachDataDisk.json + */ +async function updateAVMByForceDetachingDataDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachineUpdate = { + hardwareProfile: { vmSize: "Standard_D2_v2" }, + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + dataDisks: [ + { + createOption: "Empty", + detachOption: "ForceDetach", + diskSizeGB: 1023, + lun: 0, + toBeDetached: true + }, + { createOption: "Empty", diskSizeGB: 1023, lun: 1, toBeDetached: false } + ], + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +updateAVMByForceDetachingDataDisk().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/README.md b/sdk/compute/arm-compute/samples/v17/javascript/README.md index e775ba0517c9..a6d31bf69109 100644 --- a/sdk/compute/arm-compute/samples/v17/javascript/README.md +++ b/sdk/compute/arm-compute/samples/v17/javascript/README.md @@ -7,24 +7,74 @@ These sample programs show how to use the JavaScript client libraries for in som | [addSharingIdToTheSharingProfileOfAGallery.js][addsharingidtothesharingprofileofagallery] | Update sharing profile of a gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/AddToSharingProfileInAGallery.json | | [approveAPrivateEndpointConnectionUnderADiskAccessResource.js][approveaprivateendpointconnectionunderadiskaccessresource] | Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/ApprovePrivateEndpointConnection.json | | [assessPatchStateOfAVirtualMachine.js][assesspatchstateofavirtualmachine] | Assess patches on the VM. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineAssessPatches.json | +| [availabilitySetsCreateOrUpdateSample.js][availabilitysetscreateorupdatesample] | Create or update an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnAvailabilitySet.json | | [availabilitySetsDeleteMaximumSetGen.js][availabilitysetsdeletemaximumsetgen] | Delete an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Delete_MaximumSet_Gen.json | | [availabilitySetsDeleteMinimumSetGen.js][availabilitysetsdeleteminimumsetgen] | Delete an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Delete_MinimumSet_Gen.json | +| [availabilitySetsDeleteSample.js][availabilitysetsdeletesample] | Delete an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Delete_MaximumSet_Gen.json | | [availabilitySetsGetMaximumSetGen.js][availabilitysetsgetmaximumsetgen] | Retrieves information about an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Get_MaximumSet_Gen.json | | [availabilitySetsGetMinimumSetGen.js][availabilitysetsgetminimumsetgen] | Retrieves information about an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Get_MinimumSet_Gen.json | +| [availabilitySetsGetSample.js][availabilitysetsgetsample] | Retrieves information about an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Get_MaximumSet_Gen.json | | [availabilitySetsListAvailableSizesMaximumSetGen.js][availabilitysetslistavailablesizesmaximumsetgen] | Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_ListAvailableSizes_MaximumSet_Gen.json | | [availabilitySetsListAvailableSizesMinimumSetGen.js][availabilitysetslistavailablesizesminimumsetgen] | Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_ListAvailableSizes_MinimumSet_Gen.json | +| [availabilitySetsListAvailableSizesSample.js][availabilitysetslistavailablesizessample] | Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_ListAvailableSizes_MaximumSet_Gen.json | +| [availabilitySetsListBySubscriptionSample.js][availabilitysetslistbysubscriptionsample] | Lists all availability sets in a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListAvailabilitySetsInASubscription.json | | [availabilitySetsListMaximumSetGen.js][availabilitysetslistmaximumsetgen] | Lists all availability sets in a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_List_MaximumSet_Gen.json | | [availabilitySetsListMinimumSetGen.js][availabilitysetslistminimumsetgen] | Lists all availability sets in a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_List_MinimumSet_Gen.json | +| [availabilitySetsListSample.js][availabilitysetslistsample] | Lists all availability sets in a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_List_MaximumSet_Gen.json | | [availabilitySetsUpdateMaximumSetGen.js][availabilitysetsupdatemaximumsetgen] | Update an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Update_MaximumSet_Gen.json | | [availabilitySetsUpdateMinimumSetGen.js][availabilitysetsupdateminimumsetgen] | Update an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Update_MinimumSet_Gen.json | +| [availabilitySetsUpdateSample.js][availabilitysetsupdatesample] | Update an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Update_MaximumSet_Gen.json | +| [capacityReservationGroupsCreateOrUpdateSample.js][capacityreservationgroupscreateorupdatesample] | The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags may be modified. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateACapacityReservationGroup.json | | [capacityReservationGroupsDeleteMaximumSetGen.js][capacityreservationgroupsdeletemaximumsetgen] | The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Delete_MaximumSet_Gen.json | | [capacityReservationGroupsDeleteMinimumSetGen.js][capacityreservationgroupsdeleteminimumsetgen] | The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Delete_MinimumSet_Gen.json | +| [capacityReservationGroupsDeleteSample.js][capacityreservationgroupsdeletesample] | The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Delete_MaximumSet_Gen.json | +| [capacityReservationGroupsGetSample.js][capacityreservationgroupsgetsample] | The operation that retrieves information about a capacity reservation group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetACapacityReservationGroup.json | +| [capacityReservationGroupsListByResourceGroupSample.js][capacityreservationgroupslistbyresourcegroupsample] | Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListCapacityReservationGroupsInResourceGroup.json | +| [capacityReservationGroupsListBySubscriptionSample.js][capacityreservationgroupslistbysubscriptionsample] | Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListCapacityReservationGroupsInSubscription.json | | [capacityReservationGroupsUpdateMaximumSetGen.js][capacityreservationgroupsupdatemaximumsetgen] | The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may be modified. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Update_MaximumSet_Gen.json | | [capacityReservationGroupsUpdateMinimumSetGen.js][capacityreservationgroupsupdateminimumsetgen] | The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may be modified. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Update_MinimumSet_Gen.json | +| [capacityReservationGroupsUpdateSample.js][capacityreservationgroupsupdatesample] | The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may be modified. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Update_MaximumSet_Gen.json | +| [capacityReservationsCreateOrUpdateSample.js][capacityreservationscreateorupdatesample] | The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateACapacityReservation.json | | [capacityReservationsDeleteMaximumSetGen.js][capacityreservationsdeletemaximumsetgen] | The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Delete_MaximumSet_Gen.json | | [capacityReservationsDeleteMinimumSetGen.js][capacityreservationsdeleteminimumsetgen] | The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Delete_MinimumSet_Gen.json | +| [capacityReservationsDeleteSample.js][capacityreservationsdeletesample] | The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Delete_MaximumSet_Gen.json | +| [capacityReservationsGetSample.js][capacityreservationsgetsample] | The operation that retrieves information about the capacity reservation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetACapacityReservation.json | +| [capacityReservationsListByCapacityReservationGroupSample.js][capacityreservationslistbycapacityreservationgroupsample] | Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListCapacityReservationsInReservationGroup.json | | [capacityReservationsUpdateMaximumSetGen.js][capacityreservationsupdatemaximumsetgen] | The operation to update a capacity reservation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Update_MaximumSet_Gen.json | | [capacityReservationsUpdateMinimumSetGen.js][capacityreservationsupdateminimumsetgen] | The operation to update a capacity reservation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Update_MinimumSet_Gen.json | +| [capacityReservationsUpdateSample.js][capacityreservationsupdatesample] | The operation to update a capacity reservation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Update_MaximumSet_Gen.json | +| [cloudServiceOperatingSystemsGetOSFamilySample.js][cloudserviceoperatingsystemsgetosfamilysample] | Gets properties of a guest operating system family that can be specified in the XML service configuration (.cscfg) for a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceOSFamily.json | +| [cloudServiceOperatingSystemsGetOSVersionSample.js][cloudserviceoperatingsystemsgetosversionsample] | Gets properties of a guest operating system version that can be specified in the XML service configuration (.cscfg) for a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceOSVersion.json | +| [cloudServiceOperatingSystemsListOSFamiliesSample.js][cloudserviceoperatingsystemslistosfamiliessample] | Gets a list of all guest operating system families available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this till nextLink is null to fetch all the OS Families. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceOSFamilies.json | +| [cloudServiceOperatingSystemsListOSVersionsSample.js][cloudserviceoperatingsystemslistosversionssample] | Gets a list of all guest operating system versions available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this till nextLink is null to fetch all the OS versions. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceOSVersions.json | +| [cloudServiceRoleInstancesDeleteSample.js][cloudserviceroleinstancesdeletesample] | Deletes a role instance from a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/DeleteCloudServiceRoleInstance.json | +| [cloudServiceRoleInstancesGetInstanceViewSample.js][cloudserviceroleinstancesgetinstanceviewsample] | Retrieves information about the run-time state of a role instance in a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetInstanceViewOfCloudServiceRoleInstance.json | +| [cloudServiceRoleInstancesGetSample.js][cloudserviceroleinstancesgetsample] | Gets a role instance from a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceRoleInstance.json | +| [cloudServiceRoleInstancesListSample.js][cloudserviceroleinstanceslistsample] | Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next page of role instances. Do this till nextLink is null to fetch all the role instances. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceRolesInstances.json | +| [cloudServiceRoleInstancesRebuildSample.js][cloudserviceroleinstancesrebuildsample] | The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instance. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RebuildCloudServiceRoleInstance.json | +| [cloudServiceRoleInstancesReimageSample.js][cloudserviceroleinstancesreimagesample] | The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ReimageCloudServiceRoleInstance.json | +| [cloudServiceRoleInstancesRestartSample.js][cloudserviceroleinstancesrestartsample] | The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RestartCloudServiceRoleInstance.json | +| [cloudServiceRolesGetSample.js][cloudservicerolesgetsample] | Gets a role from a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceRole.json | +| [cloudServiceRolesListSample.js][cloudserviceroleslistsample] | Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. Do this till nextLink is null to fetch all the roles. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceRoles.json | +| [cloudServicesCreateOrUpdateSample.js][cloudservicescreateorupdatesample] | Create or update a cloud service. Please note some properties can be set only during cloud service creation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/CreateCloudServiceWithMultiRole.json | +| [cloudServicesDeleteInstancesSample.js][cloudservicesdeleteinstancessample] | Deletes role instances in a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/DeleteCloudServiceRoleInstances.json | +| [cloudServicesDeleteSample.js][cloudservicesdeletesample] | Deletes a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/DeleteCloudService.json | +| [cloudServicesGetInstanceViewSample.js][cloudservicesgetinstanceviewsample] | Gets the status of a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceInstanceViewWithMultiRole.json | +| [cloudServicesGetSample.js][cloudservicesgetsample] | Display information about a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceWithMultiRoleAndRDP.json | +| [cloudServicesListAllSample.js][cloudserviceslistallsample] | Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServicesInSubscription.json | +| [cloudServicesListSample.js][cloudserviceslistsample] | Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServicesInResourceGroup.json | +| [cloudServicesPowerOffSample.js][cloudservicespoweroffsample] | Power off the cloud service. Note that resources are still attached and you are getting charged for the resources. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/PowerOffCloudService.json | +| [cloudServicesRebuildSample.js][cloudservicesrebuildsample] | Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instances. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RebuildCloudServiceRoleInstances.json | +| [cloudServicesReimageSample.js][cloudservicesreimagesample] | Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ReimageCloudServiceRoleInstances.json | +| [cloudServicesRestartSample.js][cloudservicesrestartsample] | Restarts one or more role instances in a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RestartCloudServiceRoleInstances.json | +| [cloudServicesStartSample.js][cloudservicesstartsample] | Starts the cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/StartCloudService.json | +| [cloudServicesUpdateDomainGetUpdateDomainSample.js][cloudservicesupdatedomaingetupdatedomainsample] | Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page of update domains. Do this till nextLink is null to fetch all the update domains. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceUpdateDomain.json | +| [cloudServicesUpdateDomainListUpdateDomainsSample.js][cloudservicesupdatedomainlistupdatedomainssample] | Gets a list of all update domains in a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceUpdateDomains.json | +| [cloudServicesUpdateDomainWalkUpdateDomainSample.js][cloudservicesupdatedomainwalkupdatedomainsample] | Updates the role instances in the specified update domain. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/UpdateCloudServiceUpdateDomain.json | +| [cloudServicesUpdateSample.js][cloudservicesupdatesample] | Update a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/UpdateCloudServiceToIncludeTags.json | +| [communityGalleriesGetSample.js][communitygalleriesgetsample] | Get a community gallery by gallery public name. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/communityGallery/GetACommunityGallery.json | +| [communityGalleryImageVersionsGetSample.js][communitygalleryimageversionsgetsample] | Get a community gallery image version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/communityGallery/GetACommunityGalleryImageVersion.json | +| [communityGalleryImagesGetSample.js][communitygalleryimagesgetsample] | Get a community gallery image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/communityGallery/GetACommunityGalleryImage.json | | [copyARestorePointToADifferentRegion.js][copyarestorepointtoadifferentregion] | The operation to create the restore point. Updating properties of an existing restore point is not allowed x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CopyRestorePointBetweenRegions.json | | [createACommunityGallery.js][createacommunitygallery] | Create or update a Shared Image Gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateACommunityGallery.json | | [createAConfidentialVMSupportedDiskEncryptedWithCustomerManagedKey.js][createaconfidentialvmsupporteddiskencryptedwithcustomermanagedkey] | Creates or updates a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/CreateAConfidentialVMDiskEncryptedWithCMK.json | @@ -167,20 +217,32 @@ These sample programs show how to use the JavaScript client libraries for in som | [createOrUpdateAVMWithCapacityReservation.js][createorupdateavmwithcapacityreservation] | The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAVmWithCapacityReservation.json | | [createVirtualMachineScaleSetVMExtension.js][createvirtualmachinescalesetvmextension] | The operation to create or update the VMSS VM extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateVirtualMachineScaleSetVMExtensions.json | | [createVirtualMachineScaleSetVMRunCommand.js][createvirtualmachinescalesetvmruncommand] | The operation to create or update the VMSS VM run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/CreateOrUpdateVirtualMachineScaleSetVMRunCommands.json | +| [dedicatedHostGroupsCreateOrUpdateSample.js][dedicatedhostgroupscreateorupdatesample] | Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateADedicatedHostGroup.json | | [dedicatedHostGroupsDeleteMaximumSetGen.js][dedicatedhostgroupsdeletemaximumsetgen] | Delete a dedicated host group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Delete_MaximumSet_Gen.json | | [dedicatedHostGroupsDeleteMinimumSetGen.js][dedicatedhostgroupsdeleteminimumsetgen] | Delete a dedicated host group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Delete_MinimumSet_Gen.json | +| [dedicatedHostGroupsDeleteSample.js][dedicatedhostgroupsdeletesample] | Delete a dedicated host group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Delete_MaximumSet_Gen.json | +| [dedicatedHostGroupsGetSample.js][dedicatedhostgroupsgetsample] | Retrieves information about a dedicated host group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetADedicatedHostGroup.json | | [dedicatedHostGroupsListByResourceGroupMaximumSetGen.js][dedicatedhostgroupslistbyresourcegroupmaximumsetgen] | Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListByResourceGroup_MaximumSet_Gen.json | | [dedicatedHostGroupsListByResourceGroupMinimumSetGen.js][dedicatedhostgroupslistbyresourcegroupminimumsetgen] | Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListByResourceGroup_MinimumSet_Gen.json | +| [dedicatedHostGroupsListByResourceGroupSample.js][dedicatedhostgroupslistbyresourcegroupsample] | Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListByResourceGroup_MaximumSet_Gen.json | | [dedicatedHostGroupsListBySubscriptionMaximumSetGen.js][dedicatedhostgroupslistbysubscriptionmaximumsetgen] | Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListBySubscription_MaximumSet_Gen.json | | [dedicatedHostGroupsListBySubscriptionMinimumSetGen.js][dedicatedhostgroupslistbysubscriptionminimumsetgen] | Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListBySubscription_MinimumSet_Gen.json | +| [dedicatedHostGroupsListBySubscriptionSample.js][dedicatedhostgroupslistbysubscriptionsample] | Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListBySubscription_MaximumSet_Gen.json | | [dedicatedHostGroupsUpdateMaximumSetGen.js][dedicatedhostgroupsupdatemaximumsetgen] | Update an dedicated host group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Update_MaximumSet_Gen.json | | [dedicatedHostGroupsUpdateMinimumSetGen.js][dedicatedhostgroupsupdateminimumsetgen] | Update an dedicated host group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Update_MinimumSet_Gen.json | +| [dedicatedHostGroupsUpdateSample.js][dedicatedhostgroupsupdatesample] | Update an dedicated host group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Update_MaximumSet_Gen.json | +| [dedicatedHostsCreateOrUpdateSample.js][dedicatedhostscreateorupdatesample] | Create or update a dedicated host . x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateADedicatedHost.json | | [dedicatedHostsDeleteMaximumSetGen.js][dedicatedhostsdeletemaximumsetgen] | Delete a dedicated host. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Delete_MaximumSet_Gen.json | | [dedicatedHostsDeleteMinimumSetGen.js][dedicatedhostsdeleteminimumsetgen] | Delete a dedicated host. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Delete_MinimumSet_Gen.json | +| [dedicatedHostsDeleteSample.js][dedicatedhostsdeletesample] | Delete a dedicated host. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Delete_MaximumSet_Gen.json | +| [dedicatedHostsGetSample.js][dedicatedhostsgetsample] | Retrieves information about a dedicated host. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetADedicatedHost.json | | [dedicatedHostsListByHostGroupMaximumSetGen.js][dedicatedhostslistbyhostgroupmaximumsetgen] | Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_ListByHostGroup_MaximumSet_Gen.json | | [dedicatedHostsListByHostGroupMinimumSetGen.js][dedicatedhostslistbyhostgroupminimumsetgen] | Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_ListByHostGroup_MinimumSet_Gen.json | +| [dedicatedHostsListByHostGroupSample.js][dedicatedhostslistbyhostgroupsample] | Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_ListByHostGroup_MaximumSet_Gen.json | +| [dedicatedHostsRestartSample.js][dedicatedhostsrestartsample] | Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/en-us/azure/service-health/resource-health-overview for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostRestart.json | | [dedicatedHostsUpdateMaximumSetGen.js][dedicatedhostsupdatemaximumsetgen] | Update an dedicated host . x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Update_MaximumSet_Gen.json | | [dedicatedHostsUpdateMinimumSetGen.js][dedicatedhostsupdateminimumsetgen] | Update an dedicated host . x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Update_MinimumSet_Gen.json | +| [dedicatedHostsUpdateSample.js][dedicatedhostsupdatesample] | Update an dedicated host . x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Update_MaximumSet_Gen.json | | [deleteADiskAccessResource.js][deleteadiskaccessresource] | Deletes a disk access resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/DeleteADiskAccess.json | | [deleteADiskEncryptionSet.js][deleteadiskencryptionset] | Deletes a disk encryption set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/DeleteADiskEncryptionSet.json | | [deleteAGallery.js][deleteagallery] | Delete a Shared Image Gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGallery.json | @@ -197,11 +259,68 @@ These sample programs show how to use the JavaScript client libraries for in som | [deleteCloudServiceRoleInstances.js][deletecloudserviceroleinstances] | Deletes role instances in a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/DeleteCloudServiceRoleInstances.json | | [deleteVirtualMachineScaleSetVMExtension.js][deletevirtualmachinescalesetvmextension] | The operation to delete the VMSS VM extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DeleteVirtualMachineScaleSetVMExtensions.json | | [deleteVirtualMachineScaleSetVMRunCommand.js][deletevirtualmachinescalesetvmruncommand] | The operation to delete the VMSS VM run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/DeleteVirtualMachineScaleSetVMRunCommands.json | +| [diskAccessesCreateOrUpdateSample.js][diskaccessescreateorupdatesample] | Creates or updates a disk access resource x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateADiskAccess.json | +| [diskAccessesDeleteAPrivateEndpointConnectionSample.js][diskaccessesdeleteaprivateendpointconnectionsample] | Deletes a private endpoint connection under a disk access resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteAPrivateEndpointConnection.json | +| [diskAccessesDeleteSample.js][diskaccessesdeletesample] | Deletes a disk access resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteADiskAccess.json | +| [diskAccessesGetAPrivateEndpointConnectionSample.js][diskaccessesgetaprivateendpointconnectionsample] | Gets information about a private endpoint connection under a disk access resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutAPrivateEndpointConnection.json | +| [diskAccessesGetPrivateLinkResourcesSample.js][diskaccessesgetprivatelinkresourcessample] | Gets the private link resources possible under disk access resource x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetDiskAccessPrivateLinkResources.json | +| [diskAccessesGetSample.js][diskaccessesgetsample] | Gets information about a disk access resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutADiskAccessWithPrivateEndpoints.json | +| [diskAccessesListByResourceGroupSample.js][diskaccesseslistbyresourcegroupsample] | Lists all the disk access resources under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskAccessesInAResourceGroup.json | +| [diskAccessesListPrivateEndpointConnectionsSample.js][diskaccesseslistprivateendpointconnectionssample] | List information about private endpoint connections under a disk access resource x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListPrivateEndpointConnectionsInADiskAccess.json | +| [diskAccessesListSample.js][diskaccesseslistsample] | Lists all the disk access resources under a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskAccessesInASubscription.json | +| [diskAccessesUpdateAPrivateEndpointConnectionSample.js][diskaccessesupdateaprivateendpointconnectionsample] | Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ApprovePrivateEndpointConnection.json | +| [diskAccessesUpdateSample.js][diskaccessesupdatesample] | Updates (patches) a disk access resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateADiskAccess.json | +| [diskEncryptionSetsCreateOrUpdateSample.js][diskencryptionsetscreateorupdatesample] | Creates or updates a disk encryption set x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateADiskEncryptionSetWithKeyVaultFromADifferentSubscription.json | +| [diskEncryptionSetsDeleteSample.js][diskencryptionsetsdeletesample] | Deletes a disk encryption set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteADiskEncryptionSet.json | +| [diskEncryptionSetsGetSample.js][diskencryptionsetsgetsample] | Gets information about a disk encryption set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutADiskEncryptionSetWithAutoKeyRotationError.json | +| [diskEncryptionSetsListAssociatedResourcesSample.js][diskencryptionsetslistassociatedresourcessample] | Lists all resources that are encrypted with this disk encryption set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskEncryptionSetAssociatedResources.json | +| [diskEncryptionSetsListByResourceGroupSample.js][diskencryptionsetslistbyresourcegroupsample] | Lists all the disk encryption sets under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskEncryptionSetsInAResourceGroup.json | +| [diskEncryptionSetsListSample.js][diskencryptionsetslistsample] | Lists all the disk encryption sets under a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskEncryptionSetsInASubscription.json | +| [diskEncryptionSetsUpdateSample.js][diskencryptionsetsupdatesample] | Updates (patches) a disk encryption set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateADiskEncryptionSetWithRotationToLatestKeyVersionEnabled.json | +| [diskRestorePointGetSample.js][diskrestorepointgetsample] | Get disk restorePoint resource x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetDiskRestorePointResources.json | +| [diskRestorePointGrantAccessSample.js][diskrestorepointgrantaccesssample] | Grants access to a diskRestorePoint. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/BeginGetAccessDiskRestorePoint.json | +| [diskRestorePointListByRestorePointSample.js][diskrestorepointlistbyrestorepointsample] | Lists diskRestorePoints under a vmRestorePoint. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskRestorePointsInVmRestorePoint.json | +| [diskRestorePointRevokeAccessSample.js][diskrestorepointrevokeaccesssample] | Revokes access to a diskRestorePoint. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/EndGetAccessDiskRestorePoint.json | +| [disksCreateOrUpdateSample.js][diskscreateorupdatesample] | Creates or updates a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAConfidentialVMDiskEncryptedWithCMK.json | +| [disksDeleteSample.js][disksdeletesample] | Deletes a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteAManagedDisk.json | +| [disksGetSample.js][disksgetsample] | Gets information about a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutAManagedDisk.json | +| [disksGrantAccessSample.js][disksgrantaccesssample] | Grants access to a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/BeginGetAccessManagedDisk.json | +| [disksListByResourceGroupSample.js][diskslistbyresourcegroupsample] | Lists all the disks under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListManagedDisksInAResourceGroup.json | +| [disksListSample.js][diskslistsample] | Lists all the disks under a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListManagedDisksInASubscription.json | +| [disksRevokeAccessSample.js][disksrevokeaccesssample] | Revokes access to a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/EndGetAccessManagedDisk.json | +| [disksUpdateSample.js][disksupdatesample] | Updates (patches) a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateOrUpdateABurstingEnabledManagedDisk.json | | [exportLogsWhichContainAllApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriodBrokenDownByIntervals.js][exportlogswhichcontainallapirequestsmadetocomputeresourceproviderwithinthegiventimeperiodbrokendownbyintervals] | Export logs that show Api requests made by this subscription in the given time window to show throttling activities. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/LogAnalyticsRequestRateByInterval.json | | [exportLogsWhichContainAllThrottledApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriod.js][exportlogswhichcontainallthrottledapirequestsmadetocomputeresourceproviderwithinthegiventimeperiod] | Export logs that show total throttled Api requests for this subscription in the given time window. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/LogAnalyticsThrottledRequests.json | | [forceDeleteAVM.js][forcedeleteavm] | The operation to delete a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ForceDeleteVirtualMachine.json | | [forceDeleteAVMScaleSet.js][forcedeleteavmscaleset] | Deletes a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ForceDeleteVirtualMachineScaleSets.json | | [forceDeleteAVirtualMachineFromAVMScaleSet.js][forcedeleteavirtualmachinefromavmscaleset] | Deletes a virtual machine from a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ForceDeleteVirtualMachineScaleSetVM.json | +| [galleriesCreateOrUpdateSample.js][galleriescreateorupdatesample] | Create or update a Shared Image Gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateACommunityGallery.json | +| [galleriesDeleteSample.js][galleriesdeletesample] | Delete a Shared Image Gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGallery.json | +| [galleriesGetSample.js][galleriesgetsample] | Retrieves information about a Shared Image Gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetACommunityGallery.json | +| [galleriesListByResourceGroupSample.js][gallerieslistbyresourcegroupsample] | List galleries under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleriesInAResourceGroup.json | +| [galleriesListSample.js][gallerieslistsample] | List galleries under a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleriesInASubscription.json | +| [galleriesUpdateSample.js][galleriesupdatesample] | Update a Shared Image Gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGallery.json | +| [galleryApplicationVersionsCreateOrUpdateSample.js][galleryapplicationversionscreateorupdatesample] | Create or update a gallery Application Version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryApplicationVersion.json | +| [galleryApplicationVersionsDeleteSample.js][galleryapplicationversionsdeletesample] | Delete a gallery Application Version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGalleryApplicationVersion.json | +| [galleryApplicationVersionsGetSample.js][galleryapplicationversionsgetsample] | Retrieves information about a gallery Application Version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryApplicationVersionWithReplicationStatus.json | +| [galleryApplicationVersionsListByGalleryApplicationSample.js][galleryapplicationversionslistbygalleryapplicationsample] | List gallery Application Versions in a gallery Application Definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleryApplicationVersionsInAGalleryApplication.json | +| [galleryApplicationVersionsUpdateSample.js][galleryapplicationversionsupdatesample] | Update a gallery Application Version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGalleryApplicationVersion.json | +| [galleryApplicationsCreateOrUpdateSample.js][galleryapplicationscreateorupdatesample] | Create or update a gallery Application Definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryApplication.json | +| [galleryApplicationsDeleteSample.js][galleryapplicationsdeletesample] | Delete a gallery Application. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGalleryApplication.json | +| [galleryApplicationsGetSample.js][galleryapplicationsgetsample] | Retrieves information about a gallery Application Definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryApplication.json | +| [galleryApplicationsListByGallerySample.js][galleryapplicationslistbygallerysample] | List gallery Application Definitions in a gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleryApplicationsInAGallery.json | +| [galleryApplicationsUpdateSample.js][galleryapplicationsupdatesample] | Update a gallery Application Definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGalleryApplication.json | +| [galleryImageVersionsCreateOrUpdateSample.js][galleryimageversionscreateorupdatesample] | Create or update a gallery image version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithVMAsSource.json | +| [galleryImageVersionsDeleteSample.js][galleryimageversionsdeletesample] | Delete a gallery image version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGalleryImageVersion.json | +| [galleryImageVersionsGetSample.js][galleryimageversionsgetsample] | Retrieves information about a gallery image version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryImageVersionWithReplicationStatus.json | +| [galleryImageVersionsListByGalleryImageSample.js][galleryimageversionslistbygalleryimagesample] | List gallery image versions in a gallery image definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleryImageVersionsInAGalleryImage.json | +| [galleryImageVersionsUpdateSample.js][galleryimageversionsupdatesample] | Update a gallery image version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGalleryImageVersion.json | +| [galleryImagesCreateOrUpdateSample.js][galleryimagescreateorupdatesample] | Create or update a gallery image definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImage.json | +| [galleryImagesDeleteSample.js][galleryimagesdeletesample] | Delete a gallery image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGalleryImage.json | +| [galleryImagesGetSample.js][galleryimagesgetsample] | Retrieves information about a gallery image definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryImage.json | +| [galleryImagesListByGallerySample.js][galleryimageslistbygallerysample] | List gallery image definitions in a gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleryImagesInAGallery.json | +| [galleryImagesUpdateSample.js][galleryimagesupdatesample] | Update a gallery image definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGalleryImage.json | +| [gallerySharingProfileUpdateSample.js][gallerysharingprofileupdatesample] | Update sharing profile of a gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/AddToSharingProfileInAGallery.json | | [generalizeAVirtualMachine.js][generalizeavirtualmachine] | Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation.
For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource).
For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GeneralizeVirtualMachine.json | | [generateAnSshKeyPair.js][generateansshkeypair] | Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GenerateSshKeyPair.json | | [getACapacityReservation.js][getacapacityreservation] | The operation that retrieves information about the capacity reservation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetACapacityReservation.json | @@ -262,8 +381,14 @@ These sample programs show how to use the JavaScript client libraries for in som | [getsTheListOfRestorePointCollectionsInAResourceGroup.js][getsthelistofrestorepointcollectionsinaresourcegroup] | Gets the list of restore point collections in a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointCollectionsInAResourceGroup.json | | [getsTheListOfRestorePointCollectionsInASubscription.js][getsthelistofrestorepointcollectionsinasubscription] | Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointCollectionsInASubscription.json | | [grantsAccessToADiskRestorePoint.js][grantsaccesstoadiskrestorepoint] | Grants access to a diskRestorePoint. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/BeginGetAccessDiskRestorePoint.json | +| [imagesCreateOrUpdateSample.js][imagescreateorupdatesample] | Create or update an image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromABlobWithDiskEncryptionSet.json | | [imagesDeleteMaximumSetGen.js][imagesdeletemaximumsetgen] | Deletes an Image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Images_Delete_MaximumSet_Gen.json | | [imagesDeleteMinimumSetGen.js][imagesdeleteminimumsetgen] | Deletes an Image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Images_Delete_MinimumSet_Gen.json | +| [imagesDeleteSample.js][imagesdeletesample] | Deletes an Image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Images_Delete_MaximumSet_Gen.json | +| [imagesGetSample.js][imagesgetsample] | Gets an image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetInformationAboutAnImage.json | +| [imagesListByResourceGroupSample.js][imageslistbyresourcegroupsample] | Gets the list of images under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListImagesInAResourceGroup.json | +| [imagesListSample.js][imageslistsample] | Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListImagesInASubscription.json | +| [imagesUpdateSample.js][imagesupdatesample] | Update an image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateImage.json | | [installPatchStateOfAVirtualMachine.js][installpatchstateofavirtualmachine] | Installs patches on the VM. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineInstallPatches.json | | [listAllDiskAccessResourcesInAResourceGroup.js][listalldiskaccessresourcesinaresourcegroup] | Lists all the disk access resources under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/ListDiskAccessesInAResourceGroup.json | | [listAllDiskAccessResourcesInASubscription.js][listalldiskaccessresourcesinasubscription] | Lists all the disk access resources under a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/ListDiskAccessesInASubscription.json | @@ -303,8 +428,17 @@ These sample programs show how to use the JavaScript client libraries for in som | [listsAllAvailableVirtualMachineSizesToWhichTheSpecifiedVirtualMachineCanBeResized.js][listsallavailablevirtualmachinesizestowhichthespecifiedvirtualmachinecanberesized] | Lists all available virtual machine sizes to which the specified virtual machine can be resized. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListAvailableVmSizes_VirtualMachines.json | | [listsAllTheVMScaleSetsUnderTheSpecifiedSubscriptionForTheSpecifiedLocation.js][listsallthevmscalesetsunderthespecifiedsubscriptionforthespecifiedlocation] | Gets all the VM scale sets under the specified subscription for the specified location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListVirtualMachineScaleSetsInASubscriptionByLocation.json | | [listsAllTheVirtualMachinesUnderTheSpecifiedSubscriptionForTheSpecifiedLocation.js][listsallthevirtualmachinesunderthespecifiedsubscriptionforthespecifiedlocation] | Gets all the virtual machines under the specified subscription for the specified location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListVirtualMachinesInASubscriptionByLocation.json | +| [logAnalyticsExportRequestRateByIntervalSample.js][loganalyticsexportrequestratebyintervalsample] | Export logs that show Api requests made by this subscription in the given time window to show throttling activities. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/LogAnalyticsRequestRateByInterval.json | +| [logAnalyticsExportThrottledRequestsSample.js][loganalyticsexportthrottledrequestssample] | Export logs that show total throttled Api requests for this subscription in the given time window. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/LogAnalyticsThrottledRequests.json | | [operationsListMaximumSetGen.js][operationslistmaximumsetgen] | Gets a list of compute operations. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Operations_List_MaximumSet_Gen.json | | [operationsListMinimumSetGen.js][operationslistminimumsetgen] | Gets a list of compute operations. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Operations_List_MinimumSet_Gen.json | +| [operationsListSample.js][operationslistsample] | Gets a list of compute operations. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Operations_List_MaximumSet_Gen.json | +| [proximityPlacementGroupsCreateOrUpdateSample.js][proximityplacementgroupscreateorupdatesample] | Create or update a proximity placement group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAProximityPlacementGroup.json | +| [proximityPlacementGroupsDeleteSample.js][proximityplacementgroupsdeletesample] | Delete a proximity placement group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DeleteAProximityPlacementGroup.json | +| [proximityPlacementGroupsGetSample.js][proximityplacementgroupsgetsample] | Retrieves information about a proximity placement group . x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetAProximityPlacementGroup.json | +| [proximityPlacementGroupsListByResourceGroupSample.js][proximityplacementgroupslistbyresourcegroupsample] | Lists all proximity placement groups in a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListProximityPlacementGroupsInAResourceGroup.json | +| [proximityPlacementGroupsListBySubscriptionSample.js][proximityplacementgroupslistbysubscriptionsample] | Lists all proximity placement groups in a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListProximityPlacementGroupsInASubscription.json | +| [proximityPlacementGroupsUpdateSample.js][proximityplacementgroupsupdatesample] | Update a proximity placement group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/PatchAProximityPlacementGroup.json | | [reapplyTheStateOfAVirtualMachine.js][reapplythestateofavirtualmachine] | The operation to reapply a virtual machine's state. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ReapplyVirtualMachine.json | | [rebuildCloudServiceRoleInstance.js][rebuildcloudserviceroleinstance] | The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instance. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RebuildCloudServiceRoleInstance.json | | [rebuildCloudServiceRoleInstances.js][rebuildcloudserviceroleinstances] | Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instances. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RebuildCloudServiceRoleInstances.json | @@ -312,29 +446,60 @@ These sample programs show how to use the JavaScript client libraries for in som | [reimageCloudServiceRoleInstance.js][reimagecloudserviceroleinstance] | The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ReimageCloudServiceRoleInstance.json | | [reimageCloudServiceRoleInstances.js][reimagecloudserviceroleinstances] | Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ReimageCloudServiceRoleInstances.json | | [resetSharingProfileOfAGallery.js][resetsharingprofileofagallery] | Update sharing profile of a gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ResetSharingProfileInAGallery.json | +| [resourceSkusListSample.js][resourceskuslistsample] | Gets the list of Microsoft.Compute SKUs available for your Subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/skus/ListAvailableResourceSkus.json | | [restartCloudServiceRoleInstance.js][restartcloudserviceroleinstance] | The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RestartCloudServiceRoleInstance.json | | [restartCloudServiceRoleInstances.js][restartcloudserviceroleinstances] | Restarts one or more role instances in a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RestartCloudServiceRoleInstances.json | | [restartDedicatedHost.js][restartdedicatedhost] | Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostRestart.json | +| [restorePointCollectionsCreateOrUpdateSample.js][restorepointcollectionscreateorupdatesample] | The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateARestorePointCollectionForCrossRegionCopy.json | | [restorePointCollectionsDeleteMaximumSetGen.js][restorepointcollectionsdeletemaximumsetgen] | The operation to delete the restore point collection. This operation will also delete all the contained restore points. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Delete_MaximumSet_Gen.json | | [restorePointCollectionsDeleteMinimumSetGen.js][restorepointcollectionsdeleteminimumsetgen] | The operation to delete the restore point collection. This operation will also delete all the contained restore points. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Delete_MinimumSet_Gen.json | +| [restorePointCollectionsDeleteSample.js][restorepointcollectionsdeletesample] | The operation to delete the restore point collection. This operation will also delete all the contained restore points. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Delete_MaximumSet_Gen.json | +| [restorePointCollectionsGetSample.js][restorepointcollectionsgetsample] | The operation to get the restore point collection. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointCollection.json | +| [restorePointCollectionsListAllSample.js][restorepointcollectionslistallsample] | Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointCollectionsInASubscription.json | +| [restorePointCollectionsListSample.js][restorepointcollectionslistsample] | Gets the list of restore point collections in a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointCollectionsInAResourceGroup.json | | [restorePointCollectionsUpdateMaximumSetGen.js][restorepointcollectionsupdatemaximumsetgen] | The operation to update the restore point collection. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Update_MaximumSet_Gen.json | | [restorePointCollectionsUpdateMinimumSetGen.js][restorepointcollectionsupdateminimumsetgen] | The operation to update the restore point collection. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Update_MinimumSet_Gen.json | +| [restorePointCollectionsUpdateSample.js][restorepointcollectionsupdatesample] | The operation to update the restore point collection. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Update_MaximumSet_Gen.json | +| [restorePointsCreateSample.js][restorepointscreatesample] | The operation to create the restore point. Updating properties of an existing restore point is not allowed x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CopyRestorePointBetweenRegions.json | | [restorePointsDeleteMaximumSetGen.js][restorepointsdeletemaximumsetgen] | The operation to delete the restore point. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePoints_Delete_MaximumSet_Gen.json | | [restorePointsDeleteMinimumSetGen.js][restorepointsdeleteminimumsetgen] | The operation to delete the restore point. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePoints_Delete_MinimumSet_Gen.json | +| [restorePointsDeleteSample.js][restorepointsdeletesample] | The operation to delete the restore point. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePoints_Delete_MaximumSet_Gen.json | +| [restorePointsGetSample.js][restorepointsgetsample] | The operation to get the restore point. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePoint.json | | [retrieveBootDiagnosticsDataOfAVirtualMachine.js][retrievebootdiagnosticsdataofavirtualmachine] | The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RetrieveBootDiagnosticsDataVMScaleSetVM.json | | [revokeAccessToAManagedDisk.js][revokeaccesstoamanageddisk] | Revokes access to a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/EndGetAccessManagedDisk.json | | [revokeAccessToASnapshot.js][revokeaccesstoasnapshot] | Revokes access to a snapshot. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/EndGetAccessSnapshot.json | | [revokesAccessToADiskRestorePoint.js][revokesaccesstoadiskrestorepoint] | Revokes access to a diskRestorePoint. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/EndGetAccessDiskRestorePoint.json | | [shareAGalleryToCommunity.js][shareagallerytocommunity] | Update sharing profile of a gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/EnableACommunityGallery.json | +| [sharedGalleriesGetSample.js][sharedgalleriesgetsample] | Get a shared gallery by subscription id or tenant id. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/GetASharedGallery.json | +| [sharedGalleriesListSample.js][sharedgallerieslistsample] | List shared galleries by subscription id or tenant id. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/ListSharedGalleries.json | +| [sharedGalleryImageVersionsGetSample.js][sharedgalleryimageversionsgetsample] | Get a shared gallery image version by subscription id or tenant id. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/GetASharedGalleryImageVersion.json | +| [sharedGalleryImageVersionsListSample.js][sharedgalleryimageversionslistsample] | List shared gallery image versions by subscription id or tenant id. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/ListSharedGalleryImageVersions.json | +| [sharedGalleryImagesGetSample.js][sharedgalleryimagesgetsample] | Get a shared gallery image by subscription id or tenant id. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/GetASharedGalleryImage.json | +| [sharedGalleryImagesListSample.js][sharedgalleryimageslistsample] | List shared gallery images by subscription id or tenant id. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/ListSharedGalleryImages.json | | [simulateEvictionAVirtualMachine.js][simulateevictionavirtualmachine] | The operation to simulate the eviction of spot virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SimulateEvictionOfVmssVM.json | +| [snapshotsCreateOrUpdateSample.js][snapshotscreateorupdatesample] | Creates or updates a snapshot. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription.json | +| [snapshotsDeleteSample.js][snapshotsdeletesample] | Deletes a snapshot. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteASnapshot.json | +| [snapshotsGetSample.js][snapshotsgetsample] | Gets information about a snapshot. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutASnapshot.json | +| [snapshotsGrantAccessSample.js][snapshotsgrantaccesssample] | Grants access to a snapshot. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/BeginGetAccessSnapshot.json | +| [snapshotsListByResourceGroupSample.js][snapshotslistbyresourcegroupsample] | Lists snapshots under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListSnapshotsInAResourceGroup.json | +| [snapshotsListSample.js][snapshotslistsample] | Lists snapshots under a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListSnapshotsInASubscription.json | +| [snapshotsRevokeAccessSample.js][snapshotsrevokeaccesssample] | Revokes access to a snapshot. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/EndGetAccessSnapshot.json | +| [snapshotsUpdateSample.js][snapshotsupdatesample] | Updates (patches) a snapshot. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateASnapshotWithAcceleratedNetwork.json | +| [sshPublicKeysCreateSample.js][sshpublickeyscreatesample] | Creates a new SSH public key resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnSshPublicKey.json | | [sshPublicKeysDeleteMaximumSetGen.js][sshpublickeysdeletemaximumsetgen] | Delete an SSH public key. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Delete_MaximumSet_Gen.json | | [sshPublicKeysDeleteMinimumSetGen.js][sshpublickeysdeleteminimumsetgen] | Delete an SSH public key. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Delete_MinimumSet_Gen.json | +| [sshPublicKeysDeleteSample.js][sshpublickeysdeletesample] | Delete an SSH public key. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Delete_MaximumSet_Gen.json | +| [sshPublicKeysGenerateKeyPairSample.js][sshpublickeysgeneratekeypairsample] | Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GenerateSshKeyPair.json | +| [sshPublicKeysGetSample.js][sshpublickeysgetsample] | Retrieves information about an SSH public key. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetAnSshPublicKey.json | | [sshPublicKeysListByResourceGroupMaximumSetGen.js][sshpublickeyslistbyresourcegroupmaximumsetgen] | Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListByResourceGroup_MaximumSet_Gen.json | | [sshPublicKeysListByResourceGroupMinimumSetGen.js][sshpublickeyslistbyresourcegroupminimumsetgen] | Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListByResourceGroup_MinimumSet_Gen.json | +| [sshPublicKeysListByResourceGroupSample.js][sshpublickeyslistbyresourcegroupsample] | Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListByResourceGroup_MaximumSet_Gen.json | | [sshPublicKeysListBySubscriptionMaximumSetGen.js][sshpublickeyslistbysubscriptionmaximumsetgen] | Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListBySubscription_MaximumSet_Gen.json | | [sshPublicKeysListBySubscriptionMinimumSetGen.js][sshpublickeyslistbysubscriptionminimumsetgen] | Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListBySubscription_MinimumSet_Gen.json | +| [sshPublicKeysListBySubscriptionSample.js][sshpublickeyslistbysubscriptionsample] | Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListBySubscription_MaximumSet_Gen.json | | [sshPublicKeysUpdateMaximumSetGen.js][sshpublickeysupdatemaximumsetgen] | Updates a new SSH public key resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Update_MaximumSet_Gen.json | | [sshPublicKeysUpdateMinimumSetGen.js][sshpublickeysupdateminimumsetgen] | Updates a new SSH public key resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Update_MinimumSet_Gen.json | +| [sshPublicKeysUpdateSample.js][sshpublickeysupdatesample] | Updates a new SSH public key resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Update_MaximumSet_Gen.json | | [startAnExtensionRollingUpgrade.js][startanextensionrollingupgrade] | Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VMScaleSetExtensionRollingUpgrade.json | | [startCloudService.js][startcloudservice] | Starts the cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/StartCloudService.json | | [stopOrPowerOffCloudService.js][stoporpoweroffcloudservice] | Power off the cloud service. Note that resources are still attached and you are getting charged for the resources. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/PowerOffCloudService.json | @@ -367,140 +532,250 @@ These sample programs show how to use the JavaScript client libraries for in som | [updatesTagsOfAnImage.js][updatestagsofanimage] | Update an image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateImage.json | | [usageListMaximumSetGen.js][usagelistmaximumsetgen] | Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Usage_List_MaximumSet_Gen.json | | [usageListMinimumSetGen.js][usagelistminimumsetgen] | Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Usage_List_MinimumSet_Gen.json | +| [usageListSample.js][usagelistsample] | Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Usage_List_MaximumSet_Gen.json | | [virtualMachineExtensionImagesGetMaximumSetGen.js][virtualmachineextensionimagesgetmaximumsetgen] | Gets a virtual machine extension image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_Get_MaximumSet_Gen.json | | [virtualMachineExtensionImagesGetMinimumSetGen.js][virtualmachineextensionimagesgetminimumsetgen] | Gets a virtual machine extension image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_Get_MinimumSet_Gen.json | +| [virtualMachineExtensionImagesGetSample.js][virtualmachineextensionimagesgetsample] | Gets a virtual machine extension image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_Get_MaximumSet_Gen.json | | [virtualMachineExtensionImagesListTypesMaximumSetGen.js][virtualmachineextensionimageslisttypesmaximumsetgen] | Gets a list of virtual machine extension image types. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListTypes_MaximumSet_Gen.json | | [virtualMachineExtensionImagesListTypesMinimumSetGen.js][virtualmachineextensionimageslisttypesminimumsetgen] | Gets a list of virtual machine extension image types. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListTypes_MinimumSet_Gen.json | +| [virtualMachineExtensionImagesListTypesSample.js][virtualmachineextensionimageslisttypessample] | Gets a list of virtual machine extension image types. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListTypes_MaximumSet_Gen.json | | [virtualMachineExtensionImagesListVersionsMaximumSetGen.js][virtualmachineextensionimageslistversionsmaximumsetgen] | Gets a list of virtual machine extension image versions. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListVersions_MaximumSet_Gen.json | | [virtualMachineExtensionImagesListVersionsMinimumSetGen.js][virtualmachineextensionimageslistversionsminimumsetgen] | Gets a list of virtual machine extension image versions. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListVersions_MinimumSet_Gen.json | +| [virtualMachineExtensionImagesListVersionsSample.js][virtualmachineextensionimageslistversionssample] | Gets a list of virtual machine extension image versions. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListVersions_MaximumSet_Gen.json | | [virtualMachineExtensionsCreateOrUpdateMaximumSetGen.js][virtualmachineextensionscreateorupdatemaximumsetgen] | The operation to create or update the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_CreateOrUpdate_MaximumSet_Gen.json | | [virtualMachineExtensionsCreateOrUpdateMinimumSetGen.js][virtualmachineextensionscreateorupdateminimumsetgen] | The operation to create or update the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_CreateOrUpdate_MinimumSet_Gen.json | +| [virtualMachineExtensionsCreateOrUpdateSample.js][virtualmachineextensionscreateorupdatesample] | The operation to create or update the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_CreateOrUpdate_MaximumSet_Gen.json | | [virtualMachineExtensionsDeleteMaximumSetGen.js][virtualmachineextensionsdeletemaximumsetgen] | The operation to delete the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Delete_MaximumSet_Gen.json | | [virtualMachineExtensionsDeleteMinimumSetGen.js][virtualmachineextensionsdeleteminimumsetgen] | The operation to delete the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Delete_MinimumSet_Gen.json | +| [virtualMachineExtensionsDeleteSample.js][virtualmachineextensionsdeletesample] | The operation to delete the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Delete_MaximumSet_Gen.json | | [virtualMachineExtensionsGetMaximumSetGen.js][virtualmachineextensionsgetmaximumsetgen] | The operation to get the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Get_MaximumSet_Gen.json | | [virtualMachineExtensionsGetMinimumSetGen.js][virtualmachineextensionsgetminimumsetgen] | The operation to get the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Get_MinimumSet_Gen.json | +| [virtualMachineExtensionsGetSample.js][virtualmachineextensionsgetsample] | The operation to get the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Get_MaximumSet_Gen.json | | [virtualMachineExtensionsListMaximumSetGen.js][virtualmachineextensionslistmaximumsetgen] | The operation to get all extensions of a Virtual Machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_List_MaximumSet_Gen.json | | [virtualMachineExtensionsListMinimumSetGen.js][virtualmachineextensionslistminimumsetgen] | The operation to get all extensions of a Virtual Machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_List_MinimumSet_Gen.json | +| [virtualMachineExtensionsListSample.js][virtualmachineextensionslistsample] | The operation to get all extensions of a Virtual Machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_List_MaximumSet_Gen.json | +| [virtualMachineExtensionsUpdateSample.js][virtualmachineextensionsupdatesample] | The operation to update the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateVMExtension.json | | [virtualMachineImagesEdgeZoneGetMaximumSetGen.js][virtualmachineimagesedgezonegetmaximumsetgen] | Gets a virtual machine image in an edge zone. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.json | | [virtualMachineImagesEdgeZoneGetMinimumSetGen.js][virtualmachineimagesedgezonegetminimumsetgen] | Gets a virtual machine image in an edge zone. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_Get_MinimumSet_Gen.json | +| [virtualMachineImagesEdgeZoneGetSample.js][virtualmachineimagesedgezonegetsample] | Gets a virtual machine image in an edge zone. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.json | | [virtualMachineImagesEdgeZoneListMaximumSetGen.js][virtualmachineimagesedgezonelistmaximumsetgen] | Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.json | | [virtualMachineImagesEdgeZoneListMinimumSetGen.js][virtualmachineimagesedgezonelistminimumsetgen] | Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_List_MinimumSet_Gen.json | | [virtualMachineImagesEdgeZoneListOffersMaximumSetGen.js][virtualmachineimagesedgezonelistoffersmaximumsetgen] | Gets a list of virtual machine image offers for the specified location, edge zone and publisher. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.json | | [virtualMachineImagesEdgeZoneListOffersMinimumSetGen.js][virtualmachineimagesedgezonelistoffersminimumsetgen] | Gets a list of virtual machine image offers for the specified location, edge zone and publisher. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListOffers_MinimumSet_Gen.json | +| [virtualMachineImagesEdgeZoneListOffersSample.js][virtualmachineimagesedgezonelistofferssample] | Gets a list of virtual machine image offers for the specified location, edge zone and publisher. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.json | | [virtualMachineImagesEdgeZoneListPublishersMaximumSetGen.js][virtualmachineimagesedgezonelistpublishersmaximumsetgen] | Gets a list of virtual machine image publishers for the specified Azure location and edge zone. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.json | | [virtualMachineImagesEdgeZoneListPublishersMinimumSetGen.js][virtualmachineimagesedgezonelistpublishersminimumsetgen] | Gets a list of virtual machine image publishers for the specified Azure location and edge zone. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListPublishers_MinimumSet_Gen.json | +| [virtualMachineImagesEdgeZoneListPublishersSample.js][virtualmachineimagesedgezonelistpublisherssample] | Gets a list of virtual machine image publishers for the specified Azure location and edge zone. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.json | +| [virtualMachineImagesEdgeZoneListSample.js][virtualmachineimagesedgezonelistsample] | Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.json | | [virtualMachineImagesEdgeZoneListSkusMaximumSetGen.js][virtualmachineimagesedgezonelistskusmaximumsetgen] | Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen.json | | [virtualMachineImagesEdgeZoneListSkusMinimumSetGen.js][virtualmachineimagesedgezonelistskusminimumsetgen] | Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListSkus_MinimumSet_Gen.json | +| [virtualMachineImagesEdgeZoneListSkusSample.js][virtualmachineimagesedgezonelistskussample] | Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen.json | | [virtualMachineImagesGetMaximumSetGen.js][virtualmachineimagesgetmaximumsetgen] | Gets a virtual machine image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_Get_MaximumSet_Gen.json | | [virtualMachineImagesGetMinimumSetGen.js][virtualmachineimagesgetminimumsetgen] | Gets a virtual machine image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_Get_MinimumSet_Gen.json | +| [virtualMachineImagesGetSample.js][virtualmachineimagesgetsample] | Gets a virtual machine image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_Get_MaximumSet_Gen.json | | [virtualMachineImagesListMaximumSetGen.js][virtualmachineimageslistmaximumsetgen] | Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_List_MaximumSet_Gen.json | | [virtualMachineImagesListMinimumSetGen.js][virtualmachineimageslistminimumsetgen] | Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_List_MinimumSet_Gen.json | | [virtualMachineImagesListOffersMaximumSetGen.js][virtualmachineimageslistoffersmaximumsetgen] | Gets a list of virtual machine image offers for the specified location and publisher. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListOffers_MaximumSet_Gen.json | | [virtualMachineImagesListOffersMinimumSetGen.js][virtualmachineimageslistoffersminimumsetgen] | Gets a list of virtual machine image offers for the specified location and publisher. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListOffers_MinimumSet_Gen.json | +| [virtualMachineImagesListOffersSample.js][virtualmachineimageslistofferssample] | Gets a list of virtual machine image offers for the specified location and publisher. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListOffers_MaximumSet_Gen.json | | [virtualMachineImagesListPublishersMaximumSetGen.js][virtualmachineimageslistpublishersmaximumsetgen] | Gets a list of virtual machine image publishers for the specified Azure location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListPublishers_MaximumSet_Gen.json | | [virtualMachineImagesListPublishersMinimumSetGen.js][virtualmachineimageslistpublishersminimumsetgen] | Gets a list of virtual machine image publishers for the specified Azure location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListPublishers_MinimumSet_Gen.json | +| [virtualMachineImagesListPublishersSample.js][virtualmachineimageslistpublisherssample] | Gets a list of virtual machine image publishers for the specified Azure location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListPublishers_MaximumSet_Gen.json | +| [virtualMachineImagesListSample.js][virtualmachineimageslistsample] | Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_List_MaximumSet_Gen.json | | [virtualMachineImagesListSkusMaximumSetGen.js][virtualmachineimageslistskusmaximumsetgen] | Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListSkus_MaximumSet_Gen.json | | [virtualMachineImagesListSkusMinimumSetGen.js][virtualmachineimageslistskusminimumsetgen] | Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListSkus_MinimumSet_Gen.json | +| [virtualMachineImagesListSkusSample.js][virtualmachineimageslistskussample] | Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListSkus_MaximumSet_Gen.json | | [virtualMachineRunCommand.js][virtualmachineruncommand] | Run command on the VM. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VirtualMachineRunCommand.json | | [virtualMachineRunCommandGet.js][virtualmachineruncommandget] | Gets specific run command for a subscription in a location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VirtualMachineRunCommandGet.json | | [virtualMachineRunCommandList.js][virtualmachineruncommandlist] | Lists all available run commands for a subscription in a location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VirtualMachineRunCommandList.json | +| [virtualMachineRunCommandsCreateOrUpdateSample.js][virtualmachineruncommandscreateorupdatesample] | The operation to create or update the run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/CreateOrUpdateRunCommand.json | +| [virtualMachineRunCommandsDeleteSample.js][virtualmachineruncommandsdeletesample] | The operation to delete the run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/DeleteRunCommand.json | +| [virtualMachineRunCommandsGetByVirtualMachineSample.js][virtualmachineruncommandsgetbyvirtualmachinesample] | The operation to get the run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/GetRunCommand.json | +| [virtualMachineRunCommandsGetSample.js][virtualmachineruncommandsgetsample] | Gets specific run command for a subscription in a location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VirtualMachineRunCommandGet.json | +| [virtualMachineRunCommandsListByVirtualMachineSample.js][virtualmachineruncommandslistbyvirtualmachinesample] | The operation to get all run commands of a Virtual Machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/ListRunCommandsInVM.json | +| [virtualMachineRunCommandsListSample.js][virtualmachineruncommandslistsample] | Lists all available run commands for a subscription in a location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VirtualMachineRunCommandList.json | +| [virtualMachineRunCommandsUpdateSample.js][virtualmachineruncommandsupdatesample] | The operation to update the run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/UpdateRunCommand.json | | [virtualMachineScaleSetExtensionsCreateOrUpdateMaximumSetGen.js][virtualmachinescalesetextensionscreateorupdatemaximumsetgen] | The operation to create or update an extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_CreateOrUpdate_MaximumSet_Gen.json | | [virtualMachineScaleSetExtensionsCreateOrUpdateMinimumSetGen.js][virtualmachinescalesetextensionscreateorupdateminimumsetgen] | The operation to create or update an extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_CreateOrUpdate_MinimumSet_Gen.json | +| [virtualMachineScaleSetExtensionsCreateOrUpdateSample.js][virtualmachinescalesetextensionscreateorupdatesample] | The operation to create or update an extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_CreateOrUpdate_MaximumSet_Gen.json | | [virtualMachineScaleSetExtensionsDeleteMaximumSetGen.js][virtualmachinescalesetextensionsdeletemaximumsetgen] | The operation to delete the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Delete_MaximumSet_Gen.json | | [virtualMachineScaleSetExtensionsDeleteMinimumSetGen.js][virtualmachinescalesetextensionsdeleteminimumsetgen] | The operation to delete the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Delete_MinimumSet_Gen.json | +| [virtualMachineScaleSetExtensionsDeleteSample.js][virtualmachinescalesetextensionsdeletesample] | The operation to delete the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Delete_MaximumSet_Gen.json | | [virtualMachineScaleSetExtensionsGetMaximumSetGen.js][virtualmachinescalesetextensionsgetmaximumsetgen] | The operation to get the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Get_MaximumSet_Gen.json | | [virtualMachineScaleSetExtensionsGetMinimumSetGen.js][virtualmachinescalesetextensionsgetminimumsetgen] | The operation to get the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Get_MinimumSet_Gen.json | +| [virtualMachineScaleSetExtensionsGetSample.js][virtualmachinescalesetextensionsgetsample] | The operation to get the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Get_MaximumSet_Gen.json | | [virtualMachineScaleSetExtensionsListMaximumSetGen.js][virtualmachinescalesetextensionslistmaximumsetgen] | Gets a list of all extensions in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_List_MaximumSet_Gen.json | | [virtualMachineScaleSetExtensionsListMinimumSetGen.js][virtualmachinescalesetextensionslistminimumsetgen] | Gets a list of all extensions in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_List_MinimumSet_Gen.json | +| [virtualMachineScaleSetExtensionsListSample.js][virtualmachinescalesetextensionslistsample] | Gets a list of all extensions in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_List_MaximumSet_Gen.json | | [virtualMachineScaleSetExtensionsUpdateMaximumSetGen.js][virtualmachinescalesetextensionsupdatemaximumsetgen] | The operation to update an extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Update_MaximumSet_Gen.json | | [virtualMachineScaleSetExtensionsUpdateMinimumSetGen.js][virtualmachinescalesetextensionsupdateminimumsetgen] | The operation to update an extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Update_MinimumSet_Gen.json | +| [virtualMachineScaleSetExtensionsUpdateSample.js][virtualmachinescalesetextensionsupdatesample] | The operation to update an extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Update_MaximumSet_Gen.json | | [virtualMachineScaleSetRollingUpgradesCancelMaximumSetGen.js][virtualmachinescalesetrollingupgradescancelmaximumsetgen] | Cancels the current virtual machine scale set rolling upgrade. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_Cancel_MaximumSet_Gen.json | | [virtualMachineScaleSetRollingUpgradesCancelMinimumSetGen.js][virtualmachinescalesetrollingupgradescancelminimumsetgen] | Cancels the current virtual machine scale set rolling upgrade. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_Cancel_MinimumSet_Gen.json | +| [virtualMachineScaleSetRollingUpgradesCancelSample.js][virtualmachinescalesetrollingupgradescancelsample] | Cancels the current virtual machine scale set rolling upgrade. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_Cancel_MaximumSet_Gen.json | | [virtualMachineScaleSetRollingUpgradesGetLatestMaximumSetGen.js][virtualmachinescalesetrollingupgradesgetlatestmaximumsetgen] | Gets the status of the latest virtual machine scale set rolling upgrade. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_GetLatest_MaximumSet_Gen.json | | [virtualMachineScaleSetRollingUpgradesGetLatestMinimumSetGen.js][virtualmachinescalesetrollingupgradesgetlatestminimumsetgen] | Gets the status of the latest virtual machine scale set rolling upgrade. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_GetLatest_MinimumSet_Gen.json | +| [virtualMachineScaleSetRollingUpgradesGetLatestSample.js][virtualmachinescalesetrollingupgradesgetlatestsample] | Gets the status of the latest virtual machine scale set rolling upgrade. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_GetLatest_MaximumSet_Gen.json | +| [virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.js][virtualmachinescalesetrollingupgradesstartextensionupgradesample] | Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VMScaleSetExtensionRollingUpgrade.json | | [virtualMachineScaleSetRollingUpgradesStartOSUpgradeMaximumSetGen.js][virtualmachinescalesetrollingupgradesstartosupgrademaximumsetgen] | Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_StartOSUpgrade_MaximumSet_Gen.json | | [virtualMachineScaleSetRollingUpgradesStartOSUpgradeMinimumSetGen.js][virtualmachinescalesetrollingupgradesstartosupgrademinimumsetgen] | Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_StartOSUpgrade_MinimumSet_Gen.json | +| [virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.js][virtualmachinescalesetrollingupgradesstartosupgradesample] | Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_StartOSUpgrade_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.js][virtualmachinescalesetvmextensionscreateorupdatesample] | The operation to create or update the VMSS VM extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateVirtualMachineScaleSetVMExtensions.json | +| [virtualMachineScaleSetVMExtensionsDeleteSample.js][virtualmachinescalesetvmextensionsdeletesample] | The operation to delete the VMSS VM extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DeleteVirtualMachineScaleSetVMExtensions.json | +| [virtualMachineScaleSetVMExtensionsGetSample.js][virtualmachinescalesetvmextensionsgetsample] | The operation to get the VMSS VM extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetVMExtensions.json | +| [virtualMachineScaleSetVMExtensionsListSample.js][virtualmachinescalesetvmextensionslistsample] | The operation to get all extensions of an instance in Virtual Machine Scaleset. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListVirtualMachineScaleSetVMExtensions.json | +| [virtualMachineScaleSetVMExtensionsUpdateSample.js][virtualmachinescalesetvmextensionsupdatesample] | The operation to update the VMSS VM extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateVirtualMachineScaleSetVMExtensions.json | +| [virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.js][virtualmachinescalesetvmruncommandscreateorupdatesample] | The operation to create or update the VMSS VM run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/CreateOrUpdateVirtualMachineScaleSetVMRunCommands.json | +| [virtualMachineScaleSetVMRunCommandsDeleteSample.js][virtualmachinescalesetvmruncommandsdeletesample] | The operation to delete the VMSS VM run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/DeleteVirtualMachineScaleSetVMRunCommands.json | +| [virtualMachineScaleSetVMRunCommandsGetSample.js][virtualmachinescalesetvmruncommandsgetsample] | The operation to get the VMSS VM run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/GetVirtualMachineScaleSetVMRunCommands.json | +| [virtualMachineScaleSetVMRunCommandsListSample.js][virtualmachinescalesetvmruncommandslistsample] | The operation to get all run commands of an instance in Virtual Machine Scaleset. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/ListVirtualMachineScaleSetVMRunCommands.json | +| [virtualMachineScaleSetVMRunCommandsUpdateSample.js][virtualmachinescalesetvmruncommandsupdatesample] | The operation to update the VMSS VM run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/UpdateVirtualMachineScaleSetVMRunCommands.json | | [virtualMachineScaleSetVMSDeallocateMaximumSetGen.js][virtualmachinescalesetvmsdeallocatemaximumsetgen] | Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Deallocate_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSDeallocateMinimumSetGen.js][virtualmachinescalesetvmsdeallocateminimumsetgen] | Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Deallocate_MinimumSet_Gen.json | +| [virtualMachineScaleSetVMSDeallocateSample.js][virtualmachinescalesetvmsdeallocatesample] | Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Deallocate_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMSDeleteSample.js][virtualmachinescalesetvmsdeletesample] | Deletes a virtual machine from a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ForceDeleteVirtualMachineScaleSetVM.json | +| [virtualMachineScaleSetVMSGetInstanceViewSample.js][virtualmachinescalesetvmsgetinstanceviewsample] | Gets the status of a virtual machine from a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetVMInstanceViewAutoPlacedOnDedicatedHostGroup.json | +| [virtualMachineScaleSetVMSGetSample.js][virtualmachinescalesetvmsgetsample] | Gets a virtual machine from a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetVMWithUserData.json | | [virtualMachineScaleSetVMSListMaximumSetGen.js][virtualmachinescalesetvmslistmaximumsetgen] | Gets a list of all virtual machines in a VM scale sets. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_List_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSListMinimumSetGen.js][virtualmachinescalesetvmslistminimumsetgen] | Gets a list of all virtual machines in a VM scale sets. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_List_MinimumSet_Gen.json | +| [virtualMachineScaleSetVMSListSample.js][virtualmachinescalesetvmslistsample] | Gets a list of all virtual machines in a VM scale sets. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_List_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSPerformMaintenanceMaximumSetGen.js][virtualmachinescalesetvmsperformmaintenancemaximumsetgen] | Performs maintenance on a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PerformMaintenance_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSPerformMaintenanceMinimumSetGen.js][virtualmachinescalesetvmsperformmaintenanceminimumsetgen] | Performs maintenance on a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PerformMaintenance_MinimumSet_Gen.json | +| [virtualMachineScaleSetVMSPerformMaintenanceSample.js][virtualmachinescalesetvmsperformmaintenancesample] | Performs maintenance on a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PerformMaintenance_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSPowerOffMaximumSetGen.js][virtualmachinescalesetvmspoweroffmaximumsetgen] | Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PowerOff_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSPowerOffMinimumSetGen.js][virtualmachinescalesetvmspoweroffminimumsetgen] | Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PowerOff_MinimumSet_Gen.json | +| [virtualMachineScaleSetVMSPowerOffSample.js][virtualmachinescalesetvmspoweroffsample] | Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PowerOff_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSRedeployMaximumSetGen.js][virtualmachinescalesetvmsredeploymaximumsetgen] | Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Redeploy_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSRedeployMinimumSetGen.js][virtualmachinescalesetvmsredeployminimumsetgen] | Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Redeploy_MinimumSet_Gen.json | +| [virtualMachineScaleSetVMSRedeploySample.js][virtualmachinescalesetvmsredeploysample] | Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Redeploy_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSReimageAllMaximumSetGen.js][virtualmachinescalesetvmsreimageallmaximumsetgen] | Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_ReimageAll_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSReimageAllMinimumSetGen.js][virtualmachinescalesetvmsreimageallminimumsetgen] | Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_ReimageAll_MinimumSet_Gen.json | +| [virtualMachineScaleSetVMSReimageAllSample.js][virtualmachinescalesetvmsreimageallsample] | Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_ReimageAll_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSReimageMaximumSetGen.js][virtualmachinescalesetvmsreimagemaximumsetgen] | Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Reimage_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSReimageMinimumSetGen.js][virtualmachinescalesetvmsreimageminimumsetgen] | Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Reimage_MinimumSet_Gen.json | +| [virtualMachineScaleSetVMSReimageSample.js][virtualmachinescalesetvmsreimagesample] | Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Reimage_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSRestartMaximumSetGen.js][virtualmachinescalesetvmsrestartmaximumsetgen] | Restarts a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Restart_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSRestartMinimumSetGen.js][virtualmachinescalesetvmsrestartminimumsetgen] | Restarts a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Restart_MinimumSet_Gen.json | +| [virtualMachineScaleSetVMSRestartSample.js][virtualmachinescalesetvmsrestartsample] | Restarts a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Restart_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.js][virtualmachinescalesetvmsretrievebootdiagnosticsdatasample] | The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RetrieveBootDiagnosticsDataVMScaleSetVM.json | | [virtualMachineScaleSetVMSRunCommand.js][virtualmachinescalesetvmsruncommand] | Run command on a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VMScaleSetRunCommand.json | +| [virtualMachineScaleSetVMSRunCommandSample.js][virtualmachinescalesetvmsruncommandsample] | Run command on a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VMScaleSetRunCommand.json | +| [virtualMachineScaleSetVMSSimulateEvictionSample.js][virtualmachinescalesetvmssimulateevictionsample] | The operation to simulate the eviction of spot virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SimulateEvictionOfVmssVM.json | | [virtualMachineScaleSetVMSStartMaximumSetGen.js][virtualmachinescalesetvmsstartmaximumsetgen] | Starts a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Start_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSStartMinimumSetGen.js][virtualmachinescalesetvmsstartminimumsetgen] | Starts a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Start_MinimumSet_Gen.json | +| [virtualMachineScaleSetVMSStartSample.js][virtualmachinescalesetvmsstartsample] | Starts a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Start_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSUpdateMaximumSetGen.js][virtualmachinescalesetvmsupdatemaximumsetgen] | Updates a virtual machine of a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Update_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSUpdateMinimumSetGen.js][virtualmachinescalesetvmsupdateminimumsetgen] | Updates a virtual machine of a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Update_MinimumSet_Gen.json | +| [virtualMachineScaleSetVMSUpdateSample.js][virtualmachinescalesetvmsupdatesample] | Updates a virtual machine of a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Update_MaximumSet_Gen.json | | [virtualMachineScaleSetsConvertToSinglePlacementGroupMaximumSetGen.js][virtualmachinescalesetsconverttosingleplacementgroupmaximumsetgen] | Converts SinglePlacementGroup property to false for a existing virtual machine scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ConvertToSinglePlacementGroup_MaximumSet_Gen.json | | [virtualMachineScaleSetsConvertToSinglePlacementGroupMinimumSetGen.js][virtualmachinescalesetsconverttosingleplacementgroupminimumsetgen] | Converts SinglePlacementGroup property to false for a existing virtual machine scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ConvertToSinglePlacementGroup_MinimumSet_Gen.json | +| [virtualMachineScaleSetsConvertToSinglePlacementGroupSample.js][virtualmachinescalesetsconverttosingleplacementgroupsample] | Converts SinglePlacementGroup property to false for a existing virtual machine scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ConvertToSinglePlacementGroup_MaximumSet_Gen.json | +| [virtualMachineScaleSetsCreateOrUpdateSample.js][virtualmachinescalesetscreateorupdatesample] | Create or update a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithExtensionsSuppressFailuresEnabled.json | | [virtualMachineScaleSetsDeallocateMaximumSetGen.js][virtualmachinescalesetsdeallocatemaximumsetgen] | Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Deallocate_MaximumSet_Gen.json | | [virtualMachineScaleSetsDeallocateMinimumSetGen.js][virtualmachinescalesetsdeallocateminimumsetgen] | Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Deallocate_MinimumSet_Gen.json | +| [virtualMachineScaleSetsDeallocateSample.js][virtualmachinescalesetsdeallocatesample] | Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Deallocate_MaximumSet_Gen.json | | [virtualMachineScaleSetsDeleteInstancesMaximumSetGen.js][virtualmachinescalesetsdeleteinstancesmaximumsetgen] | Deletes virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_DeleteInstances_MaximumSet_Gen.json | | [virtualMachineScaleSetsDeleteInstancesMinimumSetGen.js][virtualmachinescalesetsdeleteinstancesminimumsetgen] | Deletes virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_DeleteInstances_MinimumSet_Gen.json | +| [virtualMachineScaleSetsDeleteInstancesSample.js][virtualmachinescalesetsdeleteinstancessample] | Deletes virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_DeleteInstances_MaximumSet_Gen.json | +| [virtualMachineScaleSetsDeleteSample.js][virtualmachinescalesetsdeletesample] | Deletes a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ForceDeleteVirtualMachineScaleSets.json | | [virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkMaximumSetGen.js][virtualmachinescalesetsforcerecoveryservicefabricplatformupdatedomainwalkmaximumsetgen] | Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.json | | [virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkMinimumSetGen.js][virtualmachinescalesetsforcerecoveryservicefabricplatformupdatedomainwalkminimumsetgen] | Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MinimumSet_Gen.json | +| [virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.js][virtualmachinescalesetsforcerecoveryservicefabricplatformupdatedomainwalksample] | Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.json | | [virtualMachineScaleSetsGetInstanceViewMaximumSetGen.js][virtualmachinescalesetsgetinstanceviewmaximumsetgen] | Gets the status of a VM scale set instance. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetInstanceView_MaximumSet_Gen.json | | [virtualMachineScaleSetsGetInstanceViewMinimumSetGen.js][virtualmachinescalesetsgetinstanceviewminimumsetgen] | Gets the status of a VM scale set instance. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetInstanceView_MinimumSet_Gen.json | +| [virtualMachineScaleSetsGetInstanceViewSample.js][virtualmachinescalesetsgetinstanceviewsample] | Gets the status of a VM scale set instance. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetInstanceView_MaximumSet_Gen.json | | [virtualMachineScaleSetsGetOSUpgradeHistoryMaximumSetGen.js][virtualmachinescalesetsgetosupgradehistorymaximumsetgen] | Gets list of OS upgrades on a VM scale set instance. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetOSUpgradeHistory_MaximumSet_Gen.json | | [virtualMachineScaleSetsGetOSUpgradeHistoryMinimumSetGen.js][virtualmachinescalesetsgetosupgradehistoryminimumsetgen] | Gets list of OS upgrades on a VM scale set instance. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetOSUpgradeHistory_MinimumSet_Gen.json | +| [virtualMachineScaleSetsGetOSUpgradeHistorySample.js][virtualmachinescalesetsgetosupgradehistorysample] | Gets list of OS upgrades on a VM scale set instance. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetOSUpgradeHistory_MaximumSet_Gen.json | +| [virtualMachineScaleSetsGetSample.js][virtualmachinescalesetsgetsample] | Display information about a virtual machine scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSet.json | | [virtualMachineScaleSetsListAllMaximumSetGen.js][virtualmachinescalesetslistallmaximumsetgen] | Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListAll_MaximumSet_Gen.json | | [virtualMachineScaleSetsListAllMinimumSetGen.js][virtualmachinescalesetslistallminimumsetgen] | Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListAll_MinimumSet_Gen.json | +| [virtualMachineScaleSetsListAllSample.js][virtualmachinescalesetslistallsample] | Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListAll_MaximumSet_Gen.json | +| [virtualMachineScaleSetsListByLocationSample.js][virtualmachinescalesetslistbylocationsample] | Gets all the VM scale sets under the specified subscription for the specified location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListVirtualMachineScaleSetsInASubscriptionByLocation.json | | [virtualMachineScaleSetsListMaximumSetGen.js][virtualmachinescalesetslistmaximumsetgen] | Gets a list of all VM scale sets under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_List_MaximumSet_Gen.json | | [virtualMachineScaleSetsListMinimumSetGen.js][virtualmachinescalesetslistminimumsetgen] | Gets a list of all VM scale sets under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_List_MinimumSet_Gen.json | +| [virtualMachineScaleSetsListSample.js][virtualmachinescalesetslistsample] | Gets a list of all VM scale sets under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_List_MaximumSet_Gen.json | | [virtualMachineScaleSetsListSkusMaximumSetGen.js][virtualmachinescalesetslistskusmaximumsetgen] | Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListSkus_MaximumSet_Gen.json | | [virtualMachineScaleSetsListSkusMinimumSetGen.js][virtualmachinescalesetslistskusminimumsetgen] | Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListSkus_MinimumSet_Gen.json | +| [virtualMachineScaleSetsListSkusSample.js][virtualmachinescalesetslistskussample] | Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListSkus_MaximumSet_Gen.json | | [virtualMachineScaleSetsPerformMaintenanceMaximumSetGen.js][virtualmachinescalesetsperformmaintenancemaximumsetgen] | Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PerformMaintenance_MaximumSet_Gen.json | | [virtualMachineScaleSetsPerformMaintenanceMinimumSetGen.js][virtualmachinescalesetsperformmaintenanceminimumsetgen] | Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PerformMaintenance_MinimumSet_Gen.json | +| [virtualMachineScaleSetsPerformMaintenanceSample.js][virtualmachinescalesetsperformmaintenancesample] | Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PerformMaintenance_MaximumSet_Gen.json | | [virtualMachineScaleSetsPowerOffMaximumSetGen.js][virtualmachinescalesetspoweroffmaximumsetgen] | Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PowerOff_MaximumSet_Gen.json | | [virtualMachineScaleSetsPowerOffMinimumSetGen.js][virtualmachinescalesetspoweroffminimumsetgen] | Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PowerOff_MinimumSet_Gen.json | +| [virtualMachineScaleSetsPowerOffSample.js][virtualmachinescalesetspoweroffsample] | Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PowerOff_MaximumSet_Gen.json | | [virtualMachineScaleSetsRedeployMaximumSetGen.js][virtualmachinescalesetsredeploymaximumsetgen] | Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Redeploy_MaximumSet_Gen.json | | [virtualMachineScaleSetsRedeployMinimumSetGen.js][virtualmachinescalesetsredeployminimumsetgen] | Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Redeploy_MinimumSet_Gen.json | +| [virtualMachineScaleSetsRedeploySample.js][virtualmachinescalesetsredeploysample] | Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Redeploy_MaximumSet_Gen.json | | [virtualMachineScaleSetsReimageAllMaximumSetGen.js][virtualmachinescalesetsreimageallmaximumsetgen] | Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ReimageAll_MaximumSet_Gen.json | | [virtualMachineScaleSetsReimageAllMinimumSetGen.js][virtualmachinescalesetsreimageallminimumsetgen] | Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ReimageAll_MinimumSet_Gen.json | +| [virtualMachineScaleSetsReimageAllSample.js][virtualmachinescalesetsreimageallsample] | Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ReimageAll_MaximumSet_Gen.json | | [virtualMachineScaleSetsReimageMaximumSetGen.js][virtualmachinescalesetsreimagemaximumsetgen] | Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Reimage_MaximumSet_Gen.json | | [virtualMachineScaleSetsReimageMinimumSetGen.js][virtualmachinescalesetsreimageminimumsetgen] | Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Reimage_MinimumSet_Gen.json | +| [virtualMachineScaleSetsReimageSample.js][virtualmachinescalesetsreimagesample] | Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Reimage_MaximumSet_Gen.json | | [virtualMachineScaleSetsRestartMaximumSetGen.js][virtualmachinescalesetsrestartmaximumsetgen] | Restarts one or more virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Restart_MaximumSet_Gen.json | | [virtualMachineScaleSetsRestartMinimumSetGen.js][virtualmachinescalesetsrestartminimumsetgen] | Restarts one or more virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Restart_MinimumSet_Gen.json | +| [virtualMachineScaleSetsRestartSample.js][virtualmachinescalesetsrestartsample] | Restarts one or more virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Restart_MaximumSet_Gen.json | | [virtualMachineScaleSetsSetOrchestrationServiceStateMaximumSetGen.js][virtualmachinescalesetssetorchestrationservicestatemaximumsetgen] | Changes ServiceState property for a given service x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_SetOrchestrationServiceState_MaximumSet_Gen.json | | [virtualMachineScaleSetsSetOrchestrationServiceStateMinimumSetGen.js][virtualmachinescalesetssetorchestrationservicestateminimumsetgen] | Changes ServiceState property for a given service x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_SetOrchestrationServiceState_MinimumSet_Gen.json | +| [virtualMachineScaleSetsSetOrchestrationServiceStateSample.js][virtualmachinescalesetssetorchestrationservicestatesample] | Changes ServiceState property for a given service x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_SetOrchestrationServiceState_MaximumSet_Gen.json | | [virtualMachineScaleSetsStartMaximumSetGen.js][virtualmachinescalesetsstartmaximumsetgen] | Starts one or more virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Start_MaximumSet_Gen.json | | [virtualMachineScaleSetsStartMinimumSetGen.js][virtualmachinescalesetsstartminimumsetgen] | Starts one or more virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Start_MinimumSet_Gen.json | +| [virtualMachineScaleSetsStartSample.js][virtualmachinescalesetsstartsample] | Starts one or more virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Start_MaximumSet_Gen.json | | [virtualMachineScaleSetsUpdateInstancesMaximumSetGen.js][virtualmachinescalesetsupdateinstancesmaximumsetgen] | Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_UpdateInstances_MaximumSet_Gen.json | | [virtualMachineScaleSetsUpdateInstancesMinimumSetGen.js][virtualmachinescalesetsupdateinstancesminimumsetgen] | Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_UpdateInstances_MinimumSet_Gen.json | +| [virtualMachineScaleSetsUpdateInstancesSample.js][virtualmachinescalesetsupdateinstancessample] | Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_UpdateInstances_MaximumSet_Gen.json | | [virtualMachineScaleSetsUpdateMaximumSetGen.js][virtualmachinescalesetsupdatemaximumsetgen] | Update a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Update_MaximumSet_Gen.json | | [virtualMachineScaleSetsUpdateMinimumSetGen.js][virtualmachinescalesetsupdateminimumsetgen] | Update a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Update_MinimumSet_Gen.json | +| [virtualMachineScaleSetsUpdateSample.js][virtualmachinescalesetsupdatesample] | Update a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Update_MaximumSet_Gen.json | | [virtualMachineSizesListMaximumSetGen.js][virtualmachinesizeslistmaximumsetgen] | This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineSizes_List_MaximumSet_Gen.json | | [virtualMachineSizesListMinimumSetGen.js][virtualmachinesizeslistminimumsetgen] | This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineSizes_List_MinimumSet_Gen.json | +| [virtualMachineSizesListSample.js][virtualmachinesizeslistsample] | This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineSizes_List_MaximumSet_Gen.json | +| [virtualMachinesAssessPatchesSample.js][virtualmachinesassesspatchessample] | Assess patches on the VM. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineAssessPatches.json | | [virtualMachinesCaptureMaximumSetGen.js][virtualmachinescapturemaximumsetgen] | Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Capture_MaximumSet_Gen.json | | [virtualMachinesCaptureMinimumSetGen.js][virtualmachinescaptureminimumsetgen] | Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Capture_MinimumSet_Gen.json | +| [virtualMachinesCaptureSample.js][virtualmachinescapturesample] | Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Capture_MaximumSet_Gen.json | | [virtualMachinesConvertToManagedDisksMaximumSetGen.js][virtualmachinesconverttomanageddisksmaximumsetgen] | Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ConvertToManagedDisks_MaximumSet_Gen.json | | [virtualMachinesConvertToManagedDisksMinimumSetGen.js][virtualmachinesconverttomanageddisksminimumsetgen] | Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ConvertToManagedDisks_MinimumSet_Gen.json | +| [virtualMachinesConvertToManagedDisksSample.js][virtualmachinesconverttomanageddiskssample] | Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ConvertToManagedDisks_MaximumSet_Gen.json | +| [virtualMachinesCreateOrUpdateSample.js][virtualmachinescreateorupdatesample] | The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateALinuxVmWithPatchSettingAssessmentModeOfImageDefault.json | | [virtualMachinesDeallocateMaximumSetGen.js][virtualmachinesdeallocatemaximumsetgen] | Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Deallocate_MaximumSet_Gen.json | | [virtualMachinesDeallocateMinimumSetGen.js][virtualmachinesdeallocateminimumsetgen] | Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Deallocate_MinimumSet_Gen.json | +| [virtualMachinesDeallocateSample.js][virtualmachinesdeallocatesample] | Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Deallocate_MaximumSet_Gen.json | +| [virtualMachinesDeleteSample.js][virtualmachinesdeletesample] | The operation to delete a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ForceDeleteVirtualMachine.json | +| [virtualMachinesGeneralizeSample.js][virtualmachinesgeneralizesample] | Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation.
For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource).
For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GeneralizeVirtualMachine.json | +| [virtualMachinesGetSample.js][virtualmachinesgetsample] | Retrieves information about the model view or the instance view of a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachine.json | +| [virtualMachinesInstallPatchesSample.js][virtualmachinesinstallpatchessample] | Installs patches on the VM. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineInstallPatches.json | +| [virtualMachinesInstanceViewSample.js][virtualmachinesinstanceviewsample] | Retrieves information about the run-time state of a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineInstanceView.json | | [virtualMachinesListAllMaximumSetGen.js][virtualmachineslistallmaximumsetgen] | Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ListAll_MaximumSet_Gen.json | | [virtualMachinesListAllMinimumSetGen.js][virtualmachineslistallminimumsetgen] | Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ListAll_MinimumSet_Gen.json | +| [virtualMachinesListAllSample.js][virtualmachineslistallsample] | Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ListAll_MaximumSet_Gen.json | +| [virtualMachinesListAvailableSizesSample.js][virtualmachineslistavailablesizessample] | Lists all available virtual machine sizes to which the specified virtual machine can be resized. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListAvailableVmSizes_VirtualMachines.json | +| [virtualMachinesListByLocationSample.js][virtualmachineslistbylocationsample] | Gets all the virtual machines under the specified subscription for the specified location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListVirtualMachinesInASubscriptionByLocation.json | | [virtualMachinesListMaximumSetGen.js][virtualmachineslistmaximumsetgen] | Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_List_MaximumSet_Gen.json | | [virtualMachinesListMinimumSetGen.js][virtualmachineslistminimumsetgen] | Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_List_MinimumSet_Gen.json | +| [virtualMachinesListSample.js][virtualmachineslistsample] | Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_List_MaximumSet_Gen.json | | [virtualMachinesPerformMaintenanceMaximumSetGen.js][virtualmachinesperformmaintenancemaximumsetgen] | The operation to perform maintenance on a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PerformMaintenance_MaximumSet_Gen.json | | [virtualMachinesPerformMaintenanceMinimumSetGen.js][virtualmachinesperformmaintenanceminimumsetgen] | The operation to perform maintenance on a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PerformMaintenance_MinimumSet_Gen.json | +| [virtualMachinesPerformMaintenanceSample.js][virtualmachinesperformmaintenancesample] | The operation to perform maintenance on a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PerformMaintenance_MaximumSet_Gen.json | | [virtualMachinesPowerOffMaximumSetGen.js][virtualmachinespoweroffmaximumsetgen] | The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PowerOff_MaximumSet_Gen.json | | [virtualMachinesPowerOffMinimumSetGen.js][virtualmachinespoweroffminimumsetgen] | The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PowerOff_MinimumSet_Gen.json | +| [virtualMachinesPowerOffSample.js][virtualmachinespoweroffsample] | The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PowerOff_MaximumSet_Gen.json | +| [virtualMachinesReapplySample.js][virtualmachinesreapplysample] | The operation to reapply a virtual machine's state. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ReapplyVirtualMachine.json | | [virtualMachinesRedeployMaximumSetGen.js][virtualmachinesredeploymaximumsetgen] | Shuts down the virtual machine, moves it to a new node, and powers it back on. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Redeploy_MaximumSet_Gen.json | | [virtualMachinesRedeployMinimumSetGen.js][virtualmachinesredeployminimumsetgen] | Shuts down the virtual machine, moves it to a new node, and powers it back on. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Redeploy_MinimumSet_Gen.json | +| [virtualMachinesRedeploySample.js][virtualmachinesredeploysample] | Shuts down the virtual machine, moves it to a new node, and powers it back on. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Redeploy_MaximumSet_Gen.json | +| [virtualMachinesReimageSample.js][virtualmachinesreimagesample] | Reimages the virtual machine which has an ephemeral OS disk back to its initial state. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ReimageVirtualMachine.json | | [virtualMachinesRestartMaximumSetGen.js][virtualmachinesrestartmaximumsetgen] | The operation to restart a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Restart_MaximumSet_Gen.json | | [virtualMachinesRestartMinimumSetGen.js][virtualmachinesrestartminimumsetgen] | The operation to restart a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Restart_MinimumSet_Gen.json | +| [virtualMachinesRestartSample.js][virtualmachinesrestartsample] | The operation to restart a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Restart_MaximumSet_Gen.json | +| [virtualMachinesRetrieveBootDiagnosticsDataSample.js][virtualmachinesretrievebootdiagnosticsdatasample] | The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RetrieveBootDiagnosticsDataVirtualMachine.json | +| [virtualMachinesRunCommandSample.js][virtualmachinesruncommandsample] | Run command on the VM. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VirtualMachineRunCommand.json | +| [virtualMachinesSimulateEvictionSample.js][virtualmachinessimulateevictionsample] | The operation to simulate the eviction of spot virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SimulateEvictionOfVM.json | | [virtualMachinesStartMaximumSetGen.js][virtualmachinesstartmaximumsetgen] | The operation to start a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Start_MaximumSet_Gen.json | | [virtualMachinesStartMinimumSetGen.js][virtualmachinesstartminimumsetgen] | The operation to start a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Start_MinimumSet_Gen.json | +| [virtualMachinesStartSample.js][virtualmachinesstartsample] | The operation to start a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Start_MaximumSet_Gen.json | +| [virtualMachinesUpdateSample.js][virtualmachinesupdatesample] | The operation to update a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateVMDetachDataDiskUsingToBeDetachedProperty.json | ## Prerequisites @@ -543,24 +818,74 @@ Take a look at our [API Documentation][apiref] for more information about the AP [addsharingidtothesharingprofileofagallery]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/addSharingIdToTheSharingProfileOfAGallery.js [approveaprivateendpointconnectionunderadiskaccessresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/approveAPrivateEndpointConnectionUnderADiskAccessResource.js [assesspatchstateofavirtualmachine]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/assessPatchStateOfAVirtualMachine.js +[availabilitysetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsCreateOrUpdateSample.js [availabilitysetsdeletemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsDeleteMaximumSetGen.js [availabilitysetsdeleteminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsDeleteMinimumSetGen.js +[availabilitysetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsDeleteSample.js [availabilitysetsgetmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsGetMaximumSetGen.js [availabilitysetsgetminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsGetMinimumSetGen.js +[availabilitysetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsGetSample.js [availabilitysetslistavailablesizesmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsListAvailableSizesMaximumSetGen.js [availabilitysetslistavailablesizesminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsListAvailableSizesMinimumSetGen.js +[availabilitysetslistavailablesizessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsListAvailableSizesSample.js +[availabilitysetslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsListBySubscriptionSample.js [availabilitysetslistmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsListMaximumSetGen.js [availabilitysetslistminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsListMinimumSetGen.js +[availabilitysetslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsListSample.js [availabilitysetsupdatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsUpdateMaximumSetGen.js [availabilitysetsupdateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsUpdateMinimumSetGen.js +[availabilitysetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsUpdateSample.js +[capacityreservationgroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsCreateOrUpdateSample.js [capacityreservationgroupsdeletemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsDeleteMaximumSetGen.js [capacityreservationgroupsdeleteminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsDeleteMinimumSetGen.js +[capacityreservationgroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsDeleteSample.js +[capacityreservationgroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsGetSample.js +[capacityreservationgroupslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsListByResourceGroupSample.js +[capacityreservationgroupslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsListBySubscriptionSample.js [capacityreservationgroupsupdatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsUpdateMaximumSetGen.js [capacityreservationgroupsupdateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsUpdateMinimumSetGen.js +[capacityreservationgroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsUpdateSample.js +[capacityreservationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationsCreateOrUpdateSample.js [capacityreservationsdeletemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationsDeleteMaximumSetGen.js [capacityreservationsdeleteminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationsDeleteMinimumSetGen.js +[capacityreservationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationsDeleteSample.js +[capacityreservationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationsGetSample.js +[capacityreservationslistbycapacityreservationgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationsListByCapacityReservationGroupSample.js [capacityreservationsupdatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationsUpdateMaximumSetGen.js [capacityreservationsupdateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationsUpdateMinimumSetGen.js +[capacityreservationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationsUpdateSample.js +[cloudserviceoperatingsystemsgetosfamilysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceOperatingSystemsGetOSFamilySample.js +[cloudserviceoperatingsystemsgetosversionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceOperatingSystemsGetOSVersionSample.js +[cloudserviceoperatingsystemslistosfamiliessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceOperatingSystemsListOSFamiliesSample.js +[cloudserviceoperatingsystemslistosversionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceOperatingSystemsListOSVersionsSample.js +[cloudserviceroleinstancesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesDeleteSample.js +[cloudserviceroleinstancesgetinstanceviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesGetInstanceViewSample.js +[cloudserviceroleinstancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesGetSample.js +[cloudserviceroleinstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesListSample.js +[cloudserviceroleinstancesrebuildsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesRebuildSample.js +[cloudserviceroleinstancesreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesReimageSample.js +[cloudserviceroleinstancesrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesRestartSample.js +[cloudservicerolesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRolesGetSample.js +[cloudserviceroleslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRolesListSample.js +[cloudservicescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesCreateOrUpdateSample.js +[cloudservicesdeleteinstancessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesDeleteInstancesSample.js +[cloudservicesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesDeleteSample.js +[cloudservicesgetinstanceviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesGetInstanceViewSample.js +[cloudservicesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesGetSample.js +[cloudserviceslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesListAllSample.js +[cloudserviceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesListSample.js +[cloudservicespoweroffsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesPowerOffSample.js +[cloudservicesrebuildsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesRebuildSample.js +[cloudservicesreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesReimageSample.js +[cloudservicesrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesRestartSample.js +[cloudservicesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesStartSample.js +[cloudservicesupdatedomaingetupdatedomainsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesUpdateDomainGetUpdateDomainSample.js +[cloudservicesupdatedomainlistupdatedomainssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesUpdateDomainListUpdateDomainsSample.js +[cloudservicesupdatedomainwalkupdatedomainsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesUpdateDomainWalkUpdateDomainSample.js +[cloudservicesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesUpdateSample.js +[communitygalleriesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/communityGalleriesGetSample.js +[communitygalleryimageversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/communityGalleryImageVersionsGetSample.js +[communitygalleryimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/communityGalleryImagesGetSample.js [copyarestorepointtoadifferentregion]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/copyARestorePointToADifferentRegion.js [createacommunitygallery]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/createACommunityGallery.js [createaconfidentialvmsupporteddiskencryptedwithcustomermanagedkey]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/createAConfidentialVMSupportedDiskEncryptedWithCustomerManagedKey.js @@ -703,20 +1028,32 @@ Take a look at our [API Documentation][apiref] for more information about the AP [createorupdateavmwithcapacityreservation]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/createOrUpdateAVMWithCapacityReservation.js [createvirtualmachinescalesetvmextension]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/createVirtualMachineScaleSetVMExtension.js [createvirtualmachinescalesetvmruncommand]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/createVirtualMachineScaleSetVMRunCommand.js +[dedicatedhostgroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsCreateOrUpdateSample.js [dedicatedhostgroupsdeletemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsDeleteMaximumSetGen.js [dedicatedhostgroupsdeleteminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsDeleteMinimumSetGen.js +[dedicatedhostgroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsDeleteSample.js +[dedicatedhostgroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsGetSample.js [dedicatedhostgroupslistbyresourcegroupmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsListByResourceGroupMaximumSetGen.js [dedicatedhostgroupslistbyresourcegroupminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsListByResourceGroupMinimumSetGen.js +[dedicatedhostgroupslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsListByResourceGroupSample.js [dedicatedhostgroupslistbysubscriptionmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsListBySubscriptionMaximumSetGen.js [dedicatedhostgroupslistbysubscriptionminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsListBySubscriptionMinimumSetGen.js +[dedicatedhostgroupslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsListBySubscriptionSample.js [dedicatedhostgroupsupdatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsUpdateMaximumSetGen.js [dedicatedhostgroupsupdateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsUpdateMinimumSetGen.js +[dedicatedhostgroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsUpdateSample.js +[dedicatedhostscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsCreateOrUpdateSample.js [dedicatedhostsdeletemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsDeleteMaximumSetGen.js [dedicatedhostsdeleteminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsDeleteMinimumSetGen.js +[dedicatedhostsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsDeleteSample.js +[dedicatedhostsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsGetSample.js [dedicatedhostslistbyhostgroupmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsListByHostGroupMaximumSetGen.js [dedicatedhostslistbyhostgroupminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsListByHostGroupMinimumSetGen.js +[dedicatedhostslistbyhostgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsListByHostGroupSample.js +[dedicatedhostsrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsRestartSample.js [dedicatedhostsupdatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsUpdateMaximumSetGen.js [dedicatedhostsupdateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsUpdateMinimumSetGen.js +[dedicatedhostsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsUpdateSample.js [deleteadiskaccessresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/deleteADiskAccessResource.js [deleteadiskencryptionset]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/deleteADiskEncryptionSet.js [deleteagallery]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/deleteAGallery.js @@ -733,11 +1070,68 @@ Take a look at our [API Documentation][apiref] for more information about the AP [deletecloudserviceroleinstances]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/deleteCloudServiceRoleInstances.js [deletevirtualmachinescalesetvmextension]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/deleteVirtualMachineScaleSetVMExtension.js [deletevirtualmachinescalesetvmruncommand]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/deleteVirtualMachineScaleSetVMRunCommand.js +[diskaccessescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesCreateOrUpdateSample.js +[diskaccessesdeleteaprivateendpointconnectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesDeleteAPrivateEndpointConnectionSample.js +[diskaccessesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesDeleteSample.js +[diskaccessesgetaprivateendpointconnectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesGetAPrivateEndpointConnectionSample.js +[diskaccessesgetprivatelinkresourcessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesGetPrivateLinkResourcesSample.js +[diskaccessesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesGetSample.js +[diskaccesseslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesListByResourceGroupSample.js +[diskaccesseslistprivateendpointconnectionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesListPrivateEndpointConnectionsSample.js +[diskaccesseslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesListSample.js +[diskaccessesupdateaprivateendpointconnectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesUpdateAPrivateEndpointConnectionSample.js +[diskaccessesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesUpdateSample.js +[diskencryptionsetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsCreateOrUpdateSample.js +[diskencryptionsetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsDeleteSample.js +[diskencryptionsetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsGetSample.js +[diskencryptionsetslistassociatedresourcessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsListAssociatedResourcesSample.js +[diskencryptionsetslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsListByResourceGroupSample.js +[diskencryptionsetslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsListSample.js +[diskencryptionsetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsUpdateSample.js +[diskrestorepointgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/diskRestorePointGetSample.js +[diskrestorepointgrantaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/diskRestorePointGrantAccessSample.js +[diskrestorepointlistbyrestorepointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/diskRestorePointListByRestorePointSample.js +[diskrestorepointrevokeaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/diskRestorePointRevokeAccessSample.js +[diskscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/disksCreateOrUpdateSample.js +[disksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/disksDeleteSample.js +[disksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/disksGetSample.js +[disksgrantaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/disksGrantAccessSample.js +[diskslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/disksListByResourceGroupSample.js +[diskslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/disksListSample.js +[disksrevokeaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/disksRevokeAccessSample.js +[disksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/disksUpdateSample.js [exportlogswhichcontainallapirequestsmadetocomputeresourceproviderwithinthegiventimeperiodbrokendownbyintervals]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/exportLogsWhichContainAllApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriodBrokenDownByIntervals.js [exportlogswhichcontainallthrottledapirequestsmadetocomputeresourceproviderwithinthegiventimeperiod]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/exportLogsWhichContainAllThrottledApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriod.js [forcedeleteavm]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/forceDeleteAVM.js [forcedeleteavmscaleset]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/forceDeleteAVMScaleSet.js [forcedeleteavirtualmachinefromavmscaleset]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/forceDeleteAVirtualMachineFromAVMScaleSet.js +[galleriescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/galleriesCreateOrUpdateSample.js +[galleriesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/galleriesDeleteSample.js +[galleriesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/galleriesGetSample.js +[gallerieslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/galleriesListByResourceGroupSample.js +[gallerieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/galleriesListSample.js +[galleriesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/galleriesUpdateSample.js +[galleryapplicationversionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationVersionsCreateOrUpdateSample.js +[galleryapplicationversionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationVersionsDeleteSample.js +[galleryapplicationversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationVersionsGetSample.js +[galleryapplicationversionslistbygalleryapplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationVersionsListByGalleryApplicationSample.js +[galleryapplicationversionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationVersionsUpdateSample.js +[galleryapplicationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationsCreateOrUpdateSample.js +[galleryapplicationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationsDeleteSample.js +[galleryapplicationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationsGetSample.js +[galleryapplicationslistbygallerysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationsListByGallerySample.js +[galleryapplicationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationsUpdateSample.js +[galleryimageversionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/galleryImageVersionsCreateOrUpdateSample.js +[galleryimageversionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/galleryImageVersionsDeleteSample.js +[galleryimageversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/galleryImageVersionsGetSample.js +[galleryimageversionslistbygalleryimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/galleryImageVersionsListByGalleryImageSample.js +[galleryimageversionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/galleryImageVersionsUpdateSample.js +[galleryimagescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/galleryImagesCreateOrUpdateSample.js +[galleryimagesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/galleryImagesDeleteSample.js +[galleryimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/galleryImagesGetSample.js +[galleryimageslistbygallerysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/galleryImagesListByGallerySample.js +[galleryimagesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/galleryImagesUpdateSample.js +[gallerysharingprofileupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/gallerySharingProfileUpdateSample.js [generalizeavirtualmachine]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/generalizeAVirtualMachine.js [generateansshkeypair]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/generateAnSshKeyPair.js [getacapacityreservation]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/getACapacityReservation.js @@ -798,8 +1192,14 @@ Take a look at our [API Documentation][apiref] for more information about the AP [getsthelistofrestorepointcollectionsinaresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/getsTheListOfRestorePointCollectionsInAResourceGroup.js [getsthelistofrestorepointcollectionsinasubscription]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/getsTheListOfRestorePointCollectionsInASubscription.js [grantsaccesstoadiskrestorepoint]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/grantsAccessToADiskRestorePoint.js +[imagescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/imagesCreateOrUpdateSample.js [imagesdeletemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/imagesDeleteMaximumSetGen.js [imagesdeleteminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/imagesDeleteMinimumSetGen.js +[imagesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/imagesDeleteSample.js +[imagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/imagesGetSample.js +[imageslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/imagesListByResourceGroupSample.js +[imageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/imagesListSample.js +[imagesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/imagesUpdateSample.js [installpatchstateofavirtualmachine]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/installPatchStateOfAVirtualMachine.js [listalldiskaccessresourcesinaresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/listAllDiskAccessResourcesInAResourceGroup.js [listalldiskaccessresourcesinasubscription]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/listAllDiskAccessResourcesInASubscription.js @@ -839,8 +1239,17 @@ Take a look at our [API Documentation][apiref] for more information about the AP [listsallavailablevirtualmachinesizestowhichthespecifiedvirtualmachinecanberesized]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/listsAllAvailableVirtualMachineSizesToWhichTheSpecifiedVirtualMachineCanBeResized.js [listsallthevmscalesetsunderthespecifiedsubscriptionforthespecifiedlocation]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/listsAllTheVMScaleSetsUnderTheSpecifiedSubscriptionForTheSpecifiedLocation.js [listsallthevirtualmachinesunderthespecifiedsubscriptionforthespecifiedlocation]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/listsAllTheVirtualMachinesUnderTheSpecifiedSubscriptionForTheSpecifiedLocation.js +[loganalyticsexportrequestratebyintervalsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/logAnalyticsExportRequestRateByIntervalSample.js +[loganalyticsexportthrottledrequestssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/logAnalyticsExportThrottledRequestsSample.js [operationslistmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/operationsListMaximumSetGen.js [operationslistminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/operationsListMinimumSetGen.js +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/operationsListSample.js +[proximityplacementgroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/proximityPlacementGroupsCreateOrUpdateSample.js +[proximityplacementgroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/proximityPlacementGroupsDeleteSample.js +[proximityplacementgroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/proximityPlacementGroupsGetSample.js +[proximityplacementgroupslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/proximityPlacementGroupsListByResourceGroupSample.js +[proximityplacementgroupslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/proximityPlacementGroupsListBySubscriptionSample.js +[proximityplacementgroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/proximityPlacementGroupsUpdateSample.js [reapplythestateofavirtualmachine]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/reapplyTheStateOfAVirtualMachine.js [rebuildcloudserviceroleinstance]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/rebuildCloudServiceRoleInstance.js [rebuildcloudserviceroleinstances]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/rebuildCloudServiceRoleInstances.js @@ -848,29 +1257,60 @@ Take a look at our [API Documentation][apiref] for more information about the AP [reimagecloudserviceroleinstance]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/reimageCloudServiceRoleInstance.js [reimagecloudserviceroleinstances]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/reimageCloudServiceRoleInstances.js [resetsharingprofileofagallery]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/resetSharingProfileOfAGallery.js +[resourceskuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/resourceSkusListSample.js [restartcloudserviceroleinstance]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/restartCloudServiceRoleInstance.js [restartcloudserviceroleinstances]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/restartCloudServiceRoleInstances.js [restartdedicatedhost]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/restartDedicatedHost.js +[restorepointcollectionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsCreateOrUpdateSample.js [restorepointcollectionsdeletemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsDeleteMaximumSetGen.js [restorepointcollectionsdeleteminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsDeleteMinimumSetGen.js +[restorepointcollectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsDeleteSample.js +[restorepointcollectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsGetSample.js +[restorepointcollectionslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsListAllSample.js +[restorepointcollectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsListSample.js [restorepointcollectionsupdatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsUpdateMaximumSetGen.js [restorepointcollectionsupdateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsUpdateMinimumSetGen.js +[restorepointcollectionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsUpdateSample.js +[restorepointscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/restorePointsCreateSample.js [restorepointsdeletemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/restorePointsDeleteMaximumSetGen.js [restorepointsdeleteminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/restorePointsDeleteMinimumSetGen.js +[restorepointsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/restorePointsDeleteSample.js +[restorepointsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/restorePointsGetSample.js [retrievebootdiagnosticsdataofavirtualmachine]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/retrieveBootDiagnosticsDataOfAVirtualMachine.js [revokeaccesstoamanageddisk]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/revokeAccessToAManagedDisk.js [revokeaccesstoasnapshot]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/revokeAccessToASnapshot.js [revokesaccesstoadiskrestorepoint]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/revokesAccessToADiskRestorePoint.js [shareagallerytocommunity]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/shareAGalleryToCommunity.js +[sharedgalleriesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/sharedGalleriesGetSample.js +[sharedgallerieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/sharedGalleriesListSample.js +[sharedgalleryimageversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/sharedGalleryImageVersionsGetSample.js +[sharedgalleryimageversionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/sharedGalleryImageVersionsListSample.js +[sharedgalleryimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/sharedGalleryImagesGetSample.js +[sharedgalleryimageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/sharedGalleryImagesListSample.js [simulateevictionavirtualmachine]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/simulateEvictionAVirtualMachine.js +[snapshotscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/snapshotsCreateOrUpdateSample.js +[snapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/snapshotsDeleteSample.js +[snapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/snapshotsGetSample.js +[snapshotsgrantaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/snapshotsGrantAccessSample.js +[snapshotslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/snapshotsListByResourceGroupSample.js +[snapshotslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/snapshotsListSample.js +[snapshotsrevokeaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/snapshotsRevokeAccessSample.js +[snapshotsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/snapshotsUpdateSample.js +[sshpublickeyscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysCreateSample.js [sshpublickeysdeletemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysDeleteMaximumSetGen.js [sshpublickeysdeleteminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysDeleteMinimumSetGen.js +[sshpublickeysdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysDeleteSample.js +[sshpublickeysgeneratekeypairsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysGenerateKeyPairSample.js +[sshpublickeysgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysGetSample.js [sshpublickeyslistbyresourcegroupmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysListByResourceGroupMaximumSetGen.js [sshpublickeyslistbyresourcegroupminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysListByResourceGroupMinimumSetGen.js +[sshpublickeyslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysListByResourceGroupSample.js [sshpublickeyslistbysubscriptionmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysListBySubscriptionMaximumSetGen.js [sshpublickeyslistbysubscriptionminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysListBySubscriptionMinimumSetGen.js +[sshpublickeyslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysListBySubscriptionSample.js [sshpublickeysupdatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysUpdateMaximumSetGen.js [sshpublickeysupdateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysUpdateMinimumSetGen.js +[sshpublickeysupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysUpdateSample.js [startanextensionrollingupgrade]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/startAnExtensionRollingUpgrade.js [startcloudservice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/startCloudService.js [stoporpoweroffcloudservice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/stopOrPowerOffCloudService.js @@ -903,140 +1343,250 @@ Take a look at our [API Documentation][apiref] for more information about the AP [updatestagsofanimage]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/updatesTagsOfAnImage.js [usagelistmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/usageListMaximumSetGen.js [usagelistminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/usageListMinimumSetGen.js +[usagelistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/usageListSample.js [virtualmachineextensionimagesgetmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionImagesGetMaximumSetGen.js [virtualmachineextensionimagesgetminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionImagesGetMinimumSetGen.js +[virtualmachineextensionimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionImagesGetSample.js [virtualmachineextensionimageslisttypesmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionImagesListTypesMaximumSetGen.js [virtualmachineextensionimageslisttypesminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionImagesListTypesMinimumSetGen.js +[virtualmachineextensionimageslisttypessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionImagesListTypesSample.js [virtualmachineextensionimageslistversionsmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionImagesListVersionsMaximumSetGen.js [virtualmachineextensionimageslistversionsminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionImagesListVersionsMinimumSetGen.js +[virtualmachineextensionimageslistversionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionImagesListVersionsSample.js [virtualmachineextensionscreateorupdatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsCreateOrUpdateMaximumSetGen.js [virtualmachineextensionscreateorupdateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsCreateOrUpdateMinimumSetGen.js +[virtualmachineextensionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsCreateOrUpdateSample.js [virtualmachineextensionsdeletemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsDeleteMaximumSetGen.js [virtualmachineextensionsdeleteminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsDeleteMinimumSetGen.js +[virtualmachineextensionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsDeleteSample.js [virtualmachineextensionsgetmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsGetMaximumSetGen.js [virtualmachineextensionsgetminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsGetMinimumSetGen.js +[virtualmachineextensionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsGetSample.js [virtualmachineextensionslistmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsListMaximumSetGen.js [virtualmachineextensionslistminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsListMinimumSetGen.js +[virtualmachineextensionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsListSample.js +[virtualmachineextensionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsUpdateSample.js [virtualmachineimagesedgezonegetmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneGetMaximumSetGen.js [virtualmachineimagesedgezonegetminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneGetMinimumSetGen.js +[virtualmachineimagesedgezonegetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneGetSample.js [virtualmachineimagesedgezonelistmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneListMaximumSetGen.js [virtualmachineimagesedgezonelistminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneListMinimumSetGen.js [virtualmachineimagesedgezonelistoffersmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneListOffersMaximumSetGen.js [virtualmachineimagesedgezonelistoffersminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneListOffersMinimumSetGen.js +[virtualmachineimagesedgezonelistofferssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneListOffersSample.js [virtualmachineimagesedgezonelistpublishersmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneListPublishersMaximumSetGen.js [virtualmachineimagesedgezonelistpublishersminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneListPublishersMinimumSetGen.js +[virtualmachineimagesedgezonelistpublisherssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneListPublishersSample.js +[virtualmachineimagesedgezonelistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneListSample.js [virtualmachineimagesedgezonelistskusmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneListSkusMaximumSetGen.js [virtualmachineimagesedgezonelistskusminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneListSkusMinimumSetGen.js +[virtualmachineimagesedgezonelistskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneListSkusSample.js [virtualmachineimagesgetmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesGetMaximumSetGen.js [virtualmachineimagesgetminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesGetMinimumSetGen.js +[virtualmachineimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesGetSample.js [virtualmachineimageslistmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesListMaximumSetGen.js [virtualmachineimageslistminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesListMinimumSetGen.js [virtualmachineimageslistoffersmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesListOffersMaximumSetGen.js [virtualmachineimageslistoffersminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesListOffersMinimumSetGen.js +[virtualmachineimageslistofferssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesListOffersSample.js [virtualmachineimageslistpublishersmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesListPublishersMaximumSetGen.js [virtualmachineimageslistpublishersminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesListPublishersMinimumSetGen.js +[virtualmachineimageslistpublisherssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesListPublishersSample.js +[virtualmachineimageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesListSample.js [virtualmachineimageslistskusmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesListSkusMaximumSetGen.js [virtualmachineimageslistskusminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesListSkusMinimumSetGen.js +[virtualmachineimageslistskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesListSkusSample.js [virtualmachineruncommand]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommand.js [virtualmachineruncommandget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandGet.js [virtualmachineruncommandlist]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandList.js +[virtualmachineruncommandscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsCreateOrUpdateSample.js +[virtualmachineruncommandsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsDeleteSample.js +[virtualmachineruncommandsgetbyvirtualmachinesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsGetByVirtualMachineSample.js +[virtualmachineruncommandsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsGetSample.js +[virtualmachineruncommandslistbyvirtualmachinesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsListByVirtualMachineSample.js +[virtualmachineruncommandslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsListSample.js +[virtualmachineruncommandsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsUpdateSample.js [virtualmachinescalesetextensionscreateorupdatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsCreateOrUpdateMaximumSetGen.js [virtualmachinescalesetextensionscreateorupdateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsCreateOrUpdateMinimumSetGen.js +[virtualmachinescalesetextensionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsCreateOrUpdateSample.js [virtualmachinescalesetextensionsdeletemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsDeleteMaximumSetGen.js [virtualmachinescalesetextensionsdeleteminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsDeleteMinimumSetGen.js +[virtualmachinescalesetextensionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsDeleteSample.js [virtualmachinescalesetextensionsgetmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsGetMaximumSetGen.js [virtualmachinescalesetextensionsgetminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsGetMinimumSetGen.js +[virtualmachinescalesetextensionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsGetSample.js [virtualmachinescalesetextensionslistmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsListMaximumSetGen.js [virtualmachinescalesetextensionslistminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsListMinimumSetGen.js +[virtualmachinescalesetextensionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsListSample.js [virtualmachinescalesetextensionsupdatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsUpdateMaximumSetGen.js [virtualmachinescalesetextensionsupdateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsUpdateMinimumSetGen.js +[virtualmachinescalesetextensionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsUpdateSample.js [virtualmachinescalesetrollingupgradescancelmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetRollingUpgradesCancelMaximumSetGen.js [virtualmachinescalesetrollingupgradescancelminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetRollingUpgradesCancelMinimumSetGen.js +[virtualmachinescalesetrollingupgradescancelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetRollingUpgradesCancelSample.js [virtualmachinescalesetrollingupgradesgetlatestmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetRollingUpgradesGetLatestMaximumSetGen.js [virtualmachinescalesetrollingupgradesgetlatestminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetRollingUpgradesGetLatestMinimumSetGen.js +[virtualmachinescalesetrollingupgradesgetlatestsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetRollingUpgradesGetLatestSample.js +[virtualmachinescalesetrollingupgradesstartextensionupgradesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.js [virtualmachinescalesetrollingupgradesstartosupgrademaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetRollingUpgradesStartOSUpgradeMaximumSetGen.js [virtualmachinescalesetrollingupgradesstartosupgrademinimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetRollingUpgradesStartOSUpgradeMinimumSetGen.js +[virtualmachinescalesetrollingupgradesstartosupgradesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.js +[virtualmachinescalesetvmextensionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.js +[virtualmachinescalesetvmextensionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMExtensionsDeleteSample.js +[virtualmachinescalesetvmextensionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMExtensionsGetSample.js +[virtualmachinescalesetvmextensionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMExtensionsListSample.js +[virtualmachinescalesetvmextensionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMExtensionsUpdateSample.js +[virtualmachinescalesetvmruncommandscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.js +[virtualmachinescalesetvmruncommandsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMRunCommandsDeleteSample.js +[virtualmachinescalesetvmruncommandsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMRunCommandsGetSample.js +[virtualmachinescalesetvmruncommandslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMRunCommandsListSample.js +[virtualmachinescalesetvmruncommandsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMRunCommandsUpdateSample.js [virtualmachinescalesetvmsdeallocatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSDeallocateMaximumSetGen.js [virtualmachinescalesetvmsdeallocateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSDeallocateMinimumSetGen.js +[virtualmachinescalesetvmsdeallocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSDeallocateSample.js +[virtualmachinescalesetvmsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSDeleteSample.js +[virtualmachinescalesetvmsgetinstanceviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSGetInstanceViewSample.js +[virtualmachinescalesetvmsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSGetSample.js [virtualmachinescalesetvmslistmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSListMaximumSetGen.js [virtualmachinescalesetvmslistminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSListMinimumSetGen.js +[virtualmachinescalesetvmslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSListSample.js [virtualmachinescalesetvmsperformmaintenancemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSPerformMaintenanceMaximumSetGen.js [virtualmachinescalesetvmsperformmaintenanceminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSPerformMaintenanceMinimumSetGen.js +[virtualmachinescalesetvmsperformmaintenancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSPerformMaintenanceSample.js [virtualmachinescalesetvmspoweroffmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSPowerOffMaximumSetGen.js [virtualmachinescalesetvmspoweroffminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSPowerOffMinimumSetGen.js +[virtualmachinescalesetvmspoweroffsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSPowerOffSample.js [virtualmachinescalesetvmsredeploymaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSRedeployMaximumSetGen.js [virtualmachinescalesetvmsredeployminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSRedeployMinimumSetGen.js +[virtualmachinescalesetvmsredeploysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSRedeploySample.js [virtualmachinescalesetvmsreimageallmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSReimageAllMaximumSetGen.js [virtualmachinescalesetvmsreimageallminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSReimageAllMinimumSetGen.js +[virtualmachinescalesetvmsreimageallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSReimageAllSample.js [virtualmachinescalesetvmsreimagemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSReimageMaximumSetGen.js [virtualmachinescalesetvmsreimageminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSReimageMinimumSetGen.js +[virtualmachinescalesetvmsreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSReimageSample.js [virtualmachinescalesetvmsrestartmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSRestartMaximumSetGen.js [virtualmachinescalesetvmsrestartminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSRestartMinimumSetGen.js +[virtualmachinescalesetvmsrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSRestartSample.js +[virtualmachinescalesetvmsretrievebootdiagnosticsdatasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.js [virtualmachinescalesetvmsruncommand]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSRunCommand.js +[virtualmachinescalesetvmsruncommandsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSRunCommandSample.js +[virtualmachinescalesetvmssimulateevictionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSSimulateEvictionSample.js [virtualmachinescalesetvmsstartmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSStartMaximumSetGen.js [virtualmachinescalesetvmsstartminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSStartMinimumSetGen.js +[virtualmachinescalesetvmsstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSStartSample.js [virtualmachinescalesetvmsupdatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSUpdateMaximumSetGen.js [virtualmachinescalesetvmsupdateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSUpdateMinimumSetGen.js +[virtualmachinescalesetvmsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSUpdateSample.js [virtualmachinescalesetsconverttosingleplacementgroupmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsConvertToSinglePlacementGroupMaximumSetGen.js [virtualmachinescalesetsconverttosingleplacementgroupminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsConvertToSinglePlacementGroupMinimumSetGen.js +[virtualmachinescalesetsconverttosingleplacementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.js +[virtualmachinescalesetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsCreateOrUpdateSample.js [virtualmachinescalesetsdeallocatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsDeallocateMaximumSetGen.js [virtualmachinescalesetsdeallocateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsDeallocateMinimumSetGen.js +[virtualmachinescalesetsdeallocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsDeallocateSample.js [virtualmachinescalesetsdeleteinstancesmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsDeleteInstancesMaximumSetGen.js [virtualmachinescalesetsdeleteinstancesminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsDeleteInstancesMinimumSetGen.js +[virtualmachinescalesetsdeleteinstancessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsDeleteInstancesSample.js +[virtualmachinescalesetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsDeleteSample.js [virtualmachinescalesetsforcerecoveryservicefabricplatformupdatedomainwalkmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkMaximumSetGen.js [virtualmachinescalesetsforcerecoveryservicefabricplatformupdatedomainwalkminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkMinimumSetGen.js +[virtualmachinescalesetsforcerecoveryservicefabricplatformupdatedomainwalksample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.js [virtualmachinescalesetsgetinstanceviewmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsGetInstanceViewMaximumSetGen.js [virtualmachinescalesetsgetinstanceviewminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsGetInstanceViewMinimumSetGen.js +[virtualmachinescalesetsgetinstanceviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsGetInstanceViewSample.js [virtualmachinescalesetsgetosupgradehistorymaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsGetOSUpgradeHistoryMaximumSetGen.js [virtualmachinescalesetsgetosupgradehistoryminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsGetOSUpgradeHistoryMinimumSetGen.js +[virtualmachinescalesetsgetosupgradehistorysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsGetOSUpgradeHistorySample.js +[virtualmachinescalesetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsGetSample.js [virtualmachinescalesetslistallmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsListAllMaximumSetGen.js [virtualmachinescalesetslistallminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsListAllMinimumSetGen.js +[virtualmachinescalesetslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsListAllSample.js +[virtualmachinescalesetslistbylocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsListByLocationSample.js [virtualmachinescalesetslistmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsListMaximumSetGen.js [virtualmachinescalesetslistminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsListMinimumSetGen.js +[virtualmachinescalesetslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsListSample.js [virtualmachinescalesetslistskusmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsListSkusMaximumSetGen.js [virtualmachinescalesetslistskusminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsListSkusMinimumSetGen.js +[virtualmachinescalesetslistskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsListSkusSample.js [virtualmachinescalesetsperformmaintenancemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsPerformMaintenanceMaximumSetGen.js [virtualmachinescalesetsperformmaintenanceminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsPerformMaintenanceMinimumSetGen.js +[virtualmachinescalesetsperformmaintenancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsPerformMaintenanceSample.js [virtualmachinescalesetspoweroffmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsPowerOffMaximumSetGen.js [virtualmachinescalesetspoweroffminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsPowerOffMinimumSetGen.js +[virtualmachinescalesetspoweroffsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsPowerOffSample.js [virtualmachinescalesetsredeploymaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsRedeployMaximumSetGen.js [virtualmachinescalesetsredeployminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsRedeployMinimumSetGen.js +[virtualmachinescalesetsredeploysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsRedeploySample.js [virtualmachinescalesetsreimageallmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsReimageAllMaximumSetGen.js [virtualmachinescalesetsreimageallminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsReimageAllMinimumSetGen.js +[virtualmachinescalesetsreimageallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsReimageAllSample.js [virtualmachinescalesetsreimagemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsReimageMaximumSetGen.js [virtualmachinescalesetsreimageminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsReimageMinimumSetGen.js +[virtualmachinescalesetsreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsReimageSample.js [virtualmachinescalesetsrestartmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsRestartMaximumSetGen.js [virtualmachinescalesetsrestartminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsRestartMinimumSetGen.js +[virtualmachinescalesetsrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsRestartSample.js [virtualmachinescalesetssetorchestrationservicestatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsSetOrchestrationServiceStateMaximumSetGen.js [virtualmachinescalesetssetorchestrationservicestateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsSetOrchestrationServiceStateMinimumSetGen.js +[virtualmachinescalesetssetorchestrationservicestatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsSetOrchestrationServiceStateSample.js [virtualmachinescalesetsstartmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsStartMaximumSetGen.js [virtualmachinescalesetsstartminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsStartMinimumSetGen.js +[virtualmachinescalesetsstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsStartSample.js [virtualmachinescalesetsupdateinstancesmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsUpdateInstancesMaximumSetGen.js [virtualmachinescalesetsupdateinstancesminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsUpdateInstancesMinimumSetGen.js +[virtualmachinescalesetsupdateinstancessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsUpdateInstancesSample.js [virtualmachinescalesetsupdatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsUpdateMaximumSetGen.js [virtualmachinescalesetsupdateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsUpdateMinimumSetGen.js +[virtualmachinescalesetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsUpdateSample.js [virtualmachinesizeslistmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineSizesListMaximumSetGen.js [virtualmachinesizeslistminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineSizesListMinimumSetGen.js +[virtualmachinesizeslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineSizesListSample.js +[virtualmachinesassesspatchessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesAssessPatchesSample.js [virtualmachinescapturemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesCaptureMaximumSetGen.js [virtualmachinescaptureminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesCaptureMinimumSetGen.js +[virtualmachinescapturesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesCaptureSample.js [virtualmachinesconverttomanageddisksmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesConvertToManagedDisksMaximumSetGen.js [virtualmachinesconverttomanageddisksminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesConvertToManagedDisksMinimumSetGen.js +[virtualmachinesconverttomanageddiskssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesConvertToManagedDisksSample.js +[virtualmachinescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesCreateOrUpdateSample.js [virtualmachinesdeallocatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesDeallocateMaximumSetGen.js [virtualmachinesdeallocateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesDeallocateMinimumSetGen.js +[virtualmachinesdeallocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesDeallocateSample.js +[virtualmachinesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesDeleteSample.js +[virtualmachinesgeneralizesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesGeneralizeSample.js +[virtualmachinesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesGetSample.js +[virtualmachinesinstallpatchessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesInstallPatchesSample.js +[virtualmachinesinstanceviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesInstanceViewSample.js [virtualmachineslistallmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesListAllMaximumSetGen.js [virtualmachineslistallminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesListAllMinimumSetGen.js +[virtualmachineslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesListAllSample.js +[virtualmachineslistavailablesizessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesListAvailableSizesSample.js +[virtualmachineslistbylocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesListByLocationSample.js [virtualmachineslistmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesListMaximumSetGen.js [virtualmachineslistminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesListMinimumSetGen.js +[virtualmachineslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesListSample.js [virtualmachinesperformmaintenancemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesPerformMaintenanceMaximumSetGen.js [virtualmachinesperformmaintenanceminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesPerformMaintenanceMinimumSetGen.js +[virtualmachinesperformmaintenancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesPerformMaintenanceSample.js [virtualmachinespoweroffmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesPowerOffMaximumSetGen.js [virtualmachinespoweroffminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesPowerOffMinimumSetGen.js +[virtualmachinespoweroffsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesPowerOffSample.js +[virtualmachinesreapplysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesReapplySample.js [virtualmachinesredeploymaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesRedeployMaximumSetGen.js [virtualmachinesredeployminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesRedeployMinimumSetGen.js +[virtualmachinesredeploysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesRedeploySample.js +[virtualmachinesreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesReimageSample.js [virtualmachinesrestartmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesRestartMaximumSetGen.js [virtualmachinesrestartminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesRestartMinimumSetGen.js +[virtualmachinesrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesRestartSample.js +[virtualmachinesretrievebootdiagnosticsdatasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesRetrieveBootDiagnosticsDataSample.js +[virtualmachinesruncommandsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesRunCommandSample.js +[virtualmachinessimulateevictionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesSimulateEvictionSample.js [virtualmachinesstartmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesStartMaximumSetGen.js [virtualmachinesstartminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesStartMinimumSetGen.js +[virtualmachinesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesStartSample.js +[virtualmachinesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesUpdateSample.js [apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-compute?view=azure-node-preview [freesub]: https://azure.microsoft.com/free/ [package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/compute/arm-compute/README.md diff --git a/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsCreateOrUpdateSample.js new file mode 100644 index 000000000000..8dbf9b43be04 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsCreateOrUpdateSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update an availability set. + * + * @summary Create or update an availability set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnAvailabilitySet.json + */ +async function createAnAvailabilitySet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const availabilitySetName = "myAvailabilitySet"; + const parameters = { + location: "westus", + platformFaultDomainCount: 2, + platformUpdateDomainCount: 20, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.createOrUpdate( + resourceGroupName, + availabilitySetName, + parameters + ); + console.log(result); +} + +createAnAvailabilitySet().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsDeleteSample.js new file mode 100644 index 000000000000..ef76be0dd4cb --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsDeleteSample.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete an availability set. + * + * @summary Delete an availability set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Delete_MaximumSet_Gen.json + */ +async function availabilitySetsDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const availabilitySetName = "aaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.delete(resourceGroupName, availabilitySetName); + console.log(result); +} + +availabilitySetsDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Delete an availability set. + * + * @summary Delete an availability set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Delete_MinimumSet_Gen.json + */ +async function availabilitySetsDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const availabilitySetName = "aaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.delete(resourceGroupName, availabilitySetName); + console.log(result); +} + +availabilitySetsDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsGetSample.js new file mode 100644 index 000000000000..42236658176a --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsGetSample.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Retrieves information about an availability set. + * + * @summary Retrieves information about an availability set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Get_MaximumSet_Gen.json + */ +async function availabilitySetsGetMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const availabilitySetName = "aaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.get(resourceGroupName, availabilitySetName); + console.log(result); +} + +availabilitySetsGetMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about an availability set. + * + * @summary Retrieves information about an availability set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Get_MinimumSet_Gen.json + */ +async function availabilitySetsGetMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const availabilitySetName = "aaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.get(resourceGroupName, availabilitySetName); + console.log(result); +} + +availabilitySetsGetMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsListAvailableSizesSample.js b/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsListAvailableSizesSample.js new file mode 100644 index 000000000000..903ad5f5f0e6 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsListAvailableSizesSample.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. + * + * @summary Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_ListAvailableSizes_MaximumSet_Gen.json + */ +async function availabilitySetsListAvailableSizesMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const availabilitySetName = "aaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.availabilitySets.listAvailableSizes( + resourceGroupName, + availabilitySetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +availabilitySetsListAvailableSizesMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. + * + * @summary Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_ListAvailableSizes_MinimumSet_Gen.json + */ +async function availabilitySetsListAvailableSizesMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const availabilitySetName = "aa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.availabilitySets.listAvailableSizes( + resourceGroupName, + availabilitySetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +availabilitySetsListAvailableSizesMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsListBySubscriptionSample.js b/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsListBySubscriptionSample.js new file mode 100644 index 000000000000..ad6fa0c111cc --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsListBySubscriptionSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all availability sets in a subscription. + * + * @summary Lists all availability sets in a subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListAvailabilitySetsInASubscription.json + */ +async function listAvailabilitySetsInASubscription() { + const subscriptionId = "{subscriptionId}"; + const expand = "virtualMachines$ref"; + const options = { expand }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.availabilitySets.listBySubscription(options)) { + resArray.push(item); + } + console.log(resArray); +} + +listAvailabilitySetsInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsListSample.js new file mode 100644 index 000000000000..a06da0f41f18 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsListSample.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all availability sets in a resource group. + * + * @summary Lists all availability sets in a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_List_MaximumSet_Gen.json + */ +async function availabilitySetsListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.availabilitySets.list(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +availabilitySetsListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Lists all availability sets in a resource group. + * + * @summary Lists all availability sets in a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_List_MinimumSet_Gen.json + */ +async function availabilitySetsListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.availabilitySets.list(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +availabilitySetsListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsUpdateSample.js new file mode 100644 index 000000000000..a8a21bbb2e38 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/availabilitySetsUpdateSample.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Update an availability set. + * + * @summary Update an availability set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Update_MaximumSet_Gen.json + */ +async function availabilitySetsUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const availabilitySetName = "aaaaaaaaaaaaaaaaaaa"; + const parameters = { + platformFaultDomainCount: 2, + platformUpdateDomainCount: 20, + proximityPlacementGroup: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + sku: { name: "DSv3-Type1", capacity: 7, tier: "aaa" }, + tags: { key2574: "aaaaaaaa" }, + virtualMachines: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.update( + resourceGroupName, + availabilitySetName, + parameters + ); + console.log(result); +} + +availabilitySetsUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Update an availability set. + * + * @summary Update an availability set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Update_MinimumSet_Gen.json + */ +async function availabilitySetsUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const availabilitySetName = "aaaaaaaaaaaaaaaaaaaa"; + const parameters = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.update( + resourceGroupName, + availabilitySetName, + parameters + ); + console.log(result); +} + +availabilitySetsUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsCreateOrUpdateSample.js new file mode 100644 index 000000000000..fedf6795941a --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsCreateOrUpdateSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateACapacityReservationGroup.json + */ +async function createOrUpdateACapacityReservationGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const capacityReservationGroupName = "myCapacityReservationGroup"; + const parameters = { + location: "westus", + tags: { department: "finance" }, + zones: ["1", "2"], + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.createOrUpdate( + resourceGroupName, + capacityReservationGroupName, + parameters + ); + console.log(result); +} + +createOrUpdateACapacityReservationGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsDeleteSample.js new file mode 100644 index 000000000000..6d9a73a9d769 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsDeleteSample.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Delete_MaximumSet_Gen.json + */ +async function capacityReservationGroupsDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const capacityReservationGroupName = "a"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.delete( + resourceGroupName, + capacityReservationGroupName + ); + console.log(result); +} + +capacityReservationGroupsDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Delete_MinimumSet_Gen.json + */ +async function capacityReservationGroupsDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const capacityReservationGroupName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.delete( + resourceGroupName, + capacityReservationGroupName + ); + console.log(result); +} + +capacityReservationGroupsDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsGetSample.js new file mode 100644 index 000000000000..cb652e8d1219 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsGetSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation that retrieves information about a capacity reservation group. + * + * @summary The operation that retrieves information about a capacity reservation group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetACapacityReservationGroup.json + */ +async function getACapacityReservationGroup() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const capacityReservationGroupName = "myCapacityReservationGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.get( + resourceGroupName, + capacityReservationGroupName + ); + console.log(result); +} + +getACapacityReservationGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsListByResourceGroupSample.js b/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsListByResourceGroupSample.js new file mode 100644 index 000000000000..33fadf7dab01 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsListByResourceGroupSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups. + * + * @summary Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListCapacityReservationGroupsInResourceGroup.json + */ +async function listCapacityReservationGroupsInResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const expand = "virtualMachines/$ref"; + const options = { + expand, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.capacityReservationGroups.listByResourceGroup( + resourceGroupName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +listCapacityReservationGroupsInResourceGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsListBySubscriptionSample.js b/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsListBySubscriptionSample.js new file mode 100644 index 000000000000..35c4b02bb46d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsListBySubscriptionSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. + * + * @summary Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListCapacityReservationGroupsInSubscription.json + */ +async function listCapacityReservationGroupsInSubscription() { + const subscriptionId = "{subscription-id}"; + const expand = "virtualMachines/$ref"; + const options = { + expand, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.capacityReservationGroups.listBySubscription(options)) { + resArray.push(item); + } + console.log(resArray); +} + +listCapacityReservationGroupsInSubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsUpdateSample.js new file mode 100644 index 000000000000..98639f72da8a --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationGroupsUpdateSample.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may be modified. + * + * @summary The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may be modified. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Update_MaximumSet_Gen.json + */ +async function capacityReservationGroupsUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const capacityReservationGroupName = "aaaaaaaaaaaaaaaaaaaaaa"; + const parameters = { + instanceView: {}, + tags: { key5355: "aaa" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.update( + resourceGroupName, + capacityReservationGroupName, + parameters + ); + console.log(result); +} + +capacityReservationGroupsUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may be modified. + * + * @summary The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may be modified. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Update_MinimumSet_Gen.json + */ +async function capacityReservationGroupsUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const capacityReservationGroupName = "aaaaaaaaaaaaaaaaaaaaaa"; + const parameters = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.update( + resourceGroupName, + capacityReservationGroupName, + parameters + ); + console.log(result); +} + +capacityReservationGroupsUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationsCreateOrUpdateSample.js new file mode 100644 index 000000000000..ecfa6121761b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationsCreateOrUpdateSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateACapacityReservation.json + */ +async function createOrUpdateACapacityReservation() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const capacityReservationGroupName = "myCapacityReservationGroup"; + const capacityReservationName = "myCapacityReservation"; + const parameters = { + location: "westus", + sku: { name: "Standard_DS1_v2", capacity: 4 }, + tags: { department: "HR" }, + zones: ["1"], + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.beginCreateOrUpdateAndWait( + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + parameters + ); + console.log(result); +} + +createOrUpdateACapacityReservation().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationsDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationsDeleteSample.js new file mode 100644 index 000000000000..b1bd2c9d943d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationsDeleteSample.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Delete_MaximumSet_Gen.json + */ +async function capacityReservationsDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const capacityReservationGroupName = "aaaaaaaaaaa"; + const capacityReservationName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.beginDeleteAndWait( + resourceGroupName, + capacityReservationGroupName, + capacityReservationName + ); + console.log(result); +} + +capacityReservationsDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Delete_MinimumSet_Gen.json + */ +async function capacityReservationsDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const capacityReservationGroupName = "aaa"; + const capacityReservationName = "aaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.beginDeleteAndWait( + resourceGroupName, + capacityReservationGroupName, + capacityReservationName + ); + console.log(result); +} + +capacityReservationsDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationsGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationsGetSample.js new file mode 100644 index 000000000000..7cd29ba7f098 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationsGetSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation that retrieves information about the capacity reservation. + * + * @summary The operation that retrieves information about the capacity reservation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetACapacityReservation.json + */ +async function getACapacityReservation() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const capacityReservationGroupName = "myCapacityReservationGroup"; + const capacityReservationName = "myCapacityReservation"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.get( + resourceGroupName, + capacityReservationGroupName, + capacityReservationName + ); + console.log(result); +} + +getACapacityReservation().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationsListByCapacityReservationGroupSample.js b/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationsListByCapacityReservationGroupSample.js new file mode 100644 index 000000000000..e3069c68dd3a --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationsListByCapacityReservationGroupSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. + * + * @summary Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListCapacityReservationsInReservationGroup.json + */ +async function listCapacityReservationsInReservationGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const capacityReservationGroupName = "myCapacityReservationGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.capacityReservations.listByCapacityReservationGroup( + resourceGroupName, + capacityReservationGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listCapacityReservationsInReservationGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationsUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationsUpdateSample.js new file mode 100644 index 000000000000..7a581f0f9a6e --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/capacityReservationsUpdateSample.js @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to update a capacity reservation. + * + * @summary The operation to update a capacity reservation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Update_MaximumSet_Gen.json + */ +async function capacityReservationsUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const capacityReservationGroupName = "aaaaaaaaaa"; + const capacityReservationName = "aaaaaaaaaaaaaaaaaaa"; + const parameters = { + instanceView: { + statuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z"), + }, + ], + utilizationInfo: {}, + }, + sku: { name: "DSv3-Type1", capacity: 7, tier: "aaa" }, + tags: { key4974: "aaaaaaaaaaaaaaaa" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.beginUpdateAndWait( + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + parameters + ); + console.log(result); +} + +capacityReservationsUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to update a capacity reservation. + * + * @summary The operation to update a capacity reservation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Update_MinimumSet_Gen.json + */ +async function capacityReservationsUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const capacityReservationGroupName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const capacityReservationName = "aaa"; + const parameters = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.beginUpdateAndWait( + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + parameters + ); + console.log(result); +} + +capacityReservationsUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceOperatingSystemsGetOSFamilySample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceOperatingSystemsGetOSFamilySample.js new file mode 100644 index 000000000000..78751dfc0075 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceOperatingSystemsGetOSFamilySample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets properties of a guest operating system family that can be specified in the XML service configuration (.cscfg) for a cloud service. + * + * @summary Gets properties of a guest operating system family that can be specified in the XML service configuration (.cscfg) for a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceOSFamily.json + */ +async function getCloudServiceOSFamily() { + const subscriptionId = "{subscription-id}"; + const location = "westus2"; + const osFamilyName = "3"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServiceOperatingSystems.getOSFamily(location, osFamilyName); + console.log(result); +} + +getCloudServiceOSFamily().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceOperatingSystemsGetOSVersionSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceOperatingSystemsGetOSVersionSample.js new file mode 100644 index 000000000000..9b5a71ea1c77 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceOperatingSystemsGetOSVersionSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets properties of a guest operating system version that can be specified in the XML service configuration (.cscfg) for a cloud service. + * + * @summary Gets properties of a guest operating system version that can be specified in the XML service configuration (.cscfg) for a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceOSVersion.json + */ +async function getCloudServiceOSVersion() { + const subscriptionId = "{subscription-id}"; + const location = "westus2"; + const osVersionName = "WA-GUEST-OS-3.90_202010-02"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServiceOperatingSystems.getOSVersion(location, osVersionName); + console.log(result); +} + +getCloudServiceOSVersion().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceOperatingSystemsListOSFamiliesSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceOperatingSystemsListOSFamiliesSample.js new file mode 100644 index 000000000000..fc0be2bbdd4f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceOperatingSystemsListOSFamiliesSample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of all guest operating system families available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this till nextLink is null to fetch all the OS Families. + * + * @summary Gets a list of all guest operating system families available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this till nextLink is null to fetch all the OS Families. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceOSFamilies.json + */ +async function listCloudServiceOSFamiliesInASubscription() { + const subscriptionId = "{subscription-id}"; + const location = "westus2"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudServiceOperatingSystems.listOSFamilies(location)) { + resArray.push(item); + } + console.log(resArray); +} + +listCloudServiceOSFamiliesInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceOperatingSystemsListOSVersionsSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceOperatingSystemsListOSVersionsSample.js new file mode 100644 index 000000000000..aa4b5ba8044a --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceOperatingSystemsListOSVersionsSample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of all guest operating system versions available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this till nextLink is null to fetch all the OS versions. + * + * @summary Gets a list of all guest operating system versions available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this till nextLink is null to fetch all the OS versions. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceOSVersions.json + */ +async function listCloudServiceOSVersionsInASubscription() { + const subscriptionId = "{subscription-id}"; + const location = "westus2"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudServiceOperatingSystems.listOSVersions(location)) { + resArray.push(item); + } + console.log(resArray); +} + +listCloudServiceOSVersionsInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesDeleteSample.js new file mode 100644 index 000000000000..c4c77c0af2b7 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesDeleteSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Deletes a role instance from a cloud service. + * + * @summary Deletes a role instance from a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/DeleteCloudServiceRoleInstance.json + */ +async function deleteCloudServiceRoleInstance() { + const subscriptionId = "{subscription-id}"; + const roleInstanceName = "{roleInstance-name}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServiceRoleInstances.beginDeleteAndWait( + roleInstanceName, + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +deleteCloudServiceRoleInstance().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesGetInstanceViewSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesGetInstanceViewSample.js new file mode 100644 index 000000000000..56fd11a01234 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesGetInstanceViewSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Retrieves information about the run-time state of a role instance in a cloud service. + * + * @summary Retrieves information about the run-time state of a role instance in a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetInstanceViewOfCloudServiceRoleInstance.json + */ +async function getInstanceViewOfCloudServiceRoleInstance() { + const subscriptionId = "{subscription-id}"; + const roleInstanceName = "{roleInstance-name}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServiceRoleInstances.getInstanceView( + roleInstanceName, + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +getInstanceViewOfCloudServiceRoleInstance().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesGetSample.js new file mode 100644 index 000000000000..bcd5bf3c8ef4 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesGetSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a role instance from a cloud service. + * + * @summary Gets a role instance from a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceRoleInstance.json + */ +async function getCloudServiceRoleInstance() { + const subscriptionId = "{subscription-id}"; + const roleInstanceName = "{roleInstance-name}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServiceRoleInstances.get( + roleInstanceName, + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +getCloudServiceRoleInstance().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesListSample.js new file mode 100644 index 000000000000..cc79ed244334 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesListSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next page of role instances. Do this till nextLink is null to fetch all the role instances. + * + * @summary Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next page of role instances. Do this till nextLink is null to fetch all the role instances. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceRolesInstances.json + */ +async function listRoleInstancesInACloudService() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudServiceRoleInstances.list( + resourceGroupName, + cloudServiceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listRoleInstancesInACloudService().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesRebuildSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesRebuildSample.js new file mode 100644 index 000000000000..1c74ec77ab1b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesRebuildSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instance. + * + * @summary The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instance. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RebuildCloudServiceRoleInstance.json + */ +async function rebuildCloudServiceRoleInstance() { + const subscriptionId = "{subscription-id}"; + const roleInstanceName = "{roleInstance-name}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServiceRoleInstances.beginRebuildAndWait( + roleInstanceName, + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +rebuildCloudServiceRoleInstance().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesReimageSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesReimageSample.js new file mode 100644 index 000000000000..75cce34903d7 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesReimageSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @summary The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ReimageCloudServiceRoleInstance.json + */ +async function reimageCloudServiceRoleInstance() { + const subscriptionId = "{subscription-id}"; + const roleInstanceName = "{roleInstance-name}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServiceRoleInstances.beginReimageAndWait( + roleInstanceName, + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +reimageCloudServiceRoleInstance().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesRestartSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesRestartSample.js new file mode 100644 index 000000000000..f25da4d5b431 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRoleInstancesRestartSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @summary The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RestartCloudServiceRoleInstance.json + */ +async function restartCloudServiceRoleInstance() { + const subscriptionId = "{subscription-id}"; + const roleInstanceName = "{roleInstance-name}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServiceRoleInstances.beginRestartAndWait( + roleInstanceName, + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +restartCloudServiceRoleInstance().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRolesGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRolesGetSample.js new file mode 100644 index 000000000000..23ab9f5f97a0 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRolesGetSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a role from a cloud service. + * + * @summary Gets a role from a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceRole.json + */ +async function getCloudServiceRole() { + const subscriptionId = "{subscription-id}"; + const roleName = "{role-name}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServiceRoles.get(roleName, resourceGroupName, cloudServiceName); + console.log(result); +} + +getCloudServiceRole().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRolesListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRolesListSample.js new file mode 100644 index 000000000000..99e1a4c0aba4 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServiceRolesListSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. Do this till nextLink is null to fetch all the roles. + * + * @summary Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. Do this till nextLink is null to fetch all the roles. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceRoles.json + */ +async function listRolesInACloudService() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudServiceRoles.list(resourceGroupName, cloudServiceName)) { + resArray.push(item); + } + console.log(resArray); +} + +listRolesInACloudService().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesCreateOrUpdateSample.js new file mode 100644 index 000000000000..cd6a0b5cec2f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesCreateOrUpdateSample.js @@ -0,0 +1,279 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/CreateCloudServiceWithMultiRole.json + */ +async function createNewCloudServiceWithMultipleRoles() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const parameters = { + location: "westus", + properties: { + configuration: "{ServiceConfiguration}", + networkProfile: { + loadBalancerConfigurations: [ + { + name: "contosolb", + properties: { + frontendIPConfigurations: [ + { + name: "contosofe", + properties: { + publicIPAddress: { + id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip", + }, + }, + }, + ], + }, + }, + ], + }, + packageUrl: "{PackageUrl}", + roleProfile: { + roles: [ + { + name: "ContosoFrontend", + sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" }, + }, + { + name: "ContosoBackend", + sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" }, + }, + ], + }, + upgradeMode: "Auto", + }, + }; + const options = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginCreateOrUpdateAndWait( + resourceGroupName, + cloudServiceName, + options + ); + console.log(result); +} + +createNewCloudServiceWithMultipleRoles().catch(console.error); + +/** + * This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/CreateCloudServiceWithSingleRole.json + */ +async function createNewCloudServiceWithSingleRole() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const parameters = { + location: "westus", + properties: { + configuration: "{ServiceConfiguration}", + networkProfile: { + loadBalancerConfigurations: [ + { + name: "myLoadBalancer", + properties: { + frontendIPConfigurations: [ + { + name: "myfe", + properties: { + publicIPAddress: { + id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP", + }, + }, + }, + ], + }, + }, + ], + }, + packageUrl: "{PackageUrl}", + roleProfile: { + roles: [ + { + name: "ContosoFrontend", + sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" }, + }, + ], + }, + upgradeMode: "Auto", + }, + }; + const options = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginCreateOrUpdateAndWait( + resourceGroupName, + cloudServiceName, + options + ); + console.log(result); +} + +createNewCloudServiceWithSingleRole().catch(console.error); + +/** + * This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/CreateCloudServiceWithSingleRoleAndCertificate.json + */ +async function createNewCloudServiceWithSingleRoleAndCertificateFromKeyVault() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const parameters = { + location: "westus", + properties: { + configuration: "{ServiceConfiguration}", + networkProfile: { + loadBalancerConfigurations: [ + { + name: "contosolb", + properties: { + frontendIPConfigurations: [ + { + name: "contosofe", + properties: { + publicIPAddress: { + id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip", + }, + }, + }, + ], + }, + }, + ], + }, + osProfile: { + secrets: [ + { + sourceVault: { + id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}", + }, + vaultCertificates: [ + { + certificateUrl: + "https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}", + }, + ], + }, + ], + }, + packageUrl: "{PackageUrl}", + roleProfile: { + roles: [ + { + name: "ContosoFrontend", + sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" }, + }, + ], + }, + upgradeMode: "Auto", + }, + }; + const options = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginCreateOrUpdateAndWait( + resourceGroupName, + cloudServiceName, + options + ); + console.log(result); +} + +createNewCloudServiceWithSingleRoleAndCertificateFromKeyVault().catch(console.error); + +/** + * This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/CreateCloudServiceWithSingleRoleAndRDP.json + */ +async function createNewCloudServiceWithSingleRoleAndRdpExtension() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const parameters = { + location: "westus", + properties: { + configuration: "{ServiceConfiguration}", + extensionProfile: { + extensions: [ + { + name: "RDPExtension", + properties: { + type: "RDP", + autoUpgradeMinorVersion: false, + protectedSettings: "{password}", + publisher: "Microsoft.Windows.Azure.Extensions", + settings: + "UserAzure10/22/2021 15:05:45", + typeHandlerVersion: "1.2.1", + }, + }, + ], + }, + networkProfile: { + loadBalancerConfigurations: [ + { + name: "contosolb", + properties: { + frontendIPConfigurations: [ + { + name: "contosofe", + properties: { + publicIPAddress: { + id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip", + }, + }, + }, + ], + }, + }, + ], + }, + packageUrl: "{PackageUrl}", + roleProfile: { + roles: [ + { + name: "ContosoFrontend", + sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" }, + }, + ], + }, + upgradeMode: "Auto", + }, + }; + const options = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginCreateOrUpdateAndWait( + resourceGroupName, + cloudServiceName, + options + ); + console.log(result); +} + +createNewCloudServiceWithSingleRoleAndRdpExtension().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesDeleteInstancesSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesDeleteInstancesSample.js new file mode 100644 index 000000000000..481a21fe1815 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesDeleteInstancesSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Deletes role instances in a cloud service. + * + * @summary Deletes role instances in a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/DeleteCloudServiceRoleInstances.json + */ +async function deleteCloudServiceRoleInstances() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const parameters = { + roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"], + }; + const options = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginDeleteInstancesAndWait( + resourceGroupName, + cloudServiceName, + options + ); + console.log(result); +} + +deleteCloudServiceRoleInstances().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesDeleteSample.js new file mode 100644 index 000000000000..a43f9e235593 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesDeleteSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Deletes a cloud service. + * + * @summary Deletes a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/DeleteCloudService.json + */ +async function deleteCloudService() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginDeleteAndWait(resourceGroupName, cloudServiceName); + console.log(result); +} + +deleteCloudService().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesGetInstanceViewSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesGetInstanceViewSample.js new file mode 100644 index 000000000000..0d8add97d8e8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesGetInstanceViewSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the status of a cloud service. + * + * @summary Gets the status of a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceInstanceViewWithMultiRole.json + */ +async function getCloudServiceInstanceViewWithMultipleRoles() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.getInstanceView(resourceGroupName, cloudServiceName); + console.log(result); +} + +getCloudServiceInstanceViewWithMultipleRoles().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesGetSample.js new file mode 100644 index 000000000000..7ae1c04d003d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesGetSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Display information about a cloud service. + * + * @summary Display information about a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceWithMultiRoleAndRDP.json + */ +async function getCloudServiceWithMultipleRolesAndRdpExtension() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.get(resourceGroupName, cloudServiceName); + console.log(result); +} + +getCloudServiceWithMultipleRolesAndRdpExtension().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesListAllSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesListAllSample.js new file mode 100644 index 000000000000..eb84ce7323b8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesListAllSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * + * @summary Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServicesInSubscription.json + */ +async function listCloudServicesInASubscription() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudServices.listAll()) { + resArray.push(item); + } + console.log(resArray); +} + +listCloudServicesInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesListSample.js new file mode 100644 index 000000000000..99540d0cc6a1 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesListSample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * + * @summary Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServicesInResourceGroup.json + */ +async function listCloudServicesInAResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudServices.list(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listCloudServicesInAResourceGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesPowerOffSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesPowerOffSample.js new file mode 100644 index 000000000000..fc336c1c0bf3 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesPowerOffSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Power off the cloud service. Note that resources are still attached and you are getting charged for the resources. + * + * @summary Power off the cloud service. Note that resources are still attached and you are getting charged for the resources. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/PowerOffCloudService.json + */ +async function stopOrPowerOffCloudService() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginPowerOffAndWait( + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +stopOrPowerOffCloudService().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesRebuildSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesRebuildSample.js new file mode 100644 index 000000000000..be941c653d09 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesRebuildSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instances. + * + * @summary Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instances. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RebuildCloudServiceRoleInstances.json + */ +async function rebuildCloudServiceRoleInstances() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const parameters = { + roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"], + }; + const options = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginRebuildAndWait( + resourceGroupName, + cloudServiceName, + options + ); + console.log(result); +} + +rebuildCloudServiceRoleInstances().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesReimageSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesReimageSample.js new file mode 100644 index 000000000000..ad5d3394f26b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesReimageSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @summary Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ReimageCloudServiceRoleInstances.json + */ +async function reimageCloudServiceRoleInstances() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const parameters = { + roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"], + }; + const options = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginReimageAndWait( + resourceGroupName, + cloudServiceName, + options + ); + console.log(result); +} + +reimageCloudServiceRoleInstances().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesRestartSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesRestartSample.js new file mode 100644 index 000000000000..0940dc62c9fb --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesRestartSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Restarts one or more role instances in a cloud service. + * + * @summary Restarts one or more role instances in a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RestartCloudServiceRoleInstances.json + */ +async function restartCloudServiceRoleInstances() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const parameters = { + roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"], + }; + const options = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginRestartAndWait( + resourceGroupName, + cloudServiceName, + options + ); + console.log(result); +} + +restartCloudServiceRoleInstances().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesStartSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesStartSample.js new file mode 100644 index 000000000000..b42ae9472a59 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesStartSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Starts the cloud service. + * + * @summary Starts the cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/StartCloudService.json + */ +async function startCloudService() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginStartAndWait(resourceGroupName, cloudServiceName); + console.log(result); +} + +startCloudService().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesUpdateDomainGetUpdateDomainSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesUpdateDomainGetUpdateDomainSample.js new file mode 100644 index 000000000000..e692332bdc32 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesUpdateDomainGetUpdateDomainSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page of update domains. Do this till nextLink is null to fetch all the update domains. + * + * @summary Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page of update domains. Do this till nextLink is null to fetch all the update domains. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceUpdateDomain.json + */ +async function getCloudServiceUpdateDomain() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const updateDomain = 1; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServicesUpdateDomain.getUpdateDomain( + resourceGroupName, + cloudServiceName, + updateDomain + ); + console.log(result); +} + +getCloudServiceUpdateDomain().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesUpdateDomainListUpdateDomainsSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesUpdateDomainListUpdateDomainsSample.js new file mode 100644 index 000000000000..ed4fa946b31c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesUpdateDomainListUpdateDomainsSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of all update domains in a cloud service. + * + * @summary Gets a list of all update domains in a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceUpdateDomains.json + */ +async function listUpdateDomainsInCloudService() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudServicesUpdateDomain.listUpdateDomains( + resourceGroupName, + cloudServiceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listUpdateDomainsInCloudService().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesUpdateDomainWalkUpdateDomainSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesUpdateDomainWalkUpdateDomainSample.js new file mode 100644 index 000000000000..9a1485640162 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesUpdateDomainWalkUpdateDomainSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Updates the role instances in the specified update domain. + * + * @summary Updates the role instances in the specified update domain. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/UpdateCloudServiceUpdateDomain.json + */ +async function updateCloudServiceToSpecifiedDomain() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const updateDomain = 1; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServicesUpdateDomain.beginWalkUpdateDomainAndWait( + resourceGroupName, + cloudServiceName, + updateDomain + ); + console.log(result); +} + +updateCloudServiceToSpecifiedDomain().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesUpdateSample.js new file mode 100644 index 000000000000..e25ae871c339 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/cloudServicesUpdateSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Update a cloud service. + * + * @summary Update a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/UpdateCloudServiceToIncludeTags.json + */ +async function updateExistingCloudServiceToAddTags() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const parameters = { tags: { documentation: "RestAPI" } }; + const options = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginUpdateAndWait( + resourceGroupName, + cloudServiceName, + options + ); + console.log(result); +} + +updateExistingCloudServiceToAddTags().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/communityGalleriesGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/communityGalleriesGetSample.js new file mode 100644 index 000000000000..e51e913971e4 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/communityGalleriesGetSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a community gallery by gallery public name. + * + * @summary Get a community gallery by gallery public name. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/communityGallery/GetACommunityGallery.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const location = "myLocation"; + const publicGalleryName = "publicGalleryName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.communityGalleries.get(location, publicGalleryName); + console.log(result); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/communityGalleryImageVersionsGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/communityGalleryImageVersionsGetSample.js new file mode 100644 index 000000000000..e4ed06bd584d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/communityGalleryImageVersionsGetSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a community gallery image version. + * + * @summary Get a community gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/communityGallery/GetACommunityGalleryImageVersion.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const location = "myLocation"; + const publicGalleryName = "publicGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "myGalleryImageVersionName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.communityGalleryImageVersions.get( + location, + publicGalleryName, + galleryImageName, + galleryImageVersionName + ); + console.log(result); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/communityGalleryImagesGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/communityGalleryImagesGetSample.js new file mode 100644 index 000000000000..89ee63bbff9e --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/communityGalleryImagesGetSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a community gallery image. + * + * @summary Get a community gallery image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/communityGallery/GetACommunityGalleryImage.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const location = "myLocation"; + const publicGalleryName = "publicGalleryName"; + const galleryImageName = "myGalleryImageName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.communityGalleryImages.get( + location, + publicGalleryName, + galleryImageName + ); + console.log(result); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsCreateOrUpdateSample.js new file mode 100644 index 000000000000..24b6c1dc5afb --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsCreateOrUpdateSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) + * + * @summary Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateADedicatedHostGroup.json + */ +async function createOrUpdateADedicatedHostGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const hostGroupName = "myDedicatedHostGroup"; + const parameters = { + location: "westus", + platformFaultDomainCount: 3, + supportAutomaticPlacement: true, + tags: { department: "finance" }, + zones: ["1"], + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.createOrUpdate( + resourceGroupName, + hostGroupName, + parameters + ); + console.log(result); +} + +createOrUpdateADedicatedHostGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsDeleteSample.js new file mode 100644 index 000000000000..6f7df59d37de --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsDeleteSample.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete a dedicated host group. + * + * @summary Delete a dedicated host group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Delete_MaximumSet_Gen.json + */ +async function dedicatedHostGroupsDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "a"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.delete(resourceGroupName, hostGroupName); + console.log(result); +} + +dedicatedHostGroupsDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Delete a dedicated host group. + * + * @summary Delete a dedicated host group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Delete_MinimumSet_Gen.json + */ +async function dedicatedHostGroupsDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "aaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.delete(resourceGroupName, hostGroupName); + console.log(result); +} + +dedicatedHostGroupsDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsGetSample.js new file mode 100644 index 000000000000..4534ac195678 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsGetSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Retrieves information about a dedicated host group. + * + * @summary Retrieves information about a dedicated host group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetADedicatedHostGroup.json + */ +async function createADedicatedHostGroup() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const hostGroupName = "myDedicatedHostGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.get(resourceGroupName, hostGroupName); + console.log(result); +} + +createADedicatedHostGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsListByResourceGroupSample.js b/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsListByResourceGroupSample.js new file mode 100644 index 000000000000..2a607483d9a7 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsListByResourceGroupSample.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. + * + * @summary Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListByResourceGroup_MaximumSet_Gen.json + */ +async function dedicatedHostGroupsListByResourceGroupMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.dedicatedHostGroups.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +dedicatedHostGroupsListByResourceGroupMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. + * + * @summary Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListByResourceGroup_MinimumSet_Gen.json + */ +async function dedicatedHostGroupsListByResourceGroupMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.dedicatedHostGroups.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +dedicatedHostGroupsListByResourceGroupMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsListBySubscriptionSample.js b/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsListBySubscriptionSample.js new file mode 100644 index 000000000000..b6ccbda88f70 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsListBySubscriptionSample.js @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. + * + * @summary Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListBySubscription_MaximumSet_Gen.json + */ +async function dedicatedHostGroupsListBySubscriptionMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.dedicatedHostGroups.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +dedicatedHostGroupsListBySubscriptionMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. + * + * @summary Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListBySubscription_MinimumSet_Gen.json + */ +async function dedicatedHostGroupsListBySubscriptionMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.dedicatedHostGroups.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +dedicatedHostGroupsListBySubscriptionMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsUpdateSample.js new file mode 100644 index 000000000000..6a051a489bcf --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostGroupsUpdateSample.js @@ -0,0 +1,81 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Update an dedicated host group. + * + * @summary Update an dedicated host group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Update_MaximumSet_Gen.json + */ +async function dedicatedHostGroupsUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "aaaa"; + const parameters = { + instanceView: { + hosts: [ + { + availableCapacity: { + allocatableVMs: [{ count: 26, vmSize: "aaaaaaaaaaaaaaaaaaaa" }], + }, + statuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z"), + }, + ], + }, + ], + }, + platformFaultDomainCount: 3, + supportAutomaticPlacement: true, + tags: { key9921: "aaaaaaaaaa" }, + zones: ["aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"], + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.update( + resourceGroupName, + hostGroupName, + parameters + ); + console.log(result); +} + +dedicatedHostGroupsUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Update an dedicated host group. + * + * @summary Update an dedicated host group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Update_MinimumSet_Gen.json + */ +async function dedicatedHostGroupsUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "aaaaaaaaaaa"; + const parameters = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.update( + resourceGroupName, + hostGroupName, + parameters + ); + console.log(result); +} + +dedicatedHostGroupsUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsCreateOrUpdateSample.js new file mode 100644 index 000000000000..e8f63e55709f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsCreateOrUpdateSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update a dedicated host . + * + * @summary Create or update a dedicated host . + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateADedicatedHost.json + */ +async function createOrUpdateADedicatedHost() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const hostGroupName = "myDedicatedHostGroup"; + const hostName = "myDedicatedHost"; + const parameters = { + location: "westus", + platformFaultDomain: 1, + sku: { name: "DSv3-Type1" }, + tags: { department: "HR" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.beginCreateOrUpdateAndWait( + resourceGroupName, + hostGroupName, + hostName, + parameters + ); + console.log(result); +} + +createOrUpdateADedicatedHost().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsDeleteSample.js new file mode 100644 index 000000000000..c75f8c34b017 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsDeleteSample.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete a dedicated host. + * + * @summary Delete a dedicated host. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Delete_MaximumSet_Gen.json + */ +async function dedicatedHostsDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "aaaaaa"; + const hostName = "aaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.beginDeleteAndWait( + resourceGroupName, + hostGroupName, + hostName + ); + console.log(result); +} + +dedicatedHostsDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Delete a dedicated host. + * + * @summary Delete a dedicated host. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Delete_MinimumSet_Gen.json + */ +async function dedicatedHostsDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "aaaaaaaaaaaaaaa"; + const hostName = "aaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.beginDeleteAndWait( + resourceGroupName, + hostGroupName, + hostName + ); + console.log(result); +} + +dedicatedHostsDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsGetSample.js new file mode 100644 index 000000000000..3473069cd172 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsGetSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Retrieves information about a dedicated host. + * + * @summary Retrieves information about a dedicated host. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetADedicatedHost.json + */ +async function getADedicatedHost() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const hostGroupName = "myDedicatedHostGroup"; + const hostName = "myHost"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.get(resourceGroupName, hostGroupName, hostName); + console.log(result); +} + +getADedicatedHost().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsListByHostGroupSample.js b/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsListByHostGroupSample.js new file mode 100644 index 000000000000..a6fc93d120ca --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsListByHostGroupSample.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + * + * @summary Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_ListByHostGroup_MaximumSet_Gen.json + */ +async function dedicatedHostsListByHostGroupMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.dedicatedHosts.listByHostGroup(resourceGroupName, hostGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +dedicatedHostsListByHostGroupMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + * + * @summary Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_ListByHostGroup_MinimumSet_Gen.json + */ +async function dedicatedHostsListByHostGroupMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "aaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.dedicatedHosts.listByHostGroup(resourceGroupName, hostGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +dedicatedHostsListByHostGroupMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsRestartSample.js b/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsRestartSample.js new file mode 100644 index 000000000000..e2a1e5d45db2 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsRestartSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/en-us/azure/service-health/resource-health-overview for more details. + * + * @summary Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/en-us/azure/service-health/resource-health-overview for more details. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostRestart.json + */ +async function restartDedicatedHost() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const hostGroupName = "myDedicatedHostGroup"; + const hostName = "myHost"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.beginRestartAndWait( + resourceGroupName, + hostGroupName, + hostName + ); + console.log(result); +} + +restartDedicatedHost().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsUpdateSample.js new file mode 100644 index 000000000000..eb7548b4c05d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/dedicatedHostsUpdateSample.js @@ -0,0 +1,81 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Update an dedicated host . + * + * @summary Update an dedicated host . + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Update_MaximumSet_Gen.json + */ +async function dedicatedHostsUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "aaaaaaaaa"; + const hostName = "aaaaaaaaaaaaaaaaaaaaa"; + const parameters = { + autoReplaceOnFailure: true, + instanceView: { + availableCapacity: { + allocatableVMs: [{ count: 26, vmSize: "aaaaaaaaaaaaaaaaaaaa" }], + }, + statuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z"), + }, + ], + }, + licenseType: "Windows_Server_Hybrid", + platformFaultDomain: 1, + tags: { key8813: "aaaaaaaaaaaaaaaaaaaaaaaaaaa" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.beginUpdateAndWait( + resourceGroupName, + hostGroupName, + hostName, + parameters + ); + console.log(result); +} + +dedicatedHostsUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Update an dedicated host . + * + * @summary Update an dedicated host . + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Update_MinimumSet_Gen.json + */ +async function dedicatedHostsUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "aa"; + const hostName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const parameters = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.beginUpdateAndWait( + resourceGroupName, + hostGroupName, + hostName, + parameters + ); + console.log(result); +} + +dedicatedHostsUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesCreateOrUpdateSample.js new file mode 100644 index 000000000000..e50a6e52a379 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesCreateOrUpdateSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Creates or updates a disk access resource + * + * @summary Creates or updates a disk access resource + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateADiskAccess.json + */ +async function createADiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const diskAccess = { location: "West US" }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.beginCreateOrUpdateAndWait( + resourceGroupName, + diskAccessName, + diskAccess + ); + console.log(result); +} + +createADiskAccessResource().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesDeleteAPrivateEndpointConnectionSample.js b/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesDeleteAPrivateEndpointConnectionSample.js new file mode 100644 index 000000000000..2e93765ddb11 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesDeleteAPrivateEndpointConnectionSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Deletes a private endpoint connection under a disk access resource. + * + * @summary Deletes a private endpoint connection under a disk access resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteAPrivateEndpointConnection.json + */ +async function deleteAPrivateEndpointConnectionUnderADiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const privateEndpointConnectionName = "myPrivateEndpointConnection"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.beginDeleteAPrivateEndpointConnectionAndWait( + resourceGroupName, + diskAccessName, + privateEndpointConnectionName + ); + console.log(result); +} + +deleteAPrivateEndpointConnectionUnderADiskAccessResource().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesDeleteSample.js new file mode 100644 index 000000000000..116260e7b435 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesDeleteSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Deletes a disk access resource. + * + * @summary Deletes a disk access resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteADiskAccess.json + */ +async function deleteADiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.beginDeleteAndWait(resourceGroupName, diskAccessName); + console.log(result); +} + +deleteADiskAccessResource().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesGetAPrivateEndpointConnectionSample.js b/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesGetAPrivateEndpointConnectionSample.js new file mode 100644 index 000000000000..f053188be574 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesGetAPrivateEndpointConnectionSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets information about a private endpoint connection under a disk access resource. + * + * @summary Gets information about a private endpoint connection under a disk access resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutAPrivateEndpointConnection.json + */ +async function getInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const privateEndpointConnectionName = "myPrivateEndpointConnection"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.getAPrivateEndpointConnection( + resourceGroupName, + diskAccessName, + privateEndpointConnectionName + ); + console.log(result); +} + +getInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesGetPrivateLinkResourcesSample.js b/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesGetPrivateLinkResourcesSample.js new file mode 100644 index 000000000000..fe7446e7852d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesGetPrivateLinkResourcesSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the private link resources possible under disk access resource + * + * @summary Gets the private link resources possible under disk access resource + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetDiskAccessPrivateLinkResources.json + */ +async function listAllPossiblePrivateLinkResourcesUnderDiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.getPrivateLinkResources( + resourceGroupName, + diskAccessName + ); + console.log(result); +} + +listAllPossiblePrivateLinkResourcesUnderDiskAccessResource().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesGetSample.js new file mode 100644 index 000000000000..030224306c45 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesGetSample.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets information about a disk access resource. + * + * @summary Gets information about a disk access resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutADiskAccessWithPrivateEndpoints.json + */ +async function getInformationAboutADiskAccessResourceWithPrivateEndpoints() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.get(resourceGroupName, diskAccessName); + console.log(result); +} + +getInformationAboutADiskAccessResourceWithPrivateEndpoints().catch(console.error); + +/** + * This sample demonstrates how to Gets information about a disk access resource. + * + * @summary Gets information about a disk access resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutADiskAccess.json + */ +async function getInformationAboutADiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.get(resourceGroupName, diskAccessName); + console.log(result); +} + +getInformationAboutADiskAccessResource().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesListByResourceGroupSample.js b/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesListByResourceGroupSample.js new file mode 100644 index 000000000000..44b08b9c6e58 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesListByResourceGroupSample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all the disk access resources under a resource group. + * + * @summary Lists all the disk access resources under a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskAccessesInAResourceGroup.json + */ +async function listAllDiskAccessResourcesInAResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.diskAccesses.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listAllDiskAccessResourcesInAResourceGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesListPrivateEndpointConnectionsSample.js b/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesListPrivateEndpointConnectionsSample.js new file mode 100644 index 000000000000..d5587407ad24 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesListPrivateEndpointConnectionsSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List information about private endpoint connections under a disk access resource + * + * @summary List information about private endpoint connections under a disk access resource + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListPrivateEndpointConnectionsInADiskAccess.json + */ +async function getInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.diskAccesses.listPrivateEndpointConnections( + resourceGroupName, + diskAccessName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesListSample.js new file mode 100644 index 000000000000..2e1218e1b850 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesListSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all the disk access resources under a subscription. + * + * @summary Lists all the disk access resources under a subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskAccessesInASubscription.json + */ +async function listAllDiskAccessResourcesInASubscription() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.diskAccesses.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listAllDiskAccessResourcesInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesUpdateAPrivateEndpointConnectionSample.js b/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesUpdateAPrivateEndpointConnectionSample.js new file mode 100644 index 000000000000..2c053878d6a9 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesUpdateAPrivateEndpointConnectionSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. + * + * @summary Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ApprovePrivateEndpointConnection.json + */ +async function approveAPrivateEndpointConnectionUnderADiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const privateEndpointConnectionName = "myPrivateEndpointConnection"; + const privateEndpointConnection = { + privateLinkServiceConnectionState: { + description: "Approving myPrivateEndpointConnection", + status: "Approved", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.beginUpdateAPrivateEndpointConnectionAndWait( + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + privateEndpointConnection + ); + console.log(result); +} + +approveAPrivateEndpointConnectionUnderADiskAccessResource().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesUpdateSample.js new file mode 100644 index 000000000000..bcfe384966f9 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/diskAccessesUpdateSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Updates (patches) a disk access resource. + * + * @summary Updates (patches) a disk access resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateADiskAccess.json + */ +async function updateADiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const diskAccess = { + tags: { department: "Development", project: "PrivateEndpoints" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.beginUpdateAndWait( + resourceGroupName, + diskAccessName, + diskAccess + ); + console.log(result); +} + +updateADiskAccessResource().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsCreateOrUpdateSample.js new file mode 100644 index 000000000000..3f77d73d21fc --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsCreateOrUpdateSample.js @@ -0,0 +1,75 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Creates or updates a disk encryption set + * + * @summary Creates or updates a disk encryption set + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateADiskEncryptionSetWithKeyVaultFromADifferentSubscription.json + */ +async function createADiskEncryptionSetWithKeyVaultFromADifferentSubscription() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskEncryptionSetName = "myDiskEncryptionSet"; + const diskEncryptionSet = { + activeKey: { + keyUrl: "https://myvaultdifferentsub.vault-int.azure-int.net/keys/{key}", + }, + encryptionType: "EncryptionAtRestWithCustomerKey", + identity: { type: "SystemAssigned" }, + location: "West US", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.beginCreateOrUpdateAndWait( + resourceGroupName, + diskEncryptionSetName, + diskEncryptionSet + ); + console.log(result); +} + +createADiskEncryptionSetWithKeyVaultFromADifferentSubscription().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk encryption set + * + * @summary Creates or updates a disk encryption set + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateADiskEncryptionSet.json + */ +async function createADiskEncryptionSet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskEncryptionSetName = "myDiskEncryptionSet"; + const diskEncryptionSet = { + activeKey: { + keyUrl: "https://myvmvault.vault-int.azure-int.net/keys/{key}", + sourceVault: { + id: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault", + }, + }, + encryptionType: "EncryptionAtRestWithCustomerKey", + identity: { type: "SystemAssigned" }, + location: "West US", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.beginCreateOrUpdateAndWait( + resourceGroupName, + diskEncryptionSetName, + diskEncryptionSet + ); + console.log(result); +} + +createADiskEncryptionSet().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsDeleteSample.js new file mode 100644 index 000000000000..3fe367f5ff63 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsDeleteSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Deletes a disk encryption set. + * + * @summary Deletes a disk encryption set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteADiskEncryptionSet.json + */ +async function deleteADiskEncryptionSet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskEncryptionSetName = "myDiskEncryptionSet"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.beginDeleteAndWait( + resourceGroupName, + diskEncryptionSetName + ); + console.log(result); +} + +deleteADiskEncryptionSet().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsGetSample.js new file mode 100644 index 000000000000..8a3473d9f737 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsGetSample.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets information about a disk encryption set. + * + * @summary Gets information about a disk encryption set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutADiskEncryptionSetWithAutoKeyRotationError.json + */ +async function getInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskEncryptionSetName = "myDiskEncryptionSet"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.get(resourceGroupName, diskEncryptionSetName); + console.log(result); +} + +getInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed().catch(console.error); + +/** + * This sample demonstrates how to Gets information about a disk encryption set. + * + * @summary Gets information about a disk encryption set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutADiskEncryptionSet.json + */ +async function getInformationAboutADiskEncryptionSet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskEncryptionSetName = "myDiskEncryptionSet"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.get(resourceGroupName, diskEncryptionSetName); + console.log(result); +} + +getInformationAboutADiskEncryptionSet().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsListAssociatedResourcesSample.js b/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsListAssociatedResourcesSample.js new file mode 100644 index 000000000000..7fe2560e5f0c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsListAssociatedResourcesSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all resources that are encrypted with this disk encryption set. + * + * @summary Lists all resources that are encrypted with this disk encryption set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskEncryptionSetAssociatedResources.json + */ +async function listAllResourcesThatAreEncryptedWithThisDiskEncryptionSet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskEncryptionSetName = "myDiskEncryptionSet"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.diskEncryptionSets.listAssociatedResources( + resourceGroupName, + diskEncryptionSetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listAllResourcesThatAreEncryptedWithThisDiskEncryptionSet().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsListByResourceGroupSample.js b/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsListByResourceGroupSample.js new file mode 100644 index 000000000000..a3a9c687763f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsListByResourceGroupSample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all the disk encryption sets under a resource group. + * + * @summary Lists all the disk encryption sets under a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskEncryptionSetsInAResourceGroup.json + */ +async function listAllDiskEncryptionSetsInAResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.diskEncryptionSets.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listAllDiskEncryptionSetsInAResourceGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsListSample.js new file mode 100644 index 000000000000..bb495ce7c2d8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsListSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all the disk encryption sets under a subscription. + * + * @summary Lists all the disk encryption sets under a subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskEncryptionSetsInASubscription.json + */ +async function listAllDiskEncryptionSetsInASubscription() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.diskEncryptionSets.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listAllDiskEncryptionSetsInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsUpdateSample.js new file mode 100644 index 000000000000..a6f5efeff6c6 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/diskEncryptionSetsUpdateSample.js @@ -0,0 +1,108 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Updates (patches) a disk encryption set. + * + * @summary Updates (patches) a disk encryption set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateADiskEncryptionSetWithRotationToLatestKeyVersionEnabled.json + */ +async function updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueSucceeded() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskEncryptionSetName = "myDiskEncryptionSet"; + const diskEncryptionSet = { + activeKey: { + keyUrl: "https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion1", + }, + encryptionType: "EncryptionAtRestWithCustomerKey", + identity: { type: "SystemAssigned" }, + rotationToLatestKeyVersionEnabled: true, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.beginUpdateAndWait( + resourceGroupName, + diskEncryptionSetName, + diskEncryptionSet + ); + console.log(result); +} + +updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueSucceeded().catch( + console.error +); + +/** + * This sample demonstrates how to Updates (patches) a disk encryption set. + * + * @summary Updates (patches) a disk encryption set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledInProgress.json + */ +async function updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueUpdating() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskEncryptionSetName = "myDiskEncryptionSet"; + const diskEncryptionSet = { + activeKey: { + keyUrl: "https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion1", + }, + encryptionType: "EncryptionAtRestWithCustomerKey", + identity: { type: "SystemAssigned" }, + rotationToLatestKeyVersionEnabled: true, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.beginUpdateAndWait( + resourceGroupName, + diskEncryptionSetName, + diskEncryptionSet + ); + console.log(result); +} + +updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueUpdating().catch( + console.error +); + +/** + * This sample demonstrates how to Updates (patches) a disk encryption set. + * + * @summary Updates (patches) a disk encryption set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateADiskEncryptionSet.json + */ +async function updateADiskEncryptionSet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskEncryptionSetName = "myDiskEncryptionSet"; + const diskEncryptionSet = { + activeKey: { + keyUrl: "https://myvmvault.vault-int.azure-int.net/keys/keyName/keyVersion", + sourceVault: { + id: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault", + }, + }, + encryptionType: "EncryptionAtRestWithCustomerKey", + tags: { department: "Development", project: "Encryption" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.beginUpdateAndWait( + resourceGroupName, + diskEncryptionSetName, + diskEncryptionSet + ); + console.log(result); +} + +updateADiskEncryptionSet().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/diskRestorePointGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/diskRestorePointGetSample.js new file mode 100644 index 000000000000..5610e2aff994 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/diskRestorePointGetSample.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get disk restorePoint resource + * + * @summary Get disk restorePoint resource + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetDiskRestorePointResources.json + */ +async function getAnIncrementalDiskRestorePointResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpc"; + const vmRestorePointName = "vmrp"; + const diskRestorePointName = "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskRestorePointOperations.get( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName + ); + console.log(result); +} + +getAnIncrementalDiskRestorePointResource().catch(console.error); + +/** + * This sample demonstrates how to Get disk restorePoint resource + * + * @summary Get disk restorePoint resource + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetDiskRestorePointWhenSourceResourceIsFromDifferentRegion.json + */ +async function getAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpc"; + const vmRestorePointName = "vmrp"; + const diskRestorePointName = "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskRestorePointOperations.get( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName + ); + console.log(result); +} + +getAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/diskRestorePointGrantAccessSample.js b/sdk/compute/arm-compute/samples/v17/javascript/diskRestorePointGrantAccessSample.js new file mode 100644 index 000000000000..f2019fd8fe87 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/diskRestorePointGrantAccessSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Grants access to a diskRestorePoint. + * + * @summary Grants access to a diskRestorePoint. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/BeginGetAccessDiskRestorePoint.json + */ +async function grantsAccessToADiskRestorePoint() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpc"; + const vmRestorePointName = "vmrp"; + const diskRestorePointName = "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"; + const grantAccessData = { + access: "Read", + durationInSeconds: 300, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskRestorePointOperations.beginGrantAccessAndWait( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData + ); + console.log(result); +} + +grantsAccessToADiskRestorePoint().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/diskRestorePointListByRestorePointSample.js b/sdk/compute/arm-compute/samples/v17/javascript/diskRestorePointListByRestorePointSample.js new file mode 100644 index 000000000000..ff3b946a67fd --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/diskRestorePointListByRestorePointSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists diskRestorePoints under a vmRestorePoint. + * + * @summary Lists diskRestorePoints under a vmRestorePoint. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskRestorePointsInVmRestorePoint.json + */ +async function getAnIncrementalDiskRestorePointResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpc"; + const vmRestorePointName = "vmrp"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.diskRestorePointOperations.listByRestorePoint( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAnIncrementalDiskRestorePointResource().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/diskRestorePointRevokeAccessSample.js b/sdk/compute/arm-compute/samples/v17/javascript/diskRestorePointRevokeAccessSample.js new file mode 100644 index 000000000000..a4574cd1f351 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/diskRestorePointRevokeAccessSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Revokes access to a diskRestorePoint. + * + * @summary Revokes access to a diskRestorePoint. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/EndGetAccessDiskRestorePoint.json + */ +async function revokesAccessToADiskRestorePoint() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpc"; + const vmRestorePointName = "vmrp"; + const diskRestorePointName = "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskRestorePointOperations.beginRevokeAccessAndWait( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName + ); + console.log(result); +} + +revokesAccessToADiskRestorePoint().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/disksCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/disksCreateOrUpdateSample.js new file mode 100644 index 000000000000..1cbbfe973cc2 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/disksCreateOrUpdateSample.js @@ -0,0 +1,459 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAConfidentialVMDiskEncryptedWithCMK.json + */ +async function createAConfidentialVMSupportedDiskEncryptedWithCustomerManagedKey() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk = { + creationData: { + createOption: "FromImage", + imageReference: { + id: "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0", + }, + }, + location: "West US", + osType: "Windows", + securityProfile: { + secureVMDiskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", + securityType: "ConfidentialVM_DiskEncryptedWithCustomerKey", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); + console.log(result); +} + +createAConfidentialVMSupportedDiskEncryptedWithCustomerManagedKey().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskWithDiskAccess.json + */ +async function createAManagedDiskAndAssociateWithDiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk = { + creationData: { createOption: "Empty" }, + diskAccessId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/{existing-diskAccess-name}", + diskSizeGB: 200, + location: "West US", + networkAccessPolicy: "AllowPrivate", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); + console.log(result); +} + +createAManagedDiskAndAssociateWithDiskAccessResource().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskWithDiskEncryptionSet.json + */ +async function createAManagedDiskAndAssociateWithDiskEncryptionSet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk = { + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + encryption: { + diskEncryptionSetId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + location: "West US", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); + console.log(result); +} + +createAManagedDiskAndAssociateWithDiskEncryptionSet().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskByCopyingASnapshot.json + */ +async function createAManagedDiskByCopyingASnapshot() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk = { + creationData: { + createOption: "Copy", + sourceResourceId: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", + }, + location: "West US", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); + console.log(result); +} + +createAManagedDiskByCopyingASnapshot().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription.json + */ +async function createAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk = { + creationData: { + createOption: "Import", + sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + storageAccountId: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount", + }, + location: "West US", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); + console.log(result); +} + +createAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription.json + */ +async function createAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk = { + creationData: { + createOption: "Import", + sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + }, + location: "West US", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); + console.log(result); +} + +createAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskFromImportSecure.json + */ +async function createAManagedDiskFromImportSecureCreateOption() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk = { + creationData: { + createOption: "ImportSecure", + securityDataUri: "https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd", + sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + storageAccountId: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount", + }, + location: "West US", + osType: "Windows", + securityProfile: { + securityType: "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); + console.log(result); +} + +createAManagedDiskFromImportSecureCreateOption().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskFromUploadPreparedSecure.json + */ +async function createAManagedDiskFromUploadPreparedSecureCreateOption() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk = { + creationData: { + createOption: "UploadPreparedSecure", + uploadSizeBytes: 10737418752, + }, + location: "West US", + osType: "Windows", + securityProfile: { securityType: "TrustedLaunch" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); + console.log(result); +} + +createAManagedDiskFromUploadPreparedSecureCreateOption().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskFromAPlatformImage.json + */ +async function createAManagedDiskFromAPlatformImage() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk = { + creationData: { + createOption: "FromImage", + imageReference: { + id: "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0", + }, + }, + location: "West US", + osType: "Windows", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); + console.log(result); +} + +createAManagedDiskFromAPlatformImage().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskFromAnExistingManagedDisk.json + */ +async function createAManagedDiskFromAnExistingManagedDiskInTheSameOrDifferentSubscription() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk2"; + const disk = { + creationData: { + createOption: "Copy", + sourceResourceId: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk1", + }, + location: "West US", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); + console.log(result); +} + +createAManagedDiskFromAnExistingManagedDiskInTheSameOrDifferentSubscription().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskWithDataAccessAuthMode.json + */ +async function createAManagedDiskWithDataAccessAuthMode() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk = { + creationData: { createOption: "Empty" }, + dataAccessAuthMode: "AzureActiveDirectory", + diskSizeGB: 200, + location: "West US", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); + console.log(result); +} + +createAManagedDiskWithDataAccessAuthMode().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskWithSecurityProfile.json + */ +async function createAManagedDiskWithSecurityProfile() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk = { + creationData: { + createOption: "FromImage", + imageReference: { + id: "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/uswest/Publishers/Microsoft/ArtifactTypes/VMImage/Offers/{offer}", + }, + }, + location: "North Central US", + osType: "Windows", + securityProfile: { securityType: "TrustedLaunch" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); + console.log(result); +} + +createAManagedDiskWithSecurityProfile().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskWithSSDZRSAccountType.json + */ +async function createAManagedDiskWithSsdZrsAccountType() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk = { + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + location: "West US", + sku: { name: "Premium_ZRS" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); + console.log(result); +} + +createAManagedDiskWithSsdZrsAccountType().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedUploadDisk.json + */ +async function createAManagedUploadDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk = { + creationData: { createOption: "Upload", uploadSizeBytes: 10737418752 }, + location: "West US", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); + console.log(result); +} + +createAManagedUploadDisk().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAnEmptyManagedDiskInExtendedLocation.json + */ +async function createAnEmptyManagedDiskInExtendedLocation() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk = { + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + extendedLocation: { name: "{edge-zone-id}", type: "EdgeZone" }, + location: "West US", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); + console.log(result); +} + +createAnEmptyManagedDiskInExtendedLocation().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAnEmptyManagedDisk.json + */ +async function createAnEmptyManagedDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk = { + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + location: "West US", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); + console.log(result); +} + +createAnEmptyManagedDisk().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskWithLogicalSectorSize.json + */ +async function createAnUltraManagedDiskWithLogicalSectorSize512E() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk = { + creationData: { createOption: "Empty", logicalSectorSize: 512 }, + diskSizeGB: 200, + location: "West US", + sku: { name: "UltraSSD_LRS" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); + console.log(result); +} + +createAnUltraManagedDiskWithLogicalSectorSize512E().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/disksDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/disksDeleteSample.js new file mode 100644 index 000000000000..d08f6a484fbb --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/disksDeleteSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Deletes a disk. + * + * @summary Deletes a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteAManagedDisk.json + */ +async function deleteAManagedDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginDeleteAndWait(resourceGroupName, diskName); + console.log(result); +} + +deleteAManagedDisk().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/disksGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/disksGetSample.js new file mode 100644 index 000000000000..8e07e9c5f39d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/disksGetSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets information about a disk. + * + * @summary Gets information about a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutAManagedDisk.json + */ +async function getInformationAboutAManagedDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myManagedDisk"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.get(resourceGroupName, diskName); + console.log(result); +} + +getInformationAboutAManagedDisk().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/disksGrantAccessSample.js b/sdk/compute/arm-compute/samples/v17/javascript/disksGrantAccessSample.js new file mode 100644 index 000000000000..5b9bcfbd0d42 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/disksGrantAccessSample.js @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Grants access to a disk. + * + * @summary Grants access to a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/BeginGetAccessManagedDisk.json + */ +async function getASasOnAManagedDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const grantAccessData = { + access: "Read", + durationInSeconds: 300, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginGrantAccessAndWait( + resourceGroupName, + diskName, + grantAccessData + ); + console.log(result); +} + +getASasOnAManagedDisk().catch(console.error); + +/** + * This sample demonstrates how to Grants access to a disk. + * + * @summary Grants access to a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/BeginGetAccessManagedDiskWithVMGuestState.json + */ +async function getSasOnManagedDiskAndVMGuestState() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const grantAccessData = { + access: "Read", + durationInSeconds: 300, + getSecureVMGuestStateSAS: true, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginGrantAccessAndWait( + resourceGroupName, + diskName, + grantAccessData + ); + console.log(result); +} + +getSasOnManagedDiskAndVMGuestState().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/disksListByResourceGroupSample.js b/sdk/compute/arm-compute/samples/v17/javascript/disksListByResourceGroupSample.js new file mode 100644 index 000000000000..cc3d1a0a0bef --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/disksListByResourceGroupSample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all the disks under a resource group. + * + * @summary Lists all the disks under a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListManagedDisksInAResourceGroup.json + */ +async function listAllManagedDisksInAResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.disks.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listAllManagedDisksInAResourceGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/disksListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/disksListSample.js new file mode 100644 index 000000000000..3dcbab56e3c4 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/disksListSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all the disks under a subscription. + * + * @summary Lists all the disks under a subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListManagedDisksInASubscription.json + */ +async function listAllManagedDisksInASubscription() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.disks.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listAllManagedDisksInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/disksRevokeAccessSample.js b/sdk/compute/arm-compute/samples/v17/javascript/disksRevokeAccessSample.js new file mode 100644 index 000000000000..c566672eb31e --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/disksRevokeAccessSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Revokes access to a disk. + * + * @summary Revokes access to a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/EndGetAccessManagedDisk.json + */ +async function revokeAccessToAManagedDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginRevokeAccessAndWait(resourceGroupName, diskName); + console.log(result); +} + +revokeAccessToAManagedDisk().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/disksUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/disksUpdateSample.js new file mode 100644 index 000000000000..d2381e6e0a82 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/disksUpdateSample.js @@ -0,0 +1,173 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Updates (patches) a disk. + * + * @summary Updates (patches) a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateOrUpdateABurstingEnabledManagedDisk.json + */ +async function createOrUpdateABurstingEnabledManagedDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk = { burstingEnabled: true, diskSizeGB: 1024 }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk); + console.log(result); +} + +createOrUpdateABurstingEnabledManagedDisk().catch(console.error); + +/** + * This sample demonstrates how to Updates (patches) a disk. + * + * @summary Updates (patches) a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateAManagedDiskToAddAcceleratedNetworking.json + */ +async function updateAManagedDiskToAddAcceleratedNetworking() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk = { + supportedCapabilities: { acceleratedNetwork: false }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk); + console.log(result); +} + +updateAManagedDiskToAddAcceleratedNetworking().catch(console.error); + +/** + * This sample demonstrates how to Updates (patches) a disk. + * + * @summary Updates (patches) a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateAManagedDiskToAddArchitecture.json + */ +async function updateAManagedDiskToAddArchitecture() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk = { supportedCapabilities: { architecture: "Arm64" } }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk); + console.log(result); +} + +updateAManagedDiskToAddArchitecture().catch(console.error); + +/** + * This sample demonstrates how to Updates (patches) a disk. + * + * @summary Updates (patches) a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateAManagedDiskToAddPurchasePlan.json + */ +async function updateAManagedDiskToAddPurchasePlan() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk = { + purchasePlan: { + name: "myPurchasePlanName", + product: "myPurchasePlanProduct", + promotionCode: "myPurchasePlanPromotionCode", + publisher: "myPurchasePlanPublisher", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk); + console.log(result); +} + +updateAManagedDiskToAddPurchasePlan().catch(console.error); + +/** + * This sample demonstrates how to Updates (patches) a disk. + * + * @summary Updates (patches) a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateAManagedDiskToAddSupportsHibernation.json + */ +async function updateAManagedDiskToAddSupportsHibernation() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk = { supportsHibernation: true }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk); + console.log(result); +} + +updateAManagedDiskToAddSupportsHibernation().catch(console.error); + +/** + * This sample demonstrates how to Updates (patches) a disk. + * + * @summary Updates (patches) a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateAManagedDiskToChangeTier.json + */ +async function updateAManagedDiskToChangeTier() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk = { tier: "P30" }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk); + console.log(result); +} + +updateAManagedDiskToChangeTier().catch(console.error); + +/** + * This sample demonstrates how to Updates (patches) a disk. + * + * @summary Updates (patches) a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateAManagedDiskToDisableBursting.json + */ +async function updateAManagedDiskToDisableBursting() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk = { burstingEnabled: false }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk); + console.log(result); +} + +updateAManagedDiskToDisableBursting().catch(console.error); + +/** + * This sample demonstrates how to Updates (patches) a disk. + * + * @summary Updates (patches) a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateAManagedDiskToRemoveDiskAccess.json + */ +async function updateManagedDiskToRemoveDiskAccessResourceAssociation() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk = { networkAccessPolicy: "AllowAll" }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk); + console.log(result); +} + +updateManagedDiskToRemoveDiskAccessResourceAssociation().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/galleriesCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/galleriesCreateOrUpdateSample.js new file mode 100644 index 000000000000..ec7d30c1f816 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/galleriesCreateOrUpdateSample.js @@ -0,0 +1,127 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update a Shared Image Gallery. + * + * @summary Create or update a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateACommunityGallery.json + */ +async function createACommunityGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const gallery = { + description: "This is the gallery description.", + location: "West US", + sharingProfile: { + communityGalleryInfo: { + eula: "eula", + publicNamePrefix: "PirPublic", + publisherContact: "pir@microsoft.com", + publisherUri: "uri", + }, + permissions: "Community", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + gallery + ); + console.log(result); +} + +createACommunityGallery().catch(console.error); + +/** + * This sample demonstrates how to Create or update a Shared Image Gallery. + * + * @summary Create or update a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryWithSharingProfile.json + */ +async function createOrUpdateASimpleGalleryWithSharingProfile() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const gallery = { + description: "This is the gallery description.", + location: "West US", + sharingProfile: { permissions: "Groups" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + gallery + ); + console.log(result); +} + +createOrUpdateASimpleGalleryWithSharingProfile().catch(console.error); + +/** + * This sample demonstrates how to Create or update a Shared Image Gallery. + * + * @summary Create or update a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryWithSoftDeletionEnabled.json + */ +async function createOrUpdateASimpleGalleryWithSoftDeletionEnabled() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const gallery = { + description: "This is the gallery description.", + location: "West US", + softDeletePolicy: { isSoftDeleteEnabled: true }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + gallery + ); + console.log(result); +} + +createOrUpdateASimpleGalleryWithSoftDeletionEnabled().catch(console.error); + +/** + * This sample demonstrates how to Create or update a Shared Image Gallery. + * + * @summary Create or update a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGallery.json + */ +async function createOrUpdateASimpleGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const gallery = { + description: "This is the gallery description.", + location: "West US", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + gallery + ); + console.log(result); +} + +createOrUpdateASimpleGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/galleriesDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/galleriesDeleteSample.js new file mode 100644 index 000000000000..1d040d37eef0 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/galleriesDeleteSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete a Shared Image Gallery. + * + * @summary Delete a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGallery.json + */ +async function deleteAGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.beginDeleteAndWait(resourceGroupName, galleryName); + console.log(result); +} + +deleteAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/galleriesGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/galleriesGetSample.js new file mode 100644 index 000000000000..f73f2c794f05 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/galleriesGetSample.js @@ -0,0 +1,88 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Retrieves information about a Shared Image Gallery. + * + * @summary Retrieves information about a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetACommunityGallery.json + */ +async function getACommunityGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.get(resourceGroupName, galleryName); + console.log(result); +} + +getACommunityGallery().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about a Shared Image Gallery. + * + * @summary Retrieves information about a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryWithExpandSharingProfileGroups.json + */ +async function getAGalleryWithExpandSharingProfileGroups() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const expand = "SharingProfile/Groups"; + const options = { expand }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.get(resourceGroupName, galleryName, options); + console.log(result); +} + +getAGalleryWithExpandSharingProfileGroups().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about a Shared Image Gallery. + * + * @summary Retrieves information about a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryWithSelectPermissions.json + */ +async function getAGalleryWithSelectPermissions() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const select = "Permissions"; + const options = { select }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.get(resourceGroupName, galleryName, options); + console.log(result); +} + +getAGalleryWithSelectPermissions().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about a Shared Image Gallery. + * + * @summary Retrieves information about a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGallery.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.get(resourceGroupName, galleryName); + console.log(result); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/galleriesListByResourceGroupSample.js b/sdk/compute/arm-compute/samples/v17/javascript/galleriesListByResourceGroupSample.js new file mode 100644 index 000000000000..88c2c52637be --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/galleriesListByResourceGroupSample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List galleries under a resource group. + * + * @summary List galleries under a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleriesInAResourceGroup.json + */ +async function listGalleriesInAResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.galleries.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listGalleriesInAResourceGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/galleriesListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/galleriesListSample.js new file mode 100644 index 000000000000..fe1c75dad5c8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/galleriesListSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List galleries under a subscription. + * + * @summary List galleries under a subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleriesInASubscription.json + */ +async function listGalleriesInASubscription() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.galleries.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listGalleriesInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/galleriesUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/galleriesUpdateSample.js new file mode 100644 index 000000000000..e2aa67f1420d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/galleriesUpdateSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Update a Shared Image Gallery. + * + * @summary Update a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGallery.json + */ +async function updateASimpleGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const gallery = { + description: "This is the gallery description.", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.beginUpdateAndWait(resourceGroupName, galleryName, gallery); + console.log(result); +} + +updateASimpleGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationVersionsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationVersionsCreateOrUpdateSample.js new file mode 100644 index 000000000000..8126d43d93c0 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationVersionsCreateOrUpdateSample.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update a gallery Application Version. + * + * @summary Create or update a gallery Application Version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryApplicationVersion.json + */ +async function createOrUpdateASimpleGalleryApplicationVersion() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const galleryApplicationVersionName = "1.0.0"; + const galleryApplicationVersion = { + location: "West US", + publishingProfile: { + endOfLifeDate: new Date("2019-07-01T07:00:00Z"), + manageActions: { + install: + 'powershell -command "Expand-Archive -Path package.zip -DestinationPath C:package"', + remove: "del C:package ", + }, + replicaCount: 1, + source: { + mediaLink: + "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}", + }, + storageAccountType: "Standard_LRS", + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + storageAccountType: "Standard_LRS", + }, + ], + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplicationVersions.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion + ); + console.log(result); +} + +createOrUpdateASimpleGalleryApplicationVersion().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationVersionsDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationVersionsDeleteSample.js new file mode 100644 index 000000000000..baad8974ab48 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationVersionsDeleteSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete a gallery Application Version. + * + * @summary Delete a gallery Application Version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGalleryApplicationVersion.json + */ +async function deleteAGalleryApplicationVersion() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const galleryApplicationVersionName = "1.0.0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplicationVersions.beginDeleteAndWait( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName + ); + console.log(result); +} + +deleteAGalleryApplicationVersion().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationVersionsGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationVersionsGetSample.js new file mode 100644 index 000000000000..b0eec3989f42 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationVersionsGetSample.js @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Retrieves information about a gallery Application Version. + * + * @summary Retrieves information about a gallery Application Version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryApplicationVersionWithReplicationStatus.json + */ +async function getAGalleryApplicationVersionWithReplicationStatus() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const galleryApplicationVersionName = "1.0.0"; + const expand = "ReplicationStatus"; + const options = { expand }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplicationVersions.get( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + options + ); + console.log(result); +} + +getAGalleryApplicationVersionWithReplicationStatus().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about a gallery Application Version. + * + * @summary Retrieves information about a gallery Application Version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryApplicationVersion.json + */ +async function getAGalleryApplicationVersion() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const galleryApplicationVersionName = "1.0.0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplicationVersions.get( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName + ); + console.log(result); +} + +getAGalleryApplicationVersion().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationVersionsListByGalleryApplicationSample.js b/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationVersionsListByGalleryApplicationSample.js new file mode 100644 index 000000000000..cb9d40568bb2 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationVersionsListByGalleryApplicationSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List gallery Application Versions in a gallery Application Definition. + * + * @summary List gallery Application Versions in a gallery Application Definition. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleryApplicationVersionsInAGalleryApplication.json + */ +async function listGalleryApplicationVersionsInAGalleryApplicationDefinition() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.galleryApplicationVersions.listByGalleryApplication( + resourceGroupName, + galleryName, + galleryApplicationName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listGalleryApplicationVersionsInAGalleryApplicationDefinition().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationVersionsUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationVersionsUpdateSample.js new file mode 100644 index 000000000000..f4be6626f0e8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationVersionsUpdateSample.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Update a gallery Application Version. + * + * @summary Update a gallery Application Version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGalleryApplicationVersion.json + */ +async function updateASimpleGalleryApplicationVersion() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const galleryApplicationVersionName = "1.0.0"; + const galleryApplicationVersion = { + publishingProfile: { + endOfLifeDate: new Date("2019-07-01T07:00:00Z"), + manageActions: { + install: + 'powershell -command "Expand-Archive -Path package.zip -DestinationPath C:package"', + remove: "del C:package ", + }, + replicaCount: 1, + source: { + mediaLink: + "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}", + }, + storageAccountType: "Standard_LRS", + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + storageAccountType: "Standard_LRS", + }, + ], + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplicationVersions.beginUpdateAndWait( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion + ); + console.log(result); +} + +updateASimpleGalleryApplicationVersion().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationsCreateOrUpdateSample.js new file mode 100644 index 000000000000..8191a5b5dcc6 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationsCreateOrUpdateSample.js @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update a gallery Application Definition. + * + * @summary Create or update a gallery Application Definition. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryApplication.json + */ +async function createOrUpdateASimpleGalleryApplication() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const galleryApplication = { + description: "This is the gallery application description.", + eula: "This is the gallery application EULA.", + location: "West US", + privacyStatementUri: "myPrivacyStatementUri}", + releaseNoteUri: "myReleaseNoteUri", + supportedOSType: "Windows", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplications.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplication + ); + console.log(result); +} + +createOrUpdateASimpleGalleryApplication().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationsDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationsDeleteSample.js new file mode 100644 index 000000000000..280e047a865b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationsDeleteSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete a gallery Application. + * + * @summary Delete a gallery Application. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGalleryApplication.json + */ +async function deleteAGalleryApplication() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplications.beginDeleteAndWait( + resourceGroupName, + galleryName, + galleryApplicationName + ); + console.log(result); +} + +deleteAGalleryApplication().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationsGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationsGetSample.js new file mode 100644 index 000000000000..f4af5af3b894 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationsGetSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Retrieves information about a gallery Application Definition. + * + * @summary Retrieves information about a gallery Application Definition. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryApplication.json + */ +async function getAGalleryApplication() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplications.get( + resourceGroupName, + galleryName, + galleryApplicationName + ); + console.log(result); +} + +getAGalleryApplication().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationsListByGallerySample.js b/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationsListByGallerySample.js new file mode 100644 index 000000000000..322a98480cac --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationsListByGallerySample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List gallery Application Definitions in a gallery. + * + * @summary List gallery Application Definitions in a gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleryApplicationsInAGallery.json + */ +async function listGalleryApplicationsInAGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.galleryApplications.listByGallery(resourceGroupName, galleryName)) { + resArray.push(item); + } + console.log(resArray); +} + +listGalleryApplicationsInAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationsUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationsUpdateSample.js new file mode 100644 index 000000000000..5ec0db316da7 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/galleryApplicationsUpdateSample.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Update a gallery Application Definition. + * + * @summary Update a gallery Application Definition. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGalleryApplication.json + */ +async function updateASimpleGalleryApplication() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const galleryApplication = { + description: "This is the gallery application description.", + eula: "This is the gallery application EULA.", + privacyStatementUri: "myPrivacyStatementUri}", + releaseNoteUri: "myReleaseNoteUri", + supportedOSType: "Windows", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplications.beginUpdateAndWait( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplication + ); + console.log(result); +} + +updateASimpleGalleryApplication().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/galleryImageVersionsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/galleryImageVersionsCreateOrUpdateSample.js new file mode 100644 index 000000000000..dd6987e4b264 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/galleryImageVersionsCreateOrUpdateSample.js @@ -0,0 +1,626 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update a gallery image version. + * + * @summary Create or update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithVMAsSource.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingVMAsSource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion = { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + lun: 0, + }, + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + lun: 1, + }, + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + }, + regionalReplicaCount: 1, + }, + { + name: "East US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + lun: 0, + }, + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + lun: 1, + }, + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + }, + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + }, + ], + }, + storageProfile: { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{vmName}", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +createOrUpdateASimpleGalleryImageVersionUsingVMAsSource().catch(console.error); + +/** + * This sample demonstrates how to Create or update a gallery image version. + * + * @summary Create or update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersion.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingManagedImageAsSource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion = { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + lun: 0, + }, + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + lun: 1, + }, + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + }, + regionalReplicaCount: 1, + }, + { + name: "East US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + lun: 0, + }, + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + lun: 1, + }, + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + }, + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + }, + ], + }, + storageProfile: { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +createOrUpdateASimpleGalleryImageVersionUsingManagedImageAsSource().catch(console.error); + +/** + * This sample demonstrates how to Create or update a gallery image version. + * + * @summary Create or update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithSnapshotsAsSource.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingMixOfDisksAndSnapshotsAsASource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion = { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + lun: 1, + }, + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + }, + regionalReplicaCount: 1, + }, + { + name: "East US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + lun: 1, + }, + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + }, + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + }, + ], + }, + storageProfile: { + dataDiskImages: [ + { + hostCaching: "None", + lun: 1, + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{dataDiskName}", + }, + }, + ], + osDiskImage: { + hostCaching: "ReadOnly", + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{osSnapshotName}", + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +createOrUpdateASimpleGalleryImageVersionUsingMixOfDisksAndSnapshotsAsASource().catch(console.error); + +/** + * This sample demonstrates how to Create or update a gallery image version. + * + * @summary Create or update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithShallowReplicationMode.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingShallowReplicationMode() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion = { + location: "West US", + publishingProfile: { + replicationMode: "Shallow", + targetRegions: [{ name: "West US", regionalReplicaCount: 1 }], + }, + storageProfile: { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +createOrUpdateASimpleGalleryImageVersionUsingShallowReplicationMode().catch(console.error); + +/** + * This sample demonstrates how to Create or update a gallery image version. + * + * @summary Create or update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithImageVersionAsSource.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingSharedImageAsSource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion = { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + lun: 0, + }, + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + lun: 1, + }, + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + }, + regionalReplicaCount: 1, + }, + { + name: "East US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + lun: 0, + }, + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + lun: 1, + }, + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + }, + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + }, + ], + }, + storageProfile: { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{versionName}", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +createOrUpdateASimpleGalleryImageVersionUsingSharedImageAsSource().catch(console.error); + +/** + * This sample demonstrates how to Create or update a gallery image version. + * + * @summary Create or update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithSnapshotsAsSource.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingSnapshotsAsASource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion = { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + lun: 1, + }, + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + }, + regionalReplicaCount: 1, + }, + { + name: "East US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + lun: 1, + }, + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + }, + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + }, + ], + }, + storageProfile: { + dataDiskImages: [ + { + hostCaching: "None", + lun: 1, + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{dataDiskName}", + }, + }, + ], + osDiskImage: { + hostCaching: "ReadOnly", + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{osSnapshotName}", + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +createOrUpdateASimpleGalleryImageVersionUsingSnapshotsAsASource().catch(console.error); + +/** + * This sample demonstrates how to Create or update a gallery image version. + * + * @summary Create or update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithVHD.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingVhdAsASource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion = { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet", + lun: 1, + }, + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet", + }, + }, + regionalReplicaCount: 1, + }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + }, + ], + }, + storageProfile: { + dataDiskImages: [ + { + hostCaching: "None", + lun: 1, + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", + uri: "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd", + }, + }, + ], + osDiskImage: { + hostCaching: "ReadOnly", + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", + uri: "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd", + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +createOrUpdateASimpleGalleryImageVersionUsingVhdAsASource().catch(console.error); + +/** + * This sample demonstrates how to Create or update a gallery image version. + * + * @summary Create or update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithTargetExtendedLocations.json + */ +async function createOrUpdateASimpleGalleryImageVersionWithTargetExtendedLocationsSpecified() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion = { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + lun: 0, + }, + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + lun: 1, + }, + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + }, + regionalReplicaCount: 1, + }, + { + name: "East US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + lun: 0, + }, + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + lun: 1, + }, + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + }, + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + }, + ], + }, + storageProfile: { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +createOrUpdateASimpleGalleryImageVersionWithTargetExtendedLocationsSpecified().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/galleryImageVersionsDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/galleryImageVersionsDeleteSample.js new file mode 100644 index 000000000000..53615360e36f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/galleryImageVersionsDeleteSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete a gallery image version. + * + * @summary Delete a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGalleryImageVersion.json + */ +async function deleteAGalleryImageVersion() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginDeleteAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName + ); + console.log(result); +} + +deleteAGalleryImageVersion().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/galleryImageVersionsGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/galleryImageVersionsGetSample.js new file mode 100644 index 000000000000..d72574faf4f3 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/galleryImageVersionsGetSample.js @@ -0,0 +1,115 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Retrieves information about a gallery image version. + * + * @summary Retrieves information about a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryImageVersionWithReplicationStatus.json + */ +async function getAGalleryImageVersionWithReplicationStatus() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const expand = "ReplicationStatus"; + const options = { expand }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.get( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + options + ); + console.log(result); +} + +getAGalleryImageVersionWithReplicationStatus().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about a gallery image version. + * + * @summary Retrieves information about a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryImageVersionWithSnapshotsAsSource.json + */ +async function getAGalleryImageVersionWithSnapshotsAsASource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.get( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName + ); + console.log(result); +} + +getAGalleryImageVersionWithSnapshotsAsASource().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about a gallery image version. + * + * @summary Retrieves information about a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryImageVersionWithVhdAsSource.json + */ +async function getAGalleryImageVersionWithVhdAsASource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.get( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName + ); + console.log(result); +} + +getAGalleryImageVersionWithVhdAsASource().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about a gallery image version. + * + * @summary Retrieves information about a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryImageVersion.json + */ +async function getAGalleryImageVersion() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.get( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName + ); + console.log(result); +} + +getAGalleryImageVersion().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/galleryImageVersionsListByGalleryImageSample.js b/sdk/compute/arm-compute/samples/v17/javascript/galleryImageVersionsListByGalleryImageSample.js new file mode 100644 index 000000000000..c969b02be465 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/galleryImageVersionsListByGalleryImageSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List gallery image versions in a gallery image definition. + * + * @summary List gallery image versions in a gallery image definition. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleryImageVersionsInAGalleryImage.json + */ +async function listGalleryImageVersionsInAGalleryImageDefinition() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.galleryImageVersions.listByGalleryImage( + resourceGroupName, + galleryName, + galleryImageName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listGalleryImageVersionsInAGalleryImageDefinition().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/galleryImageVersionsUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/galleryImageVersionsUpdateSample.js new file mode 100644 index 000000000000..7e10fb4c7a81 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/galleryImageVersionsUpdateSample.js @@ -0,0 +1,94 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Update a gallery image version. + * + * @summary Update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGalleryImageVersion.json + */ +async function updateASimpleGalleryImageVersionManagedImageAsSource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion = { + publishingProfile: { + targetRegions: [ + { name: "West US", regionalReplicaCount: 1 }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + }, + ], + }, + storageProfile: { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +updateASimpleGalleryImageVersionManagedImageAsSource().catch(console.error); + +/** + * This sample demonstrates how to Update a gallery image version. + * + * @summary Update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGalleryImageVersionWithoutSourceId.json + */ +async function updateASimpleGalleryImageVersionWithoutSourceId() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion = { + publishingProfile: { + targetRegions: [ + { name: "West US", regionalReplicaCount: 1 }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + }, + ], + }, + storageProfile: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +updateASimpleGalleryImageVersionWithoutSourceId().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/galleryImagesCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/galleryImagesCreateOrUpdateSample.js new file mode 100644 index 000000000000..95b10dfdbaee --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/galleryImagesCreateOrUpdateSample.js @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update a gallery image definition. + * + * @summary Create or update a gallery image definition. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImage.json + */ +async function createOrUpdateASimpleGalleryImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImage = { + hyperVGeneration: "V1", + identifier: { + offer: "myOfferName", + publisher: "myPublisherName", + sku: "mySkuName", + }, + location: "West US", + osState: "Generalized", + osType: "Windows", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImages.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImage + ); + console.log(result); +} + +createOrUpdateASimpleGalleryImage().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/galleryImagesDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/galleryImagesDeleteSample.js new file mode 100644 index 000000000000..62e3205b4216 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/galleryImagesDeleteSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete a gallery image. + * + * @summary Delete a gallery image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGalleryImage.json + */ +async function deleteAGalleryImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImages.beginDeleteAndWait( + resourceGroupName, + galleryName, + galleryImageName + ); + console.log(result); +} + +deleteAGalleryImage().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/galleryImagesGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/galleryImagesGetSample.js new file mode 100644 index 000000000000..c7f20df8ae67 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/galleryImagesGetSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Retrieves information about a gallery image definition. + * + * @summary Retrieves information about a gallery image definition. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryImage.json + */ +async function getAGalleryImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImages.get(resourceGroupName, galleryName, galleryImageName); + console.log(result); +} + +getAGalleryImage().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/galleryImagesListByGallerySample.js b/sdk/compute/arm-compute/samples/v17/javascript/galleryImagesListByGallerySample.js new file mode 100644 index 000000000000..4c874f04cdac --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/galleryImagesListByGallerySample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List gallery image definitions in a gallery. + * + * @summary List gallery image definitions in a gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleryImagesInAGallery.json + */ +async function listGalleryImagesInAGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.galleryImages.listByGallery(resourceGroupName, galleryName)) { + resArray.push(item); + } + console.log(resArray); +} + +listGalleryImagesInAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/galleryImagesUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/galleryImagesUpdateSample.js new file mode 100644 index 000000000000..bb56905f80cb --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/galleryImagesUpdateSample.js @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Update a gallery image definition. + * + * @summary Update a gallery image definition. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGalleryImage.json + */ +async function updateASimpleGalleryImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImage = { + hyperVGeneration: "V1", + identifier: { + offer: "myOfferName", + publisher: "myPublisherName", + sku: "mySkuName", + }, + osState: "Generalized", + osType: "Windows", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImages.beginUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImage + ); + console.log(result); +} + +updateASimpleGalleryImage().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/gallerySharingProfileUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/gallerySharingProfileUpdateSample.js new file mode 100644 index 000000000000..02d9ebaa742d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/gallerySharingProfileUpdateSample.js @@ -0,0 +1,90 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Update sharing profile of a gallery. + * + * @summary Update sharing profile of a gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/AddToSharingProfileInAGallery.json + */ +async function addSharingIdToTheSharingProfileOfAGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const sharingUpdate = { + groups: [ + { + type: "Subscriptions", + ids: ["34a4ab42-0d72-47d9-bd1a-aed207386dac", "380fd389-260b-41aa-bad9-0a83108c370b"], + }, + { type: "AADTenants", ids: ["c24c76aa-8897-4027-9b03-8f7928b54ff6"] }, + ], + operationType: "Add", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.gallerySharingProfile.beginUpdateAndWait( + resourceGroupName, + galleryName, + sharingUpdate + ); + console.log(result); +} + +addSharingIdToTheSharingProfileOfAGallery().catch(console.error); + +/** + * This sample demonstrates how to Update sharing profile of a gallery. + * + * @summary Update sharing profile of a gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ResetSharingProfileInAGallery.json + */ +async function resetSharingProfileOfAGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const sharingUpdate = { operationType: "Reset" }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.gallerySharingProfile.beginUpdateAndWait( + resourceGroupName, + galleryName, + sharingUpdate + ); + console.log(result); +} + +resetSharingProfileOfAGallery().catch(console.error); + +/** + * This sample demonstrates how to Update sharing profile of a gallery. + * + * @summary Update sharing profile of a gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/EnableACommunityGallery.json + */ +async function shareAGalleryToCommunity() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const sharingUpdate = { operationType: "EnableCommunity" }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.gallerySharingProfile.beginUpdateAndWait( + resourceGroupName, + galleryName, + sharingUpdate + ); + console.log(result); +} + +shareAGalleryToCommunity().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/imagesCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/imagesCreateOrUpdateSample.js new file mode 100644 index 000000000000..337c11608942 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/imagesCreateOrUpdateSample.js @@ -0,0 +1,377 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromABlobWithDiskEncryptionSet.json + */ +async function createAVirtualMachineImageFromABlobWithDiskEncryptionSetResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters = { + location: "West US", + storageProfile: { + osDisk: { + blobUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + osState: "Generalized", + osType: "Linux", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageFromABlobWithDiskEncryptionSetResource().catch(console.error); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromABlob.json + */ +async function createAVirtualMachineImageFromABlob() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters = { + location: "West US", + storageProfile: { + osDisk: { + blobUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + osState: "Generalized", + osType: "Linux", + }, + zoneResilient: true, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageFromABlob().catch(console.error); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromAManagedDiskWithDiskEncryptionSet.json + */ +async function createAVirtualMachineImageFromAManagedDiskWithDiskEncryptionSetResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters = { + location: "West US", + storageProfile: { + osDisk: { + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + managedDisk: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk", + }, + osState: "Generalized", + osType: "Linux", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageFromAManagedDiskWithDiskEncryptionSetResource().catch(console.error); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromAManagedDisk.json + */ +async function createAVirtualMachineImageFromAManagedDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters = { + location: "West US", + storageProfile: { + osDisk: { + managedDisk: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk", + }, + osState: "Generalized", + osType: "Linux", + }, + zoneResilient: true, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageFromAManagedDisk().catch(console.error); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromASnapshotWithDiskEncryptionSet.json + */ +async function createAVirtualMachineImageFromASnapshotWithDiskEncryptionSetResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters = { + location: "West US", + storageProfile: { + osDisk: { + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + osState: "Generalized", + osType: "Linux", + snapshot: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageFromASnapshotWithDiskEncryptionSetResource().catch(console.error); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromASnapshot.json + */ +async function createAVirtualMachineImageFromASnapshot() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters = { + location: "West US", + storageProfile: { + osDisk: { + osState: "Generalized", + osType: "Linux", + snapshot: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", + }, + }, + zoneResilient: false, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageFromASnapshot().catch(console.error); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromAVM.json + */ +async function createAVirtualMachineImageFromAnExistingVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters = { + location: "West US", + sourceVirtualMachine: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageFromAnExistingVirtualMachine().catch(console.error); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageThatIncludesADataDiskFromABlob.json + */ +async function createAVirtualMachineImageThatIncludesADataDiskFromABlob() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters = { + location: "West US", + storageProfile: { + dataDisks: [ + { + blobUri: "https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd", + lun: 1, + }, + ], + osDisk: { + blobUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + osState: "Generalized", + osType: "Linux", + }, + zoneResilient: false, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageThatIncludesADataDiskFromABlob().catch(console.error); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageThatIncludesADataDiskFromAManagedDisk.json + */ +async function createAVirtualMachineImageThatIncludesADataDiskFromAManagedDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters = { + location: "West US", + storageProfile: { + dataDisks: [ + { + lun: 1, + managedDisk: { + id: "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk2", + }, + }, + ], + osDisk: { + managedDisk: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk", + }, + osState: "Generalized", + osType: "Linux", + }, + zoneResilient: false, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageThatIncludesADataDiskFromAManagedDisk().catch(console.error); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageThatIncludesADataDiskFromASnapshot.json + */ +async function createAVirtualMachineImageThatIncludesADataDiskFromASnapshot() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters = { + location: "West US", + storageProfile: { + dataDisks: [ + { + lun: 1, + snapshot: { + id: "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2", + }, + }, + ], + osDisk: { + osState: "Generalized", + osType: "Linux", + snapshot: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", + }, + }, + zoneResilient: true, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageThatIncludesADataDiskFromASnapshot().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/imagesDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/imagesDeleteSample.js new file mode 100644 index 000000000000..619cd4506a8b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/imagesDeleteSample.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Deletes an Image. + * + * @summary Deletes an Image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Images_Delete_MaximumSet_Gen.json + */ +async function imagesDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const imageName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginDeleteAndWait(resourceGroupName, imageName); + console.log(result); +} + +imagesDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Deletes an Image. + * + * @summary Deletes an Image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Images_Delete_MinimumSet_Gen.json + */ +async function imagesDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const imageName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginDeleteAndWait(resourceGroupName, imageName); + console.log(result); +} + +imagesDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/imagesGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/imagesGetSample.js new file mode 100644 index 000000000000..17662f257909 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/imagesGetSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets an image. + * + * @summary Gets an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetInformationAboutAnImage.json + */ +async function getInformationAboutAVirtualMachineImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.get(resourceGroupName, imageName); + console.log(result); +} + +getInformationAboutAVirtualMachineImage().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/imagesListByResourceGroupSample.js b/sdk/compute/arm-compute/samples/v17/javascript/imagesListByResourceGroupSample.js new file mode 100644 index 000000000000..a0fa01a57fa7 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/imagesListByResourceGroupSample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the list of images under a resource group. + * + * @summary Gets the list of images under a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListImagesInAResourceGroup.json + */ +async function listAllVirtualMachineImagesInAResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.images.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listAllVirtualMachineImagesInAResourceGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/imagesListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/imagesListSample.js new file mode 100644 index 000000000000..884c8e418873 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/imagesListSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. + * + * @summary Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListImagesInASubscription.json + */ +async function listAllVirtualMachineImagesInASubscription() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.images.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listAllVirtualMachineImagesInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/imagesUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/imagesUpdateSample.js new file mode 100644 index 000000000000..9a5cdfa25c95 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/imagesUpdateSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Update an image. + * + * @summary Update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateImage.json + */ +async function updatesTagsOfAnImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters = { + hyperVGeneration: "V1", + sourceVirtualMachine: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM", + }, + tags: { department: "HR" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginUpdateAndWait(resourceGroupName, imageName, parameters); + console.log(result); +} + +updatesTagsOfAnImage().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/logAnalyticsExportRequestRateByIntervalSample.js b/sdk/compute/arm-compute/samples/v17/javascript/logAnalyticsExportRequestRateByIntervalSample.js new file mode 100644 index 000000000000..7baae9837ab7 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/logAnalyticsExportRequestRateByIntervalSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Export logs that show Api requests made by this subscription in the given time window to show throttling activities. + * + * @summary Export logs that show Api requests made by this subscription in the given time window to show throttling activities. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/LogAnalyticsRequestRateByInterval.json + */ +async function exportLogsWhichContainAllApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriodBrokenDownByIntervals() { + const subscriptionId = "{subscription-id}"; + const location = "westus"; + const parameters = { + blobContainerSasUri: "https://somesasuri", + fromTime: new Date("2018-01-21T01:54:06.862601Z"), + groupByResourceName: true, + intervalLength: "FiveMins", + toTime: new Date("2018-01-23T01:54:06.862601Z"), + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.logAnalytics.beginExportRequestRateByIntervalAndWait( + location, + parameters + ); + console.log(result); +} + +exportLogsWhichContainAllApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriodBrokenDownByIntervals().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/logAnalyticsExportThrottledRequestsSample.js b/sdk/compute/arm-compute/samples/v17/javascript/logAnalyticsExportThrottledRequestsSample.js new file mode 100644 index 000000000000..7754959b2baf --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/logAnalyticsExportThrottledRequestsSample.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @summary Export logs that show total throttled Api requests for this subscription in the given time window. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/LogAnalyticsThrottledRequests.json + */ +async function exportLogsWhichContainAllThrottledApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriod() { + const subscriptionId = "{subscription-id}"; + const location = "westus"; + const parameters = { + blobContainerSasUri: "https://somesasuri", + fromTime: new Date("2018-01-21T01:54:06.862601Z"), + groupByClientApplicationId: false, + groupByOperationName: true, + groupByResourceName: false, + groupByUserAgent: false, + toTime: new Date("2018-01-23T01:54:06.862601Z"), + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.logAnalytics.beginExportThrottledRequestsAndWait( + location, + parameters + ); + console.log(result); +} + +exportLogsWhichContainAllThrottledApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriod().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/operationsListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/operationsListSample.js new file mode 100644 index 000000000000..27bf26a868d6 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/operationsListSample.js @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of compute operations. + * + * @summary Gets a list of compute operations. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Operations_List_MaximumSet_Gen.json + */ +async function operationsListMaximumSetGen() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +operationsListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of compute operations. + * + * @summary Gets a list of compute operations. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Operations_List_MinimumSet_Gen.json + */ +async function operationsListMinimumSetGen() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +operationsListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/proximityPlacementGroupsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/proximityPlacementGroupsCreateOrUpdateSample.js new file mode 100644 index 000000000000..4a1e6043ff62 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/proximityPlacementGroupsCreateOrUpdateSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update a proximity placement group. + * + * @summary Create or update a proximity placement group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAProximityPlacementGroup.json + */ +async function createOrUpdateAProximityPlacementGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const proximityPlacementGroupName = "myProximityPlacementGroup"; + const parameters = { + location: "westus", + proximityPlacementGroupType: "Standard", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.proximityPlacementGroups.createOrUpdate( + resourceGroupName, + proximityPlacementGroupName, + parameters + ); + console.log(result); +} + +createOrUpdateAProximityPlacementGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/proximityPlacementGroupsDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/proximityPlacementGroupsDeleteSample.js new file mode 100644 index 000000000000..4319cb5d1dc5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/proximityPlacementGroupsDeleteSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete a proximity placement group. + * + * @summary Delete a proximity placement group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DeleteAProximityPlacementGroup.json + */ +async function createAProximityPlacementGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const proximityPlacementGroupName = "myProximityPlacementGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.proximityPlacementGroups.delete( + resourceGroupName, + proximityPlacementGroupName + ); + console.log(result); +} + +createAProximityPlacementGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/proximityPlacementGroupsGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/proximityPlacementGroupsGetSample.js new file mode 100644 index 000000000000..8e09b9dad382 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/proximityPlacementGroupsGetSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Retrieves information about a proximity placement group . + * + * @summary Retrieves information about a proximity placement group . + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetAProximityPlacementGroup.json + */ +async function createAProximityPlacementGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const proximityPlacementGroupName = "myProximityPlacementGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.proximityPlacementGroups.get( + resourceGroupName, + proximityPlacementGroupName + ); + console.log(result); +} + +createAProximityPlacementGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/proximityPlacementGroupsListByResourceGroupSample.js b/sdk/compute/arm-compute/samples/v17/javascript/proximityPlacementGroupsListByResourceGroupSample.js new file mode 100644 index 000000000000..1e039daaeed8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/proximityPlacementGroupsListByResourceGroupSample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all proximity placement groups in a resource group. + * + * @summary Lists all proximity placement groups in a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListProximityPlacementGroupsInAResourceGroup.json + */ +async function createAProximityPlacementGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.proximityPlacementGroups.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +createAProximityPlacementGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/proximityPlacementGroupsListBySubscriptionSample.js b/sdk/compute/arm-compute/samples/v17/javascript/proximityPlacementGroupsListBySubscriptionSample.js new file mode 100644 index 000000000000..e25d42dfd6c3 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/proximityPlacementGroupsListBySubscriptionSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all proximity placement groups in a subscription. + * + * @summary Lists all proximity placement groups in a subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListProximityPlacementGroupsInASubscription.json + */ +async function createAProximityPlacementGroup() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.proximityPlacementGroups.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +createAProximityPlacementGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/proximityPlacementGroupsUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/proximityPlacementGroupsUpdateSample.js new file mode 100644 index 000000000000..cf13bff5f370 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/proximityPlacementGroupsUpdateSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Update a proximity placement group. + * + * @summary Update a proximity placement group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/PatchAProximityPlacementGroup.json + */ +async function createAProximityPlacementGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const proximityPlacementGroupName = "myProximityPlacementGroup"; + const parameters = { + tags: { additionalProp1: "string" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.proximityPlacementGroups.update( + resourceGroupName, + proximityPlacementGroupName, + parameters + ); + console.log(result); +} + +createAProximityPlacementGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/resourceSkusListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/resourceSkusListSample.js new file mode 100644 index 000000000000..34fb82134eba --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/resourceSkusListSample.js @@ -0,0 +1,73 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @summary Gets the list of Microsoft.Compute SKUs available for your Subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/skus/ListAvailableResourceSkus.json + */ +async function listsAllAvailableResourceSkUs() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.resourceSkus.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listsAllAvailableResourceSkUs().catch(console.error); + +/** + * This sample demonstrates how to Gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @summary Gets the list of Microsoft.Compute SKUs available for your Subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/skus/ListAvailableResourceSkusForARegion.json + */ +async function listsAllAvailableResourceSkUsForTheSpecifiedRegion() { + const subscriptionId = "{subscription-id}"; + const filter = "location eq 'westus'"; + const options = { filter }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.resourceSkus.list(options)) { + resArray.push(item); + } + console.log(resArray); +} + +listsAllAvailableResourceSkUsForTheSpecifiedRegion().catch(console.error); + +/** + * This sample demonstrates how to Gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @summary Gets the list of Microsoft.Compute SKUs available for your Subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/skus/ListAvailableResourceSkusWithExtendedLocations.json + */ +async function listsAllAvailableResourceSkUsWithExtendedLocationInformation() { + const subscriptionId = "{subscription-id}"; + const includeExtendedLocations = "true"; + const options = { includeExtendedLocations }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.resourceSkus.list(options)) { + resArray.push(item); + } + console.log(resArray); +} + +listsAllAvailableResourceSkUsWithExtendedLocationInformation().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsCreateOrUpdateSample.js new file mode 100644 index 000000000000..4c1bf7b950c4 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsCreateOrUpdateSample.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. + * + * @summary The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateARestorePointCollectionForCrossRegionCopy.json + */ +async function createOrUpdateARestorePointCollectionForCrossRegionCopy() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "myRpc"; + const parameters = { + location: "norwayeast", + source: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/sourceRpcName", + }, + tags: { myTag1: "tagValue1" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.createOrUpdate( + resourceGroupName, + restorePointCollectionName, + parameters + ); + console.log(result); +} + +createOrUpdateARestorePointCollectionForCrossRegionCopy().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. + * + * @summary The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateARestorePointCollection.json + */ +async function createOrUpdateARestorePointCollection() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "myRpc"; + const parameters = { + location: "norwayeast", + source: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM", + }, + tags: { myTag1: "tagValue1" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.createOrUpdate( + resourceGroupName, + restorePointCollectionName, + parameters + ); + console.log(result); +} + +createOrUpdateARestorePointCollection().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsDeleteSample.js new file mode 100644 index 000000000000..9a35ee659392 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsDeleteSample.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to delete the restore point collection. This operation will also delete all the contained restore points. + * + * @summary The operation to delete the restore point collection. This operation will also delete all the contained restore points. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Delete_MaximumSet_Gen.json + */ +async function restorePointCollectionsDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const restorePointCollectionName = "aaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.beginDeleteAndWait( + resourceGroupName, + restorePointCollectionName + ); + console.log(result); +} + +restorePointCollectionsDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to delete the restore point collection. This operation will also delete all the contained restore points. + * + * @summary The operation to delete the restore point collection. This operation will also delete all the contained restore points. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Delete_MinimumSet_Gen.json + */ +async function restorePointCollectionsDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const restorePointCollectionName = "aaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.beginDeleteAndWait( + resourceGroupName, + restorePointCollectionName + ); + console.log(result); +} + +restorePointCollectionsDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsGetSample.js new file mode 100644 index 000000000000..4ffe1cd8bf46 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsGetSample.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to get the restore point collection. + * + * @summary The operation to get the restore point collection. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointCollection.json + */ +async function getARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "myRpc"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.get( + resourceGroupName, + restorePointCollectionName + ); + console.log(result); +} + +getARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to get the restore point collection. + * + * @summary The operation to get the restore point collection. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointCollectionWithContainedRestorePoints.json + */ +async function getARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpcName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.get( + resourceGroupName, + restorePointCollectionName + ); + console.log(result); +} + +getARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsListAllSample.js b/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsListAllSample.js new file mode 100644 index 000000000000..157fa6f6c6de --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsListAllSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. + * + * @summary Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointCollectionsInASubscription.json + */ +async function getsTheListOfRestorePointCollectionsInASubscription() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.restorePointCollections.listAll()) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfRestorePointCollectionsInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsListSample.js new file mode 100644 index 000000000000..1e489804d3ca --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsListSample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the list of restore point collections in a resource group. + * + * @summary Gets the list of restore point collections in a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointCollectionsInAResourceGroup.json + */ +async function getsTheListOfRestorePointCollectionsInAResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.restorePointCollections.list(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfRestorePointCollectionsInAResourceGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsUpdateSample.js new file mode 100644 index 000000000000..d8d0e0469c42 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/restorePointCollectionsUpdateSample.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to update the restore point collection. + * + * @summary The operation to update the restore point collection. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Update_MaximumSet_Gen.json + */ +async function restorePointCollectionsUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const restorePointCollectionName = "aaaaaaaaaaaaaaaaaaaa"; + const parameters = { + source: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM", + }, + tags: { key8536: "aaaaaaaaaaaaaaaaaaa" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.update( + resourceGroupName, + restorePointCollectionName, + parameters + ); + console.log(result); +} + +restorePointCollectionsUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to update the restore point collection. + * + * @summary The operation to update the restore point collection. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Update_MinimumSet_Gen.json + */ +async function restorePointCollectionsUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const restorePointCollectionName = "aaaaaaaaaaaaaaaaaa"; + const parameters = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.update( + resourceGroupName, + restorePointCollectionName, + parameters + ); + console.log(result); +} + +restorePointCollectionsUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/restorePointsCreateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/restorePointsCreateSample.js new file mode 100644 index 000000000000..f10cd396ccf5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/restorePointsCreateSample.js @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to create the restore point. Updating properties of an existing restore point is not allowed + * + * @summary The operation to create the restore point. Updating properties of an existing restore point is not allowed + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CopyRestorePointBetweenRegions.json + */ +async function copyARestorePointToADifferentRegion() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpcName"; + const restorePointName = "rpName"; + const parameters = { + sourceRestorePoint: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/sourceRpcName/restorePoints/sourceRpName", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.beginCreateAndWait( + resourceGroupName, + restorePointCollectionName, + restorePointName, + parameters + ); + console.log(result); +} + +copyARestorePointToADifferentRegion().catch(console.error); + +/** + * This sample demonstrates how to The operation to create the restore point. Updating properties of an existing restore point is not allowed + * + * @summary The operation to create the restore point. Updating properties of an existing restore point is not allowed + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateARestorePoint.json + */ +async function createARestorePoint() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpcName"; + const restorePointName = "rpName"; + const parameters = { + excludeDisks: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123", + }, + ], + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.beginCreateAndWait( + resourceGroupName, + restorePointCollectionName, + restorePointName, + parameters + ); + console.log(result); +} + +createARestorePoint().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/restorePointsDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/restorePointsDeleteSample.js new file mode 100644 index 000000000000..d7caaaf293ea --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/restorePointsDeleteSample.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to delete the restore point. + * + * @summary The operation to delete the restore point. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePoints_Delete_MaximumSet_Gen.json + */ +async function restorePointsDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const restorePointCollectionName = "aaaaaaaaaaaaaaaaaaaaaa"; + const restorePointName = "a"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.beginDeleteAndWait( + resourceGroupName, + restorePointCollectionName, + restorePointName + ); + console.log(result); +} + +restorePointsDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to delete the restore point. + * + * @summary The operation to delete the restore point. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePoints_Delete_MinimumSet_Gen.json + */ +async function restorePointsDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const restorePointCollectionName = "aaaaaaaaaaaaaaaaa"; + const restorePointName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.beginDeleteAndWait( + resourceGroupName, + restorePointCollectionName, + restorePointName + ); + console.log(result); +} + +restorePointsDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/restorePointsGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/restorePointsGetSample.js new file mode 100644 index 000000000000..c63c611fff1c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/restorePointsGetSample.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to get the restore point. + * + * @summary The operation to get the restore point. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePoint.json + */ +async function getARestorePoint() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpcName"; + const restorePointName = "rpName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.get( + resourceGroupName, + restorePointCollectionName, + restorePointName + ); + console.log(result); +} + +getARestorePoint().catch(console.error); + +/** + * This sample demonstrates how to The operation to get the restore point. + * + * @summary The operation to get the restore point. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointWithInstanceView.json + */ +async function getRestorePointWithInstanceView() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpcName"; + const restorePointName = "rpName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.get( + resourceGroupName, + restorePointCollectionName, + restorePointName + ); + console.log(result); +} + +getRestorePointWithInstanceView().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/sharedGalleriesGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/sharedGalleriesGetSample.js new file mode 100644 index 000000000000..5912313b1be8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/sharedGalleriesGetSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a shared gallery by subscription id or tenant id. + * + * @summary Get a shared gallery by subscription id or tenant id. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/GetASharedGallery.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const location = "myLocation"; + const galleryUniqueName = "galleryUniqueName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sharedGalleries.get(location, galleryUniqueName); + console.log(result); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/sharedGalleriesListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/sharedGalleriesListSample.js new file mode 100644 index 000000000000..8739e6848cfc --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/sharedGalleriesListSample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List shared galleries by subscription id or tenant id. + * + * @summary List shared galleries by subscription id or tenant id. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/ListSharedGalleries.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const location = "myLocation"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.sharedGalleries.list(location)) { + resArray.push(item); + } + console.log(resArray); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/sharedGalleryImageVersionsGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/sharedGalleryImageVersionsGetSample.js new file mode 100644 index 000000000000..969b470626d0 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/sharedGalleryImageVersionsGetSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a shared gallery image version by subscription id or tenant id. + * + * @summary Get a shared gallery image version by subscription id or tenant id. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/GetASharedGalleryImageVersion.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const location = "myLocation"; + const galleryUniqueName = "galleryUniqueName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "myGalleryImageVersionName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sharedGalleryImageVersions.get( + location, + galleryUniqueName, + galleryImageName, + galleryImageVersionName + ); + console.log(result); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/sharedGalleryImageVersionsListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/sharedGalleryImageVersionsListSample.js new file mode 100644 index 000000000000..c79f59287477 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/sharedGalleryImageVersionsListSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List shared gallery image versions by subscription id or tenant id. + * + * @summary List shared gallery image versions by subscription id or tenant id. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/ListSharedGalleryImageVersions.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const location = "myLocation"; + const galleryUniqueName = "galleryUniqueName"; + const galleryImageName = "myGalleryImageName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.sharedGalleryImageVersions.list( + location, + galleryUniqueName, + galleryImageName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/sharedGalleryImagesGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/sharedGalleryImagesGetSample.js new file mode 100644 index 000000000000..bab6e6710cbb --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/sharedGalleryImagesGetSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a shared gallery image by subscription id or tenant id. + * + * @summary Get a shared gallery image by subscription id or tenant id. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/GetASharedGalleryImage.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const location = "myLocation"; + const galleryUniqueName = "galleryUniqueName"; + const galleryImageName = "myGalleryImageName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sharedGalleryImages.get( + location, + galleryUniqueName, + galleryImageName + ); + console.log(result); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/sharedGalleryImagesListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/sharedGalleryImagesListSample.js new file mode 100644 index 000000000000..2c93020e4c5e --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/sharedGalleryImagesListSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List shared gallery images by subscription id or tenant id. + * + * @summary List shared gallery images by subscription id or tenant id. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/ListSharedGalleryImages.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const location = "myLocation"; + const galleryUniqueName = "galleryUniqueName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.sharedGalleryImages.list(location, galleryUniqueName)) { + resArray.push(item); + } + console.log(resArray); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/snapshotsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/snapshotsCreateOrUpdateSample.js new file mode 100644 index 000000000000..f583ae6bc79b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/snapshotsCreateOrUpdateSample.js @@ -0,0 +1,134 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Creates or updates a snapshot. + * + * @summary Creates or updates a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription.json + */ +async function createASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot1"; + const snapshot = { + creationData: { + createOption: "Import", + sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + storageAccountId: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount", + }, + location: "West US", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginCreateOrUpdateAndWait( + resourceGroupName, + snapshotName, + snapshot + ); + console.log(result); +} + +createASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a snapshot. + * + * @summary Creates or updates a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription.json + */ +async function createASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot1"; + const snapshot = { + creationData: { + createOption: "Import", + sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + }, + location: "West US", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginCreateOrUpdateAndWait( + resourceGroupName, + snapshotName, + snapshot + ); + console.log(result); +} + +createASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a snapshot. + * + * @summary Creates or updates a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateASnapshotFromAnExistingSnapshotInDifferentRegion.json + */ +async function createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegion() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot2"; + const snapshot = { + creationData: { + createOption: "CopyStart", + sourceResourceId: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1", + }, + location: "West US", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginCreateOrUpdateAndWait( + resourceGroupName, + snapshotName, + snapshot + ); + console.log(result); +} + +createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegion().catch( + console.error +); + +/** + * This sample demonstrates how to Creates or updates a snapshot. + * + * @summary Creates or updates a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateASnapshotFromAnExistingSnapshot.json + */ +async function createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscription() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot2"; + const snapshot = { + creationData: { + createOption: "Copy", + sourceResourceId: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1", + }, + location: "West US", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginCreateOrUpdateAndWait( + resourceGroupName, + snapshotName, + snapshot + ); + console.log(result); +} + +createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/snapshotsDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/snapshotsDeleteSample.js new file mode 100644 index 000000000000..d0c9c1cc8368 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/snapshotsDeleteSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Deletes a snapshot. + * + * @summary Deletes a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteASnapshot.json + */ +async function deleteASnapshot() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginDeleteAndWait(resourceGroupName, snapshotName); + console.log(result); +} + +deleteASnapshot().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/snapshotsGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/snapshotsGetSample.js new file mode 100644 index 000000000000..46a53fcedc88 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/snapshotsGetSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets information about a snapshot. + * + * @summary Gets information about a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutASnapshot.json + */ +async function getInformationAboutASnapshot() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.get(resourceGroupName, snapshotName); + console.log(result); +} + +getInformationAboutASnapshot().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/snapshotsGrantAccessSample.js b/sdk/compute/arm-compute/samples/v17/javascript/snapshotsGrantAccessSample.js new file mode 100644 index 000000000000..6a444473c92c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/snapshotsGrantAccessSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Grants access to a snapshot. + * + * @summary Grants access to a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/BeginGetAccessSnapshot.json + */ +async function getASasOnASnapshot() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot"; + const grantAccessData = { + access: "Read", + durationInSeconds: 300, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginGrantAccessAndWait( + resourceGroupName, + snapshotName, + grantAccessData + ); + console.log(result); +} + +getASasOnASnapshot().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/snapshotsListByResourceGroupSample.js b/sdk/compute/arm-compute/samples/v17/javascript/snapshotsListByResourceGroupSample.js new file mode 100644 index 000000000000..a6f013a732a3 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/snapshotsListByResourceGroupSample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists snapshots under a resource group. + * + * @summary Lists snapshots under a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListSnapshotsInAResourceGroup.json + */ +async function listAllSnapshotsInAResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.snapshots.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listAllSnapshotsInAResourceGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/snapshotsListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/snapshotsListSample.js new file mode 100644 index 000000000000..63074e9ce51f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/snapshotsListSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists snapshots under a subscription. + * + * @summary Lists snapshots under a subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListSnapshotsInASubscription.json + */ +async function listAllSnapshotsInASubscription() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.snapshots.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listAllSnapshotsInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/snapshotsRevokeAccessSample.js b/sdk/compute/arm-compute/samples/v17/javascript/snapshotsRevokeAccessSample.js new file mode 100644 index 000000000000..49d463fcc08a --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/snapshotsRevokeAccessSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Revokes access to a snapshot. + * + * @summary Revokes access to a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/EndGetAccessSnapshot.json + */ +async function revokeAccessToASnapshot() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginRevokeAccessAndWait(resourceGroupName, snapshotName); + console.log(result); +} + +revokeAccessToASnapshot().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/snapshotsUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/snapshotsUpdateSample.js new file mode 100644 index 000000000000..c4797ffe0c0d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/snapshotsUpdateSample.js @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Updates (patches) a snapshot. + * + * @summary Updates (patches) a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateASnapshotWithAcceleratedNetwork.json + */ +async function updateASnapshotWithAcceleratedNetworking() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot"; + const snapshot = { + diskSizeGB: 20, + supportedCapabilities: { acceleratedNetwork: false }, + tags: { department: "Development", project: "UpdateSnapshots" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginUpdateAndWait( + resourceGroupName, + snapshotName, + snapshot + ); + console.log(result); +} + +updateASnapshotWithAcceleratedNetworking().catch(console.error); + +/** + * This sample demonstrates how to Updates (patches) a snapshot. + * + * @summary Updates (patches) a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateASnapshot.json + */ +async function updateASnapshot() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot"; + const snapshot = { + diskSizeGB: 20, + tags: { department: "Development", project: "UpdateSnapshots" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginUpdateAndWait( + resourceGroupName, + snapshotName, + snapshot + ); + console.log(result); +} + +updateASnapshot().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysCreateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysCreateSample.js new file mode 100644 index 000000000000..759b3b56c8b1 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysCreateSample.js @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Creates a new SSH public key resource. + * + * @summary Creates a new SSH public key resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnSshPublicKey.json + */ +async function createANewSshPublicKeyResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const sshPublicKeyName = "mySshPublicKeyName"; + const parameters = { + location: "westus", + publicKey: "{ssh-rsa public key}", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.create(resourceGroupName, sshPublicKeyName, parameters); + console.log(result); +} + +createANewSshPublicKeyResource().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysDeleteSample.js new file mode 100644 index 000000000000..de0ba351ed22 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysDeleteSample.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete an SSH public key. + * + * @summary Delete an SSH public key. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Delete_MaximumSet_Gen.json + */ +async function sshPublicKeysDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const sshPublicKeyName = "aaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.delete(resourceGroupName, sshPublicKeyName); + console.log(result); +} + +sshPublicKeysDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Delete an SSH public key. + * + * @summary Delete an SSH public key. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Delete_MinimumSet_Gen.json + */ +async function sshPublicKeysDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const sshPublicKeyName = "aaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.delete(resourceGroupName, sshPublicKeyName); + console.log(result); +} + +sshPublicKeysDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysGenerateKeyPairSample.js b/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysGenerateKeyPairSample.js new file mode 100644 index 000000000000..802ab51c774c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysGenerateKeyPairSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * + * @summary Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GenerateSshKeyPair.json + */ +async function generateAnSshKeyPair() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const sshPublicKeyName = "mySshPublicKeyName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.generateKeyPair(resourceGroupName, sshPublicKeyName); + console.log(result); +} + +generateAnSshKeyPair().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysGetSample.js new file mode 100644 index 000000000000..46a9b23f868b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysGetSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Retrieves information about an SSH public key. + * + * @summary Retrieves information about an SSH public key. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetAnSshPublicKey.json + */ +async function getAnSshPublicKey() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const sshPublicKeyName = "mySshPublicKeyName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.get(resourceGroupName, sshPublicKeyName); + console.log(result); +} + +getAnSshPublicKey().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysListByResourceGroupSample.js b/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysListByResourceGroupSample.js new file mode 100644 index 000000000000..796e3c693c50 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysListByResourceGroupSample.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. + * + * @summary Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListByResourceGroup_MaximumSet_Gen.json + */ +async function sshPublicKeysListByResourceGroupMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.sshPublicKeys.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +sshPublicKeysListByResourceGroupMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. + * + * @summary Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListByResourceGroup_MinimumSet_Gen.json + */ +async function sshPublicKeysListByResourceGroupMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.sshPublicKeys.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +sshPublicKeysListByResourceGroupMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysListBySubscriptionSample.js b/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysListBySubscriptionSample.js new file mode 100644 index 000000000000..cdba73829729 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysListBySubscriptionSample.js @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. + * + * @summary Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListBySubscription_MaximumSet_Gen.json + */ +async function sshPublicKeysListBySubscriptionMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.sshPublicKeys.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +sshPublicKeysListBySubscriptionMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. + * + * @summary Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListBySubscription_MinimumSet_Gen.json + */ +async function sshPublicKeysListBySubscriptionMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.sshPublicKeys.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +sshPublicKeysListBySubscriptionMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysUpdateSample.js new file mode 100644 index 000000000000..0a616882a05f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/sshPublicKeysUpdateSample.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Updates a new SSH public key resource. + * + * @summary Updates a new SSH public key resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Update_MaximumSet_Gen.json + */ +async function sshPublicKeysUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const sshPublicKeyName = "aaaaaaaaaaaa"; + const parameters = { + publicKey: "{ssh-rsa public key}", + tags: { key2854: "a" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.update(resourceGroupName, sshPublicKeyName, parameters); + console.log(result); +} + +sshPublicKeysUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Updates a new SSH public key resource. + * + * @summary Updates a new SSH public key resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Update_MinimumSet_Gen.json + */ +async function sshPublicKeysUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const sshPublicKeyName = "aaaaaaaaaaa"; + const parameters = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.update(resourceGroupName, sshPublicKeyName, parameters); + console.log(result); +} + +sshPublicKeysUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/usageListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/usageListSample.js new file mode 100644 index 000000000000..db35b603d8be --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/usageListSample.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. + * + * @summary Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Usage_List_MaximumSet_Gen.json + */ +async function usageListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "4_."; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.usageOperations.list(location)) { + resArray.push(item); + } + console.log(resArray); +} + +usageListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. + * + * @summary Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Usage_List_MinimumSet_Gen.json + */ +async function usageListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "_--"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.usageOperations.list(location)) { + resArray.push(item); + } + console.log(resArray); +} + +usageListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionImagesGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionImagesGetSample.js new file mode 100644 index 000000000000..2243b08ad37b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionImagesGetSample.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a virtual machine extension image. + * + * @summary Gets a virtual machine extension image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_Get_MaximumSet_Gen.json + */ +async function virtualMachineExtensionImagesGetMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaa"; + const typeParam = "aaaaaaaaaaaaaaaaaa"; + const version = "aaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.get( + location, + publisherName, + typeParam, + version + ); + console.log(result); +} + +virtualMachineExtensionImagesGetMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a virtual machine extension image. + * + * @summary Gets a virtual machine extension image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_Get_MinimumSet_Gen.json + */ +async function virtualMachineExtensionImagesGetMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const typeParam = "aa"; + const version = "aaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.get( + location, + publisherName, + typeParam, + version + ); + console.log(result); +} + +virtualMachineExtensionImagesGetMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionImagesListTypesSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionImagesListTypesSample.js new file mode 100644 index 000000000000..3c8019257d1c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionImagesListTypesSample.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of virtual machine extension image types. + * + * @summary Gets a list of virtual machine extension image types. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListTypes_MaximumSet_Gen.json + */ +async function virtualMachineExtensionImagesListTypesMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.listTypes(location, publisherName); + console.log(result); +} + +virtualMachineExtensionImagesListTypesMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of virtual machine extension image types. + * + * @summary Gets a list of virtual machine extension image types. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListTypes_MinimumSet_Gen.json + */ +async function virtualMachineExtensionImagesListTypesMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaa"; + const publisherName = "aa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.listTypes(location, publisherName); + console.log(result); +} + +virtualMachineExtensionImagesListTypesMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionImagesListVersionsSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionImagesListVersionsSample.js new file mode 100644 index 000000000000..9b272e216030 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionImagesListVersionsSample.js @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of virtual machine extension image versions. + * + * @summary Gets a list of virtual machine extension image versions. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListVersions_MaximumSet_Gen.json + */ +async function virtualMachineExtensionImagesListVersionsMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaa"; + const typeParam = "aaaaaaaaaaaaaaaaaa"; + const filter = "aaaaaaaaaaaaaaaaaaaaaaaaa"; + const top = 22; + const orderby = "a"; + const options = { + filter, + top, + orderby, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.listVersions( + location, + publisherName, + typeParam, + options + ); + console.log(result); +} + +virtualMachineExtensionImagesListVersionsMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of virtual machine extension image versions. + * + * @summary Gets a list of virtual machine extension image versions. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListVersions_MinimumSet_Gen.json + */ +async function virtualMachineExtensionImagesListVersionsMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const typeParam = "aaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.listVersions( + location, + publisherName, + typeParam + ); + console.log(result); +} + +virtualMachineExtensionImagesListVersionsMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsCreateOrUpdateSample.js new file mode 100644 index 000000000000..82f33b0dd4fa --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsCreateOrUpdateSample.js @@ -0,0 +1,97 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to create or update the extension. + * + * @summary The operation to create or update the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_CreateOrUpdate_MaximumSet_Gen.json + */ +async function virtualMachineExtensionsCreateOrUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const vmExtensionName = "aaaaaaaaaaaaa"; + const extensionParameters = { + typePropertiesType: "extType", + autoUpgradeMinorVersion: true, + enableAutomaticUpgrade: true, + forceUpdateTag: "a", + instanceView: { + name: "aaaaaaaaaaaaaaaaa", + type: "aaaaaaaaa", + statuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z"), + }, + ], + substatuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z"), + }, + ], + typeHandlerVersion: "aaaaaaaaaaaaaaaaaaaaaaaaaa", + }, + location: "westus", + protectedSettings: {}, + publisher: "extPublisher", + settings: {}, + suppressFailures: true, + tags: { key9183: "aa" }, + typeHandlerVersion: "1.2", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + vmExtensionName, + extensionParameters + ); + console.log(result); +} + +virtualMachineExtensionsCreateOrUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update the extension. + * + * @summary The operation to create or update the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_CreateOrUpdate_MinimumSet_Gen.json + */ +async function virtualMachineExtensionsCreateOrUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaa"; + const vmExtensionName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const extensionParameters = { location: "westus" }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + vmExtensionName, + extensionParameters + ); + console.log(result); +} + +virtualMachineExtensionsCreateOrUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsDeleteSample.js new file mode 100644 index 000000000000..5733070828f1 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsDeleteSample.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to delete the extension. + * + * @summary The operation to delete the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Delete_MaximumSet_Gen.json + */ +async function virtualMachineExtensionsDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaa"; + const vmExtensionName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.beginDeleteAndWait( + resourceGroupName, + vmName, + vmExtensionName + ); + console.log(result); +} + +virtualMachineExtensionsDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to delete the extension. + * + * @summary The operation to delete the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Delete_MinimumSet_Gen.json + */ +async function virtualMachineExtensionsDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmExtensionName = "aa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.beginDeleteAndWait( + resourceGroupName, + vmName, + vmExtensionName + ); + console.log(result); +} + +virtualMachineExtensionsDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsGetSample.js new file mode 100644 index 000000000000..e4207548da43 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsGetSample.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to get the extension. + * + * @summary The operation to get the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Get_MaximumSet_Gen.json + */ +async function virtualMachineExtensionsGetMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmExtensionName = "aaaaaaa"; + const expand = "aaaaaa"; + const options = { expand }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.get( + resourceGroupName, + vmName, + vmExtensionName, + options + ); + console.log(result); +} + +virtualMachineExtensionsGetMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to get the extension. + * + * @summary The operation to get the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Get_MinimumSet_Gen.json + */ +async function virtualMachineExtensionsGetMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "a"; + const vmExtensionName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.get( + resourceGroupName, + vmName, + vmExtensionName + ); + console.log(result); +} + +virtualMachineExtensionsGetMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsListSample.js new file mode 100644 index 000000000000..596164e5a8f4 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsListSample.js @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to get all extensions of a Virtual Machine. + * + * @summary The operation to get all extensions of a Virtual Machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_List_MaximumSet_Gen.json + */ +async function virtualMachineExtensionsListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaa"; + const expand = "aaaaaaaaaaaaaaaaa"; + const options = { expand }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.list(resourceGroupName, vmName, options); + console.log(result); +} + +virtualMachineExtensionsListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to get all extensions of a Virtual Machine. + * + * @summary The operation to get all extensions of a Virtual Machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_List_MinimumSet_Gen.json + */ +async function virtualMachineExtensionsListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.list(resourceGroupName, vmName); + console.log(result); +} + +virtualMachineExtensionsListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsUpdateSample.js new file mode 100644 index 000000000000..83b142605f6b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineExtensionsUpdateSample.js @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to update the extension. + * + * @summary The operation to update the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateVMExtension.json + */ +async function updateVMExtension() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const vmExtensionName = "myVMExtension"; + const extensionParameters = { + type: "extType", + autoUpgradeMinorVersion: true, + protectedSettingsFromKeyVault: { + secretUrl: + "https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e", + sourceVault: { + id: "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName", + }, + }, + publisher: "extPublisher", + settings: { UserName: "xyz@microsoft.com" }, + suppressFailures: true, + typeHandlerVersion: "1.2", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.beginUpdateAndWait( + resourceGroupName, + vmName, + vmExtensionName, + extensionParameters + ); + console.log(result); +} + +updateVMExtension().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneGetSample.js new file mode 100644 index 000000000000..ba6a9d60db96 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneGetSample.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a virtual machine image in an edge zone. + * + * @summary Gets a virtual machine image in an edge zone. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneGetMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const edgeZone = "aaaaaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaaaaa"; + const offer = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const skus = "aaaaaaaaaa"; + const version = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.get( + location, + edgeZone, + publisherName, + offer, + skus, + version + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneGetMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a virtual machine image in an edge zone. + * + * @summary Gets a virtual machine image in an edge zone. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_Get_MinimumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneGetMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaaaaaaaaaa"; + const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const offer = "aaaaaaaaaaa"; + const skus = "aaaaaaaaaaaaaaaaaa"; + const version = "aa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.get( + location, + edgeZone, + publisherName, + offer, + skus, + version + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneGetMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneListOffersSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneListOffersSample.js new file mode 100644 index 000000000000..89d205402bc7 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneListOffersSample.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * + * @summary Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListOffersMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaaaaa"; + const edgeZone = "aaaaaaaaaaaaaaaaaaa"; + const publisherName = "aaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.listOffers( + location, + edgeZone, + publisherName + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneListOffersMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * + * @summary Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListOffers_MinimumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListOffersMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaa"; + const edgeZone = "aaaaaaaaaaaaaaaaaaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.listOffers( + location, + edgeZone, + publisherName + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneListOffersMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneListPublishersSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneListPublishersSample.js new file mode 100644 index 000000000000..ec3b71f357c5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneListPublishersSample.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * + * @summary Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListPublishersMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaa"; + const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.listPublishers(location, edgeZone); + console.log(result); +} + +virtualMachineImagesEdgeZoneListPublishersMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * + * @summary Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListPublishers_MinimumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListPublishersMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaa"; + const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.listPublishers(location, edgeZone); + console.log(result); +} + +virtualMachineImagesEdgeZoneListPublishersMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneListSample.js new file mode 100644 index 000000000000..844a87c6ce3f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneListSample.js @@ -0,0 +1,75 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. + * + * @summary Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaa"; + const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaaaa"; + const publisherName = "aaaa"; + const offer = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const skus = "aaaaaaaaaaaaaaaaaaaaaaa"; + const expand = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const top = 12; + const orderby = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const options = { + expand, + top, + orderby, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.list( + location, + edgeZone, + publisherName, + offer, + skus, + options + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. + * + * @summary Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_List_MinimumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const edgeZone = "aaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaa"; + const offer = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const skus = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.list( + location, + edgeZone, + publisherName, + offer, + skus + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneListSkusSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneListSkusSample.js new file mode 100644 index 000000000000..7b90d82bd8e6 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesEdgeZoneListSkusSample.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * + * @summary Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListSkusMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaa"; + const edgeZone = "aaaaa"; + const publisherName = "aaaaaaaaaaaa"; + const offer = "aaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.listSkus( + location, + edgeZone, + publisherName, + offer + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneListSkusMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * + * @summary Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListSkus_MinimumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListSkusMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaaaaaaa"; + const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const publisherName = "aaaaaaaaa"; + const offer = "aaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.listSkus( + location, + edgeZone, + publisherName, + offer + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneListSkusMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesGetSample.js new file mode 100644 index 000000000000..be30c0b90fbc --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesGetSample.js @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a virtual machine image. + * + * @summary Gets a virtual machine image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_Get_MaximumSet_Gen.json + */ +async function virtualMachineImagesGetMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaa"; + const publisherName = "aaa"; + const offer = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const skus = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const version = "aaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.get( + location, + publisherName, + offer, + skus, + version + ); + console.log(result); +} + +virtualMachineImagesGetMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a virtual machine image. + * + * @summary Gets a virtual machine image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_Get_MinimumSet_Gen.json + */ +async function virtualMachineImagesGetMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaa"; + const publisherName = "aaaaaaaaaaa"; + const offer = "aa"; + const skus = "aaaaaaaaa"; + const version = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.get( + location, + publisherName, + offer, + skus, + version + ); + console.log(result); +} + +virtualMachineImagesGetMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesListOffersSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesListOffersSample.js new file mode 100644 index 000000000000..e21ef95adac1 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesListOffersSample.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of virtual machine image offers for the specified location and publisher. + * + * @summary Gets a list of virtual machine image offers for the specified location and publisher. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListOffers_MaximumSet_Gen.json + */ +async function virtualMachineImagesListOffersMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaa"; + const publisherName = "aaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listOffers(location, publisherName); + console.log(result); +} + +virtualMachineImagesListOffersMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of virtual machine image offers for the specified location and publisher. + * + * @summary Gets a list of virtual machine image offers for the specified location and publisher. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListOffers_MinimumSet_Gen.json + */ +async function virtualMachineImagesListOffersMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listOffers(location, publisherName); + console.log(result); +} + +virtualMachineImagesListOffersMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesListPublishersSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesListPublishersSample.js new file mode 100644 index 000000000000..6c075336e284 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesListPublishersSample.js @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of virtual machine image publishers for the specified Azure location. + * + * @summary Gets a list of virtual machine image publishers for the specified Azure location. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListPublishers_MaximumSet_Gen.json + */ +async function virtualMachineImagesListPublishersMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listPublishers(location); + console.log(result); +} + +virtualMachineImagesListPublishersMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of virtual machine image publishers for the specified Azure location. + * + * @summary Gets a list of virtual machine image publishers for the specified Azure location. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListPublishers_MinimumSet_Gen.json + */ +async function virtualMachineImagesListPublishersMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listPublishers(location); + console.log(result); +} + +virtualMachineImagesListPublishersMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesListSample.js new file mode 100644 index 000000000000..4caecaa4af8a --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesListSample.js @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * + * @summary Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_List_MaximumSet_Gen.json + */ +async function virtualMachineImagesListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaa"; + const publisherName = "aaaaaa"; + const offer = "aaaaaaaaaaaaaaaa"; + const skus = "aaaaaaaaaaaaaaaaaaaaaaa"; + const expand = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const top = 18; + const orderby = "aa"; + const options = { + expand, + top, + orderby, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.list( + location, + publisherName, + offer, + skus, + options + ); + console.log(result); +} + +virtualMachineImagesListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * + * @summary Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_List_MinimumSet_Gen.json + */ +async function virtualMachineImagesListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaa"; + const publisherName = "aaaaaaaaaaa"; + const offer = "aaaaaaaaaa"; + const skus = "aaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.list(location, publisherName, offer, skus); + console.log(result); +} + +virtualMachineImagesListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesListSkusSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesListSkusSample.js new file mode 100644 index 000000000000..12d50115f9da --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineImagesListSkusSample.js @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * + * @summary Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListSkus_MaximumSet_Gen.json + */ +async function virtualMachineImagesListSkusMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const offer = "aaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listSkus(location, publisherName, offer); + console.log(result); +} + +virtualMachineImagesListSkusMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * + * @summary Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListSkus_MinimumSet_Gen.json + */ +async function virtualMachineImagesListSkusMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaa"; + const publisherName = "aaaaaaaaaaaaa"; + const offer = "aaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listSkus(location, publisherName, offer); + console.log(result); +} + +virtualMachineImagesListSkusMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsCreateOrUpdateSample.js new file mode 100644 index 000000000000..238a10ccc738 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsCreateOrUpdateSample.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to create or update the run command. + * + * @summary The operation to create or update the run command. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/CreateOrUpdateRunCommand.json + */ +async function createOrUpdateARunCommand() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const runCommandName = "myRunCommand"; + const runCommand = { + asyncExecution: false, + location: "West US", + parameters: [ + { name: "param1", value: "value1" }, + { name: "param2", value: "value2" }, + ], + runAsPassword: "", + runAsUser: "user1", + source: { script: "Write-Host Hello World!" }, + timeoutInSeconds: 3600, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineRunCommands.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + runCommandName, + runCommand + ); + console.log(result); +} + +createOrUpdateARunCommand().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsDeleteSample.js new file mode 100644 index 000000000000..0f8ce0538b09 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsDeleteSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to delete the run command. + * + * @summary The operation to delete the run command. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/DeleteRunCommand.json + */ +async function deleteARunCommand() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const runCommandName = "myRunCommand"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineRunCommands.beginDeleteAndWait( + resourceGroupName, + vmName, + runCommandName + ); + console.log(result); +} + +deleteARunCommand().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsGetByVirtualMachineSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsGetByVirtualMachineSample.js new file mode 100644 index 000000000000..13a95d0d202c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsGetByVirtualMachineSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to get the run command. + * + * @summary The operation to get the run command. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/GetRunCommand.json + */ +async function getARunCommand() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const runCommandName = "myRunCommand"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineRunCommands.getByVirtualMachine( + resourceGroupName, + vmName, + runCommandName + ); + console.log(result); +} + +getARunCommand().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsGetSample.js new file mode 100644 index 000000000000..b97b224eaae5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsGetSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets specific run command for a subscription in a location. + * + * @summary Gets specific run command for a subscription in a location. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VirtualMachineRunCommandGet.json + */ +async function virtualMachineRunCommandGet() { + const subscriptionId = "24fb23e3-6ba3-41f0-9b6e-e41131d5d61e"; + const location = "SoutheastAsia"; + const commandId = "RunPowerShellScript"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineRunCommands.get(location, commandId); + console.log(result); +} + +virtualMachineRunCommandGet().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsListByVirtualMachineSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsListByVirtualMachineSample.js new file mode 100644 index 000000000000..b810a01883a8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsListByVirtualMachineSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to get all run commands of a Virtual Machine. + * + * @summary The operation to get all run commands of a Virtual Machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/ListRunCommandsInVM.json + */ +async function listRunCommandsInAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineRunCommands.listByVirtualMachine( + resourceGroupName, + vmName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listRunCommandsInAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsListSample.js new file mode 100644 index 000000000000..36e2abbf39cb --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsListSample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all available run commands for a subscription in a location. + * + * @summary Lists all available run commands for a subscription in a location. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VirtualMachineRunCommandList.json + */ +async function virtualMachineRunCommandList() { + const subscriptionId = "subid"; + const location = "SoutheastAsia"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineRunCommands.list(location)) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineRunCommandList().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsUpdateSample.js new file mode 100644 index 000000000000..e61a35d7bd3e --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineRunCommandsUpdateSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to update the run command. + * + * @summary The operation to update the run command. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/UpdateRunCommand.json + */ +async function updateARunCommand() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const runCommandName = "myRunCommand"; + const runCommand = { + source: { script: "Write-Host Script Source Updated!" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineRunCommands.beginUpdateAndWait( + resourceGroupName, + vmName, + runCommandName, + runCommand + ); + console.log(result); +} + +updateARunCommand().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsCreateOrUpdateSample.js new file mode 100644 index 000000000000..0a85478e1628 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsCreateOrUpdateSample.js @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to create or update an extension. + * + * @summary The operation to create or update an extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_CreateOrUpdate_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsCreateOrUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaa"; + const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaaa"; + const extensionParameters = { + name: "{extension-name}", + typePropertiesType: "{extension-Type}", + autoUpgradeMinorVersion: true, + enableAutomaticUpgrade: true, + forceUpdateTag: "aaaaaaaaa", + protectedSettings: {}, + provisionAfterExtensions: ["aa"], + publisher: "{extension-Publisher}", + settings: {}, + suppressFailures: true, + typeHandlerVersion: "{handler-version}", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + extensionParameters + ); + console.log(result); +} + +virtualMachineScaleSetExtensionsCreateOrUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update an extension. + * + * @summary The operation to create or update an extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_CreateOrUpdate_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsCreateOrUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaa"; + const vmssExtensionName = "aaaaaaaaaaa"; + const extensionParameters = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + extensionParameters + ); + console.log(result); +} + +virtualMachineScaleSetExtensionsCreateOrUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsDeleteSample.js new file mode 100644 index 000000000000..33a32a17b081 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsDeleteSample.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to delete the extension. + * + * @summary The operation to delete the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Delete_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.beginDeleteAndWait( + resourceGroupName, + vmScaleSetName, + vmssExtensionName + ); + console.log(result); +} + +virtualMachineScaleSetExtensionsDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to delete the extension. + * + * @summary The operation to delete the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Delete_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaa"; + const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.beginDeleteAndWait( + resourceGroupName, + vmScaleSetName, + vmssExtensionName + ); + console.log(result); +} + +virtualMachineScaleSetExtensionsDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsGetSample.js new file mode 100644 index 000000000000..324ae9ab280c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsGetSample.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to get the extension. + * + * @summary The operation to get the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Get_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsGetMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaa"; + const expand = "aaaaaaa"; + const options = { expand }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.get( + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + options + ); + console.log(result); +} + +virtualMachineScaleSetExtensionsGetMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to get the extension. + * + * @summary The operation to get the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Get_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsGetMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "a"; + const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.get( + resourceGroupName, + vmScaleSetName, + vmssExtensionName + ); + console.log(result); +} + +virtualMachineScaleSetExtensionsGetMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsListSample.js new file mode 100644 index 000000000000..83fdb5fdf1d2 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsListSample.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of all extensions in a VM scale set. + * + * @summary Gets a list of all extensions in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_List_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSetExtensions.list( + resourceGroupName, + vmScaleSetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetExtensionsListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of all extensions in a VM scale set. + * + * @summary Gets a list of all extensions in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_List_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSetExtensions.list( + resourceGroupName, + vmScaleSetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetExtensionsListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsUpdateSample.js new file mode 100644 index 000000000000..a20044a2a8b8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetExtensionsUpdateSample.js @@ -0,0 +1,73 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to update an extension. + * + * @summary The operation to update an extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Update_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmssExtensionName = "aaaa"; + const extensionParameters = { + typePropertiesType: "{extension-Type}", + autoUpgradeMinorVersion: true, + enableAutomaticUpgrade: true, + forceUpdateTag: "aaaaaaaaa", + protectedSettings: {}, + provisionAfterExtensions: ["aa"], + publisher: "{extension-Publisher}", + settings: {}, + suppressFailures: true, + typeHandlerVersion: "{handler-version}", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.beginUpdateAndWait( + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + extensionParameters + ); + console.log(result); +} + +virtualMachineScaleSetExtensionsUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to update an extension. + * + * @summary The operation to update an extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Update_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmssExtensionName = "aa"; + const extensionParameters = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.beginUpdateAndWait( + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + extensionParameters + ); + console.log(result); +} + +virtualMachineScaleSetExtensionsUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetRollingUpgradesCancelSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetRollingUpgradesCancelSample.js new file mode 100644 index 000000000000..1d067f426198 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetRollingUpgradesCancelSample.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Cancels the current virtual machine scale set rolling upgrade. + * + * @summary Cancels the current virtual machine scale set rolling upgrade. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_Cancel_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetRollingUpgradesCancelMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetRollingUpgrades.beginCancelAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetRollingUpgradesCancelMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Cancels the current virtual machine scale set rolling upgrade. + * + * @summary Cancels the current virtual machine scale set rolling upgrade. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_Cancel_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetRollingUpgradesCancelMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetRollingUpgrades.beginCancelAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetRollingUpgradesCancelMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetRollingUpgradesGetLatestSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetRollingUpgradesGetLatestSample.js new file mode 100644 index 000000000000..c58ab84002bf --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetRollingUpgradesGetLatestSample.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the status of the latest virtual machine scale set rolling upgrade. + * + * @summary Gets the status of the latest virtual machine scale set rolling upgrade. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_GetLatest_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetRollingUpgradesGetLatestMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetRollingUpgrades.getLatest( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetRollingUpgradesGetLatestMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets the status of the latest virtual machine scale set rolling upgrade. + * + * @summary Gets the status of the latest virtual machine scale set rolling upgrade. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_GetLatest_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetRollingUpgradesGetLatestMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetRollingUpgrades.getLatest( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetRollingUpgradesGetLatestMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.js new file mode 100644 index 000000000000..7bb918ba3702 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.js @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. + * + * @summary Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VMScaleSetExtensionRollingUpgrade.json + */ +async function startAnExtensionRollingUpgrade() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = + await client.virtualMachineScaleSetRollingUpgrades.beginStartExtensionUpgradeAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +startAnExtensionRollingUpgrade().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.js new file mode 100644 index 000000000000..c5166947699c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. + * + * @summary Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_StartOSUpgrade_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetRollingUpgradesStartOSUpgradeMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetRollingUpgrades.beginStartOSUpgradeAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetRollingUpgradesStartOSUpgradeMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. + * + * @summary Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_StartOSUpgrade_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetRollingUpgradesStartOSUpgradeMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetRollingUpgrades.beginStartOSUpgradeAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetRollingUpgradesStartOSUpgradeMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.js new file mode 100644 index 000000000000..d4db75ecdc2d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to create or update the VMSS VM extension. + * + * @summary The operation to create or update the VMSS VM extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateVirtualMachineScaleSetVMExtensions.json + */ +async function createVirtualMachineScaleSetVMExtension() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const vmExtensionName = "myVMExtension"; + const extensionParameters = { + typePropertiesType: "extType", + autoUpgradeMinorVersion: true, + publisher: "extPublisher", + settings: { UserName: "xyz@microsoft.com" }, + typeHandlerVersion: "1.2", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMExtensions.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + extensionParameters + ); + console.log(result); +} + +createVirtualMachineScaleSetVMExtension().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMExtensionsDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMExtensionsDeleteSample.js new file mode 100644 index 000000000000..3157a4d652bb --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMExtensionsDeleteSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to delete the VMSS VM extension. + * + * @summary The operation to delete the VMSS VM extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DeleteVirtualMachineScaleSetVMExtensions.json + */ +async function deleteVirtualMachineScaleSetVMExtension() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const vmExtensionName = "myVMExtension"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMExtensions.beginDeleteAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName + ); + console.log(result); +} + +deleteVirtualMachineScaleSetVMExtension().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMExtensionsGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMExtensionsGetSample.js new file mode 100644 index 000000000000..5163f1b79bcf --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMExtensionsGetSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to get the VMSS VM extension. + * + * @summary The operation to get the VMSS VM extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetVMExtensions.json + */ +async function getVirtualMachineScaleSetVMExtension() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const vmExtensionName = "myVMExtension"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMExtensions.get( + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName + ); + console.log(result); +} + +getVirtualMachineScaleSetVMExtension().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMExtensionsListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMExtensionsListSample.js new file mode 100644 index 000000000000..6941a5a42504 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMExtensionsListSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to get all extensions of an instance in Virtual Machine Scaleset. + * + * @summary The operation to get all extensions of an instance in Virtual Machine Scaleset. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListVirtualMachineScaleSetVMExtensions.json + */ +async function listExtensionsInVmssInstance() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMExtensions.list( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +listExtensionsInVmssInstance().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMExtensionsUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMExtensionsUpdateSample.js new file mode 100644 index 000000000000..80d81cffb65f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMExtensionsUpdateSample.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to update the VMSS VM extension. + * + * @summary The operation to update the VMSS VM extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateVirtualMachineScaleSetVMExtensions.json + */ +async function updateVirtualMachineScaleSetVMExtension() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const vmExtensionName = "myVMExtension"; + const extensionParameters = { + typePropertiesType: "extType", + autoUpgradeMinorVersion: true, + publisher: "extPublisher", + settings: { UserName: "xyz@microsoft.com" }, + typeHandlerVersion: "1.2", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMExtensions.beginUpdateAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + extensionParameters + ); + console.log(result); +} + +updateVirtualMachineScaleSetVMExtension().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.js new file mode 100644 index 000000000000..885145e42bae --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.js @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to create or update the VMSS VM run command. + * + * @summary The operation to create or update the VMSS VM run command. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/CreateOrUpdateVirtualMachineScaleSetVMRunCommands.json + */ +async function createVirtualMachineScaleSetVMRunCommand() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const runCommandName = "myRunCommand"; + const runCommand = { + asyncExecution: false, + location: "West US", + parameters: [ + { name: "param1", value: "value1" }, + { name: "param2", value: "value2" }, + ], + runAsPassword: "", + runAsUser: "user1", + source: { script: "Write-Host Hello World!" }, + timeoutInSeconds: 3600, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMRunCommands.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + runCommand + ); + console.log(result); +} + +createVirtualMachineScaleSetVMRunCommand().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMRunCommandsDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMRunCommandsDeleteSample.js new file mode 100644 index 000000000000..8d722b79d924 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMRunCommandsDeleteSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to delete the VMSS VM run command. + * + * @summary The operation to delete the VMSS VM run command. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/DeleteVirtualMachineScaleSetVMRunCommands.json + */ +async function deleteVirtualMachineScaleSetVMRunCommand() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const runCommandName = "myRunCommand"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMRunCommands.beginDeleteAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName + ); + console.log(result); +} + +deleteVirtualMachineScaleSetVMRunCommand().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMRunCommandsGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMRunCommandsGetSample.js new file mode 100644 index 000000000000..fa394f80062a --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMRunCommandsGetSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to get the VMSS VM run command. + * + * @summary The operation to get the VMSS VM run command. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/GetVirtualMachineScaleSetVMRunCommands.json + */ +async function getVirtualMachineScaleSetVMRunCommands() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const runCommandName = "myRunCommand"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMRunCommands.get( + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName + ); + console.log(result); +} + +getVirtualMachineScaleSetVMRunCommands().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMRunCommandsListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMRunCommandsListSample.js new file mode 100644 index 000000000000..9e7ee6259c8c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMRunCommandsListSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @summary The operation to get all run commands of an instance in Virtual Machine Scaleset. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/ListVirtualMachineScaleSetVMRunCommands.json + */ +async function listRunCommandsInVmssInstance() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSetVMRunCommands.list( + resourceGroupName, + vmScaleSetName, + instanceId + )) { + resArray.push(item); + } + console.log(resArray); +} + +listRunCommandsInVmssInstance().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMRunCommandsUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMRunCommandsUpdateSample.js new file mode 100644 index 000000000000..7c866c8fa8e0 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMRunCommandsUpdateSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to update the VMSS VM run command. + * + * @summary The operation to update the VMSS VM run command. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/UpdateVirtualMachineScaleSetVMRunCommands.json + */ +async function updateVirtualMachineScaleSetVMRunCommand() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const runCommandName = "myRunCommand"; + const runCommand = { + source: { script: "Write-Host Script Source Updated!" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMRunCommands.beginUpdateAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + runCommand + ); + console.log(result); +} + +updateVirtualMachineScaleSetVMRunCommand().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSDeallocateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSDeallocateSample.js new file mode 100644 index 000000000000..398305e30363 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSDeallocateSample.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * + * @summary Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Deallocate_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSDeallocateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginDeallocateAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSDeallocateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * + * @summary Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Deallocate_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSDeallocateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const instanceId = "aaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginDeallocateAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSDeallocateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSDeleteSample.js new file mode 100644 index 000000000000..71e442e4df70 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSDeleteSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Deletes a virtual machine from a VM scale set. + * + * @summary Deletes a virtual machine from a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ForceDeleteVirtualMachineScaleSetVM.json + */ +async function forceDeleteAVirtualMachineFromAVMScaleSet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const forceDeletion = true; + const options = { + forceDeletion, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginDeleteAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + options + ); + console.log(result); +} + +forceDeleteAVirtualMachineFromAVMScaleSet().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSGetInstanceViewSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSGetInstanceViewSample.js new file mode 100644 index 000000000000..b9e283ad4be3 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSGetInstanceViewSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the status of a virtual machine from a VM scale set. + * + * @summary Gets the status of a virtual machine from a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetVMInstanceViewAutoPlacedOnDedicatedHostGroup.json + */ +async function getInstanceViewOfAVirtualMachineFromAVMScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myVirtualMachineScaleSet"; + const instanceId = "0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.getInstanceView( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +getInstanceViewOfAVirtualMachineFromAVMScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSGetSample.js new file mode 100644 index 000000000000..64adacff7ee8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSGetSample.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a virtual machine from a VM scale set. + * + * @summary Gets a virtual machine from a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetVMWithUserData.json + */ +async function getVMScaleSetVMWithUserData() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const instanceId = "0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.get( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +getVMScaleSetVMWithUserData().catch(console.error); + +/** + * This sample demonstrates how to Gets a virtual machine from a VM scale set. + * + * @summary Gets a virtual machine from a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetVMWithVMSizeProperties.json + */ +async function getVMScaleSetVMWithVMSizeProperties() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const instanceId = "0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.get( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +getVMScaleSetVMWithVMSizeProperties().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSListSample.js new file mode 100644 index 000000000000..8c692f956a82 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSListSample.js @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of all virtual machines in a VM scale sets. + * + * @summary Gets a list of all virtual machines in a VM scale sets. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_List_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const virtualMachineScaleSetName = "aaaaaaaaaaaaaaaaaaaaaa"; + const filter = "aaaaaaaaaaaaaa"; + const select = "aaaaaaaaaaaaaaaaaaaaa"; + const expand = "aaaaaaaaaaaaa"; + const options = { + filter, + select, + expand, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSetVMs.list( + resourceGroupName, + virtualMachineScaleSetName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetVMSListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of all virtual machines in a VM scale sets. + * + * @summary Gets a list of all virtual machines in a VM scale sets. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_List_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const virtualMachineScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSetVMs.list( + resourceGroupName, + virtualMachineScaleSetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetVMSListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSPerformMaintenanceSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSPerformMaintenanceSample.js new file mode 100644 index 000000000000..6857c4ff0903 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSPerformMaintenanceSample.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Performs maintenance on a virtual machine in a VM scale set. + * + * @summary Performs maintenance on a virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PerformMaintenance_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSPerformMaintenanceMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginPerformMaintenanceAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSPerformMaintenanceMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Performs maintenance on a virtual machine in a VM scale set. + * + * @summary Performs maintenance on a virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PerformMaintenance_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSPerformMaintenanceMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaa"; + const instanceId = "aaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginPerformMaintenanceAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSPerformMaintenanceMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSPowerOffSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSPowerOffSample.js new file mode 100644 index 000000000000..30cfee077655 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSPowerOffSample.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @summary Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PowerOff_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSPowerOffMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaa"; + const instanceId = "aaaaaaaaa"; + const skipShutdown = true; + const options = { + skipShutdown, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginPowerOffAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + options + ); + console.log(result); +} + +virtualMachineScaleSetVMSPowerOffMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @summary Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PowerOff_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSPowerOffMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginPowerOffAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSPowerOffMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSRedeploySample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSRedeploySample.js new file mode 100644 index 000000000000..7a4ab4115f78 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSRedeploySample.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @summary Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Redeploy_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSRedeployMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginRedeployAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSRedeployMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @summary Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Redeploy_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSRedeployMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginRedeployAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSRedeployMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSReimageAllSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSReimageAllSample.js new file mode 100644 index 000000000000..864fc97c67a3 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSReimageAllSample.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. + * + * @summary Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_ReimageAll_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSReimageAllMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginReimageAllAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSReimageAllMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. + * + * @summary Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_ReimageAll_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSReimageAllMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginReimageAllAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSReimageAllMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSReimageSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSReimageSample.js new file mode 100644 index 000000000000..b1e3df0bfb49 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSReimageSample.js @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @summary Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Reimage_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSReimageMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmScaleSetVMReimageInput = { + tempDisk: true, + }; + const options = { + vmScaleSetVMReimageInput, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginReimageAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + options + ); + console.log(result); +} + +virtualMachineScaleSetVMSReimageMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @summary Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Reimage_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSReimageMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaa"; + const instanceId = "aaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginReimageAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSReimageMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSRestartSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSRestartSample.js new file mode 100644 index 000000000000..c8b0efadc47b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSRestartSample.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Restarts a virtual machine in a VM scale set. + * + * @summary Restarts a virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Restart_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSRestartMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aa"; + const instanceId = "aaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginRestartAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSRestartMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Restarts a virtual machine in a VM scale set. + * + * @summary Restarts a virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Restart_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSRestartMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaa"; + const instanceId = "aaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginRestartAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSRestartMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.js new file mode 100644 index 000000000000..a581b4c5b5a2 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. + * + * @summary The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RetrieveBootDiagnosticsDataVMScaleSetVM.json + */ +async function retrieveBootDiagnosticsDataOfAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const sasUriExpirationTimeInMinutes = 60; + const options = { + sasUriExpirationTimeInMinutes, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.retrieveBootDiagnosticsData( + resourceGroupName, + vmScaleSetName, + instanceId, + options + ); + console.log(result); +} + +retrieveBootDiagnosticsDataOfAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSRunCommandSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSRunCommandSample.js new file mode 100644 index 000000000000..d16357722baa --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSRunCommandSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Run command on a virtual machine in a VM scale set. + * + * @summary Run command on a virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VMScaleSetRunCommand.json + */ +async function virtualMachineScaleSetVMSRunCommand() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myVirtualMachineScaleSet"; + const instanceId = "0"; + const parameters = { + commandId: "RunPowerShellScript", + script: ["Write-Host Hello World!"], + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginRunCommandAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + parameters + ); + console.log(result); +} + +virtualMachineScaleSetVMSRunCommand().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSSimulateEvictionSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSSimulateEvictionSample.js new file mode 100644 index 000000000000..7ae3af0bc793 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSSimulateEvictionSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to simulate the eviction of spot virtual machine in a VM scale set. + * + * @summary The operation to simulate the eviction of spot virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SimulateEvictionOfVmssVM.json + */ +async function simulateEvictionAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ResourceGroup"; + const vmScaleSetName = "VmScaleSetName"; + const instanceId = "InstanceId"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.simulateEviction( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +simulateEvictionAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSStartSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSStartSample.js new file mode 100644 index 000000000000..7639016492e7 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSStartSample.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Starts a virtual machine in a VM scale set. + * + * @summary Starts a virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Start_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSStartMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginStartAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSStartMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Starts a virtual machine in a VM scale set. + * + * @summary Starts a virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Start_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSStartMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginStartAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSStartMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSUpdateSample.js new file mode 100644 index 000000000000..c0eda19c5b6e --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetVMSUpdateSample.js @@ -0,0 +1,456 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Updates a virtual machine of a VM scale set. + * + * @summary Updates a virtual machine of a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Update_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const parameters = { + additionalCapabilities: { hibernationEnabled: true, ultraSSDEnabled: true }, + availabilitySet: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + diagnosticsProfile: { + bootDiagnostics: { enabled: true, storageUri: "aaaaaaaaaaaaa" }, + }, + hardwareProfile: { + vmSize: "Basic_A0", + vmSizeProperties: { vCPUsAvailable: 9, vCPUsPerCore: 12 }, + }, + instanceView: { + bootDiagnostics: { + status: { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z"), + }, + }, + disks: [ + { + name: "aaaaaaaaaaa", + encryptionSettings: [ + { + diskEncryptionKey: { + secretUrl: "aaaaaaaa", + sourceVault: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + }, + enabled: true, + keyEncryptionKey: { + keyUrl: "aaaaaaaaaaaaaa", + sourceVault: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + }, + }, + ], + statuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z"), + }, + ], + }, + ], + maintenanceRedeployStatus: { + isCustomerInitiatedMaintenanceAllowed: true, + lastOperationMessage: "aaaaaa", + lastOperationResultCode: "None", + maintenanceWindowEndTime: new Date("2021-11-30T12:58:26.531Z"), + maintenanceWindowStartTime: new Date("2021-11-30T12:58:26.531Z"), + preMaintenanceWindowEndTime: new Date("2021-11-30T12:58:26.531Z"), + preMaintenanceWindowStartTime: new Date("2021-11-30T12:58:26.531Z"), + }, + placementGroupId: "aaa", + platformFaultDomain: 14, + platformUpdateDomain: 23, + rdpThumbPrint: "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + statuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z"), + }, + ], + vmAgent: { + extensionHandlers: [ + { + type: "aaaaaaaaaaaaa", + status: { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z"), + }, + typeHandlerVersion: "aaaaa", + }, + ], + statuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z"), + }, + ], + vmAgentVersion: "aaaaaaaaaaaaaaaaaaaaaaa", + }, + vmHealth: { + status: { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z"), + }, + }, + extensions: [ + { + name: "aaaaaaaaaaaaaaaaa", + type: "aaaaaaaaa", + statuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z"), + }, + ], + substatuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z"), + }, + ], + typeHandlerVersion: "aaaaaaaaaaaaaaaaaaaaaaaaaa", + }, + ], + }, + licenseType: "aaaaaaaaaa", + location: "westus", + networkProfile: { + networkApiVersion: "2020-11-01", + networkInterfaceConfigurations: [ + { + name: "aaaaaaaaaaa", + deleteOption: "Delete", + dnsSettings: { dnsServers: ["aaaaaa"] }, + dscpConfiguration: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + enableAcceleratedNetworking: true, + enableFpga: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "aa", + applicationGatewayBackendAddressPools: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + applicationSecurityGroups: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + loadBalancerBackendAddressPools: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + primary: true, + privateIPAddressVersion: "IPv4", + publicIPAddressConfiguration: { + name: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + deleteOption: "Delete", + dnsSettings: { domainNameLabel: "aaaaaaaaaaaaaaaaaaaaaaaaa" }, + idleTimeoutInMinutes: 2, + ipTags: [ + { + ipTagType: "aaaaaaaaaaaaaaaaaaaaaaaaa", + tag: "aaaaaaaaaaaaaaaaaaaa", + }, + ], + publicIPAddressVersion: "IPv4", + publicIPAllocationMethod: "Dynamic", + publicIPPrefix: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + sku: { name: "Basic", tier: "Regional" }, + }, + subnet: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + }, + ], + networkSecurityGroup: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + primary: true, + }, + ], + networkInterfaces: [ + { + deleteOption: "Delete", + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0/networkInterfaces/vmsstestnetconfig5415", + primary: true, + }, + ], + }, + networkProfileConfiguration: { + networkInterfaceConfigurations: [ + { + name: "vmsstestnetconfig5415", + deleteOption: "Delete", + dnsSettings: { dnsServers: [] }, + enableAcceleratedNetworking: true, + enableFpga: true, + enableIPForwarding: true, + id: "aaaaaaaa", + ipConfigurations: [ + { + name: "vmsstestnetconfig9693", + applicationGatewayBackendAddressPools: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + applicationSecurityGroups: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + id: "aaaaaaaaa", + loadBalancerBackendAddressPools: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + loadBalancerInboundNatPools: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + primary: true, + privateIPAddressVersion: "IPv4", + publicIPAddressConfiguration: { + name: "aaaaaaaaaaaaaaaaaa", + deleteOption: "Delete", + dnsSettings: { domainNameLabel: "aaaaaaaaaaaaaaaaaa" }, + idleTimeoutInMinutes: 18, + ipTags: [{ ipTagType: "aaaaaaa", tag: "aaaaaaaaaaaaaaaaaaaaaaaaaaa" }], + publicIPAddressVersion: "IPv4", + publicIPPrefix: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + sku: { name: "Basic", tier: "Regional" }, + }, + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vn4071/subnets/sn5503", + }, + }, + ], + networkSecurityGroup: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "aaaaaaaaaaaaaaaa", + adminUsername: "Foo12", + allowExtensionOperations: true, + computerName: "test000000", + customData: "aaaa", + linuxConfiguration: { + disablePasswordAuthentication: true, + patchSettings: { + assessmentMode: "ImageDefault", + patchMode: "ImageDefault", + }, + provisionVMAgent: true, + ssh: { publicKeys: [{ path: "aaa", keyData: "aaaaaa" }] }, + }, + requireGuestProvisionSignal: true, + secrets: [], + windowsConfiguration: { + additionalUnattendContent: [ + { + componentName: "Microsoft-Windows-Shell-Setup", + content: "aaaaaaaaaaaaaaaaaaaa", + passName: "OobeSystem", + settingName: "AutoLogon", + }, + ], + enableAutomaticUpdates: true, + patchSettings: { + assessmentMode: "ImageDefault", + enableHotpatching: true, + patchMode: "Manual", + }, + provisionVMAgent: true, + timeZone: "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + winRM: { + listeners: [{ certificateUrl: "aaaaaaaaaaaaaaaaaaaaaa", protocol: "Http" }], + }, + }, + }, + plan: { + name: "aaaaaaaaaa", + product: "aaaaaaaaaaaaaaaaaaaa", + promotionCode: "aaaaaaaaaaaaaaaaaaaa", + publisher: "aaaaaaaaaaaaaaaaaaaaaa", + }, + protectionPolicy: { + protectFromScaleIn: true, + protectFromScaleSetActions: true, + }, + securityProfile: { + encryptionAtHost: true, + securityType: "TrustedLaunch", + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + }, + sku: { name: "Classic", capacity: 29, tier: "aaaaaaaaaaaaaa" }, + storageProfile: { + dataDisks: [ + { + name: "vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", + caching: "None", + createOption: "Empty", + deleteOption: "Delete", + detachOption: "ForceDetach", + diskSizeGB: 128, + image: { + uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", + }, + lun: 1, + managedDisk: { + diskEncryptionSet: { id: "aaaaaaaaaaaa" }, + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", + storageAccountType: "Standard_LRS", + }, + toBeDetached: true, + vhd: { + uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", + }, + writeAcceleratorEnabled: true, + }, + ], + imageReference: { + id: "a", + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sharedGalleryImageId: "aaaaaaaaaaaaaaaaaaaa", + sku: "2012-R2-Datacenter", + version: "4.127.20180315", + }, + osDisk: { + name: "vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc", + caching: "None", + createOption: "FromImage", + deleteOption: "Delete", + diffDiskSettings: { option: "Local", placement: "CacheDisk" }, + diskSizeGB: 127, + encryptionSettings: { + diskEncryptionKey: { + secretUrl: "aaaaaaaa", + sourceVault: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + }, + enabled: true, + keyEncryptionKey: { + keyUrl: "aaaaaaaaaaaaaa", + sourceVault: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + }, + }, + image: { + uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", + }, + managedDisk: { + diskEncryptionSet: { id: "aaaaaaaaaaaa" }, + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc", + storageAccountType: "Standard_LRS", + }, + osType: "Windows", + vhd: { + uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", + }, + writeAcceleratorEnabled: true, + }, + }, + tags: {}, + userData: "RXhhbXBsZSBVc2VyRGF0YQ==", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginUpdateAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + parameters + ); + console.log(result); +} + +virtualMachineScaleSetVMSUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Updates a virtual machine of a VM scale set. + * + * @summary Updates a virtual machine of a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Update_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaaaaa"; + const parameters = { location: "westus" }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginUpdateAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + parameters + ); + console.log(result); +} + +virtualMachineScaleSetVMSUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.js new file mode 100644 index 000000000000..4aec00e1efbb --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * + * @summary Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ConvertToSinglePlacementGroup_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsConvertToSinglePlacementGroupMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const parameters = { + activePlacementGroupId: "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.convertToSinglePlacementGroup( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +virtualMachineScaleSetsConvertToSinglePlacementGroupMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * + * @summary Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ConvertToSinglePlacementGroup_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsConvertToSinglePlacementGroupMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaa"; + const parameters = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.convertToSinglePlacementGroup( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +virtualMachineScaleSetsConvertToSinglePlacementGroupMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsCreateOrUpdateSample.js new file mode 100644 index 000000000000..9fd519caaf2c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsCreateOrUpdateSample.js @@ -0,0 +1,2357 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithExtensionsSuppressFailuresEnabled.json + */ +async function createAVmssWithAnExtensionThatHasSuppressFailuresEnabled() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + }, + }, + extensionProfile: { + extensions: [ + { + name: "{extension-name}", + typePropertiesType: "{extension-Type}", + autoUpgradeMinorVersion: false, + publisher: "{extension-Publisher}", + settings: {}, + suppressFailures: true, + typeHandlerVersion: "{handler-version}", + }, + ], + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAVmssWithAnExtensionThatHasSuppressFailuresEnabled().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithProtectedSettingsFromKeyVault.json + */ +async function createAVmssWithAnExtensionWithProtectedSettingsFromKeyVault() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + }, + }, + extensionProfile: { + extensions: [ + { + name: "{extension-name}", + typePropertiesType: "{extension-Type}", + autoUpgradeMinorVersion: false, + protectedSettingsFromKeyVault: { + secretUrl: + "https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e", + sourceVault: { + id: "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName", + }, + }, + publisher: "{extension-Publisher}", + settings: {}, + typeHandlerVersion: "{handler-version}", + }, + ], + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAVmssWithAnExtensionWithProtectedSettingsFromKeyVault().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateACustomImageScaleSetFromAnUnmanagedGeneralizedOsImage.json + */ +async function createACustomImageScaleSetFromAnUnmanagedGeneralizedOSImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + storageProfile: { + osDisk: { + name: "osDisk", + caching: "ReadWrite", + createOption: "FromImage", + image: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd", + }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createACustomImageScaleSetFromAnUnmanagedGeneralizedOSImage().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAPlatformImageScaleSetWithUnmanagedOsDisks.json + */ +async function createAPlatformImageScaleSetWithUnmanagedOSDisks() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + name: "osDisk", + caching: "ReadWrite", + createOption: "FromImage", + vhdContainers: [ + "http://{existing-storage-account-name-0}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-1}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-2}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-3}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-4}.blob.core.windows.net/vhdContainer", + ], + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAPlatformImageScaleSetWithUnmanagedOSDisks().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetFromACustomImage.json + */ +async function createAScaleSetFromACustomImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetFromACustomImage().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetFromAGeneralizedSharedImage.json + */ +async function createAScaleSetFromAGeneralizedSharedImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetFromAGeneralizedSharedImage().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetFromASpecializedSharedImage.json + */ +async function createAScaleSetFromASpecializedSharedImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetFromASpecializedSharedImage().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithApplicationProfile.json + */ +async function createAScaleSetWithApplicationProfile() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + applicationProfile: { + galleryApplications: [ + { + configurationReference: + "https://mystorageaccount.blob.core.windows.net/configurations/settings.config", + order: 1, + packageReferenceId: + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0", + tags: "myTag1", + }, + { + packageReferenceId: + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1", + }, + ], + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithApplicationProfile().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScalesetWithDiskEncryptionSetResource.json + */ +async function createAScaleSetWithDiskEncryptionSetResourceInOSDiskAndDataDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + storageProfile: { + dataDisks: [ + { + caching: "ReadWrite", + createOption: "Empty", + diskSizeGB: 1023, + lun: 0, + managedDisk: { + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + storageAccountType: "Standard_LRS", + }, + }, + ], + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + storageAccountType: "Standard_LRS", + }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithDiskEncryptionSetResourceInOSDiskAndDataDisk().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetFromWithFpgaNetworkInterface.json + */ +async function createAScaleSetWithFpgaNetworkInterfaces() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + { + name: "{fpgaNic-Name}", + enableAcceleratedNetworking: false, + enableFpga: true, + enableIPForwarding: false, + ipConfigurations: [ + { + name: "{fpgaNic-Name}", + primary: true, + privateIPAddressVersion: "IPv4", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name}", + }, + }, + ], + primary: false, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithFpgaNetworkInterfaces().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithEncryptionAtHost.json + */ +async function createAScaleSetWithHostEncryptionUsingEncryptionAtHostProperty() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads", + }, + sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + securityProfile: { encryptionAtHost: true }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest", + }, + osDisk: { + caching: "ReadOnly", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithHostEncryptionUsingEncryptionAtHostProperty().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithSecurityTypeConfidentialVM.json + */ +async function createAScaleSetWithSecurityTypeAsConfidentialVM() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + sku: { name: "Standard_DC2as_v5", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + securityProfile: { + securityType: "ConfidentialVM", + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + }, + storageProfile: { + imageReference: { + offer: "2019-datacenter-cvm", + publisher: "MicrosoftWindowsServer", + sku: "windows-cvm", + version: "17763.2183.2109130127", + }, + osDisk: { + caching: "ReadOnly", + createOption: "FromImage", + managedDisk: { + securityProfile: { securityEncryptionType: "VMGuestStateOnly" }, + storageAccountType: "StandardSSD_LRS", + }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithSecurityTypeAsConfidentialVM().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithUefiSettings.json + */ +async function createAScaleSetWithUefiSettingsOfSecureBootAndVTpm() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D2s_v3", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + securityProfile: { + securityType: "TrustedLaunch", + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + }, + storageProfile: { + imageReference: { + offer: "windowsserver-gen2preview-preview", + publisher: "MicrosoftWindowsServer", + sku: "windows10-tvm", + version: "18363.592.2001092016", + }, + osDisk: { + caching: "ReadOnly", + createOption: "FromImage", + managedDisk: { storageAccountType: "StandardSSD_LRS" }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithUefiSettingsOfSecureBootAndVTpm().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithAMarketplaceImagePlan.json + */ +async function createAScaleSetWithAMarketplaceImagePlan() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads", + }, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithAMarketplaceImagePlan().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithAnAzureApplicationGateway.json + */ +async function createAScaleSetWithAnAzureApplicationGateway() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + applicationGatewayBackendAddressPools: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/applicationGateways/{existing-application-gateway-name}/backendAddressPools/{existing-backend-address-pool-name}", + }, + ], + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithAnAzureApplicationGateway().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithAnAzureLoadBalancer.json + */ +async function createAScaleSetWithAnAzureLoadBalancer() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + loadBalancerBackendAddressPools: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/backendAddressPools/{existing-backend-address-pool-name}", + }, + ], + loadBalancerInboundNatPools: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/inboundNatPools/{existing-nat-pool-name}", + }, + ], + publicIPAddressConfiguration: { + name: "{vmss-name}", + publicIPAddressVersion: "IPv4", + }, + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithAnAzureLoadBalancer().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithAutomaticRepairs.json + */ +async function createAScaleSetWithAutomaticRepairsEnabled() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + automaticRepairsPolicy: { enabled: true, gracePeriod: "PT10M" }, + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithAutomaticRepairsEnabled().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithBootDiagnostics.json + */ +async function createAScaleSetWithBootDiagnostics() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + }, + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithBootDiagnostics().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithEmptyDataDisksOnEachVm.json + */ +async function createAScaleSetWithEmptyDataDisksOnEachVM() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D2_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + storageProfile: { + dataDisks: [ + { createOption: "Empty", diskSizeGB: 1023, lun: 0 }, + { createOption: "Empty", diskSizeGB: 1023, lun: 1 }, + ], + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + diskSizeGB: 512, + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithEmptyDataDisksOnEachVM().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithDiffOsDiskUsingDiffDiskPlacement.json + */ +async function createAScaleSetWithEphemeralOSDisksUsingPlacementProperty() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads", + }, + sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest", + }, + osDisk: { + caching: "ReadOnly", + createOption: "FromImage", + diffDiskSettings: { option: "Local", placement: "ResourceDisk" }, + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithEphemeralOSDisksUsingPlacementProperty().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithDiffOsDisk.json + */ +async function createAScaleSetWithEphemeralOSDisks() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads", + }, + sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest", + }, + osDisk: { + caching: "ReadOnly", + createOption: "FromImage", + diffDiskSettings: { option: "Local" }, + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithEphemeralOSDisks().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithExtensionsTimeBudget.json + */ +async function createAScaleSetWithExtensionTimeBudget() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + }, + }, + extensionProfile: { + extensionsTimeBudget: "PT1H20M", + extensions: [ + { + name: "{extension-name}", + typePropertiesType: "{extension-Type}", + autoUpgradeMinorVersion: false, + publisher: "{extension-Publisher}", + settings: {}, + typeHandlerVersion: "{handler-version}", + }, + ], + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithExtensionTimeBudget().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithManagedBootDiagnostics.json + */ +async function createAScaleSetWithManagedBootDiagnostics() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + diagnosticsProfile: { bootDiagnostics: { enabled: true } }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithManagedBootDiagnostics().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithPasswordAuthentication.json + */ +async function createAScaleSetWithPasswordAuthentication() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithPasswordAuthentication().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithPremiumStorage.json + */ +async function createAScaleSetWithPremiumStorage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithPremiumStorage().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithScaleInPolicy.json + */ +async function createAScaleSetWithScaleInPolicy() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + scaleInPolicy: { forceDeletion: true, rules: ["OldestVM"] }, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithScaleInPolicy().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithSpotRestorePolicy.json + */ +async function createAScaleSetWithSpotRestorePolicy() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + sku: { name: "Standard_A8m_v2", capacity: 2, tier: "Standard" }, + spotRestorePolicy: { enabled: true, restoreTimeout: "PT1H" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + billingProfile: { maxPrice: -1 }, + evictionPolicy: "Deallocate", + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + priority: "Spot", + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithSpotRestorePolicy().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithSshAuthentication.json + */ +async function createAScaleSetWithSshAuthentication() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + linuxConfiguration: { + disablePasswordAuthentication: true, + ssh: { + publicKeys: [ + { + path: "/home/{your-username}/.ssh/authorized_keys", + keyData: + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1", + }, + ], + }, + }, + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithSshAuthentication().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithTerminateScheduledEventEnabled.json + */ +async function createAScaleSetWithTerminateScheduledEventsEnabled() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + scheduledEventsProfile: { + terminateNotificationProfile: { enable: true, notBeforeTimeout: "PT5M" }, + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithTerminateScheduledEventsEnabled().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAScaleSetWithUserData.json + */ +async function createAScaleSetWithUserData() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + userData: "RXhhbXBsZSBVc2VyRGF0YQ==", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithUserData().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithVMsInDifferentZones.json + */ +async function createAScaleSetWithVirtualMachinesInDifferentZones() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "centralus", + overprovision: true, + sku: { name: "Standard_A1_v2", capacity: 2, tier: "Standard" }, + upgradePolicy: { mode: "Automatic" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + storageProfile: { + dataDisks: [ + { createOption: "Empty", diskSizeGB: 1023, lun: 0 }, + { createOption: "Empty", diskSizeGB: 1023, lun: 1 }, + ], + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + diskSizeGB: 512, + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }, + zones: ["1", "3"], + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithVirtualMachinesInDifferentZones().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAScaleSetWithVMSizeProperties.json + */ +async function createAScaleSetWithVMSizeProperties() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + hardwareProfile: { + vmSizeProperties: { vCPUsAvailable: 1, vCPUsPerCore: 1 }, + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + userData: "RXhhbXBsZSBVc2VyRGF0YQ==", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithVMSizeProperties().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAScaleSetWithCapacityReservation.json + */ +async function createOrUpdateAScaleSetWithCapacityReservation() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters = { + location: "westus", + overprovision: true, + sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + capacityReservation: { + capacityReservationGroup: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}", + }, + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createOrUpdateAScaleSetWithCapacityReservation().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsDeallocateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsDeallocateSample.js new file mode 100644 index 000000000000..8ced84b08a26 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsDeallocateSample.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @summary Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Deallocate_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsDeallocateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmInstanceIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaa"], + }; + const options = { + vmInstanceIDs, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginDeallocateAndWait( + resourceGroupName, + vmScaleSetName, + options + ); + console.log(result); +} + +virtualMachineScaleSetsDeallocateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @summary Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Deallocate_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsDeallocateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginDeallocateAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsDeallocateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsDeleteInstancesSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsDeleteInstancesSample.js new file mode 100644 index 000000000000..8b957f4ab96a --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsDeleteInstancesSample.js @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Deletes virtual machines in a VM scale set. + * + * @summary Deletes virtual machines in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_DeleteInstances_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsDeleteInstancesMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaa"; + const forceDeletion = true; + const vmInstanceIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"], + }; + const options = { + forceDeletion, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginDeleteInstancesAndWait( + resourceGroupName, + vmScaleSetName, + vmInstanceIDs, + options + ); + console.log(result); +} + +virtualMachineScaleSetsDeleteInstancesMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Deletes virtual machines in a VM scale set. + * + * @summary Deletes virtual machines in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_DeleteInstances_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsDeleteInstancesMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaa"; + const vmInstanceIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"], + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginDeleteInstancesAndWait( + resourceGroupName, + vmScaleSetName, + vmInstanceIDs + ); + console.log(result); +} + +virtualMachineScaleSetsDeleteInstancesMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsDeleteSample.js new file mode 100644 index 000000000000..08ccfaac1c9b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsDeleteSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Deletes a VM scale set. + * + * @summary Deletes a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ForceDeleteVirtualMachineScaleSets.json + */ +async function forceDeleteAVMScaleSet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const forceDeletion = true; + const options = { + forceDeletion, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginDeleteAndWait( + resourceGroupName, + vmScaleSetName, + options + ); + console.log(result); +} + +forceDeleteAVMScaleSet().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.js new file mode 100644 index 000000000000..5358761049fa --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.js @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * + * @summary Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaa"; + const platformUpdateDomain = 30; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = + await client.virtualMachineScaleSets.forceRecoveryServiceFabricPlatformUpdateDomainWalk( + resourceGroupName, + vmScaleSetName, + platformUpdateDomain + ); + console.log(result); +} + +virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkMaximumSetGen().catch( + console.error +); + +/** + * This sample demonstrates how to Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * + * @summary Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaa"; + const platformUpdateDomain = 9; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = + await client.virtualMachineScaleSets.forceRecoveryServiceFabricPlatformUpdateDomainWalk( + resourceGroupName, + vmScaleSetName, + platformUpdateDomain + ); + console.log(result); +} + +virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkMinimumSetGen().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsGetInstanceViewSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsGetInstanceViewSample.js new file mode 100644 index 000000000000..cf2e0c4c8ccb --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsGetInstanceViewSample.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the status of a VM scale set instance. + * + * @summary Gets the status of a VM scale set instance. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetInstanceView_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsGetInstanceViewMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.getInstanceView( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsGetInstanceViewMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets the status of a VM scale set instance. + * + * @summary Gets the status of a VM scale set instance. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetInstanceView_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsGetInstanceViewMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.getInstanceView( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsGetInstanceViewMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsGetOSUpgradeHistorySample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsGetOSUpgradeHistorySample.js new file mode 100644 index 000000000000..02d185e7900e --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsGetOSUpgradeHistorySample.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets list of OS upgrades on a VM scale set instance. + * + * @summary Gets list of OS upgrades on a VM scale set instance. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetOSUpgradeHistory_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsGetOSUpgradeHistoryMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSets.listOSUpgradeHistory( + resourceGroupName, + vmScaleSetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetsGetOSUpgradeHistoryMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets list of OS upgrades on a VM scale set instance. + * + * @summary Gets list of OS upgrades on a VM scale set instance. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetOSUpgradeHistory_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsGetOSUpgradeHistoryMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSets.listOSUpgradeHistory( + resourceGroupName, + vmScaleSetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetsGetOSUpgradeHistoryMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsGetSample.js new file mode 100644 index 000000000000..4ab5e7efcc24 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsGetSample.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Display information about a virtual machine scale set. + * + * @summary Display information about a virtual machine scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSet.json + */ +async function getAVirtualMachineScaleSet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myVirtualMachineScaleSet"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.get(resourceGroupName, vmScaleSetName); + console.log(result); +} + +getAVirtualMachineScaleSet().catch(console.error); + +/** + * This sample demonstrates how to Display information about a virtual machine scale set. + * + * @summary Display information about a virtual machine scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetAutoPlacedOnDedicatedHostGroup.json + */ +async function getAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myVirtualMachineScaleSet"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.get(resourceGroupName, vmScaleSetName); + console.log(result); +} + +getAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement().catch( + console.error +); + +/** + * This sample demonstrates how to Display information about a virtual machine scale set. + * + * @summary Display information about a virtual machine scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetWithUserData.json + */ +async function getAVirtualMachineScaleSetWithUserData() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myVirtualMachineScaleSet"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.get(resourceGroupName, vmScaleSetName); + console.log(result); +} + +getAVirtualMachineScaleSetWithUserData().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsListAllSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsListAllSample.js new file mode 100644 index 000000000000..7bbaa8a01e06 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsListAllSample.js @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. + * + * @summary Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListAll_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsListAllMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSets.listAll()) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetsListAllMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. + * + * @summary Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListAll_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsListAllMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSets.listAll()) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetsListAllMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsListByLocationSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsListByLocationSample.js new file mode 100644 index 000000000000..51d54adddfad --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsListByLocationSample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets all the VM scale sets under the specified subscription for the specified location. + * + * @summary Gets all the VM scale sets under the specified subscription for the specified location. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListVirtualMachineScaleSetsInASubscriptionByLocation.json + */ +async function listsAllTheVMScaleSetsUnderTheSpecifiedSubscriptionForTheSpecifiedLocation() { + const subscriptionId = "{subscription-id}"; + const location = "eastus"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSets.listByLocation(location)) { + resArray.push(item); + } + console.log(resArray); +} + +listsAllTheVMScaleSetsUnderTheSpecifiedSubscriptionForTheSpecifiedLocation().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsListSample.js new file mode 100644 index 000000000000..f9ec6de771bc --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsListSample.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of all VM scale sets under a resource group. + * + * @summary Gets a list of all VM scale sets under a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_List_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSets.list(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetsListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of all VM scale sets under a resource group. + * + * @summary Gets a list of all VM scale sets under a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_List_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSets.list(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetsListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsListSkusSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsListSkusSample.js new file mode 100644 index 000000000000..39e49f56d0fc --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsListSkusSample.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. + * + * @summary Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListSkus_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsListSkusMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSets.listSkus( + resourceGroupName, + vmScaleSetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetsListSkusMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. + * + * @summary Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListSkus_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsListSkusMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSets.listSkus( + resourceGroupName, + vmScaleSetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetsListSkusMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsPerformMaintenanceSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsPerformMaintenanceSample.js new file mode 100644 index 000000000000..7df6c9cfa427 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsPerformMaintenanceSample.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + * + * @summary Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PerformMaintenance_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsPerformMaintenanceMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaa"; + const vmInstanceIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaa"], + }; + const options = { + vmInstanceIDs, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginPerformMaintenanceAndWait( + resourceGroupName, + vmScaleSetName, + options + ); + console.log(result); +} + +virtualMachineScaleSetsPerformMaintenanceMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + * + * @summary Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PerformMaintenance_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsPerformMaintenanceMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginPerformMaintenanceAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsPerformMaintenanceMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsPowerOffSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsPowerOffSample.js new file mode 100644 index 000000000000..ee256a0cc4bb --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsPowerOffSample.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @summary Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PowerOff_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsPowerOffMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaa"; + const skipShutdown = true; + const vmInstanceIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaa"], + }; + const options = { + skipShutdown, + vmInstanceIDs, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginPowerOffAndWait( + resourceGroupName, + vmScaleSetName, + options + ); + console.log(result); +} + +virtualMachineScaleSetsPowerOffMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @summary Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PowerOff_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsPowerOffMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "a"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginPowerOffAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsPowerOffMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsRedeploySample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsRedeploySample.js new file mode 100644 index 000000000000..d73d8fb8d79f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsRedeploySample.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. + * + * @summary Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Redeploy_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsRedeployMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmInstanceIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaa"], + }; + const options = { + vmInstanceIDs, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginRedeployAndWait( + resourceGroupName, + vmScaleSetName, + options + ); + console.log(result); +} + +virtualMachineScaleSetsRedeployMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. + * + * @summary Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Redeploy_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsRedeployMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginRedeployAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsRedeployMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsReimageAllSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsReimageAllSample.js new file mode 100644 index 000000000000..78b63a74fbb5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsReimageAllSample.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * + * @summary Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ReimageAll_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsReimageAllMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaa"; + const vmInstanceIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaa"], + }; + const options = { + vmInstanceIDs, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginReimageAllAndWait( + resourceGroupName, + vmScaleSetName, + options + ); + console.log(result); +} + +virtualMachineScaleSetsReimageAllMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * + * @summary Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ReimageAll_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsReimageAllMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginReimageAllAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsReimageAllMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsReimageSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsReimageSample.js new file mode 100644 index 000000000000..e8162afc170f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsReimageSample.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. + * + * @summary Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Reimage_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsReimageMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmScaleSetReimageInput = { + instanceIds: ["aaaaaaaaaa"], + tempDisk: true, + }; + const options = { + vmScaleSetReimageInput, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginReimageAndWait( + resourceGroupName, + vmScaleSetName, + options + ); + console.log(result); +} + +virtualMachineScaleSetsReimageMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. + * + * @summary Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Reimage_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsReimageMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginReimageAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsReimageMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsRestartSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsRestartSample.js new file mode 100644 index 000000000000..952b8abd5076 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsRestartSample.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Restarts one or more virtual machines in a VM scale set. + * + * @summary Restarts one or more virtual machines in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Restart_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsRestartMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaa"; + const vmInstanceIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaa"], + }; + const options = { + vmInstanceIDs, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginRestartAndWait( + resourceGroupName, + vmScaleSetName, + options + ); + console.log(result); +} + +virtualMachineScaleSetsRestartMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Restarts one or more virtual machines in a VM scale set. + * + * @summary Restarts one or more virtual machines in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Restart_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsRestartMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginRestartAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsRestartMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsSetOrchestrationServiceStateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsSetOrchestrationServiceStateSample.js new file mode 100644 index 000000000000..9a91d54cde6d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsSetOrchestrationServiceStateSample.js @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Changes ServiceState property for a given service + * + * @summary Changes ServiceState property for a given service + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_SetOrchestrationServiceState_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsSetOrchestrationServiceStateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaa"; + const parameters = { + action: "Resume", + serviceName: "AutomaticRepairs", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginSetOrchestrationServiceStateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +virtualMachineScaleSetsSetOrchestrationServiceStateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Changes ServiceState property for a given service + * + * @summary Changes ServiceState property for a given service + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_SetOrchestrationServiceState_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsSetOrchestrationServiceStateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const parameters = { + action: "Resume", + serviceName: "AutomaticRepairs", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginSetOrchestrationServiceStateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +virtualMachineScaleSetsSetOrchestrationServiceStateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsStartSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsStartSample.js new file mode 100644 index 000000000000..e1bedc6ae66e --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsStartSample.js @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Starts one or more virtual machines in a VM scale set. + * + * @summary Starts one or more virtual machines in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Start_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsStartMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const vmInstanceIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaa"], + }; + const options = { vmInstanceIDs }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginStartAndWait( + resourceGroupName, + vmScaleSetName, + options + ); + console.log(result); +} + +virtualMachineScaleSetsStartMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Starts one or more virtual machines in a VM scale set. + * + * @summary Starts one or more virtual machines in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Start_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsStartMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginStartAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsStartMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsUpdateInstancesSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsUpdateInstancesSample.js new file mode 100644 index 000000000000..ae743d5608a4 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsUpdateInstancesSample.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @summary Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_UpdateInstances_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsUpdateInstancesMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const vmInstanceIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"], + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginUpdateInstancesAndWait( + resourceGroupName, + vmScaleSetName, + vmInstanceIDs + ); + console.log(result); +} + +virtualMachineScaleSetsUpdateInstancesMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @summary Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_UpdateInstances_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsUpdateInstancesMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmInstanceIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"], + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginUpdateInstancesAndWait( + resourceGroupName, + vmScaleSetName, + vmInstanceIDs + ); + console.log(result); +} + +virtualMachineScaleSetsUpdateInstancesMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsUpdateSample.js new file mode 100644 index 000000000000..d480a006c4a1 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineScaleSetsUpdateSample.js @@ -0,0 +1,286 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Update a VM scale set. + * + * @summary Update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Update_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaa"; + const parameters = { + additionalCapabilities: { hibernationEnabled: true, ultraSSDEnabled: true }, + automaticRepairsPolicy: { enabled: true, gracePeriod: "PT30M" }, + doNotRunExtensionsOnOverprovisionedVMs: true, + identity: { + type: "SystemAssigned", + userAssignedIdentities: { key3951: {} }, + }, + overprovision: true, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + promotionCode: "aaaaaaaaaa", + publisher: "microsoft-ads", + }, + proximityPlacementGroup: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", + }, + scaleInPolicy: { forceDeletion: true, rules: ["OldestVM"] }, + singlePlacementGroup: true, + sku: { name: "DSv3-Type1", capacity: 7, tier: "aaa" }, + tags: { key246: "aaaaaaaaaaaaaaaaaaaaaaaa" }, + upgradePolicy: { + automaticOSUpgradePolicy: { + disableAutomaticRollback: true, + enableAutomaticOSUpgrade: true, + }, + mode: "Manual", + rollingUpgradePolicy: { + enableCrossZoneUpgrade: true, + maxBatchInstancePercent: 49, + maxUnhealthyInstancePercent: 81, + maxUnhealthyUpgradedInstancePercent: 98, + pauseTimeBetweenBatches: "aaaaaaaaaaaaaaa", + prioritizeUnhealthyInstances: true, + }, + }, + virtualMachineProfile: { + billingProfile: { maxPrice: -1 }, + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + }, + }, + extensionProfile: { + extensionsTimeBudget: "PT1H20M", + extensions: [ + { + name: "{extension-name}", + typePropertiesType: "{extension-Type}", + autoUpgradeMinorVersion: true, + enableAutomaticUpgrade: true, + forceUpdateTag: "aaaaaaaaa", + protectedSettings: {}, + provisionAfterExtensions: ["aa"], + publisher: "{extension-Publisher}", + settings: {}, + suppressFailures: true, + typeHandlerVersion: "{handler-version}", + }, + ], + }, + licenseType: "aaaaaaaaaaaa", + networkProfile: { + healthProbe: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123", + }, + networkApiVersion: "2020-11-01", + networkInterfaceConfigurations: [ + { + name: "aaaaaaaa", + deleteOption: "Delete", + dnsSettings: { dnsServers: [] }, + enableAcceleratedNetworking: true, + enableFpga: true, + enableIPForwarding: true, + id: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + ipConfigurations: [ + { + name: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + applicationGatewayBackendAddressPools: [ + { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", + }, + ], + applicationSecurityGroups: [ + { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", + }, + ], + id: "aaaaaaaaaaaaaaaa", + loadBalancerBackendAddressPools: [ + { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", + }, + ], + loadBalancerInboundNatPools: [ + { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", + }, + ], + primary: true, + privateIPAddressVersion: "IPv4", + publicIPAddressConfiguration: { + name: "a", + deleteOption: "Delete", + dnsSettings: { domainNameLabel: "aaaaaaaaaaaaaaaaaa" }, + idleTimeoutInMinutes: 3, + }, + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123", + }, + }, + ], + networkSecurityGroup: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", + }, + primary: true, + }, + ], + }, + osProfile: { + customData: "aaaaaaaaaaaaaaaaaaaaaaaaaa", + linuxConfiguration: { + disablePasswordAuthentication: true, + patchSettings: { + assessmentMode: "ImageDefault", + patchMode: "ImageDefault", + }, + provisionVMAgent: true, + ssh: { + publicKeys: [ + { + path: "/home/{your-username}/.ssh/authorized_keys", + keyData: + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1", + }, + ], + }, + }, + secrets: [ + { + sourceVault: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + vaultCertificates: [ + { + certificateStore: "aaaaaaaaaaaaaaaaaaaaaaaaa", + certificateUrl: "aaaaaaa", + }, + ], + }, + ], + windowsConfiguration: { + additionalUnattendContent: [ + { + componentName: "Microsoft-Windows-Shell-Setup", + content: "aaaaaaaaaaaaaaaaaaaa", + passName: "OobeSystem", + settingName: "AutoLogon", + }, + ], + enableAutomaticUpdates: true, + patchSettings: { + assessmentMode: "ImageDefault", + enableHotpatching: true, + patchMode: "AutomaticByOS", + }, + provisionVMAgent: true, + timeZone: "aaaaaaaaaaaaaaaa", + winRM: { + listeners: [{ certificateUrl: "aaaaaaaaaaaaaaaaaaaaaa", protocol: "Http" }], + }, + }, + }, + scheduledEventsProfile: { + terminateNotificationProfile: { + enable: true, + notBeforeTimeout: "PT10M", + }, + }, + securityProfile: { + encryptionAtHost: true, + securityType: "TrustedLaunch", + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + }, + storageProfile: { + dataDisks: [ + { + name: "aaaaaaaaaaaaaaaaaaaaaaaaaa", + caching: "None", + createOption: "Empty", + diskIopsReadWrite: 28, + diskMBpsReadWrite: 15, + diskSizeGB: 1023, + lun: 26, + managedDisk: { + diskEncryptionSet: { id: "aaaaaaaaaaaa" }, + storageAccountType: "Standard_LRS", + }, + writeAcceleratorEnabled: true, + }, + ], + imageReference: { + id: "aaaaaaaaaaaaaaaaaaa", + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sharedGalleryImageId: "aaaaaa", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + caching: "ReadWrite", + diskSizeGB: 6, + image: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd", + }, + managedDisk: { + diskEncryptionSet: { id: "aaaaaaaaaaaa" }, + storageAccountType: "Standard_LRS", + }, + vhdContainers: ["aa"], + writeAcceleratorEnabled: true, + }, + }, + userData: "aaaaaaaaaaaaa", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +virtualMachineScaleSetsUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Update a VM scale set. + * + * @summary Update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Update_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaa"; + const parameters = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +virtualMachineScaleSetsUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineSizesListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineSizesListSample.js new file mode 100644 index 000000000000..8c8554387dd6 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachineSizesListSample.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) + * + * @summary This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineSizes_List_MaximumSet_Gen.json + */ +async function virtualMachineSizesListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "-e"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineSizes.list(location)) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineSizesListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) + * + * @summary This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineSizes_List_MinimumSet_Gen.json + */ +async function virtualMachineSizesListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "._.."; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineSizes.list(location)) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineSizesListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesAssessPatchesSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesAssessPatchesSample.js new file mode 100644 index 000000000000..b36048a22b90 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesAssessPatchesSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Assess patches on the VM. + * + * @summary Assess patches on the VM. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineAssessPatches.json + */ +async function assessPatchStateOfAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroupName"; + const vmName = "myVMName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginAssessPatchesAndWait(resourceGroupName, vmName); + console.log(result); +} + +assessPatchStateOfAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesCaptureSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesCaptureSample.js new file mode 100644 index 000000000000..9029f0e2a254 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesCaptureSample.js @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. + * + * @summary Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Capture_MaximumSet_Gen.json + */ +async function virtualMachinesCaptureMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaaaaaa"; + const parameters = { + destinationContainerName: "aaaaaaa", + overwriteVhds: true, + vhdPrefix: "aaaaaaaaa", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCaptureAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +virtualMachinesCaptureMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. + * + * @summary Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Capture_MinimumSet_Gen.json + */ +async function virtualMachinesCaptureMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaa"; + const parameters = { + destinationContainerName: "aaaaaaa", + overwriteVhds: true, + vhdPrefix: "aaaaaaaaa", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCaptureAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +virtualMachinesCaptureMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesConvertToManagedDisksSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesConvertToManagedDisksSample.js new file mode 100644 index 000000000000..3e8a925fcfb0 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesConvertToManagedDisksSample.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * + * @summary Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ConvertToManagedDisks_MaximumSet_Gen.json + */ +async function virtualMachinesConvertToManagedDisksMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginConvertToManagedDisksAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesConvertToManagedDisksMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * + * @summary Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ConvertToManagedDisks_MinimumSet_Gen.json + */ +async function virtualMachinesConvertToManagedDisksMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginConvertToManagedDisksAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesConvertToManagedDisksMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesCreateOrUpdateSample.js new file mode 100644 index 000000000000..96543f82a9cb --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesCreateOrUpdateSample.js @@ -0,0 +1,2376 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateALinuxVmWithPatchSettingAssessmentModeOfImageDefault.json + */ +async function createALinuxVMWithAPatchSettingAssessmentModeOfImageDefault() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + linuxConfiguration: { + patchSettings: { assessmentMode: "ImageDefault" }, + provisionVMAgent: true, + }, + }, + storageProfile: { + imageReference: { + offer: "UbuntuServer", + publisher: "Canonical", + sku: "16.04-LTS", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createALinuxVMWithAPatchSettingAssessmentModeOfImageDefault().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateALinuxVmWithPatchSettingModeOfImageDefault.json + */ +async function createALinuxVMWithAPatchSettingPatchModeOfImageDefault() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + linuxConfiguration: { + patchSettings: { patchMode: "ImageDefault" }, + provisionVMAgent: true, + }, + }, + storageProfile: { + imageReference: { + offer: "UbuntuServer", + publisher: "Canonical", + sku: "16.04-LTS", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createALinuxVMWithAPatchSettingPatchModeOfImageDefault().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateALinuxVmWithPatchSettingModesOfAutomaticByPlatform.json + */ +async function createALinuxVMWithAPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + linuxConfiguration: { + patchSettings: { + assessmentMode: "AutomaticByPlatform", + patchMode: "AutomaticByPlatform", + }, + provisionVMAgent: true, + }, + }, + storageProfile: { + imageReference: { + offer: "UbuntuServer", + publisher: "Canonical", + sku: "16.04-LTS", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createALinuxVMWithAPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmFromACommunityGalleryImage.json + */ +async function createAVMFromACommunityGalleryImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + storageProfile: { + imageReference: { + communityGalleryImageId: + "/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMFromACommunityGalleryImage().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmFromASharedGalleryImage.json + */ +async function createAVMFromASharedGalleryImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + storageProfile: { + imageReference: { + sharedGalleryImageId: + "/SharedGalleries/sharedGalleryName/Images/sharedGalleryImageName/Versions/sharedGalleryImageVersionName", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMFromASharedGalleryImage().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAVmWithHibernationEnabled.json + */ +async function createAVMWithHibernationEnabled() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "{vm-name}"; + const parameters = { + additionalCapabilities: { hibernationEnabled: true }, + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + }, + }, + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + location: "eastus2euap", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "{vm-name}", + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2019-Datacenter", + version: "latest", + }, + osDisk: { + name: "vmOSdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithHibernationEnabled().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithUefiSettings.json + */ +async function createAVMWithUefiSettingsOfSecureBootAndVTpm() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + securityProfile: { + securityType: "TrustedLaunch", + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + }, + storageProfile: { + imageReference: { + offer: "windowsserver-gen2preview-preview", + publisher: "MicrosoftWindowsServer", + sku: "windows10-tvm", + version: "18363.592.2001092016", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadOnly", + createOption: "FromImage", + managedDisk: { storageAccountType: "StandardSSD_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithUefiSettingsOfSecureBootAndVTpm().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAVmWithUserData.json + */ +async function createAVMWithUserData() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "{vm-name}"; + const parameters = { + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + }, + }, + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "{vm-name}", + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + name: "vmOSdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + userData: "RXhhbXBsZSBVc2VyRGF0YQ==", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithUserData().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAVmWithVMSizeProperties.json + */ +async function createAVMWithVMSizeProperties() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + }, + }, + hardwareProfile: { + vmSize: "Standard_D4_v3", + vmSizeProperties: { vCPUsAvailable: 1, vCPUsPerCore: 1 }, + }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + userData: "U29tZSBDdXN0b20gRGF0YQ==", + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithVMSizeProperties().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithNetworkInterfaceConfiguration.json + */ +async function createAVMWithNetworkInterfaceConfiguration() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkApiVersion: "2020-11-01", + networkInterfaceConfigurations: [ + { + name: "{nic-config-name}", + deleteOption: "Delete", + ipConfigurations: [ + { + name: "{ip-config-name}", + primary: true, + publicIPAddressConfiguration: { + name: "{publicIP-config-name}", + deleteOption: "Detach", + publicIPAllocationMethod: "Static", + sku: { name: "Basic", tier: "Global" }, + }, + }, + ], + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithNetworkInterfaceConfiguration().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithSecurityTypeConfidentialVMWithCustomerManagedKeys.json + */ +async function createAVMWithSecurityTypeConfidentialVMWithCustomerManagedKeys() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_DC2as_v5" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + securityProfile: { + securityType: "ConfidentialVM", + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + }, + storageProfile: { + imageReference: { + offer: "2019-datacenter-cvm", + publisher: "MicrosoftWindowsServer", + sku: "windows-cvm", + version: "17763.2183.2109130127", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadOnly", + createOption: "FromImage", + managedDisk: { + securityProfile: { + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + securityEncryptionType: "DiskWithVMGuestState", + }, + storageAccountType: "StandardSSD_LRS", + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithSecurityTypeConfidentialVMWithCustomerManagedKeys().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithSecurityTypeConfidentialVM.json + */ +async function createAVMWithSecurityTypeConfidentialVMWithPlatformManagedKeys() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_DC2as_v5" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + securityProfile: { + securityType: "ConfidentialVM", + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + }, + storageProfile: { + imageReference: { + offer: "2019-datacenter-cvm", + publisher: "MicrosoftWindowsServer", + sku: "windows-cvm", + version: "17763.2183.2109130127", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadOnly", + createOption: "FromImage", + managedDisk: { + securityProfile: { securityEncryptionType: "DiskWithVMGuestState" }, + storageAccountType: "StandardSSD_LRS", + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithSecurityTypeConfidentialVMWithPlatformManagedKeys().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAWindowsVmWithPatchSettingAssessmentModeOfImageDefault.json + */ +async function createAWindowsVMWithAPatchSettingAssessmentModeOfImageDefault() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + windowsConfiguration: { + enableAutomaticUpdates: true, + patchSettings: { assessmentMode: "ImageDefault" }, + provisionVMAgent: true, + }, + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAWindowsVMWithAPatchSettingAssessmentModeOfImageDefault().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAWindowsVmWithPatchSettingModeOfAutomaticByOS.json + */ +async function createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByOS() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + windowsConfiguration: { + enableAutomaticUpdates: true, + patchSettings: { patchMode: "AutomaticByOS" }, + provisionVMAgent: true, + }, + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByOS().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAWindowsVmWithPatchSettingModeOfAutomaticByPlatformAndEnableHotPatchingTrue.json + */ +async function createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + windowsConfiguration: { + enableAutomaticUpdates: true, + patchSettings: { + enableHotpatching: true, + patchMode: "AutomaticByPlatform", + }, + provisionVMAgent: true, + }, + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAWindowsVmWithPatchSettingModeOfManual.json + */ +async function createAWindowsVMWithAPatchSettingPatchModeOfManual() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + windowsConfiguration: { + enableAutomaticUpdates: true, + patchSettings: { patchMode: "Manual" }, + provisionVMAgent: true, + }, + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAWindowsVMWithAPatchSettingPatchModeOfManual().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAWindowsVmWithPatchSettingModesOfAutomaticByPlatform.json + */ +async function createAWindowsVMWithPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + windowsConfiguration: { + enableAutomaticUpdates: true, + patchSettings: { + assessmentMode: "AutomaticByPlatform", + patchMode: "AutomaticByPlatform", + }, + provisionVMAgent: true, + }, + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAWindowsVMWithPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateACustomImageVmFromAnUnmanagedGeneralizedOsImage.json + */ +async function createACustomImageVMFromAnUnmanagedGeneralizedOSImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "{vm-name}"; + const parameters = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + storageProfile: { + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + image: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd", + }, + osType: "Windows", + vhd: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd", + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createACustomImageVMFromAnUnmanagedGeneralizedOSImage().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAPlatformImageVmWithUnmanagedOsAndDataDisks.json + */ +async function createAPlatformImageVMWithUnmanagedOSAndDataDisks() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "{vm-name}"; + const parameters = { + hardwareProfile: { vmSize: "Standard_D2_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + storageProfile: { + dataDisks: [ + { + createOption: "Empty", + diskSizeGB: 1023, + lun: 0, + vhd: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk0.vhd", + }, + }, + { + createOption: "Empty", + diskSizeGB: 1023, + lun: 1, + vhd: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk1.vhd", + }, + }, + ], + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + vhd: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd", + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAPlatformImageVMWithUnmanagedOSAndDataDisks().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmFromACustomImage.json + */ +async function createAVMFromACustomImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMFromACustomImage().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmFromAGeneralizedSharedImage.json + */ +async function createAVMFromAGeneralizedSharedImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMFromAGeneralizedSharedImage().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmFromASpecializedSharedImage.json + */ +async function createAVMFromASpecializedSharedImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMFromASpecializedSharedImage().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain.json + */ +async function createAVMInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + platformFaultDomain: 1, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + virtualMachineScaleSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{existing-flex-vmss-name-with-platformFaultDomainCount-greater-than-1}", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmInAnAvailabilitySet.json + */ +async function createAVMInAnAvailabilitySet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + availabilitySet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/{existing-availability-set-name}", + }, + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMInAnAvailabilitySet().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithApplicationProfile.json + */ +async function createAVMWithApplicationProfile() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + applicationProfile: { + galleryApplications: [ + { + configurationReference: + "https://mystorageaccount.blob.core.windows.net/configurations/settings.config", + order: 1, + packageReferenceId: + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0", + tags: "myTag1", + }, + { + packageReferenceId: + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1", + }, + ], + }, + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + storageProfile: { + imageReference: { + offer: "{image_offer}", + publisher: "{image_publisher}", + sku: "{image_sku}", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithApplicationProfile().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithDiskEncryptionSetResource.json + */ +async function createAVMWithDiskEncryptionSetResourceIdInTheOSDiskAndDataDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + storageProfile: { + dataDisks: [ + { + caching: "ReadWrite", + createOption: "Empty", + diskSizeGB: 1023, + lun: 0, + managedDisk: { + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + storageAccountType: "Standard_LRS", + }, + }, + { + caching: "ReadWrite", + createOption: "Attach", + diskSizeGB: 1023, + lun: 1, + managedDisk: { + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-managed-disk-name}", + storageAccountType: "Standard_LRS", + }, + }, + ], + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + storageAccountType: "Standard_LRS", + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithDiskEncryptionSetResourceIdInTheOSDiskAndDataDisk().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithEncryptionAtHost.json + */ +async function createAVMWithHostEncryptionUsingEncryptionAtHostProperty() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_DS1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads", + }, + securityProfile: { encryptionAtHost: true }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadOnly", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithHostEncryptionUsingEncryptionAtHostProperty().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithScheduledEventsProfile.json + */ +async function createAVMWithScheduledEventsProfile() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + }, + }, + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + scheduledEventsProfile: { + terminateNotificationProfile: { enable: true, notBeforeTimeout: "PT10M" }, + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithScheduledEventsProfile().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithAMarketplaceImagePlan.json + */ +async function createAVMWithAMarketplaceImagePlan() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads", + }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithAMarketplaceImagePlan().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithExtensionsTimeBudget.json + */ +async function createAVMWithAnExtensionsTimeBudget() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + }, + }, + extensionsTimeBudget: "PT30M", + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithAnExtensionsTimeBudget().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithBootDiagnostics.json + */ +async function createAVMWithBootDiagnostics() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + }, + }, + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithBootDiagnostics().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithEmptyDataDisks.json + */ +async function createAVMWithEmptyDataDisks() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_D2_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + storageProfile: { + dataDisks: [ + { createOption: "Empty", diskSizeGB: 1023, lun: 0 }, + { createOption: "Empty", diskSizeGB: 1023, lun: 1 }, + ], + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithEmptyDataDisks().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithADiffOsDiskUsingDiffDiskPlacementAsCacheDisk.json + */ +async function createAVMWithEphemeralOSDiskProvisioningInCacheDiskUsingPlacementProperty() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_DS1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads", + }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadOnly", + createOption: "FromImage", + diffDiskSettings: { option: "Local", placement: "CacheDisk" }, + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithEphemeralOSDiskProvisioningInCacheDiskUsingPlacementProperty().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithADiffOsDiskUsingDiffDiskPlacementAsResourceDisk.json + */ +async function createAVMWithEphemeralOSDiskProvisioningInResourceDiskUsingPlacementProperty() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_DS1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads", + }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadOnly", + createOption: "FromImage", + diffDiskSettings: { option: "Local", placement: "ResourceDisk" }, + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithEphemeralOSDiskProvisioningInResourceDiskUsingPlacementProperty().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithADiffOsDisk.json + */ +async function createAVMWithEphemeralOSDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_DS1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads", + }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadOnly", + createOption: "FromImage", + diffDiskSettings: { option: "Local" }, + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithEphemeralOSDisk().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithManagedBootDiagnostics.json + */ +async function createAVMWithManagedBootDiagnostics() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + diagnosticsProfile: { bootDiagnostics: { enabled: true } }, + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithManagedBootDiagnostics().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithPasswordAuthentication.json + */ +async function createAVMWithPasswordAuthentication() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithPasswordAuthentication().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithPremiumStorage.json + */ +async function createAVMWithPremiumStorage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithPremiumStorage().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithSshAuthentication.json + */ +async function createAVMWithSshAuthentication() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + linuxConfiguration: { + disablePasswordAuthentication: true, + ssh: { + publicKeys: [ + { + path: "/home/{your-username}/.ssh/authorized_keys", + keyData: + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1", + }, + ], + }, + }, + }, + storageProfile: { + imageReference: { + offer: "{image_offer}", + publisher: "{image_publisher}", + sku: "{image_sku}", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithSshAuthentication().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAVmWithCapacityReservation.json + */ +async function createOrUpdateAVMWithCapacityReservation() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + capacityReservation: { + capacityReservationGroup: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}", + }, + }, + hardwareProfile: { vmSize: "Standard_DS1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads", + }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadOnly", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createOrUpdateAVMWithCapacityReservation().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesDeallocateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesDeallocateSample.js new file mode 100644 index 000000000000..501ff6e651aa --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesDeallocateSample.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * + * @summary Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Deallocate_MaximumSet_Gen.json + */ +async function virtualMachinesDeallocateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaa"; + const hibernate = true; + const options = { hibernate }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginDeallocateAndWait( + resourceGroupName, + vmName, + options + ); + console.log(result); +} + +virtualMachinesDeallocateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * + * @summary Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Deallocate_MinimumSet_Gen.json + */ +async function virtualMachinesDeallocateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginDeallocateAndWait(resourceGroupName, vmName); + console.log(result); +} + +virtualMachinesDeallocateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesDeleteSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesDeleteSample.js new file mode 100644 index 000000000000..4dab8870d249 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesDeleteSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to delete a virtual machine. + * + * @summary The operation to delete a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ForceDeleteVirtualMachine.json + */ +async function forceDeleteAVM() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const forceDeletion = true; + const options = { forceDeletion }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginDeleteAndWait( + resourceGroupName, + vmName, + options + ); + console.log(result); +} + +forceDeleteAVM().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesGeneralizeSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesGeneralizeSample.js new file mode 100644 index 000000000000..c5bf89235ff8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesGeneralizeSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation.
For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource).
For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * + * @summary Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation.
For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource).
For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GeneralizeVirtualMachine.json + */ +async function generalizeAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVMName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.generalize(resourceGroupName, vmName); + console.log(result); +} + +generalizeAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesGetSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesGetSample.js new file mode 100644 index 000000000000..87f8034f60a7 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesGetSample.js @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Retrieves information about the model view or the instance view of a virtual machine. + * + * @summary Retrieves information about the model view or the instance view of a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachine.json + */ +async function getAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.get(resourceGroupName, vmName); + console.log(result); +} + +getAVirtualMachine().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about the model view or the instance view of a virtual machine. + * + * @summary Retrieves information about the model view or the instance view of a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineAutoPlacedOnDedicatedHostGroup.json + */ +async function getAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.get(resourceGroupName, vmName); + console.log(result); +} + +getAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about the model view or the instance view of a virtual machine. + * + * @summary Retrieves information about the model view or the instance view of a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineWithVMSizeProperties.json + */ +async function getAVirtualMachineWithVMSizeProperties() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.get(resourceGroupName, vmName); + console.log(result); +} + +getAVirtualMachineWithVMSizeProperties().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesInstallPatchesSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesInstallPatchesSample.js new file mode 100644 index 000000000000..03c16921c3de --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesInstallPatchesSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Installs patches on the VM. + * + * @summary Installs patches on the VM. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineInstallPatches.json + */ +async function installPatchStateOfAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroupName"; + const vmName = "myVMName"; + const installPatchesInput = { + maximumDuration: "PT4H", + rebootSetting: "IfRequired", + windowsParameters: { + classificationsToInclude: ["Critical", "Security"], + maxPatchPublishDate: new Date("2020-11-19T02:36:43.0539904+00:00"), + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginInstallPatchesAndWait( + resourceGroupName, + vmName, + installPatchesInput + ); + console.log(result); +} + +installPatchStateOfAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesInstanceViewSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesInstanceViewSample.js new file mode 100644 index 000000000000..0977527f060c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesInstanceViewSample.js @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Retrieves information about the run-time state of a virtual machine. + * + * @summary Retrieves information about the run-time state of a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineInstanceView.json + */ +async function getVirtualMachineInstanceView() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.instanceView(resourceGroupName, vmName); + console.log(result); +} + +getVirtualMachineInstanceView().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about the run-time state of a virtual machine. + * + * @summary Retrieves information about the run-time state of a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineInstanceViewAutoPlacedOnDedicatedHostGroup.json + */ +async function getInstanceViewOfAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.instanceView(resourceGroupName, vmName); + console.log(result); +} + +getInstanceViewOfAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesListAllSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesListAllSample.js new file mode 100644 index 000000000000..3fcb405453c5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesListAllSample.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. + * + * @summary Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ListAll_MaximumSet_Gen.json + */ +async function virtualMachinesListAllMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const statusOnly = "aaaaaa"; + const filter = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const options = { statusOnly, filter }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachines.listAll(options)) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachinesListAllMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. + * + * @summary Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ListAll_MinimumSet_Gen.json + */ +async function virtualMachinesListAllMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachines.listAll()) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachinesListAllMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesListAvailableSizesSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesListAvailableSizesSample.js new file mode 100644 index 000000000000..0775557ce385 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesListAvailableSizesSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * + * @summary Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListAvailableVmSizes_VirtualMachines.json + */ +async function listsAllAvailableVirtualMachineSizesToWhichTheSpecifiedVirtualMachineCanBeResized() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVmName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachines.listAvailableSizes(resourceGroupName, vmName)) { + resArray.push(item); + } + console.log(resArray); +} + +listsAllAvailableVirtualMachineSizesToWhichTheSpecifiedVirtualMachineCanBeResized().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesListByLocationSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesListByLocationSample.js new file mode 100644 index 000000000000..5f5a654c0f10 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesListByLocationSample.js @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets all the virtual machines under the specified subscription for the specified location. + * + * @summary Gets all the virtual machines under the specified subscription for the specified location. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListVirtualMachinesInASubscriptionByLocation.json + */ +async function listsAllTheVirtualMachinesUnderTheSpecifiedSubscriptionForTheSpecifiedLocation() { + const subscriptionId = "{subscriptionId}"; + const location = "eastus"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachines.listByLocation(location)) { + resArray.push(item); + } + console.log(resArray); +} + +listsAllTheVirtualMachinesUnderTheSpecifiedSubscriptionForTheSpecifiedLocation().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesListSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesListSample.js new file mode 100644 index 000000000000..e539eb1322cd --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesListSample.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. + * + * @summary Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_List_MaximumSet_Gen.json + */ +async function virtualMachinesListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const filter = "aaaaaaaaaaaaaaaaaaaaaaa"; + const options = { filter }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachines.list(resourceGroupName, options)) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachinesListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. + * + * @summary Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_List_MinimumSet_Gen.json + */ +async function virtualMachinesListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachines.list(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachinesListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesPerformMaintenanceSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesPerformMaintenanceSample.js new file mode 100644 index 000000000000..109951def3cd --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesPerformMaintenanceSample.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to perform maintenance on a virtual machine. + * + * @summary The operation to perform maintenance on a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PerformMaintenance_MaximumSet_Gen.json + */ +async function virtualMachinesPerformMaintenanceMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginPerformMaintenanceAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesPerformMaintenanceMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to perform maintenance on a virtual machine. + * + * @summary The operation to perform maintenance on a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PerformMaintenance_MinimumSet_Gen.json + */ +async function virtualMachinesPerformMaintenanceMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginPerformMaintenanceAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesPerformMaintenanceMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesPowerOffSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesPowerOffSample.js new file mode 100644 index 000000000000..63ca11a654a8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesPowerOffSample.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. + * + * @summary The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PowerOff_MaximumSet_Gen.json + */ +async function virtualMachinesPowerOffMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const skipShutdown = true; + const options = { skipShutdown }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginPowerOffAndWait( + resourceGroupName, + vmName, + options + ); + console.log(result); +} + +virtualMachinesPowerOffMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. + * + * @summary The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PowerOff_MinimumSet_Gen.json + */ +async function virtualMachinesPowerOffMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginPowerOffAndWait(resourceGroupName, vmName); + console.log(result); +} + +virtualMachinesPowerOffMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesReapplySample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesReapplySample.js new file mode 100644 index 000000000000..e8508fb1da7e --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesReapplySample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to reapply a virtual machine's state. + * + * @summary The operation to reapply a virtual machine's state. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ReapplyVirtualMachine.json + */ +async function reapplyTheStateOfAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ResourceGroup"; + const vmName = "VMName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginReapplyAndWait(resourceGroupName, vmName); + console.log(result); +} + +reapplyTheStateOfAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesRedeploySample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesRedeploySample.js new file mode 100644 index 000000000000..83b6f9255b27 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesRedeploySample.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @summary Shuts down the virtual machine, moves it to a new node, and powers it back on. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Redeploy_MaximumSet_Gen.json + */ +async function virtualMachinesRedeployMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "a"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginRedeployAndWait(resourceGroupName, vmName); + console.log(result); +} + +virtualMachinesRedeployMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @summary Shuts down the virtual machine, moves it to a new node, and powers it back on. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Redeploy_MinimumSet_Gen.json + */ +async function virtualMachinesRedeployMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginRedeployAndWait(resourceGroupName, vmName); + console.log(result); +} + +virtualMachinesRedeployMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesReimageSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesReimageSample.js new file mode 100644 index 000000000000..f536545f5d85 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesReimageSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @summary Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ReimageVirtualMachine.json + */ +async function reimageAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVMName"; + const parameters = { tempDisk: true }; + const options = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginReimageAndWait( + resourceGroupName, + vmName, + options + ); + console.log(result); +} + +reimageAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesRestartSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesRestartSample.js new file mode 100644 index 000000000000..08dc7c470a9c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesRestartSample.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to restart a virtual machine. + * + * @summary The operation to restart a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Restart_MaximumSet_Gen.json + */ +async function virtualMachinesRestartMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginRestartAndWait(resourceGroupName, vmName); + console.log(result); +} + +virtualMachinesRestartMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to restart a virtual machine. + * + * @summary The operation to restart a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Restart_MinimumSet_Gen.json + */ +async function virtualMachinesRestartMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginRestartAndWait(resourceGroupName, vmName); + console.log(result); +} + +virtualMachinesRestartMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesRetrieveBootDiagnosticsDataSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesRetrieveBootDiagnosticsDataSample.js new file mode 100644 index 000000000000..646b55074ad2 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesRetrieveBootDiagnosticsDataSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + * + * @summary The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RetrieveBootDiagnosticsDataVirtualMachine.json + */ +async function retrieveBootDiagnosticsDataOfAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ResourceGroup"; + const vmName = "VMName"; + const sasUriExpirationTimeInMinutes = 60; + const options = { + sasUriExpirationTimeInMinutes, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.retrieveBootDiagnosticsData( + resourceGroupName, + vmName, + options + ); + console.log(result); +} + +retrieveBootDiagnosticsDataOfAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesRunCommandSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesRunCommandSample.js new file mode 100644 index 000000000000..c64f100c7083 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesRunCommandSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Run command on the VM. + * + * @summary Run command on the VM. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VirtualMachineRunCommand.json + */ +async function virtualMachineRunCommand() { + const subscriptionId = "24fb23e3-6ba3-41f0-9b6e-e41131d5d61e"; + const resourceGroupName = "crptestar98131"; + const vmName = "vm3036"; + const parameters = { commandId: "RunPowerShellScript" }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginRunCommandAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +virtualMachineRunCommand().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesSimulateEvictionSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesSimulateEvictionSample.js new file mode 100644 index 000000000000..78b5cbd96bbc --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesSimulateEvictionSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to simulate the eviction of spot virtual machine. + * + * @summary The operation to simulate the eviction of spot virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SimulateEvictionOfVM.json + */ +async function simulateEvictionAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ResourceGroup"; + const vmName = "VMName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.simulateEviction(resourceGroupName, vmName); + console.log(result); +} + +simulateEvictionAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesStartSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesStartSample.js new file mode 100644 index 000000000000..66c7e19e528a --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesStartSample.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to start a virtual machine. + * + * @summary The operation to start a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Start_MaximumSet_Gen.json + */ +async function virtualMachinesStartMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginStartAndWait(resourceGroupName, vmName); + console.log(result); +} + +virtualMachinesStartMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to start a virtual machine. + * + * @summary The operation to start a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Start_MinimumSet_Gen.json + */ +async function virtualMachinesStartMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginStartAndWait(resourceGroupName, vmName); + console.log(result); +} + +virtualMachinesStartMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesUpdateSample.js b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesUpdateSample.js new file mode 100644 index 000000000000..047d0a44bd5b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/javascript/virtualMachinesUpdateSample.js @@ -0,0 +1,130 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to update a virtual machine. + * + * @summary The operation to update a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateVMDetachDataDiskUsingToBeDetachedProperty.json + */ +async function updateAVMByDetachingDataDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_D2_v2" }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + storageProfile: { + dataDisks: [ + { createOption: "Empty", diskSizeGB: 1023, lun: 0, toBeDetached: true }, + { createOption: "Empty", diskSizeGB: 1023, lun: 1, toBeDetached: false }, + ], + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +updateAVMByDetachingDataDisk().catch(console.error); + +/** + * This sample demonstrates how to The operation to update a virtual machine. + * + * @summary The operation to update a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateVMForceDetachDataDisk.json + */ +async function updateAVMByForceDetachingDataDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters = { + hardwareProfile: { vmSize: "Standard_D2_v2" }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + }, + storageProfile: { + dataDisks: [ + { + createOption: "Empty", + detachOption: "ForceDetach", + diskSizeGB: 1023, + lun: 0, + toBeDetached: true, + }, + { createOption: "Empty", diskSizeGB: 1023, lun: 1, toBeDetached: false }, + ], + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest", + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +updateAVMByForceDetachingDataDisk().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/README.md b/sdk/compute/arm-compute/samples/v17/typescript/README.md index 7552c10527cf..92f6ffa07671 100644 --- a/sdk/compute/arm-compute/samples/v17/typescript/README.md +++ b/sdk/compute/arm-compute/samples/v17/typescript/README.md @@ -7,24 +7,74 @@ These sample programs show how to use the TypeScript client libraries for in som | [addSharingIdToTheSharingProfileOfAGallery.ts][addsharingidtothesharingprofileofagallery] | Update sharing profile of a gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/AddToSharingProfileInAGallery.json | | [approveAPrivateEndpointConnectionUnderADiskAccessResource.ts][approveaprivateendpointconnectionunderadiskaccessresource] | Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/ApprovePrivateEndpointConnection.json | | [assessPatchStateOfAVirtualMachine.ts][assesspatchstateofavirtualmachine] | Assess patches on the VM. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineAssessPatches.json | +| [availabilitySetsCreateOrUpdateSample.ts][availabilitysetscreateorupdatesample] | Create or update an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnAvailabilitySet.json | | [availabilitySetsDeleteMaximumSetGen.ts][availabilitysetsdeletemaximumsetgen] | Delete an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Delete_MaximumSet_Gen.json | | [availabilitySetsDeleteMinimumSetGen.ts][availabilitysetsdeleteminimumsetgen] | Delete an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Delete_MinimumSet_Gen.json | +| [availabilitySetsDeleteSample.ts][availabilitysetsdeletesample] | Delete an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Delete_MaximumSet_Gen.json | | [availabilitySetsGetMaximumSetGen.ts][availabilitysetsgetmaximumsetgen] | Retrieves information about an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Get_MaximumSet_Gen.json | | [availabilitySetsGetMinimumSetGen.ts][availabilitysetsgetminimumsetgen] | Retrieves information about an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Get_MinimumSet_Gen.json | +| [availabilitySetsGetSample.ts][availabilitysetsgetsample] | Retrieves information about an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Get_MaximumSet_Gen.json | | [availabilitySetsListAvailableSizesMaximumSetGen.ts][availabilitysetslistavailablesizesmaximumsetgen] | Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_ListAvailableSizes_MaximumSet_Gen.json | | [availabilitySetsListAvailableSizesMinimumSetGen.ts][availabilitysetslistavailablesizesminimumsetgen] | Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_ListAvailableSizes_MinimumSet_Gen.json | +| [availabilitySetsListAvailableSizesSample.ts][availabilitysetslistavailablesizessample] | Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_ListAvailableSizes_MaximumSet_Gen.json | +| [availabilitySetsListBySubscriptionSample.ts][availabilitysetslistbysubscriptionsample] | Lists all availability sets in a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListAvailabilitySetsInASubscription.json | | [availabilitySetsListMaximumSetGen.ts][availabilitysetslistmaximumsetgen] | Lists all availability sets in a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_List_MaximumSet_Gen.json | | [availabilitySetsListMinimumSetGen.ts][availabilitysetslistminimumsetgen] | Lists all availability sets in a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_List_MinimumSet_Gen.json | +| [availabilitySetsListSample.ts][availabilitysetslistsample] | Lists all availability sets in a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_List_MaximumSet_Gen.json | | [availabilitySetsUpdateMaximumSetGen.ts][availabilitysetsupdatemaximumsetgen] | Update an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Update_MaximumSet_Gen.json | | [availabilitySetsUpdateMinimumSetGen.ts][availabilitysetsupdateminimumsetgen] | Update an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Update_MinimumSet_Gen.json | +| [availabilitySetsUpdateSample.ts][availabilitysetsupdatesample] | Update an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Update_MaximumSet_Gen.json | +| [capacityReservationGroupsCreateOrUpdateSample.ts][capacityreservationgroupscreateorupdatesample] | The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags may be modified. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateACapacityReservationGroup.json | | [capacityReservationGroupsDeleteMaximumSetGen.ts][capacityreservationgroupsdeletemaximumsetgen] | The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Delete_MaximumSet_Gen.json | | [capacityReservationGroupsDeleteMinimumSetGen.ts][capacityreservationgroupsdeleteminimumsetgen] | The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Delete_MinimumSet_Gen.json | +| [capacityReservationGroupsDeleteSample.ts][capacityreservationgroupsdeletesample] | The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Delete_MaximumSet_Gen.json | +| [capacityReservationGroupsGetSample.ts][capacityreservationgroupsgetsample] | The operation that retrieves information about a capacity reservation group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetACapacityReservationGroup.json | +| [capacityReservationGroupsListByResourceGroupSample.ts][capacityreservationgroupslistbyresourcegroupsample] | Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListCapacityReservationGroupsInResourceGroup.json | +| [capacityReservationGroupsListBySubscriptionSample.ts][capacityreservationgroupslistbysubscriptionsample] | Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListCapacityReservationGroupsInSubscription.json | | [capacityReservationGroupsUpdateMaximumSetGen.ts][capacityreservationgroupsupdatemaximumsetgen] | The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may be modified. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Update_MaximumSet_Gen.json | | [capacityReservationGroupsUpdateMinimumSetGen.ts][capacityreservationgroupsupdateminimumsetgen] | The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may be modified. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Update_MinimumSet_Gen.json | +| [capacityReservationGroupsUpdateSample.ts][capacityreservationgroupsupdatesample] | The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may be modified. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Update_MaximumSet_Gen.json | +| [capacityReservationsCreateOrUpdateSample.ts][capacityreservationscreateorupdatesample] | The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateACapacityReservation.json | | [capacityReservationsDeleteMaximumSetGen.ts][capacityreservationsdeletemaximumsetgen] | The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Delete_MaximumSet_Gen.json | | [capacityReservationsDeleteMinimumSetGen.ts][capacityreservationsdeleteminimumsetgen] | The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Delete_MinimumSet_Gen.json | +| [capacityReservationsDeleteSample.ts][capacityreservationsdeletesample] | The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Delete_MaximumSet_Gen.json | +| [capacityReservationsGetSample.ts][capacityreservationsgetsample] | The operation that retrieves information about the capacity reservation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetACapacityReservation.json | +| [capacityReservationsListByCapacityReservationGroupSample.ts][capacityreservationslistbycapacityreservationgroupsample] | Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListCapacityReservationsInReservationGroup.json | | [capacityReservationsUpdateMaximumSetGen.ts][capacityreservationsupdatemaximumsetgen] | The operation to update a capacity reservation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Update_MaximumSet_Gen.json | | [capacityReservationsUpdateMinimumSetGen.ts][capacityreservationsupdateminimumsetgen] | The operation to update a capacity reservation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Update_MinimumSet_Gen.json | +| [capacityReservationsUpdateSample.ts][capacityreservationsupdatesample] | The operation to update a capacity reservation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Update_MaximumSet_Gen.json | +| [cloudServiceOperatingSystemsGetOSFamilySample.ts][cloudserviceoperatingsystemsgetosfamilysample] | Gets properties of a guest operating system family that can be specified in the XML service configuration (.cscfg) for a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceOSFamily.json | +| [cloudServiceOperatingSystemsGetOSVersionSample.ts][cloudserviceoperatingsystemsgetosversionsample] | Gets properties of a guest operating system version that can be specified in the XML service configuration (.cscfg) for a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceOSVersion.json | +| [cloudServiceOperatingSystemsListOSFamiliesSample.ts][cloudserviceoperatingsystemslistosfamiliessample] | Gets a list of all guest operating system families available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this till nextLink is null to fetch all the OS Families. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceOSFamilies.json | +| [cloudServiceOperatingSystemsListOSVersionsSample.ts][cloudserviceoperatingsystemslistosversionssample] | Gets a list of all guest operating system versions available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this till nextLink is null to fetch all the OS versions. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceOSVersions.json | +| [cloudServiceRoleInstancesDeleteSample.ts][cloudserviceroleinstancesdeletesample] | Deletes a role instance from a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/DeleteCloudServiceRoleInstance.json | +| [cloudServiceRoleInstancesGetInstanceViewSample.ts][cloudserviceroleinstancesgetinstanceviewsample] | Retrieves information about the run-time state of a role instance in a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetInstanceViewOfCloudServiceRoleInstance.json | +| [cloudServiceRoleInstancesGetSample.ts][cloudserviceroleinstancesgetsample] | Gets a role instance from a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceRoleInstance.json | +| [cloudServiceRoleInstancesListSample.ts][cloudserviceroleinstanceslistsample] | Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next page of role instances. Do this till nextLink is null to fetch all the role instances. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceRolesInstances.json | +| [cloudServiceRoleInstancesRebuildSample.ts][cloudserviceroleinstancesrebuildsample] | The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instance. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RebuildCloudServiceRoleInstance.json | +| [cloudServiceRoleInstancesReimageSample.ts][cloudserviceroleinstancesreimagesample] | The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ReimageCloudServiceRoleInstance.json | +| [cloudServiceRoleInstancesRestartSample.ts][cloudserviceroleinstancesrestartsample] | The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RestartCloudServiceRoleInstance.json | +| [cloudServiceRolesGetSample.ts][cloudservicerolesgetsample] | Gets a role from a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceRole.json | +| [cloudServiceRolesListSample.ts][cloudserviceroleslistsample] | Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. Do this till nextLink is null to fetch all the roles. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceRoles.json | +| [cloudServicesCreateOrUpdateSample.ts][cloudservicescreateorupdatesample] | Create or update a cloud service. Please note some properties can be set only during cloud service creation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/CreateCloudServiceWithMultiRole.json | +| [cloudServicesDeleteInstancesSample.ts][cloudservicesdeleteinstancessample] | Deletes role instances in a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/DeleteCloudServiceRoleInstances.json | +| [cloudServicesDeleteSample.ts][cloudservicesdeletesample] | Deletes a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/DeleteCloudService.json | +| [cloudServicesGetInstanceViewSample.ts][cloudservicesgetinstanceviewsample] | Gets the status of a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceInstanceViewWithMultiRole.json | +| [cloudServicesGetSample.ts][cloudservicesgetsample] | Display information about a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceWithMultiRoleAndRDP.json | +| [cloudServicesListAllSample.ts][cloudserviceslistallsample] | Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServicesInSubscription.json | +| [cloudServicesListSample.ts][cloudserviceslistsample] | Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServicesInResourceGroup.json | +| [cloudServicesPowerOffSample.ts][cloudservicespoweroffsample] | Power off the cloud service. Note that resources are still attached and you are getting charged for the resources. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/PowerOffCloudService.json | +| [cloudServicesRebuildSample.ts][cloudservicesrebuildsample] | Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instances. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RebuildCloudServiceRoleInstances.json | +| [cloudServicesReimageSample.ts][cloudservicesreimagesample] | Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ReimageCloudServiceRoleInstances.json | +| [cloudServicesRestartSample.ts][cloudservicesrestartsample] | Restarts one or more role instances in a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RestartCloudServiceRoleInstances.json | +| [cloudServicesStartSample.ts][cloudservicesstartsample] | Starts the cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/StartCloudService.json | +| [cloudServicesUpdateDomainGetUpdateDomainSample.ts][cloudservicesupdatedomaingetupdatedomainsample] | Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page of update domains. Do this till nextLink is null to fetch all the update domains. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceUpdateDomain.json | +| [cloudServicesUpdateDomainListUpdateDomainsSample.ts][cloudservicesupdatedomainlistupdatedomainssample] | Gets a list of all update domains in a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceUpdateDomains.json | +| [cloudServicesUpdateDomainWalkUpdateDomainSample.ts][cloudservicesupdatedomainwalkupdatedomainsample] | Updates the role instances in the specified update domain. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/UpdateCloudServiceUpdateDomain.json | +| [cloudServicesUpdateSample.ts][cloudservicesupdatesample] | Update a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/UpdateCloudServiceToIncludeTags.json | +| [communityGalleriesGetSample.ts][communitygalleriesgetsample] | Get a community gallery by gallery public name. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/communityGallery/GetACommunityGallery.json | +| [communityGalleryImageVersionsGetSample.ts][communitygalleryimageversionsgetsample] | Get a community gallery image version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/communityGallery/GetACommunityGalleryImageVersion.json | +| [communityGalleryImagesGetSample.ts][communitygalleryimagesgetsample] | Get a community gallery image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/communityGallery/GetACommunityGalleryImage.json | | [copyARestorePointToADifferentRegion.ts][copyarestorepointtoadifferentregion] | The operation to create the restore point. Updating properties of an existing restore point is not allowed x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CopyRestorePointBetweenRegions.json | | [createACommunityGallery.ts][createacommunitygallery] | Create or update a Shared Image Gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateACommunityGallery.json | | [createAConfidentialVMSupportedDiskEncryptedWithCustomerManagedKey.ts][createaconfidentialvmsupporteddiskencryptedwithcustomermanagedkey] | Creates or updates a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/CreateAConfidentialVMDiskEncryptedWithCMK.json | @@ -167,20 +217,32 @@ These sample programs show how to use the TypeScript client libraries for in som | [createOrUpdateAVMWithCapacityReservation.ts][createorupdateavmwithcapacityreservation] | The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAVmWithCapacityReservation.json | | [createVirtualMachineScaleSetVMExtension.ts][createvirtualmachinescalesetvmextension] | The operation to create or update the VMSS VM extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateVirtualMachineScaleSetVMExtensions.json | | [createVirtualMachineScaleSetVMRunCommand.ts][createvirtualmachinescalesetvmruncommand] | The operation to create or update the VMSS VM run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/CreateOrUpdateVirtualMachineScaleSetVMRunCommands.json | +| [dedicatedHostGroupsCreateOrUpdateSample.ts][dedicatedhostgroupscreateorupdatesample] | Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateADedicatedHostGroup.json | | [dedicatedHostGroupsDeleteMaximumSetGen.ts][dedicatedhostgroupsdeletemaximumsetgen] | Delete a dedicated host group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Delete_MaximumSet_Gen.json | | [dedicatedHostGroupsDeleteMinimumSetGen.ts][dedicatedhostgroupsdeleteminimumsetgen] | Delete a dedicated host group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Delete_MinimumSet_Gen.json | +| [dedicatedHostGroupsDeleteSample.ts][dedicatedhostgroupsdeletesample] | Delete a dedicated host group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Delete_MaximumSet_Gen.json | +| [dedicatedHostGroupsGetSample.ts][dedicatedhostgroupsgetsample] | Retrieves information about a dedicated host group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetADedicatedHostGroup.json | | [dedicatedHostGroupsListByResourceGroupMaximumSetGen.ts][dedicatedhostgroupslistbyresourcegroupmaximumsetgen] | Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListByResourceGroup_MaximumSet_Gen.json | | [dedicatedHostGroupsListByResourceGroupMinimumSetGen.ts][dedicatedhostgroupslistbyresourcegroupminimumsetgen] | Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListByResourceGroup_MinimumSet_Gen.json | +| [dedicatedHostGroupsListByResourceGroupSample.ts][dedicatedhostgroupslistbyresourcegroupsample] | Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListByResourceGroup_MaximumSet_Gen.json | | [dedicatedHostGroupsListBySubscriptionMaximumSetGen.ts][dedicatedhostgroupslistbysubscriptionmaximumsetgen] | Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListBySubscription_MaximumSet_Gen.json | | [dedicatedHostGroupsListBySubscriptionMinimumSetGen.ts][dedicatedhostgroupslistbysubscriptionminimumsetgen] | Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListBySubscription_MinimumSet_Gen.json | +| [dedicatedHostGroupsListBySubscriptionSample.ts][dedicatedhostgroupslistbysubscriptionsample] | Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListBySubscription_MaximumSet_Gen.json | | [dedicatedHostGroupsUpdateMaximumSetGen.ts][dedicatedhostgroupsupdatemaximumsetgen] | Update an dedicated host group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Update_MaximumSet_Gen.json | | [dedicatedHostGroupsUpdateMinimumSetGen.ts][dedicatedhostgroupsupdateminimumsetgen] | Update an dedicated host group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Update_MinimumSet_Gen.json | +| [dedicatedHostGroupsUpdateSample.ts][dedicatedhostgroupsupdatesample] | Update an dedicated host group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Update_MaximumSet_Gen.json | +| [dedicatedHostsCreateOrUpdateSample.ts][dedicatedhostscreateorupdatesample] | Create or update a dedicated host . x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateADedicatedHost.json | | [dedicatedHostsDeleteMaximumSetGen.ts][dedicatedhostsdeletemaximumsetgen] | Delete a dedicated host. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Delete_MaximumSet_Gen.json | | [dedicatedHostsDeleteMinimumSetGen.ts][dedicatedhostsdeleteminimumsetgen] | Delete a dedicated host. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Delete_MinimumSet_Gen.json | +| [dedicatedHostsDeleteSample.ts][dedicatedhostsdeletesample] | Delete a dedicated host. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Delete_MaximumSet_Gen.json | +| [dedicatedHostsGetSample.ts][dedicatedhostsgetsample] | Retrieves information about a dedicated host. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetADedicatedHost.json | | [dedicatedHostsListByHostGroupMaximumSetGen.ts][dedicatedhostslistbyhostgroupmaximumsetgen] | Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_ListByHostGroup_MaximumSet_Gen.json | | [dedicatedHostsListByHostGroupMinimumSetGen.ts][dedicatedhostslistbyhostgroupminimumsetgen] | Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_ListByHostGroup_MinimumSet_Gen.json | +| [dedicatedHostsListByHostGroupSample.ts][dedicatedhostslistbyhostgroupsample] | Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_ListByHostGroup_MaximumSet_Gen.json | +| [dedicatedHostsRestartSample.ts][dedicatedhostsrestartsample] | Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/en-us/azure/service-health/resource-health-overview for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostRestart.json | | [dedicatedHostsUpdateMaximumSetGen.ts][dedicatedhostsupdatemaximumsetgen] | Update an dedicated host . x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Update_MaximumSet_Gen.json | | [dedicatedHostsUpdateMinimumSetGen.ts][dedicatedhostsupdateminimumsetgen] | Update an dedicated host . x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Update_MinimumSet_Gen.json | +| [dedicatedHostsUpdateSample.ts][dedicatedhostsupdatesample] | Update an dedicated host . x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Update_MaximumSet_Gen.json | | [deleteADiskAccessResource.ts][deleteadiskaccessresource] | Deletes a disk access resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/DeleteADiskAccess.json | | [deleteADiskEncryptionSet.ts][deleteadiskencryptionset] | Deletes a disk encryption set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/DeleteADiskEncryptionSet.json | | [deleteAGallery.ts][deleteagallery] | Delete a Shared Image Gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGallery.json | @@ -197,11 +259,68 @@ These sample programs show how to use the TypeScript client libraries for in som | [deleteCloudServiceRoleInstances.ts][deletecloudserviceroleinstances] | Deletes role instances in a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/DeleteCloudServiceRoleInstances.json | | [deleteVirtualMachineScaleSetVMExtension.ts][deletevirtualmachinescalesetvmextension] | The operation to delete the VMSS VM extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DeleteVirtualMachineScaleSetVMExtensions.json | | [deleteVirtualMachineScaleSetVMRunCommand.ts][deletevirtualmachinescalesetvmruncommand] | The operation to delete the VMSS VM run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/DeleteVirtualMachineScaleSetVMRunCommands.json | +| [diskAccessesCreateOrUpdateSample.ts][diskaccessescreateorupdatesample] | Creates or updates a disk access resource x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateADiskAccess.json | +| [diskAccessesDeleteAPrivateEndpointConnectionSample.ts][diskaccessesdeleteaprivateendpointconnectionsample] | Deletes a private endpoint connection under a disk access resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteAPrivateEndpointConnection.json | +| [diskAccessesDeleteSample.ts][diskaccessesdeletesample] | Deletes a disk access resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteADiskAccess.json | +| [diskAccessesGetAPrivateEndpointConnectionSample.ts][diskaccessesgetaprivateendpointconnectionsample] | Gets information about a private endpoint connection under a disk access resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutAPrivateEndpointConnection.json | +| [diskAccessesGetPrivateLinkResourcesSample.ts][diskaccessesgetprivatelinkresourcessample] | Gets the private link resources possible under disk access resource x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetDiskAccessPrivateLinkResources.json | +| [diskAccessesGetSample.ts][diskaccessesgetsample] | Gets information about a disk access resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutADiskAccessWithPrivateEndpoints.json | +| [diskAccessesListByResourceGroupSample.ts][diskaccesseslistbyresourcegroupsample] | Lists all the disk access resources under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskAccessesInAResourceGroup.json | +| [diskAccessesListPrivateEndpointConnectionsSample.ts][diskaccesseslistprivateendpointconnectionssample] | List information about private endpoint connections under a disk access resource x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListPrivateEndpointConnectionsInADiskAccess.json | +| [diskAccessesListSample.ts][diskaccesseslistsample] | Lists all the disk access resources under a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskAccessesInASubscription.json | +| [diskAccessesUpdateAPrivateEndpointConnectionSample.ts][diskaccessesupdateaprivateendpointconnectionsample] | Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ApprovePrivateEndpointConnection.json | +| [diskAccessesUpdateSample.ts][diskaccessesupdatesample] | Updates (patches) a disk access resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateADiskAccess.json | +| [diskEncryptionSetsCreateOrUpdateSample.ts][diskencryptionsetscreateorupdatesample] | Creates or updates a disk encryption set x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateADiskEncryptionSetWithKeyVaultFromADifferentSubscription.json | +| [diskEncryptionSetsDeleteSample.ts][diskencryptionsetsdeletesample] | Deletes a disk encryption set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteADiskEncryptionSet.json | +| [diskEncryptionSetsGetSample.ts][diskencryptionsetsgetsample] | Gets information about a disk encryption set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutADiskEncryptionSetWithAutoKeyRotationError.json | +| [diskEncryptionSetsListAssociatedResourcesSample.ts][diskencryptionsetslistassociatedresourcessample] | Lists all resources that are encrypted with this disk encryption set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskEncryptionSetAssociatedResources.json | +| [diskEncryptionSetsListByResourceGroupSample.ts][diskencryptionsetslistbyresourcegroupsample] | Lists all the disk encryption sets under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskEncryptionSetsInAResourceGroup.json | +| [diskEncryptionSetsListSample.ts][diskencryptionsetslistsample] | Lists all the disk encryption sets under a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskEncryptionSetsInASubscription.json | +| [diskEncryptionSetsUpdateSample.ts][diskencryptionsetsupdatesample] | Updates (patches) a disk encryption set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateADiskEncryptionSetWithRotationToLatestKeyVersionEnabled.json | +| [diskRestorePointGetSample.ts][diskrestorepointgetsample] | Get disk restorePoint resource x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetDiskRestorePointResources.json | +| [diskRestorePointGrantAccessSample.ts][diskrestorepointgrantaccesssample] | Grants access to a diskRestorePoint. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/BeginGetAccessDiskRestorePoint.json | +| [diskRestorePointListByRestorePointSample.ts][diskrestorepointlistbyrestorepointsample] | Lists diskRestorePoints under a vmRestorePoint. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskRestorePointsInVmRestorePoint.json | +| [diskRestorePointRevokeAccessSample.ts][diskrestorepointrevokeaccesssample] | Revokes access to a diskRestorePoint. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/EndGetAccessDiskRestorePoint.json | +| [disksCreateOrUpdateSample.ts][diskscreateorupdatesample] | Creates or updates a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAConfidentialVMDiskEncryptedWithCMK.json | +| [disksDeleteSample.ts][disksdeletesample] | Deletes a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteAManagedDisk.json | +| [disksGetSample.ts][disksgetsample] | Gets information about a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutAManagedDisk.json | +| [disksGrantAccessSample.ts][disksgrantaccesssample] | Grants access to a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/BeginGetAccessManagedDisk.json | +| [disksListByResourceGroupSample.ts][diskslistbyresourcegroupsample] | Lists all the disks under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListManagedDisksInAResourceGroup.json | +| [disksListSample.ts][diskslistsample] | Lists all the disks under a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListManagedDisksInASubscription.json | +| [disksRevokeAccessSample.ts][disksrevokeaccesssample] | Revokes access to a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/EndGetAccessManagedDisk.json | +| [disksUpdateSample.ts][disksupdatesample] | Updates (patches) a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateOrUpdateABurstingEnabledManagedDisk.json | | [exportLogsWhichContainAllApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriodBrokenDownByIntervals.ts][exportlogswhichcontainallapirequestsmadetocomputeresourceproviderwithinthegiventimeperiodbrokendownbyintervals] | Export logs that show Api requests made by this subscription in the given time window to show throttling activities. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/LogAnalyticsRequestRateByInterval.json | | [exportLogsWhichContainAllThrottledApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriod.ts][exportlogswhichcontainallthrottledapirequestsmadetocomputeresourceproviderwithinthegiventimeperiod] | Export logs that show total throttled Api requests for this subscription in the given time window. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/LogAnalyticsThrottledRequests.json | | [forceDeleteAVM.ts][forcedeleteavm] | The operation to delete a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ForceDeleteVirtualMachine.json | | [forceDeleteAVMScaleSet.ts][forcedeleteavmscaleset] | Deletes a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ForceDeleteVirtualMachineScaleSets.json | | [forceDeleteAVirtualMachineFromAVMScaleSet.ts][forcedeleteavirtualmachinefromavmscaleset] | Deletes a virtual machine from a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ForceDeleteVirtualMachineScaleSetVM.json | +| [galleriesCreateOrUpdateSample.ts][galleriescreateorupdatesample] | Create or update a Shared Image Gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateACommunityGallery.json | +| [galleriesDeleteSample.ts][galleriesdeletesample] | Delete a Shared Image Gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGallery.json | +| [galleriesGetSample.ts][galleriesgetsample] | Retrieves information about a Shared Image Gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetACommunityGallery.json | +| [galleriesListByResourceGroupSample.ts][gallerieslistbyresourcegroupsample] | List galleries under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleriesInAResourceGroup.json | +| [galleriesListSample.ts][gallerieslistsample] | List galleries under a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleriesInASubscription.json | +| [galleriesUpdateSample.ts][galleriesupdatesample] | Update a Shared Image Gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGallery.json | +| [galleryApplicationVersionsCreateOrUpdateSample.ts][galleryapplicationversionscreateorupdatesample] | Create or update a gallery Application Version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryApplicationVersion.json | +| [galleryApplicationVersionsDeleteSample.ts][galleryapplicationversionsdeletesample] | Delete a gallery Application Version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGalleryApplicationVersion.json | +| [galleryApplicationVersionsGetSample.ts][galleryapplicationversionsgetsample] | Retrieves information about a gallery Application Version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryApplicationVersionWithReplicationStatus.json | +| [galleryApplicationVersionsListByGalleryApplicationSample.ts][galleryapplicationversionslistbygalleryapplicationsample] | List gallery Application Versions in a gallery Application Definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleryApplicationVersionsInAGalleryApplication.json | +| [galleryApplicationVersionsUpdateSample.ts][galleryapplicationversionsupdatesample] | Update a gallery Application Version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGalleryApplicationVersion.json | +| [galleryApplicationsCreateOrUpdateSample.ts][galleryapplicationscreateorupdatesample] | Create or update a gallery Application Definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryApplication.json | +| [galleryApplicationsDeleteSample.ts][galleryapplicationsdeletesample] | Delete a gallery Application. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGalleryApplication.json | +| [galleryApplicationsGetSample.ts][galleryapplicationsgetsample] | Retrieves information about a gallery Application Definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryApplication.json | +| [galleryApplicationsListByGallerySample.ts][galleryapplicationslistbygallerysample] | List gallery Application Definitions in a gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleryApplicationsInAGallery.json | +| [galleryApplicationsUpdateSample.ts][galleryapplicationsupdatesample] | Update a gallery Application Definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGalleryApplication.json | +| [galleryImageVersionsCreateOrUpdateSample.ts][galleryimageversionscreateorupdatesample] | Create or update a gallery image version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithVMAsSource.json | +| [galleryImageVersionsDeleteSample.ts][galleryimageversionsdeletesample] | Delete a gallery image version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGalleryImageVersion.json | +| [galleryImageVersionsGetSample.ts][galleryimageversionsgetsample] | Retrieves information about a gallery image version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryImageVersionWithReplicationStatus.json | +| [galleryImageVersionsListByGalleryImageSample.ts][galleryimageversionslistbygalleryimagesample] | List gallery image versions in a gallery image definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleryImageVersionsInAGalleryImage.json | +| [galleryImageVersionsUpdateSample.ts][galleryimageversionsupdatesample] | Update a gallery image version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGalleryImageVersion.json | +| [galleryImagesCreateOrUpdateSample.ts][galleryimagescreateorupdatesample] | Create or update a gallery image definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImage.json | +| [galleryImagesDeleteSample.ts][galleryimagesdeletesample] | Delete a gallery image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGalleryImage.json | +| [galleryImagesGetSample.ts][galleryimagesgetsample] | Retrieves information about a gallery image definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryImage.json | +| [galleryImagesListByGallerySample.ts][galleryimageslistbygallerysample] | List gallery image definitions in a gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleryImagesInAGallery.json | +| [galleryImagesUpdateSample.ts][galleryimagesupdatesample] | Update a gallery image definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGalleryImage.json | +| [gallerySharingProfileUpdateSample.ts][gallerysharingprofileupdatesample] | Update sharing profile of a gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/AddToSharingProfileInAGallery.json | | [generalizeAVirtualMachine.ts][generalizeavirtualmachine] | Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation.
For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource).
For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GeneralizeVirtualMachine.json | | [generateAnSshKeyPair.ts][generateansshkeypair] | Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GenerateSshKeyPair.json | | [getACapacityReservation.ts][getacapacityreservation] | The operation that retrieves information about the capacity reservation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetACapacityReservation.json | @@ -262,8 +381,14 @@ These sample programs show how to use the TypeScript client libraries for in som | [getsTheListOfRestorePointCollectionsInAResourceGroup.ts][getsthelistofrestorepointcollectionsinaresourcegroup] | Gets the list of restore point collections in a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointCollectionsInAResourceGroup.json | | [getsTheListOfRestorePointCollectionsInASubscription.ts][getsthelistofrestorepointcollectionsinasubscription] | Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointCollectionsInASubscription.json | | [grantsAccessToADiskRestorePoint.ts][grantsaccesstoadiskrestorepoint] | Grants access to a diskRestorePoint. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/BeginGetAccessDiskRestorePoint.json | +| [imagesCreateOrUpdateSample.ts][imagescreateorupdatesample] | Create or update an image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromABlobWithDiskEncryptionSet.json | | [imagesDeleteMaximumSetGen.ts][imagesdeletemaximumsetgen] | Deletes an Image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Images_Delete_MaximumSet_Gen.json | | [imagesDeleteMinimumSetGen.ts][imagesdeleteminimumsetgen] | Deletes an Image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Images_Delete_MinimumSet_Gen.json | +| [imagesDeleteSample.ts][imagesdeletesample] | Deletes an Image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Images_Delete_MaximumSet_Gen.json | +| [imagesGetSample.ts][imagesgetsample] | Gets an image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetInformationAboutAnImage.json | +| [imagesListByResourceGroupSample.ts][imageslistbyresourcegroupsample] | Gets the list of images under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListImagesInAResourceGroup.json | +| [imagesListSample.ts][imageslistsample] | Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListImagesInASubscription.json | +| [imagesUpdateSample.ts][imagesupdatesample] | Update an image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateImage.json | | [installPatchStateOfAVirtualMachine.ts][installpatchstateofavirtualmachine] | Installs patches on the VM. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineInstallPatches.json | | [listAllDiskAccessResourcesInAResourceGroup.ts][listalldiskaccessresourcesinaresourcegroup] | Lists all the disk access resources under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/ListDiskAccessesInAResourceGroup.json | | [listAllDiskAccessResourcesInASubscription.ts][listalldiskaccessresourcesinasubscription] | Lists all the disk access resources under a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/ListDiskAccessesInASubscription.json | @@ -303,8 +428,17 @@ These sample programs show how to use the TypeScript client libraries for in som | [listsAllAvailableVirtualMachineSizesToWhichTheSpecifiedVirtualMachineCanBeResized.ts][listsallavailablevirtualmachinesizestowhichthespecifiedvirtualmachinecanberesized] | Lists all available virtual machine sizes to which the specified virtual machine can be resized. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListAvailableVmSizes_VirtualMachines.json | | [listsAllTheVMScaleSetsUnderTheSpecifiedSubscriptionForTheSpecifiedLocation.ts][listsallthevmscalesetsunderthespecifiedsubscriptionforthespecifiedlocation] | Gets all the VM scale sets under the specified subscription for the specified location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListVirtualMachineScaleSetsInASubscriptionByLocation.json | | [listsAllTheVirtualMachinesUnderTheSpecifiedSubscriptionForTheSpecifiedLocation.ts][listsallthevirtualmachinesunderthespecifiedsubscriptionforthespecifiedlocation] | Gets all the virtual machines under the specified subscription for the specified location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListVirtualMachinesInASubscriptionByLocation.json | +| [logAnalyticsExportRequestRateByIntervalSample.ts][loganalyticsexportrequestratebyintervalsample] | Export logs that show Api requests made by this subscription in the given time window to show throttling activities. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/LogAnalyticsRequestRateByInterval.json | +| [logAnalyticsExportThrottledRequestsSample.ts][loganalyticsexportthrottledrequestssample] | Export logs that show total throttled Api requests for this subscription in the given time window. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/LogAnalyticsThrottledRequests.json | | [operationsListMaximumSetGen.ts][operationslistmaximumsetgen] | Gets a list of compute operations. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Operations_List_MaximumSet_Gen.json | | [operationsListMinimumSetGen.ts][operationslistminimumsetgen] | Gets a list of compute operations. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Operations_List_MinimumSet_Gen.json | +| [operationsListSample.ts][operationslistsample] | Gets a list of compute operations. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Operations_List_MaximumSet_Gen.json | +| [proximityPlacementGroupsCreateOrUpdateSample.ts][proximityplacementgroupscreateorupdatesample] | Create or update a proximity placement group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAProximityPlacementGroup.json | +| [proximityPlacementGroupsDeleteSample.ts][proximityplacementgroupsdeletesample] | Delete a proximity placement group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DeleteAProximityPlacementGroup.json | +| [proximityPlacementGroupsGetSample.ts][proximityplacementgroupsgetsample] | Retrieves information about a proximity placement group . x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetAProximityPlacementGroup.json | +| [proximityPlacementGroupsListByResourceGroupSample.ts][proximityplacementgroupslistbyresourcegroupsample] | Lists all proximity placement groups in a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListProximityPlacementGroupsInAResourceGroup.json | +| [proximityPlacementGroupsListBySubscriptionSample.ts][proximityplacementgroupslistbysubscriptionsample] | Lists all proximity placement groups in a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListProximityPlacementGroupsInASubscription.json | +| [proximityPlacementGroupsUpdateSample.ts][proximityplacementgroupsupdatesample] | Update a proximity placement group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/PatchAProximityPlacementGroup.json | | [reapplyTheStateOfAVirtualMachine.ts][reapplythestateofavirtualmachine] | The operation to reapply a virtual machine's state. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ReapplyVirtualMachine.json | | [rebuildCloudServiceRoleInstance.ts][rebuildcloudserviceroleinstance] | The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instance. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RebuildCloudServiceRoleInstance.json | | [rebuildCloudServiceRoleInstances.ts][rebuildcloudserviceroleinstances] | Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instances. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RebuildCloudServiceRoleInstances.json | @@ -312,29 +446,60 @@ These sample programs show how to use the TypeScript client libraries for in som | [reimageCloudServiceRoleInstance.ts][reimagecloudserviceroleinstance] | The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ReimageCloudServiceRoleInstance.json | | [reimageCloudServiceRoleInstances.ts][reimagecloudserviceroleinstances] | Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ReimageCloudServiceRoleInstances.json | | [resetSharingProfileOfAGallery.ts][resetsharingprofileofagallery] | Update sharing profile of a gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ResetSharingProfileInAGallery.json | +| [resourceSkusListSample.ts][resourceskuslistsample] | Gets the list of Microsoft.Compute SKUs available for your Subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/skus/ListAvailableResourceSkus.json | | [restartCloudServiceRoleInstance.ts][restartcloudserviceroleinstance] | The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RestartCloudServiceRoleInstance.json | | [restartCloudServiceRoleInstances.ts][restartcloudserviceroleinstances] | Restarts one or more role instances in a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RestartCloudServiceRoleInstances.json | | [restartDedicatedHost.ts][restartdedicatedhost] | Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostRestart.json | +| [restorePointCollectionsCreateOrUpdateSample.ts][restorepointcollectionscreateorupdatesample] | The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateARestorePointCollectionForCrossRegionCopy.json | | [restorePointCollectionsDeleteMaximumSetGen.ts][restorepointcollectionsdeletemaximumsetgen] | The operation to delete the restore point collection. This operation will also delete all the contained restore points. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Delete_MaximumSet_Gen.json | | [restorePointCollectionsDeleteMinimumSetGen.ts][restorepointcollectionsdeleteminimumsetgen] | The operation to delete the restore point collection. This operation will also delete all the contained restore points. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Delete_MinimumSet_Gen.json | +| [restorePointCollectionsDeleteSample.ts][restorepointcollectionsdeletesample] | The operation to delete the restore point collection. This operation will also delete all the contained restore points. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Delete_MaximumSet_Gen.json | +| [restorePointCollectionsGetSample.ts][restorepointcollectionsgetsample] | The operation to get the restore point collection. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointCollection.json | +| [restorePointCollectionsListAllSample.ts][restorepointcollectionslistallsample] | Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointCollectionsInASubscription.json | +| [restorePointCollectionsListSample.ts][restorepointcollectionslistsample] | Gets the list of restore point collections in a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointCollectionsInAResourceGroup.json | | [restorePointCollectionsUpdateMaximumSetGen.ts][restorepointcollectionsupdatemaximumsetgen] | The operation to update the restore point collection. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Update_MaximumSet_Gen.json | | [restorePointCollectionsUpdateMinimumSetGen.ts][restorepointcollectionsupdateminimumsetgen] | The operation to update the restore point collection. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Update_MinimumSet_Gen.json | +| [restorePointCollectionsUpdateSample.ts][restorepointcollectionsupdatesample] | The operation to update the restore point collection. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Update_MaximumSet_Gen.json | +| [restorePointsCreateSample.ts][restorepointscreatesample] | The operation to create the restore point. Updating properties of an existing restore point is not allowed x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CopyRestorePointBetweenRegions.json | | [restorePointsDeleteMaximumSetGen.ts][restorepointsdeletemaximumsetgen] | The operation to delete the restore point. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePoints_Delete_MaximumSet_Gen.json | | [restorePointsDeleteMinimumSetGen.ts][restorepointsdeleteminimumsetgen] | The operation to delete the restore point. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePoints_Delete_MinimumSet_Gen.json | +| [restorePointsDeleteSample.ts][restorepointsdeletesample] | The operation to delete the restore point. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePoints_Delete_MaximumSet_Gen.json | +| [restorePointsGetSample.ts][restorepointsgetsample] | The operation to get the restore point. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePoint.json | | [retrieveBootDiagnosticsDataOfAVirtualMachine.ts][retrievebootdiagnosticsdataofavirtualmachine] | The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RetrieveBootDiagnosticsDataVMScaleSetVM.json | | [revokeAccessToAManagedDisk.ts][revokeaccesstoamanageddisk] | Revokes access to a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/EndGetAccessManagedDisk.json | | [revokeAccessToASnapshot.ts][revokeaccesstoasnapshot] | Revokes access to a snapshot. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/EndGetAccessSnapshot.json | | [revokesAccessToADiskRestorePoint.ts][revokesaccesstoadiskrestorepoint] | Revokes access to a diskRestorePoint. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/EndGetAccessDiskRestorePoint.json | | [shareAGalleryToCommunity.ts][shareagallerytocommunity] | Update sharing profile of a gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/EnableACommunityGallery.json | +| [sharedGalleriesGetSample.ts][sharedgalleriesgetsample] | Get a shared gallery by subscription id or tenant id. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/GetASharedGallery.json | +| [sharedGalleriesListSample.ts][sharedgallerieslistsample] | List shared galleries by subscription id or tenant id. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/ListSharedGalleries.json | +| [sharedGalleryImageVersionsGetSample.ts][sharedgalleryimageversionsgetsample] | Get a shared gallery image version by subscription id or tenant id. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/GetASharedGalleryImageVersion.json | +| [sharedGalleryImageVersionsListSample.ts][sharedgalleryimageversionslistsample] | List shared gallery image versions by subscription id or tenant id. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/ListSharedGalleryImageVersions.json | +| [sharedGalleryImagesGetSample.ts][sharedgalleryimagesgetsample] | Get a shared gallery image by subscription id or tenant id. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/GetASharedGalleryImage.json | +| [sharedGalleryImagesListSample.ts][sharedgalleryimageslistsample] | List shared gallery images by subscription id or tenant id. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/ListSharedGalleryImages.json | | [simulateEvictionAVirtualMachine.ts][simulateevictionavirtualmachine] | The operation to simulate the eviction of spot virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SimulateEvictionOfVmssVM.json | +| [snapshotsCreateOrUpdateSample.ts][snapshotscreateorupdatesample] | Creates or updates a snapshot. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription.json | +| [snapshotsDeleteSample.ts][snapshotsdeletesample] | Deletes a snapshot. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteASnapshot.json | +| [snapshotsGetSample.ts][snapshotsgetsample] | Gets information about a snapshot. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutASnapshot.json | +| [snapshotsGrantAccessSample.ts][snapshotsgrantaccesssample] | Grants access to a snapshot. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/BeginGetAccessSnapshot.json | +| [snapshotsListByResourceGroupSample.ts][snapshotslistbyresourcegroupsample] | Lists snapshots under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListSnapshotsInAResourceGroup.json | +| [snapshotsListSample.ts][snapshotslistsample] | Lists snapshots under a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListSnapshotsInASubscription.json | +| [snapshotsRevokeAccessSample.ts][snapshotsrevokeaccesssample] | Revokes access to a snapshot. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/EndGetAccessSnapshot.json | +| [snapshotsUpdateSample.ts][snapshotsupdatesample] | Updates (patches) a snapshot. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateASnapshotWithAcceleratedNetwork.json | +| [sshPublicKeysCreateSample.ts][sshpublickeyscreatesample] | Creates a new SSH public key resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnSshPublicKey.json | | [sshPublicKeysDeleteMaximumSetGen.ts][sshpublickeysdeletemaximumsetgen] | Delete an SSH public key. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Delete_MaximumSet_Gen.json | | [sshPublicKeysDeleteMinimumSetGen.ts][sshpublickeysdeleteminimumsetgen] | Delete an SSH public key. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Delete_MinimumSet_Gen.json | +| [sshPublicKeysDeleteSample.ts][sshpublickeysdeletesample] | Delete an SSH public key. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Delete_MaximumSet_Gen.json | +| [sshPublicKeysGenerateKeyPairSample.ts][sshpublickeysgeneratekeypairsample] | Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GenerateSshKeyPair.json | +| [sshPublicKeysGetSample.ts][sshpublickeysgetsample] | Retrieves information about an SSH public key. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetAnSshPublicKey.json | | [sshPublicKeysListByResourceGroupMaximumSetGen.ts][sshpublickeyslistbyresourcegroupmaximumsetgen] | Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListByResourceGroup_MaximumSet_Gen.json | | [sshPublicKeysListByResourceGroupMinimumSetGen.ts][sshpublickeyslistbyresourcegroupminimumsetgen] | Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListByResourceGroup_MinimumSet_Gen.json | +| [sshPublicKeysListByResourceGroupSample.ts][sshpublickeyslistbyresourcegroupsample] | Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListByResourceGroup_MaximumSet_Gen.json | | [sshPublicKeysListBySubscriptionMaximumSetGen.ts][sshpublickeyslistbysubscriptionmaximumsetgen] | Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListBySubscription_MaximumSet_Gen.json | | [sshPublicKeysListBySubscriptionMinimumSetGen.ts][sshpublickeyslistbysubscriptionminimumsetgen] | Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListBySubscription_MinimumSet_Gen.json | +| [sshPublicKeysListBySubscriptionSample.ts][sshpublickeyslistbysubscriptionsample] | Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListBySubscription_MaximumSet_Gen.json | | [sshPublicKeysUpdateMaximumSetGen.ts][sshpublickeysupdatemaximumsetgen] | Updates a new SSH public key resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Update_MaximumSet_Gen.json | | [sshPublicKeysUpdateMinimumSetGen.ts][sshpublickeysupdateminimumsetgen] | Updates a new SSH public key resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Update_MinimumSet_Gen.json | +| [sshPublicKeysUpdateSample.ts][sshpublickeysupdatesample] | Updates a new SSH public key resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Update_MaximumSet_Gen.json | | [startAnExtensionRollingUpgrade.ts][startanextensionrollingupgrade] | Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VMScaleSetExtensionRollingUpgrade.json | | [startCloudService.ts][startcloudservice] | Starts the cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/StartCloudService.json | | [stopOrPowerOffCloudService.ts][stoporpoweroffcloudservice] | Power off the cloud service. Note that resources are still attached and you are getting charged for the resources. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/PowerOffCloudService.json | @@ -367,140 +532,250 @@ These sample programs show how to use the TypeScript client libraries for in som | [updatesTagsOfAnImage.ts][updatestagsofanimage] | Update an image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateImage.json | | [usageListMaximumSetGen.ts][usagelistmaximumsetgen] | Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Usage_List_MaximumSet_Gen.json | | [usageListMinimumSetGen.ts][usagelistminimumsetgen] | Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Usage_List_MinimumSet_Gen.json | +| [usageListSample.ts][usagelistsample] | Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Usage_List_MaximumSet_Gen.json | | [virtualMachineExtensionImagesGetMaximumSetGen.ts][virtualmachineextensionimagesgetmaximumsetgen] | Gets a virtual machine extension image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_Get_MaximumSet_Gen.json | | [virtualMachineExtensionImagesGetMinimumSetGen.ts][virtualmachineextensionimagesgetminimumsetgen] | Gets a virtual machine extension image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_Get_MinimumSet_Gen.json | +| [virtualMachineExtensionImagesGetSample.ts][virtualmachineextensionimagesgetsample] | Gets a virtual machine extension image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_Get_MaximumSet_Gen.json | | [virtualMachineExtensionImagesListTypesMaximumSetGen.ts][virtualmachineextensionimageslisttypesmaximumsetgen] | Gets a list of virtual machine extension image types. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListTypes_MaximumSet_Gen.json | | [virtualMachineExtensionImagesListTypesMinimumSetGen.ts][virtualmachineextensionimageslisttypesminimumsetgen] | Gets a list of virtual machine extension image types. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListTypes_MinimumSet_Gen.json | +| [virtualMachineExtensionImagesListTypesSample.ts][virtualmachineextensionimageslisttypessample] | Gets a list of virtual machine extension image types. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListTypes_MaximumSet_Gen.json | | [virtualMachineExtensionImagesListVersionsMaximumSetGen.ts][virtualmachineextensionimageslistversionsmaximumsetgen] | Gets a list of virtual machine extension image versions. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListVersions_MaximumSet_Gen.json | | [virtualMachineExtensionImagesListVersionsMinimumSetGen.ts][virtualmachineextensionimageslistversionsminimumsetgen] | Gets a list of virtual machine extension image versions. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListVersions_MinimumSet_Gen.json | +| [virtualMachineExtensionImagesListVersionsSample.ts][virtualmachineextensionimageslistversionssample] | Gets a list of virtual machine extension image versions. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListVersions_MaximumSet_Gen.json | | [virtualMachineExtensionsCreateOrUpdateMaximumSetGen.ts][virtualmachineextensionscreateorupdatemaximumsetgen] | The operation to create or update the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_CreateOrUpdate_MaximumSet_Gen.json | | [virtualMachineExtensionsCreateOrUpdateMinimumSetGen.ts][virtualmachineextensionscreateorupdateminimumsetgen] | The operation to create or update the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_CreateOrUpdate_MinimumSet_Gen.json | +| [virtualMachineExtensionsCreateOrUpdateSample.ts][virtualmachineextensionscreateorupdatesample] | The operation to create or update the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_CreateOrUpdate_MaximumSet_Gen.json | | [virtualMachineExtensionsDeleteMaximumSetGen.ts][virtualmachineextensionsdeletemaximumsetgen] | The operation to delete the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Delete_MaximumSet_Gen.json | | [virtualMachineExtensionsDeleteMinimumSetGen.ts][virtualmachineextensionsdeleteminimumsetgen] | The operation to delete the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Delete_MinimumSet_Gen.json | +| [virtualMachineExtensionsDeleteSample.ts][virtualmachineextensionsdeletesample] | The operation to delete the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Delete_MaximumSet_Gen.json | | [virtualMachineExtensionsGetMaximumSetGen.ts][virtualmachineextensionsgetmaximumsetgen] | The operation to get the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Get_MaximumSet_Gen.json | | [virtualMachineExtensionsGetMinimumSetGen.ts][virtualmachineextensionsgetminimumsetgen] | The operation to get the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Get_MinimumSet_Gen.json | +| [virtualMachineExtensionsGetSample.ts][virtualmachineextensionsgetsample] | The operation to get the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Get_MaximumSet_Gen.json | | [virtualMachineExtensionsListMaximumSetGen.ts][virtualmachineextensionslistmaximumsetgen] | The operation to get all extensions of a Virtual Machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_List_MaximumSet_Gen.json | | [virtualMachineExtensionsListMinimumSetGen.ts][virtualmachineextensionslistminimumsetgen] | The operation to get all extensions of a Virtual Machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_List_MinimumSet_Gen.json | +| [virtualMachineExtensionsListSample.ts][virtualmachineextensionslistsample] | The operation to get all extensions of a Virtual Machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_List_MaximumSet_Gen.json | +| [virtualMachineExtensionsUpdateSample.ts][virtualmachineextensionsupdatesample] | The operation to update the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateVMExtension.json | | [virtualMachineImagesEdgeZoneGetMaximumSetGen.ts][virtualmachineimagesedgezonegetmaximumsetgen] | Gets a virtual machine image in an edge zone. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.json | | [virtualMachineImagesEdgeZoneGetMinimumSetGen.ts][virtualmachineimagesedgezonegetminimumsetgen] | Gets a virtual machine image in an edge zone. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_Get_MinimumSet_Gen.json | +| [virtualMachineImagesEdgeZoneGetSample.ts][virtualmachineimagesedgezonegetsample] | Gets a virtual machine image in an edge zone. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.json | | [virtualMachineImagesEdgeZoneListMaximumSetGen.ts][virtualmachineimagesedgezonelistmaximumsetgen] | Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.json | | [virtualMachineImagesEdgeZoneListMinimumSetGen.ts][virtualmachineimagesedgezonelistminimumsetgen] | Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_List_MinimumSet_Gen.json | | [virtualMachineImagesEdgeZoneListOffersMaximumSetGen.ts][virtualmachineimagesedgezonelistoffersmaximumsetgen] | Gets a list of virtual machine image offers for the specified location, edge zone and publisher. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.json | | [virtualMachineImagesEdgeZoneListOffersMinimumSetGen.ts][virtualmachineimagesedgezonelistoffersminimumsetgen] | Gets a list of virtual machine image offers for the specified location, edge zone and publisher. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListOffers_MinimumSet_Gen.json | +| [virtualMachineImagesEdgeZoneListOffersSample.ts][virtualmachineimagesedgezonelistofferssample] | Gets a list of virtual machine image offers for the specified location, edge zone and publisher. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.json | | [virtualMachineImagesEdgeZoneListPublishersMaximumSetGen.ts][virtualmachineimagesedgezonelistpublishersmaximumsetgen] | Gets a list of virtual machine image publishers for the specified Azure location and edge zone. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.json | | [virtualMachineImagesEdgeZoneListPublishersMinimumSetGen.ts][virtualmachineimagesedgezonelistpublishersminimumsetgen] | Gets a list of virtual machine image publishers for the specified Azure location and edge zone. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListPublishers_MinimumSet_Gen.json | +| [virtualMachineImagesEdgeZoneListPublishersSample.ts][virtualmachineimagesedgezonelistpublisherssample] | Gets a list of virtual machine image publishers for the specified Azure location and edge zone. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.json | +| [virtualMachineImagesEdgeZoneListSample.ts][virtualmachineimagesedgezonelistsample] | Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.json | | [virtualMachineImagesEdgeZoneListSkusMaximumSetGen.ts][virtualmachineimagesedgezonelistskusmaximumsetgen] | Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen.json | | [virtualMachineImagesEdgeZoneListSkusMinimumSetGen.ts][virtualmachineimagesedgezonelistskusminimumsetgen] | Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListSkus_MinimumSet_Gen.json | +| [virtualMachineImagesEdgeZoneListSkusSample.ts][virtualmachineimagesedgezonelistskussample] | Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen.json | | [virtualMachineImagesGetMaximumSetGen.ts][virtualmachineimagesgetmaximumsetgen] | Gets a virtual machine image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_Get_MaximumSet_Gen.json | | [virtualMachineImagesGetMinimumSetGen.ts][virtualmachineimagesgetminimumsetgen] | Gets a virtual machine image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_Get_MinimumSet_Gen.json | +| [virtualMachineImagesGetSample.ts][virtualmachineimagesgetsample] | Gets a virtual machine image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_Get_MaximumSet_Gen.json | | [virtualMachineImagesListMaximumSetGen.ts][virtualmachineimageslistmaximumsetgen] | Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_List_MaximumSet_Gen.json | | [virtualMachineImagesListMinimumSetGen.ts][virtualmachineimageslistminimumsetgen] | Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_List_MinimumSet_Gen.json | | [virtualMachineImagesListOffersMaximumSetGen.ts][virtualmachineimageslistoffersmaximumsetgen] | Gets a list of virtual machine image offers for the specified location and publisher. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListOffers_MaximumSet_Gen.json | | [virtualMachineImagesListOffersMinimumSetGen.ts][virtualmachineimageslistoffersminimumsetgen] | Gets a list of virtual machine image offers for the specified location and publisher. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListOffers_MinimumSet_Gen.json | +| [virtualMachineImagesListOffersSample.ts][virtualmachineimageslistofferssample] | Gets a list of virtual machine image offers for the specified location and publisher. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListOffers_MaximumSet_Gen.json | | [virtualMachineImagesListPublishersMaximumSetGen.ts][virtualmachineimageslistpublishersmaximumsetgen] | Gets a list of virtual machine image publishers for the specified Azure location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListPublishers_MaximumSet_Gen.json | | [virtualMachineImagesListPublishersMinimumSetGen.ts][virtualmachineimageslistpublishersminimumsetgen] | Gets a list of virtual machine image publishers for the specified Azure location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListPublishers_MinimumSet_Gen.json | +| [virtualMachineImagesListPublishersSample.ts][virtualmachineimageslistpublisherssample] | Gets a list of virtual machine image publishers for the specified Azure location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListPublishers_MaximumSet_Gen.json | +| [virtualMachineImagesListSample.ts][virtualmachineimageslistsample] | Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_List_MaximumSet_Gen.json | | [virtualMachineImagesListSkusMaximumSetGen.ts][virtualmachineimageslistskusmaximumsetgen] | Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListSkus_MaximumSet_Gen.json | | [virtualMachineImagesListSkusMinimumSetGen.ts][virtualmachineimageslistskusminimumsetgen] | Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListSkus_MinimumSet_Gen.json | +| [virtualMachineImagesListSkusSample.ts][virtualmachineimageslistskussample] | Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListSkus_MaximumSet_Gen.json | | [virtualMachineRunCommand.ts][virtualmachineruncommand] | Run command on the VM. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VirtualMachineRunCommand.json | | [virtualMachineRunCommandGet.ts][virtualmachineruncommandget] | Gets specific run command for a subscription in a location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VirtualMachineRunCommandGet.json | | [virtualMachineRunCommandList.ts][virtualmachineruncommandlist] | Lists all available run commands for a subscription in a location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VirtualMachineRunCommandList.json | +| [virtualMachineRunCommandsCreateOrUpdateSample.ts][virtualmachineruncommandscreateorupdatesample] | The operation to create or update the run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/CreateOrUpdateRunCommand.json | +| [virtualMachineRunCommandsDeleteSample.ts][virtualmachineruncommandsdeletesample] | The operation to delete the run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/DeleteRunCommand.json | +| [virtualMachineRunCommandsGetByVirtualMachineSample.ts][virtualmachineruncommandsgetbyvirtualmachinesample] | The operation to get the run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/GetRunCommand.json | +| [virtualMachineRunCommandsGetSample.ts][virtualmachineruncommandsgetsample] | Gets specific run command for a subscription in a location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VirtualMachineRunCommandGet.json | +| [virtualMachineRunCommandsListByVirtualMachineSample.ts][virtualmachineruncommandslistbyvirtualmachinesample] | The operation to get all run commands of a Virtual Machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/ListRunCommandsInVM.json | +| [virtualMachineRunCommandsListSample.ts][virtualmachineruncommandslistsample] | Lists all available run commands for a subscription in a location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VirtualMachineRunCommandList.json | +| [virtualMachineRunCommandsUpdateSample.ts][virtualmachineruncommandsupdatesample] | The operation to update the run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/UpdateRunCommand.json | | [virtualMachineScaleSetExtensionsCreateOrUpdateMaximumSetGen.ts][virtualmachinescalesetextensionscreateorupdatemaximumsetgen] | The operation to create or update an extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_CreateOrUpdate_MaximumSet_Gen.json | | [virtualMachineScaleSetExtensionsCreateOrUpdateMinimumSetGen.ts][virtualmachinescalesetextensionscreateorupdateminimumsetgen] | The operation to create or update an extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_CreateOrUpdate_MinimumSet_Gen.json | +| [virtualMachineScaleSetExtensionsCreateOrUpdateSample.ts][virtualmachinescalesetextensionscreateorupdatesample] | The operation to create or update an extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_CreateOrUpdate_MaximumSet_Gen.json | | [virtualMachineScaleSetExtensionsDeleteMaximumSetGen.ts][virtualmachinescalesetextensionsdeletemaximumsetgen] | The operation to delete the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Delete_MaximumSet_Gen.json | | [virtualMachineScaleSetExtensionsDeleteMinimumSetGen.ts][virtualmachinescalesetextensionsdeleteminimumsetgen] | The operation to delete the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Delete_MinimumSet_Gen.json | +| [virtualMachineScaleSetExtensionsDeleteSample.ts][virtualmachinescalesetextensionsdeletesample] | The operation to delete the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Delete_MaximumSet_Gen.json | | [virtualMachineScaleSetExtensionsGetMaximumSetGen.ts][virtualmachinescalesetextensionsgetmaximumsetgen] | The operation to get the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Get_MaximumSet_Gen.json | | [virtualMachineScaleSetExtensionsGetMinimumSetGen.ts][virtualmachinescalesetextensionsgetminimumsetgen] | The operation to get the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Get_MinimumSet_Gen.json | +| [virtualMachineScaleSetExtensionsGetSample.ts][virtualmachinescalesetextensionsgetsample] | The operation to get the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Get_MaximumSet_Gen.json | | [virtualMachineScaleSetExtensionsListMaximumSetGen.ts][virtualmachinescalesetextensionslistmaximumsetgen] | Gets a list of all extensions in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_List_MaximumSet_Gen.json | | [virtualMachineScaleSetExtensionsListMinimumSetGen.ts][virtualmachinescalesetextensionslistminimumsetgen] | Gets a list of all extensions in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_List_MinimumSet_Gen.json | +| [virtualMachineScaleSetExtensionsListSample.ts][virtualmachinescalesetextensionslistsample] | Gets a list of all extensions in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_List_MaximumSet_Gen.json | | [virtualMachineScaleSetExtensionsUpdateMaximumSetGen.ts][virtualmachinescalesetextensionsupdatemaximumsetgen] | The operation to update an extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Update_MaximumSet_Gen.json | | [virtualMachineScaleSetExtensionsUpdateMinimumSetGen.ts][virtualmachinescalesetextensionsupdateminimumsetgen] | The operation to update an extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Update_MinimumSet_Gen.json | +| [virtualMachineScaleSetExtensionsUpdateSample.ts][virtualmachinescalesetextensionsupdatesample] | The operation to update an extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Update_MaximumSet_Gen.json | | [virtualMachineScaleSetRollingUpgradesCancelMaximumSetGen.ts][virtualmachinescalesetrollingupgradescancelmaximumsetgen] | Cancels the current virtual machine scale set rolling upgrade. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_Cancel_MaximumSet_Gen.json | | [virtualMachineScaleSetRollingUpgradesCancelMinimumSetGen.ts][virtualmachinescalesetrollingupgradescancelminimumsetgen] | Cancels the current virtual machine scale set rolling upgrade. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_Cancel_MinimumSet_Gen.json | +| [virtualMachineScaleSetRollingUpgradesCancelSample.ts][virtualmachinescalesetrollingupgradescancelsample] | Cancels the current virtual machine scale set rolling upgrade. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_Cancel_MaximumSet_Gen.json | | [virtualMachineScaleSetRollingUpgradesGetLatestMaximumSetGen.ts][virtualmachinescalesetrollingupgradesgetlatestmaximumsetgen] | Gets the status of the latest virtual machine scale set rolling upgrade. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_GetLatest_MaximumSet_Gen.json | | [virtualMachineScaleSetRollingUpgradesGetLatestMinimumSetGen.ts][virtualmachinescalesetrollingupgradesgetlatestminimumsetgen] | Gets the status of the latest virtual machine scale set rolling upgrade. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_GetLatest_MinimumSet_Gen.json | +| [virtualMachineScaleSetRollingUpgradesGetLatestSample.ts][virtualmachinescalesetrollingupgradesgetlatestsample] | Gets the status of the latest virtual machine scale set rolling upgrade. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_GetLatest_MaximumSet_Gen.json | +| [virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.ts][virtualmachinescalesetrollingupgradesstartextensionupgradesample] | Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VMScaleSetExtensionRollingUpgrade.json | | [virtualMachineScaleSetRollingUpgradesStartOSUpgradeMaximumSetGen.ts][virtualmachinescalesetrollingupgradesstartosupgrademaximumsetgen] | Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_StartOSUpgrade_MaximumSet_Gen.json | | [virtualMachineScaleSetRollingUpgradesStartOSUpgradeMinimumSetGen.ts][virtualmachinescalesetrollingupgradesstartosupgrademinimumsetgen] | Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_StartOSUpgrade_MinimumSet_Gen.json | +| [virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.ts][virtualmachinescalesetrollingupgradesstartosupgradesample] | Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_StartOSUpgrade_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.ts][virtualmachinescalesetvmextensionscreateorupdatesample] | The operation to create or update the VMSS VM extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateVirtualMachineScaleSetVMExtensions.json | +| [virtualMachineScaleSetVMExtensionsDeleteSample.ts][virtualmachinescalesetvmextensionsdeletesample] | The operation to delete the VMSS VM extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DeleteVirtualMachineScaleSetVMExtensions.json | +| [virtualMachineScaleSetVMExtensionsGetSample.ts][virtualmachinescalesetvmextensionsgetsample] | The operation to get the VMSS VM extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetVMExtensions.json | +| [virtualMachineScaleSetVMExtensionsListSample.ts][virtualmachinescalesetvmextensionslistsample] | The operation to get all extensions of an instance in Virtual Machine Scaleset. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListVirtualMachineScaleSetVMExtensions.json | +| [virtualMachineScaleSetVMExtensionsUpdateSample.ts][virtualmachinescalesetvmextensionsupdatesample] | The operation to update the VMSS VM extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateVirtualMachineScaleSetVMExtensions.json | +| [virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.ts][virtualmachinescalesetvmruncommandscreateorupdatesample] | The operation to create or update the VMSS VM run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/CreateOrUpdateVirtualMachineScaleSetVMRunCommands.json | +| [virtualMachineScaleSetVMRunCommandsDeleteSample.ts][virtualmachinescalesetvmruncommandsdeletesample] | The operation to delete the VMSS VM run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/DeleteVirtualMachineScaleSetVMRunCommands.json | +| [virtualMachineScaleSetVMRunCommandsGetSample.ts][virtualmachinescalesetvmruncommandsgetsample] | The operation to get the VMSS VM run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/GetVirtualMachineScaleSetVMRunCommands.json | +| [virtualMachineScaleSetVMRunCommandsListSample.ts][virtualmachinescalesetvmruncommandslistsample] | The operation to get all run commands of an instance in Virtual Machine Scaleset. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/ListVirtualMachineScaleSetVMRunCommands.json | +| [virtualMachineScaleSetVMRunCommandsUpdateSample.ts][virtualmachinescalesetvmruncommandsupdatesample] | The operation to update the VMSS VM run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/UpdateVirtualMachineScaleSetVMRunCommands.json | | [virtualMachineScaleSetVMSDeallocateMaximumSetGen.ts][virtualmachinescalesetvmsdeallocatemaximumsetgen] | Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Deallocate_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSDeallocateMinimumSetGen.ts][virtualmachinescalesetvmsdeallocateminimumsetgen] | Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Deallocate_MinimumSet_Gen.json | +| [virtualMachineScaleSetVMSDeallocateSample.ts][virtualmachinescalesetvmsdeallocatesample] | Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Deallocate_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMSDeleteSample.ts][virtualmachinescalesetvmsdeletesample] | Deletes a virtual machine from a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ForceDeleteVirtualMachineScaleSetVM.json | +| [virtualMachineScaleSetVMSGetInstanceViewSample.ts][virtualmachinescalesetvmsgetinstanceviewsample] | Gets the status of a virtual machine from a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetVMInstanceViewAutoPlacedOnDedicatedHostGroup.json | +| [virtualMachineScaleSetVMSGetSample.ts][virtualmachinescalesetvmsgetsample] | Gets a virtual machine from a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetVMWithUserData.json | | [virtualMachineScaleSetVMSListMaximumSetGen.ts][virtualmachinescalesetvmslistmaximumsetgen] | Gets a list of all virtual machines in a VM scale sets. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_List_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSListMinimumSetGen.ts][virtualmachinescalesetvmslistminimumsetgen] | Gets a list of all virtual machines in a VM scale sets. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_List_MinimumSet_Gen.json | +| [virtualMachineScaleSetVMSListSample.ts][virtualmachinescalesetvmslistsample] | Gets a list of all virtual machines in a VM scale sets. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_List_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSPerformMaintenanceMaximumSetGen.ts][virtualmachinescalesetvmsperformmaintenancemaximumsetgen] | Performs maintenance on a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PerformMaintenance_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSPerformMaintenanceMinimumSetGen.ts][virtualmachinescalesetvmsperformmaintenanceminimumsetgen] | Performs maintenance on a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PerformMaintenance_MinimumSet_Gen.json | +| [virtualMachineScaleSetVMSPerformMaintenanceSample.ts][virtualmachinescalesetvmsperformmaintenancesample] | Performs maintenance on a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PerformMaintenance_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSPowerOffMaximumSetGen.ts][virtualmachinescalesetvmspoweroffmaximumsetgen] | Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PowerOff_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSPowerOffMinimumSetGen.ts][virtualmachinescalesetvmspoweroffminimumsetgen] | Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PowerOff_MinimumSet_Gen.json | +| [virtualMachineScaleSetVMSPowerOffSample.ts][virtualmachinescalesetvmspoweroffsample] | Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PowerOff_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSRedeployMaximumSetGen.ts][virtualmachinescalesetvmsredeploymaximumsetgen] | Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Redeploy_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSRedeployMinimumSetGen.ts][virtualmachinescalesetvmsredeployminimumsetgen] | Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Redeploy_MinimumSet_Gen.json | +| [virtualMachineScaleSetVMSRedeploySample.ts][virtualmachinescalesetvmsredeploysample] | Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Redeploy_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSReimageAllMaximumSetGen.ts][virtualmachinescalesetvmsreimageallmaximumsetgen] | Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_ReimageAll_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSReimageAllMinimumSetGen.ts][virtualmachinescalesetvmsreimageallminimumsetgen] | Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_ReimageAll_MinimumSet_Gen.json | +| [virtualMachineScaleSetVMSReimageAllSample.ts][virtualmachinescalesetvmsreimageallsample] | Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_ReimageAll_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSReimageMaximumSetGen.ts][virtualmachinescalesetvmsreimagemaximumsetgen] | Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Reimage_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSReimageMinimumSetGen.ts][virtualmachinescalesetvmsreimageminimumsetgen] | Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Reimage_MinimumSet_Gen.json | +| [virtualMachineScaleSetVMSReimageSample.ts][virtualmachinescalesetvmsreimagesample] | Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Reimage_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSRestartMaximumSetGen.ts][virtualmachinescalesetvmsrestartmaximumsetgen] | Restarts a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Restart_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSRestartMinimumSetGen.ts][virtualmachinescalesetvmsrestartminimumsetgen] | Restarts a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Restart_MinimumSet_Gen.json | +| [virtualMachineScaleSetVMSRestartSample.ts][virtualmachinescalesetvmsrestartsample] | Restarts a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Restart_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.ts][virtualmachinescalesetvmsretrievebootdiagnosticsdatasample] | The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RetrieveBootDiagnosticsDataVMScaleSetVM.json | | [virtualMachineScaleSetVMSRunCommand.ts][virtualmachinescalesetvmsruncommand] | Run command on a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VMScaleSetRunCommand.json | +| [virtualMachineScaleSetVMSRunCommandSample.ts][virtualmachinescalesetvmsruncommandsample] | Run command on a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VMScaleSetRunCommand.json | +| [virtualMachineScaleSetVMSSimulateEvictionSample.ts][virtualmachinescalesetvmssimulateevictionsample] | The operation to simulate the eviction of spot virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SimulateEvictionOfVmssVM.json | | [virtualMachineScaleSetVMSStartMaximumSetGen.ts][virtualmachinescalesetvmsstartmaximumsetgen] | Starts a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Start_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSStartMinimumSetGen.ts][virtualmachinescalesetvmsstartminimumsetgen] | Starts a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Start_MinimumSet_Gen.json | +| [virtualMachineScaleSetVMSStartSample.ts][virtualmachinescalesetvmsstartsample] | Starts a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Start_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSUpdateMaximumSetGen.ts][virtualmachinescalesetvmsupdatemaximumsetgen] | Updates a virtual machine of a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Update_MaximumSet_Gen.json | | [virtualMachineScaleSetVMSUpdateMinimumSetGen.ts][virtualmachinescalesetvmsupdateminimumsetgen] | Updates a virtual machine of a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Update_MinimumSet_Gen.json | +| [virtualMachineScaleSetVMSUpdateSample.ts][virtualmachinescalesetvmsupdatesample] | Updates a virtual machine of a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Update_MaximumSet_Gen.json | | [virtualMachineScaleSetsConvertToSinglePlacementGroupMaximumSetGen.ts][virtualmachinescalesetsconverttosingleplacementgroupmaximumsetgen] | Converts SinglePlacementGroup property to false for a existing virtual machine scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ConvertToSinglePlacementGroup_MaximumSet_Gen.json | | [virtualMachineScaleSetsConvertToSinglePlacementGroupMinimumSetGen.ts][virtualmachinescalesetsconverttosingleplacementgroupminimumsetgen] | Converts SinglePlacementGroup property to false for a existing virtual machine scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ConvertToSinglePlacementGroup_MinimumSet_Gen.json | +| [virtualMachineScaleSetsConvertToSinglePlacementGroupSample.ts][virtualmachinescalesetsconverttosingleplacementgroupsample] | Converts SinglePlacementGroup property to false for a existing virtual machine scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ConvertToSinglePlacementGroup_MaximumSet_Gen.json | +| [virtualMachineScaleSetsCreateOrUpdateSample.ts][virtualmachinescalesetscreateorupdatesample] | Create or update a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithExtensionsSuppressFailuresEnabled.json | | [virtualMachineScaleSetsDeallocateMaximumSetGen.ts][virtualmachinescalesetsdeallocatemaximumsetgen] | Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Deallocate_MaximumSet_Gen.json | | [virtualMachineScaleSetsDeallocateMinimumSetGen.ts][virtualmachinescalesetsdeallocateminimumsetgen] | Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Deallocate_MinimumSet_Gen.json | +| [virtualMachineScaleSetsDeallocateSample.ts][virtualmachinescalesetsdeallocatesample] | Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Deallocate_MaximumSet_Gen.json | | [virtualMachineScaleSetsDeleteInstancesMaximumSetGen.ts][virtualmachinescalesetsdeleteinstancesmaximumsetgen] | Deletes virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_DeleteInstances_MaximumSet_Gen.json | | [virtualMachineScaleSetsDeleteInstancesMinimumSetGen.ts][virtualmachinescalesetsdeleteinstancesminimumsetgen] | Deletes virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_DeleteInstances_MinimumSet_Gen.json | +| [virtualMachineScaleSetsDeleteInstancesSample.ts][virtualmachinescalesetsdeleteinstancessample] | Deletes virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_DeleteInstances_MaximumSet_Gen.json | +| [virtualMachineScaleSetsDeleteSample.ts][virtualmachinescalesetsdeletesample] | Deletes a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ForceDeleteVirtualMachineScaleSets.json | | [virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkMaximumSetGen.ts][virtualmachinescalesetsforcerecoveryservicefabricplatformupdatedomainwalkmaximumsetgen] | Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.json | | [virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkMinimumSetGen.ts][virtualmachinescalesetsforcerecoveryservicefabricplatformupdatedomainwalkminimumsetgen] | Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MinimumSet_Gen.json | +| [virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.ts][virtualmachinescalesetsforcerecoveryservicefabricplatformupdatedomainwalksample] | Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.json | | [virtualMachineScaleSetsGetInstanceViewMaximumSetGen.ts][virtualmachinescalesetsgetinstanceviewmaximumsetgen] | Gets the status of a VM scale set instance. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetInstanceView_MaximumSet_Gen.json | | [virtualMachineScaleSetsGetInstanceViewMinimumSetGen.ts][virtualmachinescalesetsgetinstanceviewminimumsetgen] | Gets the status of a VM scale set instance. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetInstanceView_MinimumSet_Gen.json | +| [virtualMachineScaleSetsGetInstanceViewSample.ts][virtualmachinescalesetsgetinstanceviewsample] | Gets the status of a VM scale set instance. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetInstanceView_MaximumSet_Gen.json | | [virtualMachineScaleSetsGetOSUpgradeHistoryMaximumSetGen.ts][virtualmachinescalesetsgetosupgradehistorymaximumsetgen] | Gets list of OS upgrades on a VM scale set instance. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetOSUpgradeHistory_MaximumSet_Gen.json | | [virtualMachineScaleSetsGetOSUpgradeHistoryMinimumSetGen.ts][virtualmachinescalesetsgetosupgradehistoryminimumsetgen] | Gets list of OS upgrades on a VM scale set instance. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetOSUpgradeHistory_MinimumSet_Gen.json | +| [virtualMachineScaleSetsGetOSUpgradeHistorySample.ts][virtualmachinescalesetsgetosupgradehistorysample] | Gets list of OS upgrades on a VM scale set instance. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetOSUpgradeHistory_MaximumSet_Gen.json | +| [virtualMachineScaleSetsGetSample.ts][virtualmachinescalesetsgetsample] | Display information about a virtual machine scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSet.json | | [virtualMachineScaleSetsListAllMaximumSetGen.ts][virtualmachinescalesetslistallmaximumsetgen] | Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListAll_MaximumSet_Gen.json | | [virtualMachineScaleSetsListAllMinimumSetGen.ts][virtualmachinescalesetslistallminimumsetgen] | Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListAll_MinimumSet_Gen.json | +| [virtualMachineScaleSetsListAllSample.ts][virtualmachinescalesetslistallsample] | Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListAll_MaximumSet_Gen.json | +| [virtualMachineScaleSetsListByLocationSample.ts][virtualmachinescalesetslistbylocationsample] | Gets all the VM scale sets under the specified subscription for the specified location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListVirtualMachineScaleSetsInASubscriptionByLocation.json | | [virtualMachineScaleSetsListMaximumSetGen.ts][virtualmachinescalesetslistmaximumsetgen] | Gets a list of all VM scale sets under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_List_MaximumSet_Gen.json | | [virtualMachineScaleSetsListMinimumSetGen.ts][virtualmachinescalesetslistminimumsetgen] | Gets a list of all VM scale sets under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_List_MinimumSet_Gen.json | +| [virtualMachineScaleSetsListSample.ts][virtualmachinescalesetslistsample] | Gets a list of all VM scale sets under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_List_MaximumSet_Gen.json | | [virtualMachineScaleSetsListSkusMaximumSetGen.ts][virtualmachinescalesetslistskusmaximumsetgen] | Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListSkus_MaximumSet_Gen.json | | [virtualMachineScaleSetsListSkusMinimumSetGen.ts][virtualmachinescalesetslistskusminimumsetgen] | Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListSkus_MinimumSet_Gen.json | +| [virtualMachineScaleSetsListSkusSample.ts][virtualmachinescalesetslistskussample] | Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListSkus_MaximumSet_Gen.json | | [virtualMachineScaleSetsPerformMaintenanceMaximumSetGen.ts][virtualmachinescalesetsperformmaintenancemaximumsetgen] | Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PerformMaintenance_MaximumSet_Gen.json | | [virtualMachineScaleSetsPerformMaintenanceMinimumSetGen.ts][virtualmachinescalesetsperformmaintenanceminimumsetgen] | Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PerformMaintenance_MinimumSet_Gen.json | +| [virtualMachineScaleSetsPerformMaintenanceSample.ts][virtualmachinescalesetsperformmaintenancesample] | Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PerformMaintenance_MaximumSet_Gen.json | | [virtualMachineScaleSetsPowerOffMaximumSetGen.ts][virtualmachinescalesetspoweroffmaximumsetgen] | Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PowerOff_MaximumSet_Gen.json | | [virtualMachineScaleSetsPowerOffMinimumSetGen.ts][virtualmachinescalesetspoweroffminimumsetgen] | Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PowerOff_MinimumSet_Gen.json | +| [virtualMachineScaleSetsPowerOffSample.ts][virtualmachinescalesetspoweroffsample] | Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PowerOff_MaximumSet_Gen.json | | [virtualMachineScaleSetsRedeployMaximumSetGen.ts][virtualmachinescalesetsredeploymaximumsetgen] | Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Redeploy_MaximumSet_Gen.json | | [virtualMachineScaleSetsRedeployMinimumSetGen.ts][virtualmachinescalesetsredeployminimumsetgen] | Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Redeploy_MinimumSet_Gen.json | +| [virtualMachineScaleSetsRedeploySample.ts][virtualmachinescalesetsredeploysample] | Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Redeploy_MaximumSet_Gen.json | | [virtualMachineScaleSetsReimageAllMaximumSetGen.ts][virtualmachinescalesetsreimageallmaximumsetgen] | Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ReimageAll_MaximumSet_Gen.json | | [virtualMachineScaleSetsReimageAllMinimumSetGen.ts][virtualmachinescalesetsreimageallminimumsetgen] | Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ReimageAll_MinimumSet_Gen.json | +| [virtualMachineScaleSetsReimageAllSample.ts][virtualmachinescalesetsreimageallsample] | Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ReimageAll_MaximumSet_Gen.json | | [virtualMachineScaleSetsReimageMaximumSetGen.ts][virtualmachinescalesetsreimagemaximumsetgen] | Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Reimage_MaximumSet_Gen.json | | [virtualMachineScaleSetsReimageMinimumSetGen.ts][virtualmachinescalesetsreimageminimumsetgen] | Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Reimage_MinimumSet_Gen.json | +| [virtualMachineScaleSetsReimageSample.ts][virtualmachinescalesetsreimagesample] | Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Reimage_MaximumSet_Gen.json | | [virtualMachineScaleSetsRestartMaximumSetGen.ts][virtualmachinescalesetsrestartmaximumsetgen] | Restarts one or more virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Restart_MaximumSet_Gen.json | | [virtualMachineScaleSetsRestartMinimumSetGen.ts][virtualmachinescalesetsrestartminimumsetgen] | Restarts one or more virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Restart_MinimumSet_Gen.json | +| [virtualMachineScaleSetsRestartSample.ts][virtualmachinescalesetsrestartsample] | Restarts one or more virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Restart_MaximumSet_Gen.json | | [virtualMachineScaleSetsSetOrchestrationServiceStateMaximumSetGen.ts][virtualmachinescalesetssetorchestrationservicestatemaximumsetgen] | Changes ServiceState property for a given service x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_SetOrchestrationServiceState_MaximumSet_Gen.json | | [virtualMachineScaleSetsSetOrchestrationServiceStateMinimumSetGen.ts][virtualmachinescalesetssetorchestrationservicestateminimumsetgen] | Changes ServiceState property for a given service x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_SetOrchestrationServiceState_MinimumSet_Gen.json | +| [virtualMachineScaleSetsSetOrchestrationServiceStateSample.ts][virtualmachinescalesetssetorchestrationservicestatesample] | Changes ServiceState property for a given service x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_SetOrchestrationServiceState_MaximumSet_Gen.json | | [virtualMachineScaleSetsStartMaximumSetGen.ts][virtualmachinescalesetsstartmaximumsetgen] | Starts one or more virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Start_MaximumSet_Gen.json | | [virtualMachineScaleSetsStartMinimumSetGen.ts][virtualmachinescalesetsstartminimumsetgen] | Starts one or more virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Start_MinimumSet_Gen.json | +| [virtualMachineScaleSetsStartSample.ts][virtualmachinescalesetsstartsample] | Starts one or more virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Start_MaximumSet_Gen.json | | [virtualMachineScaleSetsUpdateInstancesMaximumSetGen.ts][virtualmachinescalesetsupdateinstancesmaximumsetgen] | Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_UpdateInstances_MaximumSet_Gen.json | | [virtualMachineScaleSetsUpdateInstancesMinimumSetGen.ts][virtualmachinescalesetsupdateinstancesminimumsetgen] | Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_UpdateInstances_MinimumSet_Gen.json | +| [virtualMachineScaleSetsUpdateInstancesSample.ts][virtualmachinescalesetsupdateinstancessample] | Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_UpdateInstances_MaximumSet_Gen.json | | [virtualMachineScaleSetsUpdateMaximumSetGen.ts][virtualmachinescalesetsupdatemaximumsetgen] | Update a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Update_MaximumSet_Gen.json | | [virtualMachineScaleSetsUpdateMinimumSetGen.ts][virtualmachinescalesetsupdateminimumsetgen] | Update a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Update_MinimumSet_Gen.json | +| [virtualMachineScaleSetsUpdateSample.ts][virtualmachinescalesetsupdatesample] | Update a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Update_MaximumSet_Gen.json | | [virtualMachineSizesListMaximumSetGen.ts][virtualmachinesizeslistmaximumsetgen] | This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineSizes_List_MaximumSet_Gen.json | | [virtualMachineSizesListMinimumSetGen.ts][virtualmachinesizeslistminimumsetgen] | This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineSizes_List_MinimumSet_Gen.json | +| [virtualMachineSizesListSample.ts][virtualmachinesizeslistsample] | This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineSizes_List_MaximumSet_Gen.json | +| [virtualMachinesAssessPatchesSample.ts][virtualmachinesassesspatchessample] | Assess patches on the VM. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineAssessPatches.json | | [virtualMachinesCaptureMaximumSetGen.ts][virtualmachinescapturemaximumsetgen] | Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Capture_MaximumSet_Gen.json | | [virtualMachinesCaptureMinimumSetGen.ts][virtualmachinescaptureminimumsetgen] | Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Capture_MinimumSet_Gen.json | +| [virtualMachinesCaptureSample.ts][virtualmachinescapturesample] | Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Capture_MaximumSet_Gen.json | | [virtualMachinesConvertToManagedDisksMaximumSetGen.ts][virtualmachinesconverttomanageddisksmaximumsetgen] | Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ConvertToManagedDisks_MaximumSet_Gen.json | | [virtualMachinesConvertToManagedDisksMinimumSetGen.ts][virtualmachinesconverttomanageddisksminimumsetgen] | Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ConvertToManagedDisks_MinimumSet_Gen.json | +| [virtualMachinesConvertToManagedDisksSample.ts][virtualmachinesconverttomanageddiskssample] | Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ConvertToManagedDisks_MaximumSet_Gen.json | +| [virtualMachinesCreateOrUpdateSample.ts][virtualmachinescreateorupdatesample] | The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateALinuxVmWithPatchSettingAssessmentModeOfImageDefault.json | | [virtualMachinesDeallocateMaximumSetGen.ts][virtualmachinesdeallocatemaximumsetgen] | Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Deallocate_MaximumSet_Gen.json | | [virtualMachinesDeallocateMinimumSetGen.ts][virtualmachinesdeallocateminimumsetgen] | Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Deallocate_MinimumSet_Gen.json | +| [virtualMachinesDeallocateSample.ts][virtualmachinesdeallocatesample] | Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Deallocate_MaximumSet_Gen.json | +| [virtualMachinesDeleteSample.ts][virtualmachinesdeletesample] | The operation to delete a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ForceDeleteVirtualMachine.json | +| [virtualMachinesGeneralizeSample.ts][virtualmachinesgeneralizesample] | Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation.
For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource).
For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GeneralizeVirtualMachine.json | +| [virtualMachinesGetSample.ts][virtualmachinesgetsample] | Retrieves information about the model view or the instance view of a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachine.json | +| [virtualMachinesInstallPatchesSample.ts][virtualmachinesinstallpatchessample] | Installs patches on the VM. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineInstallPatches.json | +| [virtualMachinesInstanceViewSample.ts][virtualmachinesinstanceviewsample] | Retrieves information about the run-time state of a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineInstanceView.json | | [virtualMachinesListAllMaximumSetGen.ts][virtualmachineslistallmaximumsetgen] | Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ListAll_MaximumSet_Gen.json | | [virtualMachinesListAllMinimumSetGen.ts][virtualmachineslistallminimumsetgen] | Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ListAll_MinimumSet_Gen.json | +| [virtualMachinesListAllSample.ts][virtualmachineslistallsample] | Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ListAll_MaximumSet_Gen.json | +| [virtualMachinesListAvailableSizesSample.ts][virtualmachineslistavailablesizessample] | Lists all available virtual machine sizes to which the specified virtual machine can be resized. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListAvailableVmSizes_VirtualMachines.json | +| [virtualMachinesListByLocationSample.ts][virtualmachineslistbylocationsample] | Gets all the virtual machines under the specified subscription for the specified location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListVirtualMachinesInASubscriptionByLocation.json | | [virtualMachinesListMaximumSetGen.ts][virtualmachineslistmaximumsetgen] | Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_List_MaximumSet_Gen.json | | [virtualMachinesListMinimumSetGen.ts][virtualmachineslistminimumsetgen] | Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_List_MinimumSet_Gen.json | +| [virtualMachinesListSample.ts][virtualmachineslistsample] | Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_List_MaximumSet_Gen.json | | [virtualMachinesPerformMaintenanceMaximumSetGen.ts][virtualmachinesperformmaintenancemaximumsetgen] | The operation to perform maintenance on a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PerformMaintenance_MaximumSet_Gen.json | | [virtualMachinesPerformMaintenanceMinimumSetGen.ts][virtualmachinesperformmaintenanceminimumsetgen] | The operation to perform maintenance on a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PerformMaintenance_MinimumSet_Gen.json | +| [virtualMachinesPerformMaintenanceSample.ts][virtualmachinesperformmaintenancesample] | The operation to perform maintenance on a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PerformMaintenance_MaximumSet_Gen.json | | [virtualMachinesPowerOffMaximumSetGen.ts][virtualmachinespoweroffmaximumsetgen] | The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PowerOff_MaximumSet_Gen.json | | [virtualMachinesPowerOffMinimumSetGen.ts][virtualmachinespoweroffminimumsetgen] | The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PowerOff_MinimumSet_Gen.json | +| [virtualMachinesPowerOffSample.ts][virtualmachinespoweroffsample] | The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PowerOff_MaximumSet_Gen.json | +| [virtualMachinesReapplySample.ts][virtualmachinesreapplysample] | The operation to reapply a virtual machine's state. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ReapplyVirtualMachine.json | | [virtualMachinesRedeployMaximumSetGen.ts][virtualmachinesredeploymaximumsetgen] | Shuts down the virtual machine, moves it to a new node, and powers it back on. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Redeploy_MaximumSet_Gen.json | | [virtualMachinesRedeployMinimumSetGen.ts][virtualmachinesredeployminimumsetgen] | Shuts down the virtual machine, moves it to a new node, and powers it back on. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Redeploy_MinimumSet_Gen.json | +| [virtualMachinesRedeploySample.ts][virtualmachinesredeploysample] | Shuts down the virtual machine, moves it to a new node, and powers it back on. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Redeploy_MaximumSet_Gen.json | +| [virtualMachinesReimageSample.ts][virtualmachinesreimagesample] | Reimages the virtual machine which has an ephemeral OS disk back to its initial state. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ReimageVirtualMachine.json | | [virtualMachinesRestartMaximumSetGen.ts][virtualmachinesrestartmaximumsetgen] | The operation to restart a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Restart_MaximumSet_Gen.json | | [virtualMachinesRestartMinimumSetGen.ts][virtualmachinesrestartminimumsetgen] | The operation to restart a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Restart_MinimumSet_Gen.json | +| [virtualMachinesRestartSample.ts][virtualmachinesrestartsample] | The operation to restart a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Restart_MaximumSet_Gen.json | +| [virtualMachinesRetrieveBootDiagnosticsDataSample.ts][virtualmachinesretrievebootdiagnosticsdatasample] | The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RetrieveBootDiagnosticsDataVirtualMachine.json | +| [virtualMachinesRunCommandSample.ts][virtualmachinesruncommandsample] | Run command on the VM. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VirtualMachineRunCommand.json | +| [virtualMachinesSimulateEvictionSample.ts][virtualmachinessimulateevictionsample] | The operation to simulate the eviction of spot virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SimulateEvictionOfVM.json | | [virtualMachinesStartMaximumSetGen.ts][virtualmachinesstartmaximumsetgen] | The operation to start a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Start_MaximumSet_Gen.json | | [virtualMachinesStartMinimumSetGen.ts][virtualmachinesstartminimumsetgen] | The operation to start a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Start_MinimumSet_Gen.json | +| [virtualMachinesStartSample.ts][virtualmachinesstartsample] | The operation to start a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Start_MaximumSet_Gen.json | +| [virtualMachinesUpdateSample.ts][virtualmachinesupdatesample] | The operation to update a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateVMDetachDataDiskUsingToBeDetachedProperty.json | ## Prerequisites @@ -555,24 +830,74 @@ Take a look at our [API Documentation][apiref] for more information about the AP [addsharingidtothesharingprofileofagallery]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/addSharingIdToTheSharingProfileOfAGallery.ts [approveaprivateendpointconnectionunderadiskaccessresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/approveAPrivateEndpointConnectionUnderADiskAccessResource.ts [assesspatchstateofavirtualmachine]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/assessPatchStateOfAVirtualMachine.ts +[availabilitysetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsCreateOrUpdateSample.ts [availabilitysetsdeletemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsDeleteMaximumSetGen.ts [availabilitysetsdeleteminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsDeleteMinimumSetGen.ts +[availabilitysetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsDeleteSample.ts [availabilitysetsgetmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsGetMaximumSetGen.ts [availabilitysetsgetminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsGetMinimumSetGen.ts +[availabilitysetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsGetSample.ts [availabilitysetslistavailablesizesmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsListAvailableSizesMaximumSetGen.ts [availabilitysetslistavailablesizesminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsListAvailableSizesMinimumSetGen.ts +[availabilitysetslistavailablesizessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsListAvailableSizesSample.ts +[availabilitysetslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsListBySubscriptionSample.ts [availabilitysetslistmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsListMaximumSetGen.ts [availabilitysetslistminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsListMinimumSetGen.ts +[availabilitysetslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsListSample.ts [availabilitysetsupdatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsUpdateMaximumSetGen.ts [availabilitysetsupdateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsUpdateMinimumSetGen.ts +[availabilitysetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsUpdateSample.ts +[capacityreservationgroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsCreateOrUpdateSample.ts [capacityreservationgroupsdeletemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsDeleteMaximumSetGen.ts [capacityreservationgroupsdeleteminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsDeleteMinimumSetGen.ts +[capacityreservationgroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsDeleteSample.ts +[capacityreservationgroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsGetSample.ts +[capacityreservationgroupslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsListByResourceGroupSample.ts +[capacityreservationgroupslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsListBySubscriptionSample.ts [capacityreservationgroupsupdatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsUpdateMaximumSetGen.ts [capacityreservationgroupsupdateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsUpdateMinimumSetGen.ts +[capacityreservationgroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsUpdateSample.ts +[capacityreservationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationsCreateOrUpdateSample.ts [capacityreservationsdeletemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationsDeleteMaximumSetGen.ts [capacityreservationsdeleteminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationsDeleteMinimumSetGen.ts +[capacityreservationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationsDeleteSample.ts +[capacityreservationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationsGetSample.ts +[capacityreservationslistbycapacityreservationgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationsListByCapacityReservationGroupSample.ts [capacityreservationsupdatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationsUpdateMaximumSetGen.ts [capacityreservationsupdateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationsUpdateMinimumSetGen.ts +[capacityreservationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationsUpdateSample.ts +[cloudserviceoperatingsystemsgetosfamilysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceOperatingSystemsGetOSFamilySample.ts +[cloudserviceoperatingsystemsgetosversionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceOperatingSystemsGetOSVersionSample.ts +[cloudserviceoperatingsystemslistosfamiliessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceOperatingSystemsListOSFamiliesSample.ts +[cloudserviceoperatingsystemslistosversionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceOperatingSystemsListOSVersionsSample.ts +[cloudserviceroleinstancesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesDeleteSample.ts +[cloudserviceroleinstancesgetinstanceviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesGetInstanceViewSample.ts +[cloudserviceroleinstancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesGetSample.ts +[cloudserviceroleinstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesListSample.ts +[cloudserviceroleinstancesrebuildsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesRebuildSample.ts +[cloudserviceroleinstancesreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesReimageSample.ts +[cloudserviceroleinstancesrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesRestartSample.ts +[cloudservicerolesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRolesGetSample.ts +[cloudserviceroleslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRolesListSample.ts +[cloudservicescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesCreateOrUpdateSample.ts +[cloudservicesdeleteinstancessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesDeleteInstancesSample.ts +[cloudservicesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesDeleteSample.ts +[cloudservicesgetinstanceviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesGetInstanceViewSample.ts +[cloudservicesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesGetSample.ts +[cloudserviceslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesListAllSample.ts +[cloudserviceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesListSample.ts +[cloudservicespoweroffsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesPowerOffSample.ts +[cloudservicesrebuildsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesRebuildSample.ts +[cloudservicesreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesReimageSample.ts +[cloudservicesrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesRestartSample.ts +[cloudservicesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesStartSample.ts +[cloudservicesupdatedomaingetupdatedomainsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesUpdateDomainGetUpdateDomainSample.ts +[cloudservicesupdatedomainlistupdatedomainssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesUpdateDomainListUpdateDomainsSample.ts +[cloudservicesupdatedomainwalkupdatedomainsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesUpdateDomainWalkUpdateDomainSample.ts +[cloudservicesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesUpdateSample.ts +[communitygalleriesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/communityGalleriesGetSample.ts +[communitygalleryimageversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/communityGalleryImageVersionsGetSample.ts +[communitygalleryimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/communityGalleryImagesGetSample.ts [copyarestorepointtoadifferentregion]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/copyARestorePointToADifferentRegion.ts [createacommunitygallery]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/createACommunityGallery.ts [createaconfidentialvmsupporteddiskencryptedwithcustomermanagedkey]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/createAConfidentialVMSupportedDiskEncryptedWithCustomerManagedKey.ts @@ -715,20 +1040,32 @@ Take a look at our [API Documentation][apiref] for more information about the AP [createorupdateavmwithcapacityreservation]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/createOrUpdateAVMWithCapacityReservation.ts [createvirtualmachinescalesetvmextension]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/createVirtualMachineScaleSetVMExtension.ts [createvirtualmachinescalesetvmruncommand]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/createVirtualMachineScaleSetVMRunCommand.ts +[dedicatedhostgroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsCreateOrUpdateSample.ts [dedicatedhostgroupsdeletemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsDeleteMaximumSetGen.ts [dedicatedhostgroupsdeleteminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsDeleteMinimumSetGen.ts +[dedicatedhostgroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsDeleteSample.ts +[dedicatedhostgroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsGetSample.ts [dedicatedhostgroupslistbyresourcegroupmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsListByResourceGroupMaximumSetGen.ts [dedicatedhostgroupslistbyresourcegroupminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsListByResourceGroupMinimumSetGen.ts +[dedicatedhostgroupslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsListByResourceGroupSample.ts [dedicatedhostgroupslistbysubscriptionmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsListBySubscriptionMaximumSetGen.ts [dedicatedhostgroupslistbysubscriptionminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsListBySubscriptionMinimumSetGen.ts +[dedicatedhostgroupslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsListBySubscriptionSample.ts [dedicatedhostgroupsupdatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsUpdateMaximumSetGen.ts [dedicatedhostgroupsupdateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsUpdateMinimumSetGen.ts +[dedicatedhostgroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsUpdateSample.ts +[dedicatedhostscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsCreateOrUpdateSample.ts [dedicatedhostsdeletemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsDeleteMaximumSetGen.ts [dedicatedhostsdeleteminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsDeleteMinimumSetGen.ts +[dedicatedhostsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsDeleteSample.ts +[dedicatedhostsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsGetSample.ts [dedicatedhostslistbyhostgroupmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsListByHostGroupMaximumSetGen.ts [dedicatedhostslistbyhostgroupminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsListByHostGroupMinimumSetGen.ts +[dedicatedhostslistbyhostgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsListByHostGroupSample.ts +[dedicatedhostsrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsRestartSample.ts [dedicatedhostsupdatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsUpdateMaximumSetGen.ts [dedicatedhostsupdateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsUpdateMinimumSetGen.ts +[dedicatedhostsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsUpdateSample.ts [deleteadiskaccessresource]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/deleteADiskAccessResource.ts [deleteadiskencryptionset]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/deleteADiskEncryptionSet.ts [deleteagallery]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/deleteAGallery.ts @@ -745,11 +1082,68 @@ Take a look at our [API Documentation][apiref] for more information about the AP [deletecloudserviceroleinstances]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/deleteCloudServiceRoleInstances.ts [deletevirtualmachinescalesetvmextension]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/deleteVirtualMachineScaleSetVMExtension.ts [deletevirtualmachinescalesetvmruncommand]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/deleteVirtualMachineScaleSetVMRunCommand.ts +[diskaccessescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesCreateOrUpdateSample.ts +[diskaccessesdeleteaprivateendpointconnectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesDeleteAPrivateEndpointConnectionSample.ts +[diskaccessesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesDeleteSample.ts +[diskaccessesgetaprivateendpointconnectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesGetAPrivateEndpointConnectionSample.ts +[diskaccessesgetprivatelinkresourcessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesGetPrivateLinkResourcesSample.ts +[diskaccessesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesGetSample.ts +[diskaccesseslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesListByResourceGroupSample.ts +[diskaccesseslistprivateendpointconnectionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesListPrivateEndpointConnectionsSample.ts +[diskaccesseslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesListSample.ts +[diskaccessesupdateaprivateendpointconnectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesUpdateAPrivateEndpointConnectionSample.ts +[diskaccessesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesUpdateSample.ts +[diskencryptionsetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsCreateOrUpdateSample.ts +[diskencryptionsetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsDeleteSample.ts +[diskencryptionsetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsGetSample.ts +[diskencryptionsetslistassociatedresourcessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsListAssociatedResourcesSample.ts +[diskencryptionsetslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsListByResourceGroupSample.ts +[diskencryptionsetslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsListSample.ts +[diskencryptionsetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsUpdateSample.ts +[diskrestorepointgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/diskRestorePointGetSample.ts +[diskrestorepointgrantaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/diskRestorePointGrantAccessSample.ts +[diskrestorepointlistbyrestorepointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/diskRestorePointListByRestorePointSample.ts +[diskrestorepointrevokeaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/diskRestorePointRevokeAccessSample.ts +[diskscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/disksCreateOrUpdateSample.ts +[disksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/disksDeleteSample.ts +[disksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/disksGetSample.ts +[disksgrantaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/disksGrantAccessSample.ts +[diskslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/disksListByResourceGroupSample.ts +[diskslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/disksListSample.ts +[disksrevokeaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/disksRevokeAccessSample.ts +[disksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/disksUpdateSample.ts [exportlogswhichcontainallapirequestsmadetocomputeresourceproviderwithinthegiventimeperiodbrokendownbyintervals]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/exportLogsWhichContainAllApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriodBrokenDownByIntervals.ts [exportlogswhichcontainallthrottledapirequestsmadetocomputeresourceproviderwithinthegiventimeperiod]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/exportLogsWhichContainAllThrottledApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriod.ts [forcedeleteavm]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/forceDeleteAVM.ts [forcedeleteavmscaleset]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/forceDeleteAVMScaleSet.ts [forcedeleteavirtualmachinefromavmscaleset]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/forceDeleteAVirtualMachineFromAVMScaleSet.ts +[galleriescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/galleriesCreateOrUpdateSample.ts +[galleriesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/galleriesDeleteSample.ts +[galleriesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/galleriesGetSample.ts +[gallerieslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/galleriesListByResourceGroupSample.ts +[gallerieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/galleriesListSample.ts +[galleriesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/galleriesUpdateSample.ts +[galleryapplicationversionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationVersionsCreateOrUpdateSample.ts +[galleryapplicationversionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationVersionsDeleteSample.ts +[galleryapplicationversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationVersionsGetSample.ts +[galleryapplicationversionslistbygalleryapplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationVersionsListByGalleryApplicationSample.ts +[galleryapplicationversionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationVersionsUpdateSample.ts +[galleryapplicationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationsCreateOrUpdateSample.ts +[galleryapplicationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationsDeleteSample.ts +[galleryapplicationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationsGetSample.ts +[galleryapplicationslistbygallerysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationsListByGallerySample.ts +[galleryapplicationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationsUpdateSample.ts +[galleryimageversionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImageVersionsCreateOrUpdateSample.ts +[galleryimageversionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImageVersionsDeleteSample.ts +[galleryimageversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImageVersionsGetSample.ts +[galleryimageversionslistbygalleryimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImageVersionsListByGalleryImageSample.ts +[galleryimageversionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImageVersionsUpdateSample.ts +[galleryimagescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImagesCreateOrUpdateSample.ts +[galleryimagesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImagesDeleteSample.ts +[galleryimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImagesGetSample.ts +[galleryimageslistbygallerysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImagesListByGallerySample.ts +[galleryimagesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImagesUpdateSample.ts +[gallerysharingprofileupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/gallerySharingProfileUpdateSample.ts [generalizeavirtualmachine]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/generalizeAVirtualMachine.ts [generateansshkeypair]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/generateAnSshKeyPair.ts [getacapacityreservation]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/getACapacityReservation.ts @@ -810,8 +1204,14 @@ Take a look at our [API Documentation][apiref] for more information about the AP [getsthelistofrestorepointcollectionsinaresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/getsTheListOfRestorePointCollectionsInAResourceGroup.ts [getsthelistofrestorepointcollectionsinasubscription]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/getsTheListOfRestorePointCollectionsInASubscription.ts [grantsaccesstoadiskrestorepoint]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/grantsAccessToADiskRestorePoint.ts +[imagescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/imagesCreateOrUpdateSample.ts [imagesdeletemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/imagesDeleteMaximumSetGen.ts [imagesdeleteminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/imagesDeleteMinimumSetGen.ts +[imagesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/imagesDeleteSample.ts +[imagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/imagesGetSample.ts +[imageslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/imagesListByResourceGroupSample.ts +[imageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/imagesListSample.ts +[imagesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/imagesUpdateSample.ts [installpatchstateofavirtualmachine]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/installPatchStateOfAVirtualMachine.ts [listalldiskaccessresourcesinaresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/listAllDiskAccessResourcesInAResourceGroup.ts [listalldiskaccessresourcesinasubscription]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/listAllDiskAccessResourcesInASubscription.ts @@ -851,8 +1251,17 @@ Take a look at our [API Documentation][apiref] for more information about the AP [listsallavailablevirtualmachinesizestowhichthespecifiedvirtualmachinecanberesized]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/listsAllAvailableVirtualMachineSizesToWhichTheSpecifiedVirtualMachineCanBeResized.ts [listsallthevmscalesetsunderthespecifiedsubscriptionforthespecifiedlocation]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/listsAllTheVMScaleSetsUnderTheSpecifiedSubscriptionForTheSpecifiedLocation.ts [listsallthevirtualmachinesunderthespecifiedsubscriptionforthespecifiedlocation]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/listsAllTheVirtualMachinesUnderTheSpecifiedSubscriptionForTheSpecifiedLocation.ts +[loganalyticsexportrequestratebyintervalsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/logAnalyticsExportRequestRateByIntervalSample.ts +[loganalyticsexportthrottledrequestssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/logAnalyticsExportThrottledRequestsSample.ts [operationslistmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/operationsListMaximumSetGen.ts [operationslistminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/operationsListMinimumSetGen.ts +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/operationsListSample.ts +[proximityplacementgroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/proximityPlacementGroupsCreateOrUpdateSample.ts +[proximityplacementgroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/proximityPlacementGroupsDeleteSample.ts +[proximityplacementgroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/proximityPlacementGroupsGetSample.ts +[proximityplacementgroupslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/proximityPlacementGroupsListByResourceGroupSample.ts +[proximityplacementgroupslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/proximityPlacementGroupsListBySubscriptionSample.ts +[proximityplacementgroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/proximityPlacementGroupsUpdateSample.ts [reapplythestateofavirtualmachine]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/reapplyTheStateOfAVirtualMachine.ts [rebuildcloudserviceroleinstance]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/rebuildCloudServiceRoleInstance.ts [rebuildcloudserviceroleinstances]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/rebuildCloudServiceRoleInstances.ts @@ -860,29 +1269,60 @@ Take a look at our [API Documentation][apiref] for more information about the AP [reimagecloudserviceroleinstance]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/reimageCloudServiceRoleInstance.ts [reimagecloudserviceroleinstances]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/reimageCloudServiceRoleInstances.ts [resetsharingprofileofagallery]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/resetSharingProfileOfAGallery.ts +[resourceskuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/resourceSkusListSample.ts [restartcloudserviceroleinstance]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/restartCloudServiceRoleInstance.ts [restartcloudserviceroleinstances]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/restartCloudServiceRoleInstances.ts [restartdedicatedhost]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/restartDedicatedHost.ts +[restorepointcollectionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsCreateOrUpdateSample.ts [restorepointcollectionsdeletemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsDeleteMaximumSetGen.ts [restorepointcollectionsdeleteminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsDeleteMinimumSetGen.ts +[restorepointcollectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsDeleteSample.ts +[restorepointcollectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsGetSample.ts +[restorepointcollectionslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsListAllSample.ts +[restorepointcollectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsListSample.ts [restorepointcollectionsupdatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsUpdateMaximumSetGen.ts [restorepointcollectionsupdateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsUpdateMinimumSetGen.ts +[restorepointcollectionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsUpdateSample.ts +[restorepointscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointsCreateSample.ts [restorepointsdeletemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointsDeleteMaximumSetGen.ts [restorepointsdeleteminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointsDeleteMinimumSetGen.ts +[restorepointsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointsDeleteSample.ts +[restorepointsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointsGetSample.ts [retrievebootdiagnosticsdataofavirtualmachine]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/retrieveBootDiagnosticsDataOfAVirtualMachine.ts [revokeaccesstoamanageddisk]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/revokeAccessToAManagedDisk.ts [revokeaccesstoasnapshot]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/revokeAccessToASnapshot.ts [revokesaccesstoadiskrestorepoint]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/revokesAccessToADiskRestorePoint.ts [shareagallerytocommunity]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/shareAGalleryToCommunity.ts +[sharedgalleriesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/sharedGalleriesGetSample.ts +[sharedgallerieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/sharedGalleriesListSample.ts +[sharedgalleryimageversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/sharedGalleryImageVersionsGetSample.ts +[sharedgalleryimageversionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/sharedGalleryImageVersionsListSample.ts +[sharedgalleryimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/sharedGalleryImagesGetSample.ts +[sharedgalleryimageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/sharedGalleryImagesListSample.ts [simulateevictionavirtualmachine]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/simulateEvictionAVirtualMachine.ts +[snapshotscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsCreateOrUpdateSample.ts +[snapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsDeleteSample.ts +[snapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsGetSample.ts +[snapshotsgrantaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsGrantAccessSample.ts +[snapshotslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsListByResourceGroupSample.ts +[snapshotslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsListSample.ts +[snapshotsrevokeaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsRevokeAccessSample.ts +[snapshotsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsUpdateSample.ts +[sshpublickeyscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysCreateSample.ts [sshpublickeysdeletemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysDeleteMaximumSetGen.ts [sshpublickeysdeleteminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysDeleteMinimumSetGen.ts +[sshpublickeysdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysDeleteSample.ts +[sshpublickeysgeneratekeypairsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysGenerateKeyPairSample.ts +[sshpublickeysgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysGetSample.ts [sshpublickeyslistbyresourcegroupmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysListByResourceGroupMaximumSetGen.ts [sshpublickeyslistbyresourcegroupminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysListByResourceGroupMinimumSetGen.ts +[sshpublickeyslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysListByResourceGroupSample.ts [sshpublickeyslistbysubscriptionmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysListBySubscriptionMaximumSetGen.ts [sshpublickeyslistbysubscriptionminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysListBySubscriptionMinimumSetGen.ts +[sshpublickeyslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysListBySubscriptionSample.ts [sshpublickeysupdatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysUpdateMaximumSetGen.ts [sshpublickeysupdateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysUpdateMinimumSetGen.ts +[sshpublickeysupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysUpdateSample.ts [startanextensionrollingupgrade]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/startAnExtensionRollingUpgrade.ts [startcloudservice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/startCloudService.ts [stoporpoweroffcloudservice]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/stopOrPowerOffCloudService.ts @@ -915,140 +1355,250 @@ Take a look at our [API Documentation][apiref] for more information about the AP [updatestagsofanimage]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/updatesTagsOfAnImage.ts [usagelistmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/usageListMaximumSetGen.ts [usagelistminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/usageListMinimumSetGen.ts +[usagelistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/usageListSample.ts [virtualmachineextensionimagesgetmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionImagesGetMaximumSetGen.ts [virtualmachineextensionimagesgetminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionImagesGetMinimumSetGen.ts +[virtualmachineextensionimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionImagesGetSample.ts [virtualmachineextensionimageslisttypesmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionImagesListTypesMaximumSetGen.ts [virtualmachineextensionimageslisttypesminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionImagesListTypesMinimumSetGen.ts +[virtualmachineextensionimageslisttypessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionImagesListTypesSample.ts [virtualmachineextensionimageslistversionsmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionImagesListVersionsMaximumSetGen.ts [virtualmachineextensionimageslistversionsminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionImagesListVersionsMinimumSetGen.ts +[virtualmachineextensionimageslistversionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionImagesListVersionsSample.ts [virtualmachineextensionscreateorupdatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsCreateOrUpdateMaximumSetGen.ts [virtualmachineextensionscreateorupdateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsCreateOrUpdateMinimumSetGen.ts +[virtualmachineextensionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsCreateOrUpdateSample.ts [virtualmachineextensionsdeletemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsDeleteMaximumSetGen.ts [virtualmachineextensionsdeleteminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsDeleteMinimumSetGen.ts +[virtualmachineextensionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsDeleteSample.ts [virtualmachineextensionsgetmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsGetMaximumSetGen.ts [virtualmachineextensionsgetminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsGetMinimumSetGen.ts +[virtualmachineextensionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsGetSample.ts [virtualmachineextensionslistmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsListMaximumSetGen.ts [virtualmachineextensionslistminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsListMinimumSetGen.ts +[virtualmachineextensionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsListSample.ts +[virtualmachineextensionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsUpdateSample.ts [virtualmachineimagesedgezonegetmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneGetMaximumSetGen.ts [virtualmachineimagesedgezonegetminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneGetMinimumSetGen.ts +[virtualmachineimagesedgezonegetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneGetSample.ts [virtualmachineimagesedgezonelistmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneListMaximumSetGen.ts [virtualmachineimagesedgezonelistminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneListMinimumSetGen.ts [virtualmachineimagesedgezonelistoffersmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneListOffersMaximumSetGen.ts [virtualmachineimagesedgezonelistoffersminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneListOffersMinimumSetGen.ts +[virtualmachineimagesedgezonelistofferssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneListOffersSample.ts [virtualmachineimagesedgezonelistpublishersmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneListPublishersMaximumSetGen.ts [virtualmachineimagesedgezonelistpublishersminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneListPublishersMinimumSetGen.ts +[virtualmachineimagesedgezonelistpublisherssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneListPublishersSample.ts +[virtualmachineimagesedgezonelistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneListSample.ts [virtualmachineimagesedgezonelistskusmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneListSkusMaximumSetGen.ts [virtualmachineimagesedgezonelistskusminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneListSkusMinimumSetGen.ts +[virtualmachineimagesedgezonelistskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneListSkusSample.ts [virtualmachineimagesgetmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesGetMaximumSetGen.ts [virtualmachineimagesgetminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesGetMinimumSetGen.ts +[virtualmachineimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesGetSample.ts [virtualmachineimageslistmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesListMaximumSetGen.ts [virtualmachineimageslistminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesListMinimumSetGen.ts [virtualmachineimageslistoffersmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesListOffersMaximumSetGen.ts [virtualmachineimageslistoffersminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesListOffersMinimumSetGen.ts +[virtualmachineimageslistofferssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesListOffersSample.ts [virtualmachineimageslistpublishersmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesListPublishersMaximumSetGen.ts [virtualmachineimageslistpublishersminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesListPublishersMinimumSetGen.ts +[virtualmachineimageslistpublisherssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesListPublishersSample.ts +[virtualmachineimageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesListSample.ts [virtualmachineimageslistskusmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesListSkusMaximumSetGen.ts [virtualmachineimageslistskusminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesListSkusMinimumSetGen.ts +[virtualmachineimageslistskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesListSkusSample.ts [virtualmachineruncommand]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommand.ts [virtualmachineruncommandget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandGet.ts [virtualmachineruncommandlist]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandList.ts +[virtualmachineruncommandscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsCreateOrUpdateSample.ts +[virtualmachineruncommandsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsDeleteSample.ts +[virtualmachineruncommandsgetbyvirtualmachinesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsGetByVirtualMachineSample.ts +[virtualmachineruncommandsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsGetSample.ts +[virtualmachineruncommandslistbyvirtualmachinesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsListByVirtualMachineSample.ts +[virtualmachineruncommandslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsListSample.ts +[virtualmachineruncommandsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsUpdateSample.ts [virtualmachinescalesetextensionscreateorupdatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsCreateOrUpdateMaximumSetGen.ts [virtualmachinescalesetextensionscreateorupdateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsCreateOrUpdateMinimumSetGen.ts +[virtualmachinescalesetextensionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsCreateOrUpdateSample.ts [virtualmachinescalesetextensionsdeletemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsDeleteMaximumSetGen.ts [virtualmachinescalesetextensionsdeleteminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsDeleteMinimumSetGen.ts +[virtualmachinescalesetextensionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsDeleteSample.ts [virtualmachinescalesetextensionsgetmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsGetMaximumSetGen.ts [virtualmachinescalesetextensionsgetminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsGetMinimumSetGen.ts +[virtualmachinescalesetextensionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsGetSample.ts [virtualmachinescalesetextensionslistmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsListMaximumSetGen.ts [virtualmachinescalesetextensionslistminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsListMinimumSetGen.ts +[virtualmachinescalesetextensionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsListSample.ts [virtualmachinescalesetextensionsupdatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsUpdateMaximumSetGen.ts [virtualmachinescalesetextensionsupdateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsUpdateMinimumSetGen.ts +[virtualmachinescalesetextensionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsUpdateSample.ts [virtualmachinescalesetrollingupgradescancelmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetRollingUpgradesCancelMaximumSetGen.ts [virtualmachinescalesetrollingupgradescancelminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetRollingUpgradesCancelMinimumSetGen.ts +[virtualmachinescalesetrollingupgradescancelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetRollingUpgradesCancelSample.ts [virtualmachinescalesetrollingupgradesgetlatestmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetRollingUpgradesGetLatestMaximumSetGen.ts [virtualmachinescalesetrollingupgradesgetlatestminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetRollingUpgradesGetLatestMinimumSetGen.ts +[virtualmachinescalesetrollingupgradesgetlatestsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetRollingUpgradesGetLatestSample.ts +[virtualmachinescalesetrollingupgradesstartextensionupgradesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.ts [virtualmachinescalesetrollingupgradesstartosupgrademaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetRollingUpgradesStartOSUpgradeMaximumSetGen.ts [virtualmachinescalesetrollingupgradesstartosupgrademinimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetRollingUpgradesStartOSUpgradeMinimumSetGen.ts +[virtualmachinescalesetrollingupgradesstartosupgradesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.ts +[virtualmachinescalesetvmextensionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.ts +[virtualmachinescalesetvmextensionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMExtensionsDeleteSample.ts +[virtualmachinescalesetvmextensionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMExtensionsGetSample.ts +[virtualmachinescalesetvmextensionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMExtensionsListSample.ts +[virtualmachinescalesetvmextensionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMExtensionsUpdateSample.ts +[virtualmachinescalesetvmruncommandscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.ts +[virtualmachinescalesetvmruncommandsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMRunCommandsDeleteSample.ts +[virtualmachinescalesetvmruncommandsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMRunCommandsGetSample.ts +[virtualmachinescalesetvmruncommandslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMRunCommandsListSample.ts +[virtualmachinescalesetvmruncommandsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMRunCommandsUpdateSample.ts [virtualmachinescalesetvmsdeallocatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSDeallocateMaximumSetGen.ts [virtualmachinescalesetvmsdeallocateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSDeallocateMinimumSetGen.ts +[virtualmachinescalesetvmsdeallocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSDeallocateSample.ts +[virtualmachinescalesetvmsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSDeleteSample.ts +[virtualmachinescalesetvmsgetinstanceviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSGetInstanceViewSample.ts +[virtualmachinescalesetvmsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSGetSample.ts [virtualmachinescalesetvmslistmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSListMaximumSetGen.ts [virtualmachinescalesetvmslistminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSListMinimumSetGen.ts +[virtualmachinescalesetvmslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSListSample.ts [virtualmachinescalesetvmsperformmaintenancemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSPerformMaintenanceMaximumSetGen.ts [virtualmachinescalesetvmsperformmaintenanceminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSPerformMaintenanceMinimumSetGen.ts +[virtualmachinescalesetvmsperformmaintenancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSPerformMaintenanceSample.ts [virtualmachinescalesetvmspoweroffmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSPowerOffMaximumSetGen.ts [virtualmachinescalesetvmspoweroffminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSPowerOffMinimumSetGen.ts +[virtualmachinescalesetvmspoweroffsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSPowerOffSample.ts [virtualmachinescalesetvmsredeploymaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSRedeployMaximumSetGen.ts [virtualmachinescalesetvmsredeployminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSRedeployMinimumSetGen.ts +[virtualmachinescalesetvmsredeploysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSRedeploySample.ts [virtualmachinescalesetvmsreimageallmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSReimageAllMaximumSetGen.ts [virtualmachinescalesetvmsreimageallminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSReimageAllMinimumSetGen.ts +[virtualmachinescalesetvmsreimageallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSReimageAllSample.ts [virtualmachinescalesetvmsreimagemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSReimageMaximumSetGen.ts [virtualmachinescalesetvmsreimageminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSReimageMinimumSetGen.ts +[virtualmachinescalesetvmsreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSReimageSample.ts [virtualmachinescalesetvmsrestartmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSRestartMaximumSetGen.ts [virtualmachinescalesetvmsrestartminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSRestartMinimumSetGen.ts +[virtualmachinescalesetvmsrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSRestartSample.ts +[virtualmachinescalesetvmsretrievebootdiagnosticsdatasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.ts [virtualmachinescalesetvmsruncommand]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSRunCommand.ts +[virtualmachinescalesetvmsruncommandsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSRunCommandSample.ts +[virtualmachinescalesetvmssimulateevictionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSSimulateEvictionSample.ts [virtualmachinescalesetvmsstartmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSStartMaximumSetGen.ts [virtualmachinescalesetvmsstartminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSStartMinimumSetGen.ts +[virtualmachinescalesetvmsstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSStartSample.ts [virtualmachinescalesetvmsupdatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSUpdateMaximumSetGen.ts [virtualmachinescalesetvmsupdateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSUpdateMinimumSetGen.ts +[virtualmachinescalesetvmsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSUpdateSample.ts [virtualmachinescalesetsconverttosingleplacementgroupmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsConvertToSinglePlacementGroupMaximumSetGen.ts [virtualmachinescalesetsconverttosingleplacementgroupminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsConvertToSinglePlacementGroupMinimumSetGen.ts +[virtualmachinescalesetsconverttosingleplacementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.ts +[virtualmachinescalesetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsCreateOrUpdateSample.ts [virtualmachinescalesetsdeallocatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsDeallocateMaximumSetGen.ts [virtualmachinescalesetsdeallocateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsDeallocateMinimumSetGen.ts +[virtualmachinescalesetsdeallocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsDeallocateSample.ts [virtualmachinescalesetsdeleteinstancesmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsDeleteInstancesMaximumSetGen.ts [virtualmachinescalesetsdeleteinstancesminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsDeleteInstancesMinimumSetGen.ts +[virtualmachinescalesetsdeleteinstancessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsDeleteInstancesSample.ts +[virtualmachinescalesetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsDeleteSample.ts [virtualmachinescalesetsforcerecoveryservicefabricplatformupdatedomainwalkmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkMaximumSetGen.ts [virtualmachinescalesetsforcerecoveryservicefabricplatformupdatedomainwalkminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkMinimumSetGen.ts +[virtualmachinescalesetsforcerecoveryservicefabricplatformupdatedomainwalksample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.ts [virtualmachinescalesetsgetinstanceviewmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsGetInstanceViewMaximumSetGen.ts [virtualmachinescalesetsgetinstanceviewminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsGetInstanceViewMinimumSetGen.ts +[virtualmachinescalesetsgetinstanceviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsGetInstanceViewSample.ts [virtualmachinescalesetsgetosupgradehistorymaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsGetOSUpgradeHistoryMaximumSetGen.ts [virtualmachinescalesetsgetosupgradehistoryminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsGetOSUpgradeHistoryMinimumSetGen.ts +[virtualmachinescalesetsgetosupgradehistorysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsGetOSUpgradeHistorySample.ts +[virtualmachinescalesetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsGetSample.ts [virtualmachinescalesetslistallmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsListAllMaximumSetGen.ts [virtualmachinescalesetslistallminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsListAllMinimumSetGen.ts +[virtualmachinescalesetslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsListAllSample.ts +[virtualmachinescalesetslistbylocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsListByLocationSample.ts [virtualmachinescalesetslistmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsListMaximumSetGen.ts [virtualmachinescalesetslistminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsListMinimumSetGen.ts +[virtualmachinescalesetslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsListSample.ts [virtualmachinescalesetslistskusmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsListSkusMaximumSetGen.ts [virtualmachinescalesetslistskusminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsListSkusMinimumSetGen.ts +[virtualmachinescalesetslistskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsListSkusSample.ts [virtualmachinescalesetsperformmaintenancemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsPerformMaintenanceMaximumSetGen.ts [virtualmachinescalesetsperformmaintenanceminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsPerformMaintenanceMinimumSetGen.ts +[virtualmachinescalesetsperformmaintenancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsPerformMaintenanceSample.ts [virtualmachinescalesetspoweroffmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsPowerOffMaximumSetGen.ts [virtualmachinescalesetspoweroffminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsPowerOffMinimumSetGen.ts +[virtualmachinescalesetspoweroffsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsPowerOffSample.ts [virtualmachinescalesetsredeploymaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsRedeployMaximumSetGen.ts [virtualmachinescalesetsredeployminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsRedeployMinimumSetGen.ts +[virtualmachinescalesetsredeploysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsRedeploySample.ts [virtualmachinescalesetsreimageallmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsReimageAllMaximumSetGen.ts [virtualmachinescalesetsreimageallminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsReimageAllMinimumSetGen.ts +[virtualmachinescalesetsreimageallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsReimageAllSample.ts [virtualmachinescalesetsreimagemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsReimageMaximumSetGen.ts [virtualmachinescalesetsreimageminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsReimageMinimumSetGen.ts +[virtualmachinescalesetsreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsReimageSample.ts [virtualmachinescalesetsrestartmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsRestartMaximumSetGen.ts [virtualmachinescalesetsrestartminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsRestartMinimumSetGen.ts +[virtualmachinescalesetsrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsRestartSample.ts [virtualmachinescalesetssetorchestrationservicestatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsSetOrchestrationServiceStateMaximumSetGen.ts [virtualmachinescalesetssetorchestrationservicestateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsSetOrchestrationServiceStateMinimumSetGen.ts +[virtualmachinescalesetssetorchestrationservicestatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsSetOrchestrationServiceStateSample.ts [virtualmachinescalesetsstartmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsStartMaximumSetGen.ts [virtualmachinescalesetsstartminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsStartMinimumSetGen.ts +[virtualmachinescalesetsstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsStartSample.ts [virtualmachinescalesetsupdateinstancesmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsUpdateInstancesMaximumSetGen.ts [virtualmachinescalesetsupdateinstancesminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsUpdateInstancesMinimumSetGen.ts +[virtualmachinescalesetsupdateinstancessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsUpdateInstancesSample.ts [virtualmachinescalesetsupdatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsUpdateMaximumSetGen.ts [virtualmachinescalesetsupdateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsUpdateMinimumSetGen.ts +[virtualmachinescalesetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsUpdateSample.ts [virtualmachinesizeslistmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineSizesListMaximumSetGen.ts [virtualmachinesizeslistminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineSizesListMinimumSetGen.ts +[virtualmachinesizeslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineSizesListSample.ts +[virtualmachinesassesspatchessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesAssessPatchesSample.ts [virtualmachinescapturemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesCaptureMaximumSetGen.ts [virtualmachinescaptureminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesCaptureMinimumSetGen.ts +[virtualmachinescapturesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesCaptureSample.ts [virtualmachinesconverttomanageddisksmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesConvertToManagedDisksMaximumSetGen.ts [virtualmachinesconverttomanageddisksminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesConvertToManagedDisksMinimumSetGen.ts +[virtualmachinesconverttomanageddiskssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesConvertToManagedDisksSample.ts +[virtualmachinescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesCreateOrUpdateSample.ts [virtualmachinesdeallocatemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesDeallocateMaximumSetGen.ts [virtualmachinesdeallocateminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesDeallocateMinimumSetGen.ts +[virtualmachinesdeallocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesDeallocateSample.ts +[virtualmachinesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesDeleteSample.ts +[virtualmachinesgeneralizesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesGeneralizeSample.ts +[virtualmachinesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesGetSample.ts +[virtualmachinesinstallpatchessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesInstallPatchesSample.ts +[virtualmachinesinstanceviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesInstanceViewSample.ts [virtualmachineslistallmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesListAllMaximumSetGen.ts [virtualmachineslistallminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesListAllMinimumSetGen.ts +[virtualmachineslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesListAllSample.ts +[virtualmachineslistavailablesizessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesListAvailableSizesSample.ts +[virtualmachineslistbylocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesListByLocationSample.ts [virtualmachineslistmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesListMaximumSetGen.ts [virtualmachineslistminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesListMinimumSetGen.ts +[virtualmachineslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesListSample.ts [virtualmachinesperformmaintenancemaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesPerformMaintenanceMaximumSetGen.ts [virtualmachinesperformmaintenanceminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesPerformMaintenanceMinimumSetGen.ts +[virtualmachinesperformmaintenancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesPerformMaintenanceSample.ts [virtualmachinespoweroffmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesPowerOffMaximumSetGen.ts [virtualmachinespoweroffminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesPowerOffMinimumSetGen.ts +[virtualmachinespoweroffsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesPowerOffSample.ts +[virtualmachinesreapplysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesReapplySample.ts [virtualmachinesredeploymaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesRedeployMaximumSetGen.ts [virtualmachinesredeployminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesRedeployMinimumSetGen.ts +[virtualmachinesredeploysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesRedeploySample.ts +[virtualmachinesreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesReimageSample.ts [virtualmachinesrestartmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesRestartMaximumSetGen.ts [virtualmachinesrestartminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesRestartMinimumSetGen.ts +[virtualmachinesrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesRestartSample.ts +[virtualmachinesretrievebootdiagnosticsdatasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesRetrieveBootDiagnosticsDataSample.ts +[virtualmachinesruncommandsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesRunCommandSample.ts +[virtualmachinessimulateevictionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesSimulateEvictionSample.ts [virtualmachinesstartmaximumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesStartMaximumSetGen.ts [virtualmachinesstartminimumsetgen]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesStartMinimumSetGen.ts +[virtualmachinesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesStartSample.ts +[virtualmachinesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesUpdateSample.ts [apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-compute?view=azure-node-preview [freesub]: https://azure.microsoft.com/free/ [package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/compute/arm-compute/README.md diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..d8ab1cc23673 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsCreateOrUpdateSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AvailabilitySet, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update an availability set. + * + * @summary Create or update an availability set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnAvailabilitySet.json + */ +async function createAnAvailabilitySet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const availabilitySetName = "myAvailabilitySet"; + const parameters: AvailabilitySet = { + location: "westus", + platformFaultDomainCount: 2, + platformUpdateDomainCount: 20 + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.createOrUpdate( + resourceGroupName, + availabilitySetName, + parameters + ); + console.log(result); +} + +createAnAvailabilitySet().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsDeleteSample.ts new file mode 100644 index 000000000000..1f75affa45d7 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsDeleteSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete an availability set. + * + * @summary Delete an availability set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Delete_MaximumSet_Gen.json + */ +async function availabilitySetsDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const availabilitySetName = "aaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.delete( + resourceGroupName, + availabilitySetName + ); + console.log(result); +} + +availabilitySetsDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Delete an availability set. + * + * @summary Delete an availability set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Delete_MinimumSet_Gen.json + */ +async function availabilitySetsDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const availabilitySetName = "aaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.delete( + resourceGroupName, + availabilitySetName + ); + console.log(result); +} + +availabilitySetsDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsGetSample.ts new file mode 100644 index 000000000000..35f6dbf90809 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsGetSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Retrieves information about an availability set. + * + * @summary Retrieves information about an availability set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Get_MaximumSet_Gen.json + */ +async function availabilitySetsGetMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const availabilitySetName = "aaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.get( + resourceGroupName, + availabilitySetName + ); + console.log(result); +} + +availabilitySetsGetMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about an availability set. + * + * @summary Retrieves information about an availability set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Get_MinimumSet_Gen.json + */ +async function availabilitySetsGetMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const availabilitySetName = "aaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.get( + resourceGroupName, + availabilitySetName + ); + console.log(result); +} + +availabilitySetsGetMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsListAvailableSizesSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsListAvailableSizesSample.ts new file mode 100644 index 000000000000..3a8368a9ff88 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsListAvailableSizesSample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. + * + * @summary Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_ListAvailableSizes_MaximumSet_Gen.json + */ +async function availabilitySetsListAvailableSizesMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const availabilitySetName = "aaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.availabilitySets.listAvailableSizes( + resourceGroupName, + availabilitySetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +availabilitySetsListAvailableSizesMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. + * + * @summary Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_ListAvailableSizes_MinimumSet_Gen.json + */ +async function availabilitySetsListAvailableSizesMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const availabilitySetName = "aa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.availabilitySets.listAvailableSizes( + resourceGroupName, + availabilitySetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +availabilitySetsListAvailableSizesMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsListBySubscriptionSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsListBySubscriptionSample.ts new file mode 100644 index 000000000000..78b9f9c10cbe --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsListBySubscriptionSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AvailabilitySetsListBySubscriptionOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all availability sets in a subscription. + * + * @summary Lists all availability sets in a subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListAvailabilitySetsInASubscription.json + */ +async function listAvailabilitySetsInASubscription() { + const subscriptionId = "{subscriptionId}"; + const expand = "virtualMachines$ref"; + const options: AvailabilitySetsListBySubscriptionOptionalParams = { expand }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.availabilitySets.listBySubscription(options)) { + resArray.push(item); + } + console.log(resArray); +} + +listAvailabilitySetsInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsListSample.ts new file mode 100644 index 000000000000..c6574f3fe425 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsListSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all availability sets in a resource group. + * + * @summary Lists all availability sets in a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_List_MaximumSet_Gen.json + */ +async function availabilitySetsListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.availabilitySets.list(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +availabilitySetsListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Lists all availability sets in a resource group. + * + * @summary Lists all availability sets in a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_List_MinimumSet_Gen.json + */ +async function availabilitySetsListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.availabilitySets.list(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +availabilitySetsListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsUpdateSample.ts new file mode 100644 index 000000000000..48f6641b051d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/availabilitySetsUpdateSample.ts @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + AvailabilitySetUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update an availability set. + * + * @summary Update an availability set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Update_MaximumSet_Gen.json + */ +async function availabilitySetsUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const availabilitySetName = "aaaaaaaaaaaaaaaaaaa"; + const parameters: AvailabilitySetUpdate = { + platformFaultDomainCount: 2, + platformUpdateDomainCount: 20, + proximityPlacementGroup: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + }, + sku: { name: "DSv3-Type1", capacity: 7, tier: "aaa" }, + tags: { key2574: "aaaaaaaa" }, + virtualMachines: [ + { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + } + ] + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.update( + resourceGroupName, + availabilitySetName, + parameters + ); + console.log(result); +} + +availabilitySetsUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Update an availability set. + * + * @summary Update an availability set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Update_MinimumSet_Gen.json + */ +async function availabilitySetsUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const availabilitySetName = "aaaaaaaaaaaaaaaaaaaa"; + const parameters: AvailabilitySetUpdate = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.update( + resourceGroupName, + availabilitySetName, + parameters + ); + console.log(result); +} + +availabilitySetsUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..c8f2b720bdef --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsCreateOrUpdateSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CapacityReservationGroup, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateACapacityReservationGroup.json + */ +async function createOrUpdateACapacityReservationGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const capacityReservationGroupName = "myCapacityReservationGroup"; + const parameters: CapacityReservationGroup = { + location: "westus", + tags: { department: "finance" }, + zones: ["1", "2"] + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.createOrUpdate( + resourceGroupName, + capacityReservationGroupName, + parameters + ); + console.log(result); +} + +createOrUpdateACapacityReservationGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsDeleteSample.ts new file mode 100644 index 000000000000..08592d6a93b6 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsDeleteSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Delete_MaximumSet_Gen.json + */ +async function capacityReservationGroupsDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const capacityReservationGroupName = "a"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.delete( + resourceGroupName, + capacityReservationGroupName + ); + console.log(result); +} + +capacityReservationGroupsDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Delete_MinimumSet_Gen.json + */ +async function capacityReservationGroupsDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const capacityReservationGroupName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.delete( + resourceGroupName, + capacityReservationGroupName + ); + console.log(result); +} + +capacityReservationGroupsDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsGetSample.ts new file mode 100644 index 000000000000..1335ae08c3af --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation that retrieves information about a capacity reservation group. + * + * @summary The operation that retrieves information about a capacity reservation group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetACapacityReservationGroup.json + */ +async function getACapacityReservationGroup() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const capacityReservationGroupName = "myCapacityReservationGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.get( + resourceGroupName, + capacityReservationGroupName + ); + console.log(result); +} + +getACapacityReservationGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsListByResourceGroupSample.ts new file mode 100644 index 000000000000..620bd2a55af5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsListByResourceGroupSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CapacityReservationGroupsListByResourceGroupOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups. + * + * @summary Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListCapacityReservationGroupsInResourceGroup.json + */ +async function listCapacityReservationGroupsInResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const expand = "virtualMachines/$ref"; + const options: CapacityReservationGroupsListByResourceGroupOptionalParams = { + expand + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.capacityReservationGroups.listByResourceGroup( + resourceGroupName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +listCapacityReservationGroupsInResourceGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsListBySubscriptionSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsListBySubscriptionSample.ts new file mode 100644 index 000000000000..5af5c6cd72c9 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsListBySubscriptionSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + CapacityReservationGroupsListBySubscriptionOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. + * + * @summary Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListCapacityReservationGroupsInSubscription.json + */ +async function listCapacityReservationGroupsInSubscription() { + const subscriptionId = "{subscription-id}"; + const expand = "virtualMachines/$ref"; + const options: CapacityReservationGroupsListBySubscriptionOptionalParams = { + expand + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.capacityReservationGroups.listBySubscription( + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +listCapacityReservationGroupsInSubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsUpdateSample.ts new file mode 100644 index 000000000000..fdec70b83509 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationGroupsUpdateSample.ts @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + CapacityReservationGroupUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may be modified. + * + * @summary The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may be modified. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Update_MaximumSet_Gen.json + */ +async function capacityReservationGroupsUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const capacityReservationGroupName = "aaaaaaaaaaaaaaaaaaaaaa"; + const parameters: CapacityReservationGroupUpdate = { + instanceView: {}, + tags: { key5355: "aaa" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.update( + resourceGroupName, + capacityReservationGroupName, + parameters + ); + console.log(result); +} + +capacityReservationGroupsUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may be modified. + * + * @summary The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may be modified. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Update_MinimumSet_Gen.json + */ +async function capacityReservationGroupsUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const capacityReservationGroupName = "aaaaaaaaaaaaaaaaaaaaaa"; + const parameters: CapacityReservationGroupUpdate = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.update( + resourceGroupName, + capacityReservationGroupName, + parameters + ); + console.log(result); +} + +capacityReservationGroupsUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..24a939aa50d2 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationsCreateOrUpdateSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CapacityReservation, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateACapacityReservation.json + */ +async function createOrUpdateACapacityReservation() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const capacityReservationGroupName = "myCapacityReservationGroup"; + const capacityReservationName = "myCapacityReservation"; + const parameters: CapacityReservation = { + location: "westus", + sku: { name: "Standard_DS1_v2", capacity: 4 }, + tags: { department: "HR" }, + zones: ["1"] + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.beginCreateOrUpdateAndWait( + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + parameters + ); + console.log(result); +} + +createOrUpdateACapacityReservation().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationsDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationsDeleteSample.ts new file mode 100644 index 000000000000..0420bbf13169 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationsDeleteSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Delete_MaximumSet_Gen.json + */ +async function capacityReservationsDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const capacityReservationGroupName = "aaaaaaaaaaa"; + const capacityReservationName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.beginDeleteAndWait( + resourceGroupName, + capacityReservationGroupName, + capacityReservationName + ); + console.log(result); +} + +capacityReservationsDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Delete_MinimumSet_Gen.json + */ +async function capacityReservationsDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const capacityReservationGroupName = "aaa"; + const capacityReservationName = "aaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.beginDeleteAndWait( + resourceGroupName, + capacityReservationGroupName, + capacityReservationName + ); + console.log(result); +} + +capacityReservationsDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationsGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationsGetSample.ts new file mode 100644 index 000000000000..f29a425b3d70 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation that retrieves information about the capacity reservation. + * + * @summary The operation that retrieves information about the capacity reservation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetACapacityReservation.json + */ +async function getACapacityReservation() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const capacityReservationGroupName = "myCapacityReservationGroup"; + const capacityReservationName = "myCapacityReservation"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.get( + resourceGroupName, + capacityReservationGroupName, + capacityReservationName + ); + console.log(result); +} + +getACapacityReservation().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationsListByCapacityReservationGroupSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationsListByCapacityReservationGroupSample.ts new file mode 100644 index 000000000000..ca1112c7c874 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationsListByCapacityReservationGroupSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. + * + * @summary Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListCapacityReservationsInReservationGroup.json + */ +async function listCapacityReservationsInReservationGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const capacityReservationGroupName = "myCapacityReservationGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.capacityReservations.listByCapacityReservationGroup( + resourceGroupName, + capacityReservationGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listCapacityReservationsInReservationGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationsUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationsUpdateSample.ts new file mode 100644 index 000000000000..1e3ac50fdaed --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/capacityReservationsUpdateSample.ts @@ -0,0 +1,80 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + CapacityReservationUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update a capacity reservation. + * + * @summary The operation to update a capacity reservation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Update_MaximumSet_Gen.json + */ +async function capacityReservationsUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const capacityReservationGroupName = "aaaaaaaaaa"; + const capacityReservationName = "aaaaaaaaaaaaaaaaaaa"; + const parameters: CapacityReservationUpdate = { + instanceView: { + statuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z") + } + ], + utilizationInfo: {} + }, + sku: { name: "DSv3-Type1", capacity: 7, tier: "aaa" }, + tags: { key4974: "aaaaaaaaaaaaaaaa" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.beginUpdateAndWait( + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + parameters + ); + console.log(result); +} + +capacityReservationsUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to update a capacity reservation. + * + * @summary The operation to update a capacity reservation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Update_MinimumSet_Gen.json + */ +async function capacityReservationsUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const capacityReservationGroupName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const capacityReservationName = "aaa"; + const parameters: CapacityReservationUpdate = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.beginUpdateAndWait( + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + parameters + ); + console.log(result); +} + +capacityReservationsUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceOperatingSystemsGetOSFamilySample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceOperatingSystemsGetOSFamilySample.ts new file mode 100644 index 000000000000..7303242eaea6 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceOperatingSystemsGetOSFamilySample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets properties of a guest operating system family that can be specified in the XML service configuration (.cscfg) for a cloud service. + * + * @summary Gets properties of a guest operating system family that can be specified in the XML service configuration (.cscfg) for a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceOSFamily.json + */ +async function getCloudServiceOSFamily() { + const subscriptionId = "{subscription-id}"; + const location = "westus2"; + const osFamilyName = "3"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServiceOperatingSystems.getOSFamily( + location, + osFamilyName + ); + console.log(result); +} + +getCloudServiceOSFamily().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceOperatingSystemsGetOSVersionSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceOperatingSystemsGetOSVersionSample.ts new file mode 100644 index 000000000000..942efead48fe --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceOperatingSystemsGetOSVersionSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets properties of a guest operating system version that can be specified in the XML service configuration (.cscfg) for a cloud service. + * + * @summary Gets properties of a guest operating system version that can be specified in the XML service configuration (.cscfg) for a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceOSVersion.json + */ +async function getCloudServiceOSVersion() { + const subscriptionId = "{subscription-id}"; + const location = "westus2"; + const osVersionName = "WA-GUEST-OS-3.90_202010-02"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServiceOperatingSystems.getOSVersion( + location, + osVersionName + ); + console.log(result); +} + +getCloudServiceOSVersion().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceOperatingSystemsListOSFamiliesSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceOperatingSystemsListOSFamiliesSample.ts new file mode 100644 index 000000000000..1a94753a9157 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceOperatingSystemsListOSFamiliesSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of all guest operating system families available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this till nextLink is null to fetch all the OS Families. + * + * @summary Gets a list of all guest operating system families available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this till nextLink is null to fetch all the OS Families. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceOSFamilies.json + */ +async function listCloudServiceOSFamiliesInASubscription() { + const subscriptionId = "{subscription-id}"; + const location = "westus2"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudServiceOperatingSystems.listOSFamilies( + location + )) { + resArray.push(item); + } + console.log(resArray); +} + +listCloudServiceOSFamiliesInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceOperatingSystemsListOSVersionsSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceOperatingSystemsListOSVersionsSample.ts new file mode 100644 index 000000000000..fd887a48f283 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceOperatingSystemsListOSVersionsSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of all guest operating system versions available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this till nextLink is null to fetch all the OS versions. + * + * @summary Gets a list of all guest operating system versions available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this till nextLink is null to fetch all the OS versions. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceOSVersions.json + */ +async function listCloudServiceOSVersionsInASubscription() { + const subscriptionId = "{subscription-id}"; + const location = "westus2"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudServiceOperatingSystems.listOSVersions( + location + )) { + resArray.push(item); + } + console.log(resArray); +} + +listCloudServiceOSVersionsInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesDeleteSample.ts new file mode 100644 index 000000000000..d12d75cbe235 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes a role instance from a cloud service. + * + * @summary Deletes a role instance from a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/DeleteCloudServiceRoleInstance.json + */ +async function deleteCloudServiceRoleInstance() { + const subscriptionId = "{subscription-id}"; + const roleInstanceName = "{roleInstance-name}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServiceRoleInstances.beginDeleteAndWait( + roleInstanceName, + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +deleteCloudServiceRoleInstance().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesGetInstanceViewSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesGetInstanceViewSample.ts new file mode 100644 index 000000000000..29dde7020336 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesGetInstanceViewSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Retrieves information about the run-time state of a role instance in a cloud service. + * + * @summary Retrieves information about the run-time state of a role instance in a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetInstanceViewOfCloudServiceRoleInstance.json + */ +async function getInstanceViewOfCloudServiceRoleInstance() { + const subscriptionId = "{subscription-id}"; + const roleInstanceName = "{roleInstance-name}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServiceRoleInstances.getInstanceView( + roleInstanceName, + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +getInstanceViewOfCloudServiceRoleInstance().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesGetSample.ts new file mode 100644 index 000000000000..ad9cf89bc0d0 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a role instance from a cloud service. + * + * @summary Gets a role instance from a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceRoleInstance.json + */ +async function getCloudServiceRoleInstance() { + const subscriptionId = "{subscription-id}"; + const roleInstanceName = "{roleInstance-name}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServiceRoleInstances.get( + roleInstanceName, + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +getCloudServiceRoleInstance().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesListSample.ts new file mode 100644 index 000000000000..f0982c570d4b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next page of role instances. Do this till nextLink is null to fetch all the role instances. + * + * @summary Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next page of role instances. Do this till nextLink is null to fetch all the role instances. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceRolesInstances.json + */ +async function listRoleInstancesInACloudService() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudServiceRoleInstances.list( + resourceGroupName, + cloudServiceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listRoleInstancesInACloudService().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesRebuildSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesRebuildSample.ts new file mode 100644 index 000000000000..c4bca9550654 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesRebuildSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instance. + * + * @summary The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instance. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RebuildCloudServiceRoleInstance.json + */ +async function rebuildCloudServiceRoleInstance() { + const subscriptionId = "{subscription-id}"; + const roleInstanceName = "{roleInstance-name}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServiceRoleInstances.beginRebuildAndWait( + roleInstanceName, + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +rebuildCloudServiceRoleInstance().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesReimageSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesReimageSample.ts new file mode 100644 index 000000000000..2f139fab570b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesReimageSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @summary The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ReimageCloudServiceRoleInstance.json + */ +async function reimageCloudServiceRoleInstance() { + const subscriptionId = "{subscription-id}"; + const roleInstanceName = "{roleInstance-name}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServiceRoleInstances.beginReimageAndWait( + roleInstanceName, + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +reimageCloudServiceRoleInstance().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesRestartSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesRestartSample.ts new file mode 100644 index 000000000000..4adca254441b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRoleInstancesRestartSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @summary The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RestartCloudServiceRoleInstance.json + */ +async function restartCloudServiceRoleInstance() { + const subscriptionId = "{subscription-id}"; + const roleInstanceName = "{roleInstance-name}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServiceRoleInstances.beginRestartAndWait( + roleInstanceName, + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +restartCloudServiceRoleInstance().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRolesGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRolesGetSample.ts new file mode 100644 index 000000000000..11e9a7c6ee1c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRolesGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a role from a cloud service. + * + * @summary Gets a role from a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceRole.json + */ +async function getCloudServiceRole() { + const subscriptionId = "{subscription-id}"; + const roleName = "{role-name}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServiceRoles.get( + roleName, + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +getCloudServiceRole().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRolesListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRolesListSample.ts new file mode 100644 index 000000000000..76dad03f9061 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServiceRolesListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. Do this till nextLink is null to fetch all the roles. + * + * @summary Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. Do this till nextLink is null to fetch all the roles. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceRoles.json + */ +async function listRolesInACloudService() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudServiceRoles.list( + resourceGroupName, + cloudServiceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listRolesInACloudService().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..61b54f135395 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesCreateOrUpdateSample.ts @@ -0,0 +1,291 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + CloudService, + CloudServicesCreateOrUpdateOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/CreateCloudServiceWithMultiRole.json + */ +async function createNewCloudServiceWithMultipleRoles() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const parameters: CloudService = { + location: "westus", + properties: { + configuration: "{ServiceConfiguration}", + networkProfile: { + loadBalancerConfigurations: [ + { + name: "contosolb", + properties: { + frontendIPConfigurations: [ + { + name: "contosofe", + properties: { + publicIPAddress: { + id: + "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip" + } + } + } + ] + } + } + ] + }, + packageUrl: "{PackageUrl}", + roleProfile: { + roles: [ + { + name: "ContosoFrontend", + sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" } + }, + { + name: "ContosoBackend", + sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" } + } + ] + }, + upgradeMode: "Auto" + } + }; + const options: CloudServicesCreateOrUpdateOptionalParams = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginCreateOrUpdateAndWait( + resourceGroupName, + cloudServiceName, + options + ); + console.log(result); +} + +createNewCloudServiceWithMultipleRoles().catch(console.error); + +/** + * This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/CreateCloudServiceWithSingleRole.json + */ +async function createNewCloudServiceWithSingleRole() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const parameters: CloudService = { + location: "westus", + properties: { + configuration: "{ServiceConfiguration}", + networkProfile: { + loadBalancerConfigurations: [ + { + name: "myLoadBalancer", + properties: { + frontendIPConfigurations: [ + { + name: "myfe", + properties: { + publicIPAddress: { + id: + "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP" + } + } + } + ] + } + } + ] + }, + packageUrl: "{PackageUrl}", + roleProfile: { + roles: [ + { + name: "ContosoFrontend", + sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" } + } + ] + }, + upgradeMode: "Auto" + } + }; + const options: CloudServicesCreateOrUpdateOptionalParams = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginCreateOrUpdateAndWait( + resourceGroupName, + cloudServiceName, + options + ); + console.log(result); +} + +createNewCloudServiceWithSingleRole().catch(console.error); + +/** + * This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/CreateCloudServiceWithSingleRoleAndCertificate.json + */ +async function createNewCloudServiceWithSingleRoleAndCertificateFromKeyVault() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const parameters: CloudService = { + location: "westus", + properties: { + configuration: "{ServiceConfiguration}", + networkProfile: { + loadBalancerConfigurations: [ + { + name: "contosolb", + properties: { + frontendIPConfigurations: [ + { + name: "contosofe", + properties: { + publicIPAddress: { + id: + "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip" + } + } + } + ] + } + } + ] + }, + osProfile: { + secrets: [ + { + sourceVault: { + id: + "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}" + }, + vaultCertificates: [ + { + certificateUrl: + "https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}" + } + ] + } + ] + }, + packageUrl: "{PackageUrl}", + roleProfile: { + roles: [ + { + name: "ContosoFrontend", + sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" } + } + ] + }, + upgradeMode: "Auto" + } + }; + const options: CloudServicesCreateOrUpdateOptionalParams = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginCreateOrUpdateAndWait( + resourceGroupName, + cloudServiceName, + options + ); + console.log(result); +} + +createNewCloudServiceWithSingleRoleAndCertificateFromKeyVault().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/CreateCloudServiceWithSingleRoleAndRDP.json + */ +async function createNewCloudServiceWithSingleRoleAndRdpExtension() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const parameters: CloudService = { + location: "westus", + properties: { + configuration: "{ServiceConfiguration}", + extensionProfile: { + extensions: [ + { + name: "RDPExtension", + properties: { + type: "RDP", + autoUpgradeMinorVersion: false, + protectedSettings: + "{password}", + publisher: "Microsoft.Windows.Azure.Extensions", + settings: + "UserAzure10/22/2021 15:05:45", + typeHandlerVersion: "1.2.1" + } + } + ] + }, + networkProfile: { + loadBalancerConfigurations: [ + { + name: "contosolb", + properties: { + frontendIPConfigurations: [ + { + name: "contosofe", + properties: { + publicIPAddress: { + id: + "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip" + } + } + } + ] + } + } + ] + }, + packageUrl: "{PackageUrl}", + roleProfile: { + roles: [ + { + name: "ContosoFrontend", + sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" } + } + ] + }, + upgradeMode: "Auto" + } + }; + const options: CloudServicesCreateOrUpdateOptionalParams = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginCreateOrUpdateAndWait( + resourceGroupName, + cloudServiceName, + options + ); + console.log(result); +} + +createNewCloudServiceWithSingleRoleAndRdpExtension().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesDeleteInstancesSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesDeleteInstancesSample.ts new file mode 100644 index 000000000000..eea25b6aef18 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesDeleteInstancesSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleInstances, + CloudServicesDeleteInstancesOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes role instances in a cloud service. + * + * @summary Deletes role instances in a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/DeleteCloudServiceRoleInstances.json + */ +async function deleteCloudServiceRoleInstances() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const parameters: RoleInstances = { + roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"] + }; + const options: CloudServicesDeleteInstancesOptionalParams = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginDeleteInstancesAndWait( + resourceGroupName, + cloudServiceName, + options + ); + console.log(result); +} + +deleteCloudServiceRoleInstances().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesDeleteSample.ts new file mode 100644 index 000000000000..963effacd472 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes a cloud service. + * + * @summary Deletes a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/DeleteCloudService.json + */ +async function deleteCloudService() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginDeleteAndWait( + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +deleteCloudService().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesGetInstanceViewSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesGetInstanceViewSample.ts new file mode 100644 index 000000000000..f0c480bbd3fa --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesGetInstanceViewSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the status of a cloud service. + * + * @summary Gets the status of a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceInstanceViewWithMultiRole.json + */ +async function getCloudServiceInstanceViewWithMultipleRoles() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.getInstanceView( + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +getCloudServiceInstanceViewWithMultipleRoles().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesGetSample.ts new file mode 100644 index 000000000000..62013e2868dd --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Display information about a cloud service. + * + * @summary Display information about a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceWithMultiRoleAndRDP.json + */ +async function getCloudServiceWithMultipleRolesAndRdpExtension() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.get( + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +getCloudServiceWithMultipleRolesAndRdpExtension().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesListAllSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesListAllSample.ts new file mode 100644 index 000000000000..07ba26444b1c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesListAllSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * + * @summary Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServicesInSubscription.json + */ +async function listCloudServicesInASubscription() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudServices.listAll()) { + resArray.push(item); + } + console.log(resArray); +} + +listCloudServicesInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesListSample.ts new file mode 100644 index 000000000000..cc6338f6d446 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesListSample.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * + * @summary Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServicesInResourceGroup.json + */ +async function listCloudServicesInAResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudServices.list(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listCloudServicesInAResourceGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesPowerOffSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesPowerOffSample.ts new file mode 100644 index 000000000000..a5708506b2e5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesPowerOffSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Power off the cloud service. Note that resources are still attached and you are getting charged for the resources. + * + * @summary Power off the cloud service. Note that resources are still attached and you are getting charged for the resources. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/PowerOffCloudService.json + */ +async function stopOrPowerOffCloudService() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginPowerOffAndWait( + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +stopOrPowerOffCloudService().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesRebuildSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesRebuildSample.ts new file mode 100644 index 000000000000..405f4d92cd04 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesRebuildSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleInstances, + CloudServicesRebuildOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instances. + * + * @summary Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instances. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RebuildCloudServiceRoleInstances.json + */ +async function rebuildCloudServiceRoleInstances() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const parameters: RoleInstances = { + roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"] + }; + const options: CloudServicesRebuildOptionalParams = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginRebuildAndWait( + resourceGroupName, + cloudServiceName, + options + ); + console.log(result); +} + +rebuildCloudServiceRoleInstances().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesReimageSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesReimageSample.ts new file mode 100644 index 000000000000..5eaaa3c310e5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesReimageSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleInstances, + CloudServicesReimageOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @summary Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ReimageCloudServiceRoleInstances.json + */ +async function reimageCloudServiceRoleInstances() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const parameters: RoleInstances = { + roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"] + }; + const options: CloudServicesReimageOptionalParams = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginReimageAndWait( + resourceGroupName, + cloudServiceName, + options + ); + console.log(result); +} + +reimageCloudServiceRoleInstances().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesRestartSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesRestartSample.ts new file mode 100644 index 000000000000..a76422935df1 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesRestartSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleInstances, + CloudServicesRestartOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Restarts one or more role instances in a cloud service. + * + * @summary Restarts one or more role instances in a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RestartCloudServiceRoleInstances.json + */ +async function restartCloudServiceRoleInstances() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const parameters: RoleInstances = { + roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"] + }; + const options: CloudServicesRestartOptionalParams = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginRestartAndWait( + resourceGroupName, + cloudServiceName, + options + ); + console.log(result); +} + +restartCloudServiceRoleInstances().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesStartSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesStartSample.ts new file mode 100644 index 000000000000..1ea93fc235f5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesStartSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Starts the cloud service. + * + * @summary Starts the cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/StartCloudService.json + */ +async function startCloudService() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginStartAndWait( + resourceGroupName, + cloudServiceName + ); + console.log(result); +} + +startCloudService().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesUpdateDomainGetUpdateDomainSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesUpdateDomainGetUpdateDomainSample.ts new file mode 100644 index 000000000000..15d318fa94eb --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesUpdateDomainGetUpdateDomainSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page of update domains. Do this till nextLink is null to fetch all the update domains. + * + * @summary Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page of update domains. Do this till nextLink is null to fetch all the update domains. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceUpdateDomain.json + */ +async function getCloudServiceUpdateDomain() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const updateDomain = 1; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServicesUpdateDomain.getUpdateDomain( + resourceGroupName, + cloudServiceName, + updateDomain + ); + console.log(result); +} + +getCloudServiceUpdateDomain().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesUpdateDomainListUpdateDomainsSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesUpdateDomainListUpdateDomainsSample.ts new file mode 100644 index 000000000000..4228ca0634eb --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesUpdateDomainListUpdateDomainsSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of all update domains in a cloud service. + * + * @summary Gets a list of all update domains in a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceUpdateDomains.json + */ +async function listUpdateDomainsInCloudService() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudServicesUpdateDomain.listUpdateDomains( + resourceGroupName, + cloudServiceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listUpdateDomainsInCloudService().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesUpdateDomainWalkUpdateDomainSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesUpdateDomainWalkUpdateDomainSample.ts new file mode 100644 index 000000000000..c54794b70d3a --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesUpdateDomainWalkUpdateDomainSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Updates the role instances in the specified update domain. + * + * @summary Updates the role instances in the specified update domain. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/UpdateCloudServiceUpdateDomain.json + */ +async function updateCloudServiceToSpecifiedDomain() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const updateDomain = 1; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServicesUpdateDomain.beginWalkUpdateDomainAndWait( + resourceGroupName, + cloudServiceName, + updateDomain + ); + console.log(result); +} + +updateCloudServiceToSpecifiedDomain().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesUpdateSample.ts new file mode 100644 index 000000000000..c761147681df --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/cloudServicesUpdateSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + CloudServiceUpdate, + CloudServicesUpdateOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update a cloud service. + * + * @summary Update a cloud service. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/UpdateCloudServiceToIncludeTags.json + */ +async function updateExistingCloudServiceToAddTags() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ConstosoRG"; + const cloudServiceName = "{cs-name}"; + const parameters: CloudServiceUpdate = { tags: { documentation: "RestAPI" } }; + const options: CloudServicesUpdateOptionalParams = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.cloudServices.beginUpdateAndWait( + resourceGroupName, + cloudServiceName, + options + ); + console.log(result); +} + +updateExistingCloudServiceToAddTags().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/communityGalleriesGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/communityGalleriesGetSample.ts new file mode 100644 index 000000000000..604fb888c06f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/communityGalleriesGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a community gallery by gallery public name. + * + * @summary Get a community gallery by gallery public name. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/communityGallery/GetACommunityGallery.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const location = "myLocation"; + const publicGalleryName = "publicGalleryName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.communityGalleries.get( + location, + publicGalleryName + ); + console.log(result); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/communityGalleryImageVersionsGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/communityGalleryImageVersionsGetSample.ts new file mode 100644 index 000000000000..ceb7d71eb209 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/communityGalleryImageVersionsGetSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a community gallery image version. + * + * @summary Get a community gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/communityGallery/GetACommunityGalleryImageVersion.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const location = "myLocation"; + const publicGalleryName = "publicGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "myGalleryImageVersionName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.communityGalleryImageVersions.get( + location, + publicGalleryName, + galleryImageName, + galleryImageVersionName + ); + console.log(result); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/communityGalleryImagesGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/communityGalleryImagesGetSample.ts new file mode 100644 index 000000000000..7b5d9f9f2b58 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/communityGalleryImagesGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a community gallery image. + * + * @summary Get a community gallery image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/communityGallery/GetACommunityGalleryImage.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const location = "myLocation"; + const publicGalleryName = "publicGalleryName"; + const galleryImageName = "myGalleryImageName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.communityGalleryImages.get( + location, + publicGalleryName, + galleryImageName + ); + console.log(result); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..009218f00f9a --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsCreateOrUpdateSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + DedicatedHostGroup, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) + * + * @summary Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateADedicatedHostGroup.json + */ +async function createOrUpdateADedicatedHostGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const hostGroupName = "myDedicatedHostGroup"; + const parameters: DedicatedHostGroup = { + location: "westus", + platformFaultDomainCount: 3, + supportAutomaticPlacement: true, + tags: { department: "finance" }, + zones: ["1"] + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.createOrUpdate( + resourceGroupName, + hostGroupName, + parameters + ); + console.log(result); +} + +createOrUpdateADedicatedHostGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsDeleteSample.ts new file mode 100644 index 000000000000..1c3ae824cfb5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsDeleteSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a dedicated host group. + * + * @summary Delete a dedicated host group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Delete_MaximumSet_Gen.json + */ +async function dedicatedHostGroupsDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "a"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.delete( + resourceGroupName, + hostGroupName + ); + console.log(result); +} + +dedicatedHostGroupsDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Delete a dedicated host group. + * + * @summary Delete a dedicated host group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Delete_MinimumSet_Gen.json + */ +async function dedicatedHostGroupsDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "aaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.delete( + resourceGroupName, + hostGroupName + ); + console.log(result); +} + +dedicatedHostGroupsDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsGetSample.ts new file mode 100644 index 000000000000..ec6d32acc5a3 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Retrieves information about a dedicated host group. + * + * @summary Retrieves information about a dedicated host group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetADedicatedHostGroup.json + */ +async function createADedicatedHostGroup() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const hostGroupName = "myDedicatedHostGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.get( + resourceGroupName, + hostGroupName + ); + console.log(result); +} + +createADedicatedHostGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsListByResourceGroupSample.ts new file mode 100644 index 000000000000..825f790164b1 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsListByResourceGroupSample.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. + * + * @summary Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListByResourceGroup_MaximumSet_Gen.json + */ +async function dedicatedHostGroupsListByResourceGroupMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.dedicatedHostGroups.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +dedicatedHostGroupsListByResourceGroupMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. + * + * @summary Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListByResourceGroup_MinimumSet_Gen.json + */ +async function dedicatedHostGroupsListByResourceGroupMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.dedicatedHostGroups.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +dedicatedHostGroupsListByResourceGroupMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsListBySubscriptionSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsListBySubscriptionSample.ts new file mode 100644 index 000000000000..b79c63eacfde --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsListBySubscriptionSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. + * + * @summary Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListBySubscription_MaximumSet_Gen.json + */ +async function dedicatedHostGroupsListBySubscriptionMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.dedicatedHostGroups.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +dedicatedHostGroupsListBySubscriptionMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. + * + * @summary Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListBySubscription_MinimumSet_Gen.json + */ +async function dedicatedHostGroupsListBySubscriptionMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.dedicatedHostGroups.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +dedicatedHostGroupsListBySubscriptionMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsUpdateSample.ts new file mode 100644 index 000000000000..55436283b934 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostGroupsUpdateSample.ts @@ -0,0 +1,84 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + DedicatedHostGroupUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update an dedicated host group. + * + * @summary Update an dedicated host group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Update_MaximumSet_Gen.json + */ +async function dedicatedHostGroupsUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "aaaa"; + const parameters: DedicatedHostGroupUpdate = { + instanceView: { + hosts: [ + { + availableCapacity: { + allocatableVMs: [{ count: 26, vmSize: "aaaaaaaaaaaaaaaaaaaa" }] + }, + statuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z") + } + ] + } + ] + }, + platformFaultDomainCount: 3, + supportAutomaticPlacement: true, + tags: { key9921: "aaaaaaaaaa" }, + zones: ["aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"] + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.update( + resourceGroupName, + hostGroupName, + parameters + ); + console.log(result); +} + +dedicatedHostGroupsUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Update an dedicated host group. + * + * @summary Update an dedicated host group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Update_MinimumSet_Gen.json + */ +async function dedicatedHostGroupsUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "aaaaaaaaaaa"; + const parameters: DedicatedHostGroupUpdate = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.update( + resourceGroupName, + hostGroupName, + parameters + ); + console.log(result); +} + +dedicatedHostGroupsUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..2ad0c1c6bbf9 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsCreateOrUpdateSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { DedicatedHost, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a dedicated host . + * + * @summary Create or update a dedicated host . + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateADedicatedHost.json + */ +async function createOrUpdateADedicatedHost() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const hostGroupName = "myDedicatedHostGroup"; + const hostName = "myDedicatedHost"; + const parameters: DedicatedHost = { + location: "westus", + platformFaultDomain: 1, + sku: { name: "DSv3-Type1" }, + tags: { department: "HR" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.beginCreateOrUpdateAndWait( + resourceGroupName, + hostGroupName, + hostName, + parameters + ); + console.log(result); +} + +createOrUpdateADedicatedHost().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsDeleteSample.ts new file mode 100644 index 000000000000..b79d8ea85299 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsDeleteSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a dedicated host. + * + * @summary Delete a dedicated host. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Delete_MaximumSet_Gen.json + */ +async function dedicatedHostsDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "aaaaaa"; + const hostName = "aaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.beginDeleteAndWait( + resourceGroupName, + hostGroupName, + hostName + ); + console.log(result); +} + +dedicatedHostsDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Delete a dedicated host. + * + * @summary Delete a dedicated host. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Delete_MinimumSet_Gen.json + */ +async function dedicatedHostsDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "aaaaaaaaaaaaaaa"; + const hostName = "aaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.beginDeleteAndWait( + resourceGroupName, + hostGroupName, + hostName + ); + console.log(result); +} + +dedicatedHostsDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsGetSample.ts new file mode 100644 index 000000000000..16ccf14a72aa --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Retrieves information about a dedicated host. + * + * @summary Retrieves information about a dedicated host. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetADedicatedHost.json + */ +async function getADedicatedHost() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const hostGroupName = "myDedicatedHostGroup"; + const hostName = "myHost"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.get( + resourceGroupName, + hostGroupName, + hostName + ); + console.log(result); +} + +getADedicatedHost().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsListByHostGroupSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsListByHostGroupSample.ts new file mode 100644 index 000000000000..d0b0be3104d7 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsListByHostGroupSample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + * + * @summary Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_ListByHostGroup_MaximumSet_Gen.json + */ +async function dedicatedHostsListByHostGroupMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.dedicatedHosts.listByHostGroup( + resourceGroupName, + hostGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +dedicatedHostsListByHostGroupMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + * + * @summary Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_ListByHostGroup_MinimumSet_Gen.json + */ +async function dedicatedHostsListByHostGroupMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "aaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.dedicatedHosts.listByHostGroup( + resourceGroupName, + hostGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +dedicatedHostsListByHostGroupMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsRestartSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsRestartSample.ts new file mode 100644 index 000000000000..d4472203528c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsRestartSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/en-us/azure/service-health/resource-health-overview for more details. + * + * @summary Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/en-us/azure/service-health/resource-health-overview for more details. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostRestart.json + */ +async function restartDedicatedHost() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const hostGroupName = "myDedicatedHostGroup"; + const hostName = "myHost"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.beginRestartAndWait( + resourceGroupName, + hostGroupName, + hostName + ); + console.log(result); +} + +restartDedicatedHost().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsUpdateSample.ts new file mode 100644 index 000000000000..55382dbd8075 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/dedicatedHostsUpdateSample.ts @@ -0,0 +1,84 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + DedicatedHostUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update an dedicated host . + * + * @summary Update an dedicated host . + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Update_MaximumSet_Gen.json + */ +async function dedicatedHostsUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "aaaaaaaaa"; + const hostName = "aaaaaaaaaaaaaaaaaaaaa"; + const parameters: DedicatedHostUpdate = { + autoReplaceOnFailure: true, + instanceView: { + availableCapacity: { + allocatableVMs: [{ count: 26, vmSize: "aaaaaaaaaaaaaaaaaaaa" }] + }, + statuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z") + } + ] + }, + licenseType: "Windows_Server_Hybrid", + platformFaultDomain: 1, + tags: { key8813: "aaaaaaaaaaaaaaaaaaaaaaaaaaa" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.beginUpdateAndWait( + resourceGroupName, + hostGroupName, + hostName, + parameters + ); + console.log(result); +} + +dedicatedHostsUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Update an dedicated host . + * + * @summary Update an dedicated host . + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Update_MinimumSet_Gen.json + */ +async function dedicatedHostsUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const hostGroupName = "aa"; + const hostName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const parameters: DedicatedHostUpdate = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.beginUpdateAndWait( + resourceGroupName, + hostGroupName, + hostName, + parameters + ); + console.log(result); +} + +dedicatedHostsUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..de15f4b1c771 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesCreateOrUpdateSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { DiskAccess, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates or updates a disk access resource + * + * @summary Creates or updates a disk access resource + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateADiskAccess.json + */ +async function createADiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const diskAccess: DiskAccess = { location: "West US" }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.beginCreateOrUpdateAndWait( + resourceGroupName, + diskAccessName, + diskAccess + ); + console.log(result); +} + +createADiskAccessResource().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesDeleteAPrivateEndpointConnectionSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesDeleteAPrivateEndpointConnectionSample.ts new file mode 100644 index 000000000000..407b138eff48 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesDeleteAPrivateEndpointConnectionSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes a private endpoint connection under a disk access resource. + * + * @summary Deletes a private endpoint connection under a disk access resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteAPrivateEndpointConnection.json + */ +async function deleteAPrivateEndpointConnectionUnderADiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const privateEndpointConnectionName = "myPrivateEndpointConnection"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.beginDeleteAPrivateEndpointConnectionAndWait( + resourceGroupName, + diskAccessName, + privateEndpointConnectionName + ); + console.log(result); +} + +deleteAPrivateEndpointConnectionUnderADiskAccessResource().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesDeleteSample.ts new file mode 100644 index 000000000000..da32f1908c8f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes a disk access resource. + * + * @summary Deletes a disk access resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteADiskAccess.json + */ +async function deleteADiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.beginDeleteAndWait( + resourceGroupName, + diskAccessName + ); + console.log(result); +} + +deleteADiskAccessResource().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesGetAPrivateEndpointConnectionSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesGetAPrivateEndpointConnectionSample.ts new file mode 100644 index 000000000000..8d1edadb75cd --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesGetAPrivateEndpointConnectionSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets information about a private endpoint connection under a disk access resource. + * + * @summary Gets information about a private endpoint connection under a disk access resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutAPrivateEndpointConnection.json + */ +async function getInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const privateEndpointConnectionName = "myPrivateEndpointConnection"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.getAPrivateEndpointConnection( + resourceGroupName, + diskAccessName, + privateEndpointConnectionName + ); + console.log(result); +} + +getInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesGetPrivateLinkResourcesSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesGetPrivateLinkResourcesSample.ts new file mode 100644 index 000000000000..2a5abc59ee94 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesGetPrivateLinkResourcesSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the private link resources possible under disk access resource + * + * @summary Gets the private link resources possible under disk access resource + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetDiskAccessPrivateLinkResources.json + */ +async function listAllPossiblePrivateLinkResourcesUnderDiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.getPrivateLinkResources( + resourceGroupName, + diskAccessName + ); + console.log(result); +} + +listAllPossiblePrivateLinkResourcesUnderDiskAccessResource().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesGetSample.ts new file mode 100644 index 000000000000..ec50ce9d989e --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesGetSample.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets information about a disk access resource. + * + * @summary Gets information about a disk access resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutADiskAccessWithPrivateEndpoints.json + */ +async function getInformationAboutADiskAccessResourceWithPrivateEndpoints() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.get( + resourceGroupName, + diskAccessName + ); + console.log(result); +} + +getInformationAboutADiskAccessResourceWithPrivateEndpoints().catch( + console.error +); + +/** + * This sample demonstrates how to Gets information about a disk access resource. + * + * @summary Gets information about a disk access resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutADiskAccess.json + */ +async function getInformationAboutADiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.get( + resourceGroupName, + diskAccessName + ); + console.log(result); +} + +getInformationAboutADiskAccessResource().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesListByResourceGroupSample.ts new file mode 100644 index 000000000000..e272df593a6c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesListByResourceGroupSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all the disk access resources under a resource group. + * + * @summary Lists all the disk access resources under a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskAccessesInAResourceGroup.json + */ +async function listAllDiskAccessResourcesInAResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.diskAccesses.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listAllDiskAccessResourcesInAResourceGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesListPrivateEndpointConnectionsSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesListPrivateEndpointConnectionsSample.ts new file mode 100644 index 000000000000..27c02d86c9e1 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesListPrivateEndpointConnectionsSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List information about private endpoint connections under a disk access resource + * + * @summary List information about private endpoint connections under a disk access resource + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListPrivateEndpointConnectionsInADiskAccess.json + */ +async function getInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.diskAccesses.listPrivateEndpointConnections( + resourceGroupName, + diskAccessName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesListSample.ts new file mode 100644 index 000000000000..a101e7ff94b2 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all the disk access resources under a subscription. + * + * @summary Lists all the disk access resources under a subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskAccessesInASubscription.json + */ +async function listAllDiskAccessResourcesInASubscription() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.diskAccesses.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listAllDiskAccessResourcesInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesUpdateAPrivateEndpointConnectionSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesUpdateAPrivateEndpointConnectionSample.ts new file mode 100644 index 000000000000..debecb5004a2 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesUpdateAPrivateEndpointConnectionSample.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + PrivateEndpointConnection, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. + * + * @summary Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ApprovePrivateEndpointConnection.json + */ +async function approveAPrivateEndpointConnectionUnderADiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const privateEndpointConnectionName = "myPrivateEndpointConnection"; + const privateEndpointConnection: PrivateEndpointConnection = { + privateLinkServiceConnectionState: { + description: "Approving myPrivateEndpointConnection", + status: "Approved" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.beginUpdateAPrivateEndpointConnectionAndWait( + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + privateEndpointConnection + ); + console.log(result); +} + +approveAPrivateEndpointConnectionUnderADiskAccessResource().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesUpdateSample.ts new file mode 100644 index 000000000000..52533c527b6b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/diskAccessesUpdateSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { DiskAccessUpdate, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Updates (patches) a disk access resource. + * + * @summary Updates (patches) a disk access resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateADiskAccess.json + */ +async function updateADiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskAccessName = "myDiskAccess"; + const diskAccess: DiskAccessUpdate = { + tags: { department: "Development", project: "PrivateEndpoints" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.beginUpdateAndWait( + resourceGroupName, + diskAccessName, + diskAccess + ); + console.log(result); +} + +updateADiskAccessResource().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..3d125dd86d7c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsCreateOrUpdateSample.ts @@ -0,0 +1,78 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { DiskEncryptionSet, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates or updates a disk encryption set + * + * @summary Creates or updates a disk encryption set + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateADiskEncryptionSetWithKeyVaultFromADifferentSubscription.json + */ +async function createADiskEncryptionSetWithKeyVaultFromADifferentSubscription() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskEncryptionSetName = "myDiskEncryptionSet"; + const diskEncryptionSet: DiskEncryptionSet = { + activeKey: { + keyUrl: "https://myvaultdifferentsub.vault-int.azure-int.net/keys/{key}" + }, + encryptionType: "EncryptionAtRestWithCustomerKey", + identity: { type: "SystemAssigned" }, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.beginCreateOrUpdateAndWait( + resourceGroupName, + diskEncryptionSetName, + diskEncryptionSet + ); + console.log(result); +} + +createADiskEncryptionSetWithKeyVaultFromADifferentSubscription().catch( + console.error +); + +/** + * This sample demonstrates how to Creates or updates a disk encryption set + * + * @summary Creates or updates a disk encryption set + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateADiskEncryptionSet.json + */ +async function createADiskEncryptionSet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskEncryptionSetName = "myDiskEncryptionSet"; + const diskEncryptionSet: DiskEncryptionSet = { + activeKey: { + keyUrl: "https://myvmvault.vault-int.azure-int.net/keys/{key}", + sourceVault: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault" + } + }, + encryptionType: "EncryptionAtRestWithCustomerKey", + identity: { type: "SystemAssigned" }, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.beginCreateOrUpdateAndWait( + resourceGroupName, + diskEncryptionSetName, + diskEncryptionSet + ); + console.log(result); +} + +createADiskEncryptionSet().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsDeleteSample.ts new file mode 100644 index 000000000000..492b4ab2ecc1 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes a disk encryption set. + * + * @summary Deletes a disk encryption set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteADiskEncryptionSet.json + */ +async function deleteADiskEncryptionSet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskEncryptionSetName = "myDiskEncryptionSet"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.beginDeleteAndWait( + resourceGroupName, + diskEncryptionSetName + ); + console.log(result); +} + +deleteADiskEncryptionSet().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsGetSample.ts new file mode 100644 index 000000000000..04c58351b5cd --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsGetSample.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets information about a disk encryption set. + * + * @summary Gets information about a disk encryption set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutADiskEncryptionSetWithAutoKeyRotationError.json + */ +async function getInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskEncryptionSetName = "myDiskEncryptionSet"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.get( + resourceGroupName, + diskEncryptionSetName + ); + console.log(result); +} + +getInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed().catch( + console.error +); + +/** + * This sample demonstrates how to Gets information about a disk encryption set. + * + * @summary Gets information about a disk encryption set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutADiskEncryptionSet.json + */ +async function getInformationAboutADiskEncryptionSet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskEncryptionSetName = "myDiskEncryptionSet"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.get( + resourceGroupName, + diskEncryptionSetName + ); + console.log(result); +} + +getInformationAboutADiskEncryptionSet().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsListAssociatedResourcesSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsListAssociatedResourcesSample.ts new file mode 100644 index 000000000000..560370473ad9 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsListAssociatedResourcesSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all resources that are encrypted with this disk encryption set. + * + * @summary Lists all resources that are encrypted with this disk encryption set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskEncryptionSetAssociatedResources.json + */ +async function listAllResourcesThatAreEncryptedWithThisDiskEncryptionSet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskEncryptionSetName = "myDiskEncryptionSet"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.diskEncryptionSets.listAssociatedResources( + resourceGroupName, + diskEncryptionSetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listAllResourcesThatAreEncryptedWithThisDiskEncryptionSet().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsListByResourceGroupSample.ts new file mode 100644 index 000000000000..140ec28c1346 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsListByResourceGroupSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all the disk encryption sets under a resource group. + * + * @summary Lists all the disk encryption sets under a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskEncryptionSetsInAResourceGroup.json + */ +async function listAllDiskEncryptionSetsInAResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.diskEncryptionSets.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listAllDiskEncryptionSetsInAResourceGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsListSample.ts new file mode 100644 index 000000000000..2a36961168e8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all the disk encryption sets under a subscription. + * + * @summary Lists all the disk encryption sets under a subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskEncryptionSetsInASubscription.json + */ +async function listAllDiskEncryptionSetsInASubscription() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.diskEncryptionSets.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listAllDiskEncryptionSetsInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsUpdateSample.ts new file mode 100644 index 000000000000..5733c9fa3309 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/diskEncryptionSetsUpdateSample.ts @@ -0,0 +1,115 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + DiskEncryptionSetUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Updates (patches) a disk encryption set. + * + * @summary Updates (patches) a disk encryption set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateADiskEncryptionSetWithRotationToLatestKeyVersionEnabled.json + */ +async function updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueSucceeded() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskEncryptionSetName = "myDiskEncryptionSet"; + const diskEncryptionSet: DiskEncryptionSetUpdate = { + activeKey: { + keyUrl: + "https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion1" + }, + encryptionType: "EncryptionAtRestWithCustomerKey", + identity: { type: "SystemAssigned" }, + rotationToLatestKeyVersionEnabled: true + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.beginUpdateAndWait( + resourceGroupName, + diskEncryptionSetName, + diskEncryptionSet + ); + console.log(result); +} + +updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueSucceeded().catch( + console.error +); + +/** + * This sample demonstrates how to Updates (patches) a disk encryption set. + * + * @summary Updates (patches) a disk encryption set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledInProgress.json + */ +async function updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueUpdating() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskEncryptionSetName = "myDiskEncryptionSet"; + const diskEncryptionSet: DiskEncryptionSetUpdate = { + activeKey: { + keyUrl: + "https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion1" + }, + encryptionType: "EncryptionAtRestWithCustomerKey", + identity: { type: "SystemAssigned" }, + rotationToLatestKeyVersionEnabled: true + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.beginUpdateAndWait( + resourceGroupName, + diskEncryptionSetName, + diskEncryptionSet + ); + console.log(result); +} + +updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueUpdating().catch( + console.error +); + +/** + * This sample demonstrates how to Updates (patches) a disk encryption set. + * + * @summary Updates (patches) a disk encryption set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateADiskEncryptionSet.json + */ +async function updateADiskEncryptionSet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskEncryptionSetName = "myDiskEncryptionSet"; + const diskEncryptionSet: DiskEncryptionSetUpdate = { + activeKey: { + keyUrl: + "https://myvmvault.vault-int.azure-int.net/keys/keyName/keyVersion", + sourceVault: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault" + } + }, + encryptionType: "EncryptionAtRestWithCustomerKey", + tags: { department: "Development", project: "Encryption" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.beginUpdateAndWait( + resourceGroupName, + diskEncryptionSetName, + diskEncryptionSet + ); + console.log(result); +} + +updateADiskEncryptionSet().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/diskRestorePointGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/diskRestorePointGetSample.ts new file mode 100644 index 000000000000..71ce9f0901a4 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/diskRestorePointGetSample.ts @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get disk restorePoint resource + * + * @summary Get disk restorePoint resource + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetDiskRestorePointResources.json + */ +async function getAnIncrementalDiskRestorePointResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpc"; + const vmRestorePointName = "vmrp"; + const diskRestorePointName = + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskRestorePointOperations.get( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName + ); + console.log(result); +} + +getAnIncrementalDiskRestorePointResource().catch(console.error); + +/** + * This sample demonstrates how to Get disk restorePoint resource + * + * @summary Get disk restorePoint resource + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetDiskRestorePointWhenSourceResourceIsFromDifferentRegion.json + */ +async function getAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpc"; + const vmRestorePointName = "vmrp"; + const diskRestorePointName = + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskRestorePointOperations.get( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName + ); + console.log(result); +} + +getAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/diskRestorePointGrantAccessSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/diskRestorePointGrantAccessSample.ts new file mode 100644 index 000000000000..bc13fb771a09 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/diskRestorePointGrantAccessSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { GrantAccessData, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Grants access to a diskRestorePoint. + * + * @summary Grants access to a diskRestorePoint. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/BeginGetAccessDiskRestorePoint.json + */ +async function grantsAccessToADiskRestorePoint() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpc"; + const vmRestorePointName = "vmrp"; + const diskRestorePointName = + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"; + const grantAccessData: GrantAccessData = { + access: "Read", + durationInSeconds: 300 + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskRestorePointOperations.beginGrantAccessAndWait( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData + ); + console.log(result); +} + +grantsAccessToADiskRestorePoint().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/diskRestorePointListByRestorePointSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/diskRestorePointListByRestorePointSample.ts new file mode 100644 index 000000000000..4a652dee31e8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/diskRestorePointListByRestorePointSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists diskRestorePoints under a vmRestorePoint. + * + * @summary Lists diskRestorePoints under a vmRestorePoint. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskRestorePointsInVmRestorePoint.json + */ +async function getAnIncrementalDiskRestorePointResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpc"; + const vmRestorePointName = "vmrp"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.diskRestorePointOperations.listByRestorePoint( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAnIncrementalDiskRestorePointResource().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/diskRestorePointRevokeAccessSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/diskRestorePointRevokeAccessSample.ts new file mode 100644 index 000000000000..313218e59a41 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/diskRestorePointRevokeAccessSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Revokes access to a diskRestorePoint. + * + * @summary Revokes access to a diskRestorePoint. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/EndGetAccessDiskRestorePoint.json + */ +async function revokesAccessToADiskRestorePoint() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpc"; + const vmRestorePointName = "vmrp"; + const diskRestorePointName = + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskRestorePointOperations.beginRevokeAccessAndWait( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName + ); + console.log(result); +} + +revokesAccessToADiskRestorePoint().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/disksCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/disksCreateOrUpdateSample.ts new file mode 100644 index 000000000000..1b37b06ee90b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/disksCreateOrUpdateSample.ts @@ -0,0 +1,542 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { Disk, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAConfidentialVMDiskEncryptedWithCMK.json + */ +async function createAConfidentialVMSupportedDiskEncryptedWithCustomerManagedKey() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { + createOption: "FromImage", + imageReference: { + id: + "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0" + } + }, + location: "West US", + osType: "Windows", + securityProfile: { + secureVMDiskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", + securityType: "ConfidentialVM_DiskEncryptedWithCustomerKey" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAConfidentialVMSupportedDiskEncryptedWithCustomerManagedKey().catch( + console.error +); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskWithDiskAccess.json + */ +async function createAManagedDiskAndAssociateWithDiskAccessResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { createOption: "Empty" }, + diskAccessId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/{existing-diskAccess-name}", + diskSizeGB: 200, + location: "West US", + networkAccessPolicy: "AllowPrivate" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAManagedDiskAndAssociateWithDiskAccessResource().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskWithDiskEncryptionSet.json + */ +async function createAManagedDiskAndAssociateWithDiskEncryptionSet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + encryption: { + diskEncryptionSetId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}" + }, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAManagedDiskAndAssociateWithDiskEncryptionSet().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskByCopyingASnapshot.json + */ +async function createAManagedDiskByCopyingASnapshot() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { + createOption: "Copy", + sourceResourceId: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot" + }, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAManagedDiskByCopyingASnapshot().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription.json + */ +async function createAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { + createOption: "Import", + sourceUri: + "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + storageAccountId: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount" + }, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription().catch( + console.error +); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription.json + */ +async function createAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { + createOption: "Import", + sourceUri: + "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd" + }, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription().catch( + console.error +); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskFromImportSecure.json + */ +async function createAManagedDiskFromImportSecureCreateOption() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { + createOption: "ImportSecure", + securityDataUri: + "https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd", + sourceUri: + "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + storageAccountId: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount" + }, + location: "West US", + osType: "Windows", + securityProfile: { + securityType: "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAManagedDiskFromImportSecureCreateOption().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskFromUploadPreparedSecure.json + */ +async function createAManagedDiskFromUploadPreparedSecureCreateOption() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { + createOption: "UploadPreparedSecure", + uploadSizeBytes: 10737418752 + }, + location: "West US", + osType: "Windows", + securityProfile: { securityType: "TrustedLaunch" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAManagedDiskFromUploadPreparedSecureCreateOption().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskFromAPlatformImage.json + */ +async function createAManagedDiskFromAPlatformImage() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { + createOption: "FromImage", + imageReference: { + id: + "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0" + } + }, + location: "West US", + osType: "Windows" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAManagedDiskFromAPlatformImage().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskFromAnExistingManagedDisk.json + */ +async function createAManagedDiskFromAnExistingManagedDiskInTheSameOrDifferentSubscription() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk2"; + const disk: Disk = { + creationData: { + createOption: "Copy", + sourceResourceId: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk1" + }, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAManagedDiskFromAnExistingManagedDiskInTheSameOrDifferentSubscription().catch( + console.error +); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskWithDataAccessAuthMode.json + */ +async function createAManagedDiskWithDataAccessAuthMode() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { createOption: "Empty" }, + dataAccessAuthMode: "AzureActiveDirectory", + diskSizeGB: 200, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAManagedDiskWithDataAccessAuthMode().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskWithSecurityProfile.json + */ +async function createAManagedDiskWithSecurityProfile() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { + createOption: "FromImage", + imageReference: { + id: + "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/uswest/Publishers/Microsoft/ArtifactTypes/VMImage/Offers/{offer}" + } + }, + location: "North Central US", + osType: "Windows", + securityProfile: { securityType: "TrustedLaunch" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAManagedDiskWithSecurityProfile().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskWithSSDZRSAccountType.json + */ +async function createAManagedDiskWithSsdZrsAccountType() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + location: "West US", + sku: { name: "Premium_ZRS" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAManagedDiskWithSsdZrsAccountType().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedUploadDisk.json + */ +async function createAManagedUploadDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { createOption: "Upload", uploadSizeBytes: 10737418752 }, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAManagedUploadDisk().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAnEmptyManagedDiskInExtendedLocation.json + */ +async function createAnEmptyManagedDiskInExtendedLocation() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + extendedLocation: { name: "{edge-zone-id}", type: "EdgeZone" }, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAnEmptyManagedDiskInExtendedLocation().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAnEmptyManagedDisk.json + */ +async function createAnEmptyManagedDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAnEmptyManagedDisk().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a disk. + * + * @summary Creates or updates a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAManagedDiskWithLogicalSectorSize.json + */ +async function createAnUltraManagedDiskWithLogicalSectorSize512E() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: Disk = { + creationData: { createOption: "Empty", logicalSectorSize: 512 }, + diskSizeGB: 200, + location: "West US", + sku: { name: "UltraSSD_LRS" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginCreateOrUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createAnUltraManagedDiskWithLogicalSectorSize512E().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/disksDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/disksDeleteSample.ts new file mode 100644 index 000000000000..a496a65c4970 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/disksDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes a disk. + * + * @summary Deletes a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteAManagedDisk.json + */ +async function deleteAManagedDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginDeleteAndWait( + resourceGroupName, + diskName + ); + console.log(result); +} + +deleteAManagedDisk().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/disksGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/disksGetSample.ts new file mode 100644 index 000000000000..a79272455306 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/disksGetSample.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets information about a disk. + * + * @summary Gets information about a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutAManagedDisk.json + */ +async function getInformationAboutAManagedDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myManagedDisk"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.get(resourceGroupName, diskName); + console.log(result); +} + +getInformationAboutAManagedDisk().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/disksGrantAccessSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/disksGrantAccessSample.ts new file mode 100644 index 000000000000..b1c2adef02ae --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/disksGrantAccessSample.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { GrantAccessData, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Grants access to a disk. + * + * @summary Grants access to a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/BeginGetAccessManagedDisk.json + */ +async function getASasOnAManagedDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const grantAccessData: GrantAccessData = { + access: "Read", + durationInSeconds: 300 + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginGrantAccessAndWait( + resourceGroupName, + diskName, + grantAccessData + ); + console.log(result); +} + +getASasOnAManagedDisk().catch(console.error); + +/** + * This sample demonstrates how to Grants access to a disk. + * + * @summary Grants access to a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/BeginGetAccessManagedDiskWithVMGuestState.json + */ +async function getSasOnManagedDiskAndVMGuestState() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const grantAccessData: GrantAccessData = { + access: "Read", + durationInSeconds: 300, + getSecureVMGuestStateSAS: true + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginGrantAccessAndWait( + resourceGroupName, + diskName, + grantAccessData + ); + console.log(result); +} + +getSasOnManagedDiskAndVMGuestState().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/disksListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/disksListByResourceGroupSample.ts new file mode 100644 index 000000000000..70176d30dd08 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/disksListByResourceGroupSample.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all the disks under a resource group. + * + * @summary Lists all the disks under a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListManagedDisksInAResourceGroup.json + */ +async function listAllManagedDisksInAResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.disks.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listAllManagedDisksInAResourceGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/disksListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/disksListSample.ts new file mode 100644 index 000000000000..b4e769c1c94e --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/disksListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all the disks under a subscription. + * + * @summary Lists all the disks under a subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListManagedDisksInASubscription.json + */ +async function listAllManagedDisksInASubscription() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.disks.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listAllManagedDisksInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/disksRevokeAccessSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/disksRevokeAccessSample.ts new file mode 100644 index 000000000000..39c6c7bacd42 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/disksRevokeAccessSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Revokes access to a disk. + * + * @summary Revokes access to a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/EndGetAccessManagedDisk.json + */ +async function revokeAccessToAManagedDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginRevokeAccessAndWait( + resourceGroupName, + diskName + ); + console.log(result); +} + +revokeAccessToAManagedDisk().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/disksUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/disksUpdateSample.ts new file mode 100644 index 000000000000..821f1ecb9b07 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/disksUpdateSample.ts @@ -0,0 +1,205 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { DiskUpdate, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Updates (patches) a disk. + * + * @summary Updates (patches) a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateOrUpdateABurstingEnabledManagedDisk.json + */ +async function createOrUpdateABurstingEnabledManagedDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: DiskUpdate = { burstingEnabled: true, diskSizeGB: 1024 }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +createOrUpdateABurstingEnabledManagedDisk().catch(console.error); + +/** + * This sample demonstrates how to Updates (patches) a disk. + * + * @summary Updates (patches) a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateAManagedDiskToAddAcceleratedNetworking.json + */ +async function updateAManagedDiskToAddAcceleratedNetworking() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: DiskUpdate = { + supportedCapabilities: { acceleratedNetwork: false } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +updateAManagedDiskToAddAcceleratedNetworking().catch(console.error); + +/** + * This sample demonstrates how to Updates (patches) a disk. + * + * @summary Updates (patches) a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateAManagedDiskToAddArchitecture.json + */ +async function updateAManagedDiskToAddArchitecture() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: DiskUpdate = { supportedCapabilities: { architecture: "Arm64" } }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +updateAManagedDiskToAddArchitecture().catch(console.error); + +/** + * This sample demonstrates how to Updates (patches) a disk. + * + * @summary Updates (patches) a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateAManagedDiskToAddPurchasePlan.json + */ +async function updateAManagedDiskToAddPurchasePlan() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: DiskUpdate = { + purchasePlan: { + name: "myPurchasePlanName", + product: "myPurchasePlanProduct", + promotionCode: "myPurchasePlanPromotionCode", + publisher: "myPurchasePlanPublisher" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +updateAManagedDiskToAddPurchasePlan().catch(console.error); + +/** + * This sample demonstrates how to Updates (patches) a disk. + * + * @summary Updates (patches) a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateAManagedDiskToAddSupportsHibernation.json + */ +async function updateAManagedDiskToAddSupportsHibernation() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: DiskUpdate = { supportsHibernation: true }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +updateAManagedDiskToAddSupportsHibernation().catch(console.error); + +/** + * This sample demonstrates how to Updates (patches) a disk. + * + * @summary Updates (patches) a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateAManagedDiskToChangeTier.json + */ +async function updateAManagedDiskToChangeTier() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: DiskUpdate = { tier: "P30" }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +updateAManagedDiskToChangeTier().catch(console.error); + +/** + * This sample demonstrates how to Updates (patches) a disk. + * + * @summary Updates (patches) a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateAManagedDiskToDisableBursting.json + */ +async function updateAManagedDiskToDisableBursting() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: DiskUpdate = { burstingEnabled: false }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +updateAManagedDiskToDisableBursting().catch(console.error); + +/** + * This sample demonstrates how to Updates (patches) a disk. + * + * @summary Updates (patches) a disk. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateAManagedDiskToRemoveDiskAccess.json + */ +async function updateManagedDiskToRemoveDiskAccessResourceAssociation() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const diskName = "myDisk"; + const disk: DiskUpdate = { networkAccessPolicy: "AllowAll" }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.beginUpdateAndWait( + resourceGroupName, + diskName, + disk + ); + console.log(result); +} + +updateManagedDiskToRemoveDiskAccessResourceAssociation().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/galleriesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/galleriesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..29bee9d11a67 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/galleriesCreateOrUpdateSample.ts @@ -0,0 +1,127 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { Gallery, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a Shared Image Gallery. + * + * @summary Create or update a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateACommunityGallery.json + */ +async function createACommunityGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const gallery: Gallery = { + description: "This is the gallery description.", + location: "West US", + sharingProfile: { + communityGalleryInfo: { + eula: "eula", + publicNamePrefix: "PirPublic", + publisherContact: "pir@microsoft.com", + publisherUri: "uri" + }, + permissions: "Community" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + gallery + ); + console.log(result); +} + +createACommunityGallery().catch(console.error); + +/** + * This sample demonstrates how to Create or update a Shared Image Gallery. + * + * @summary Create or update a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryWithSharingProfile.json + */ +async function createOrUpdateASimpleGalleryWithSharingProfile() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const gallery: Gallery = { + description: "This is the gallery description.", + location: "West US", + sharingProfile: { permissions: "Groups" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + gallery + ); + console.log(result); +} + +createOrUpdateASimpleGalleryWithSharingProfile().catch(console.error); + +/** + * This sample demonstrates how to Create or update a Shared Image Gallery. + * + * @summary Create or update a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryWithSoftDeletionEnabled.json + */ +async function createOrUpdateASimpleGalleryWithSoftDeletionEnabled() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const gallery: Gallery = { + description: "This is the gallery description.", + location: "West US", + softDeletePolicy: { isSoftDeleteEnabled: true } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + gallery + ); + console.log(result); +} + +createOrUpdateASimpleGalleryWithSoftDeletionEnabled().catch(console.error); + +/** + * This sample demonstrates how to Create or update a Shared Image Gallery. + * + * @summary Create or update a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGallery.json + */ +async function createOrUpdateASimpleGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const gallery: Gallery = { + description: "This is the gallery description.", + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + gallery + ); + console.log(result); +} + +createOrUpdateASimpleGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/galleriesDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/galleriesDeleteSample.ts new file mode 100644 index 000000000000..62da9bf5b8f3 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/galleriesDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a Shared Image Gallery. + * + * @summary Delete a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGallery.json + */ +async function deleteAGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.beginDeleteAndWait( + resourceGroupName, + galleryName + ); + console.log(result); +} + +deleteAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/galleriesGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/galleriesGetSample.ts new file mode 100644 index 000000000000..cb761d6898da --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/galleriesGetSample.ts @@ -0,0 +1,99 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + GalleriesGetOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Retrieves information about a Shared Image Gallery. + * + * @summary Retrieves information about a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetACommunityGallery.json + */ +async function getACommunityGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.get(resourceGroupName, galleryName); + console.log(result); +} + +getACommunityGallery().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about a Shared Image Gallery. + * + * @summary Retrieves information about a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryWithExpandSharingProfileGroups.json + */ +async function getAGalleryWithExpandSharingProfileGroups() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const expand = "SharingProfile/Groups"; + const options: GalleriesGetOptionalParams = { expand }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.get( + resourceGroupName, + galleryName, + options + ); + console.log(result); +} + +getAGalleryWithExpandSharingProfileGroups().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about a Shared Image Gallery. + * + * @summary Retrieves information about a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryWithSelectPermissions.json + */ +async function getAGalleryWithSelectPermissions() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const select = "Permissions"; + const options: GalleriesGetOptionalParams = { select }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.get( + resourceGroupName, + galleryName, + options + ); + console.log(result); +} + +getAGalleryWithSelectPermissions().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about a Shared Image Gallery. + * + * @summary Retrieves information about a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGallery.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.get(resourceGroupName, galleryName); + console.log(result); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/galleriesListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/galleriesListByResourceGroupSample.ts new file mode 100644 index 000000000000..66f6109f54fd --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/galleriesListByResourceGroupSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List galleries under a resource group. + * + * @summary List galleries under a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleriesInAResourceGroup.json + */ +async function listGalleriesInAResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.galleries.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listGalleriesInAResourceGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/galleriesListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/galleriesListSample.ts new file mode 100644 index 000000000000..3733afce354b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/galleriesListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List galleries under a subscription. + * + * @summary List galleries under a subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleriesInASubscription.json + */ +async function listGalleriesInASubscription() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.galleries.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listGalleriesInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/galleriesUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/galleriesUpdateSample.ts new file mode 100644 index 000000000000..eb4ae84a7b46 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/galleriesUpdateSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { GalleryUpdate, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update a Shared Image Gallery. + * + * @summary Update a Shared Image Gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGallery.json + */ +async function updateASimpleGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const gallery: GalleryUpdate = { + description: "This is the gallery description." + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.beginUpdateAndWait( + resourceGroupName, + galleryName, + gallery + ); + console.log(result); +} + +updateASimpleGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationVersionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationVersionsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..570975798522 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationVersionsCreateOrUpdateSample.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + GalleryApplicationVersion, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a gallery Application Version. + * + * @summary Create or update a gallery Application Version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryApplicationVersion.json + */ +async function createOrUpdateASimpleGalleryApplicationVersion() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const galleryApplicationVersionName = "1.0.0"; + const galleryApplicationVersion: GalleryApplicationVersion = { + location: "West US", + publishingProfile: { + endOfLifeDate: new Date("2019-07-01T07:00:00Z"), + manageActions: { + install: + 'powershell -command "Expand-Archive -Path package.zip -DestinationPath C:package"', + remove: "del C:package " + }, + replicaCount: 1, + source: { + mediaLink: + "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}" + }, + storageAccountType: "Standard_LRS", + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + storageAccountType: "Standard_LRS" + } + ] + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplicationVersions.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion + ); + console.log(result); +} + +createOrUpdateASimpleGalleryApplicationVersion().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationVersionsDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationVersionsDeleteSample.ts new file mode 100644 index 000000000000..ae168a1dec6d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationVersionsDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a gallery Application Version. + * + * @summary Delete a gallery Application Version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGalleryApplicationVersion.json + */ +async function deleteAGalleryApplicationVersion() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const galleryApplicationVersionName = "1.0.0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplicationVersions.beginDeleteAndWait( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName + ); + console.log(result); +} + +deleteAGalleryApplicationVersion().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationVersionsGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationVersionsGetSample.ts new file mode 100644 index 000000000000..3f3e3113430a --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationVersionsGetSample.ts @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + GalleryApplicationVersionsGetOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Retrieves information about a gallery Application Version. + * + * @summary Retrieves information about a gallery Application Version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryApplicationVersionWithReplicationStatus.json + */ +async function getAGalleryApplicationVersionWithReplicationStatus() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const galleryApplicationVersionName = "1.0.0"; + const expand = "ReplicationStatus"; + const options: GalleryApplicationVersionsGetOptionalParams = { expand }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplicationVersions.get( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + options + ); + console.log(result); +} + +getAGalleryApplicationVersionWithReplicationStatus().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about a gallery Application Version. + * + * @summary Retrieves information about a gallery Application Version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryApplicationVersion.json + */ +async function getAGalleryApplicationVersion() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const galleryApplicationVersionName = "1.0.0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplicationVersions.get( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName + ); + console.log(result); +} + +getAGalleryApplicationVersion().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationVersionsListByGalleryApplicationSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationVersionsListByGalleryApplicationSample.ts new file mode 100644 index 000000000000..84ce99e2fcd8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationVersionsListByGalleryApplicationSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List gallery Application Versions in a gallery Application Definition. + * + * @summary List gallery Application Versions in a gallery Application Definition. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleryApplicationVersionsInAGalleryApplication.json + */ +async function listGalleryApplicationVersionsInAGalleryApplicationDefinition() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.galleryApplicationVersions.listByGalleryApplication( + resourceGroupName, + galleryName, + galleryApplicationName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listGalleryApplicationVersionsInAGalleryApplicationDefinition().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationVersionsUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationVersionsUpdateSample.ts new file mode 100644 index 000000000000..08ca33c5ff91 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationVersionsUpdateSample.ts @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + GalleryApplicationVersionUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update a gallery Application Version. + * + * @summary Update a gallery Application Version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGalleryApplicationVersion.json + */ +async function updateASimpleGalleryApplicationVersion() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const galleryApplicationVersionName = "1.0.0"; + const galleryApplicationVersion: GalleryApplicationVersionUpdate = { + publishingProfile: { + endOfLifeDate: new Date("2019-07-01T07:00:00Z"), + manageActions: { + install: + 'powershell -command "Expand-Archive -Path package.zip -DestinationPath C:package"', + remove: "del C:package " + }, + replicaCount: 1, + source: { + mediaLink: + "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}" + }, + storageAccountType: "Standard_LRS", + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + storageAccountType: "Standard_LRS" + } + ] + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplicationVersions.beginUpdateAndWait( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion + ); + console.log(result); +} + +updateASimpleGalleryApplicationVersion().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..6a098a336346 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationsCreateOrUpdateSample.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + GalleryApplication, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a gallery Application Definition. + * + * @summary Create or update a gallery Application Definition. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryApplication.json + */ +async function createOrUpdateASimpleGalleryApplication() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const galleryApplication: GalleryApplication = { + description: "This is the gallery application description.", + eula: "This is the gallery application EULA.", + location: "West US", + privacyStatementUri: "myPrivacyStatementUri}", + releaseNoteUri: "myReleaseNoteUri", + supportedOSType: "Windows" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplications.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplication + ); + console.log(result); +} + +createOrUpdateASimpleGalleryApplication().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationsDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationsDeleteSample.ts new file mode 100644 index 000000000000..80e94a463d69 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationsDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a gallery Application. + * + * @summary Delete a gallery Application. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGalleryApplication.json + */ +async function deleteAGalleryApplication() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplications.beginDeleteAndWait( + resourceGroupName, + galleryName, + galleryApplicationName + ); + console.log(result); +} + +deleteAGalleryApplication().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationsGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationsGetSample.ts new file mode 100644 index 000000000000..aab0946b632a --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Retrieves information about a gallery Application Definition. + * + * @summary Retrieves information about a gallery Application Definition. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryApplication.json + */ +async function getAGalleryApplication() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplications.get( + resourceGroupName, + galleryName, + galleryApplicationName + ); + console.log(result); +} + +getAGalleryApplication().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationsListByGallerySample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationsListByGallerySample.ts new file mode 100644 index 000000000000..cdadaedeeced --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationsListByGallerySample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List gallery Application Definitions in a gallery. + * + * @summary List gallery Application Definitions in a gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleryApplicationsInAGallery.json + */ +async function listGalleryApplicationsInAGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.galleryApplications.listByGallery( + resourceGroupName, + galleryName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listGalleryApplicationsInAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationsUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationsUpdateSample.ts new file mode 100644 index 000000000000..2493e0eb4afd --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryApplicationsUpdateSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + GalleryApplicationUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update a gallery Application Definition. + * + * @summary Update a gallery Application Definition. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGalleryApplication.json + */ +async function updateASimpleGalleryApplication() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryApplicationName = "myGalleryApplicationName"; + const galleryApplication: GalleryApplicationUpdate = { + description: "This is the gallery application description.", + eula: "This is the gallery application EULA.", + privacyStatementUri: "myPrivacyStatementUri}", + releaseNoteUri: "myReleaseNoteUri", + supportedOSType: "Windows" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplications.beginUpdateAndWait( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplication + ); + console.log(result); +} + +updateASimpleGalleryApplication().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImageVersionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImageVersionsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..82d3fb697128 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImageVersionsCreateOrUpdateSample.ts @@ -0,0 +1,656 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + GalleryImageVersion, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a gallery image version. + * + * @summary Create or update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithVMAsSource.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingVMAsSource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion: GalleryImageVersion = { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + lun: 0 + }, + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + lun: 1 + } + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet" + } + }, + regionalReplicaCount: 1 + }, + { + name: "East US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + lun: 0 + }, + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + lun: 1 + } + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet" + } + }, + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS" + } + ] + }, + storageProfile: { + source: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{vmName}" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +createOrUpdateASimpleGalleryImageVersionUsingVMAsSource().catch(console.error); + +/** + * This sample demonstrates how to Create or update a gallery image version. + * + * @summary Create or update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersion.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingManagedImageAsSource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion: GalleryImageVersion = { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + lun: 0 + }, + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + lun: 1 + } + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet" + } + }, + regionalReplicaCount: 1 + }, + { + name: "East US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + lun: 0 + }, + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + lun: 1 + } + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet" + } + }, + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS" + } + ] + }, + storageProfile: { + source: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +createOrUpdateASimpleGalleryImageVersionUsingManagedImageAsSource().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update a gallery image version. + * + * @summary Create or update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithSnapshotsAsSource.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingMixOfDisksAndSnapshotsAsASource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion: GalleryImageVersion = { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + lun: 1 + } + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet" + } + }, + regionalReplicaCount: 1 + }, + { + name: "East US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + lun: 1 + } + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet" + } + }, + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS" + } + ] + }, + storageProfile: { + dataDiskImages: [ + { + hostCaching: "None", + lun: 1, + source: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{dataDiskName}" + } + } + ], + osDiskImage: { + hostCaching: "ReadOnly", + source: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{osSnapshotName}" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +createOrUpdateASimpleGalleryImageVersionUsingMixOfDisksAndSnapshotsAsASource().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update a gallery image version. + * + * @summary Create or update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithShallowReplicationMode.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingShallowReplicationMode() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion: GalleryImageVersion = { + location: "West US", + publishingProfile: { + replicationMode: "Shallow", + targetRegions: [{ name: "West US", regionalReplicaCount: 1 }] + }, + storageProfile: { + source: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +createOrUpdateASimpleGalleryImageVersionUsingShallowReplicationMode().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update a gallery image version. + * + * @summary Create or update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithImageVersionAsSource.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingSharedImageAsSource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion: GalleryImageVersion = { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + lun: 0 + }, + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + lun: 1 + } + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet" + } + }, + regionalReplicaCount: 1 + }, + { + name: "East US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + lun: 0 + }, + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + lun: 1 + } + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet" + } + }, + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS" + } + ] + }, + storageProfile: { + source: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{versionName}" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +createOrUpdateASimpleGalleryImageVersionUsingSharedImageAsSource().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update a gallery image version. + * + * @summary Create or update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithSnapshotsAsSource.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingSnapshotsAsASource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion: GalleryImageVersion = { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + lun: 1 + } + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet" + } + }, + regionalReplicaCount: 1 + }, + { + name: "East US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + lun: 1 + } + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet" + } + }, + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS" + } + ] + }, + storageProfile: { + dataDiskImages: [ + { + hostCaching: "None", + lun: 1, + source: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{dataDiskName}" + } + } + ], + osDiskImage: { + hostCaching: "ReadOnly", + source: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{osSnapshotName}" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +createOrUpdateASimpleGalleryImageVersionUsingSnapshotsAsASource().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update a gallery image version. + * + * @summary Create or update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithVHD.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingVhdAsASource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion: GalleryImageVersion = { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet", + lun: 1 + } + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet" + } + }, + regionalReplicaCount: 1 + }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS" + } + ] + }, + storageProfile: { + dataDiskImages: [ + { + hostCaching: "None", + lun: 1, + source: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", + uri: + "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd" + } + } + ], + osDiskImage: { + hostCaching: "ReadOnly", + source: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", + uri: + "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +createOrUpdateASimpleGalleryImageVersionUsingVhdAsASource().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update a gallery image version. + * + * @summary Create or update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithTargetExtendedLocations.json + */ +async function createOrUpdateASimpleGalleryImageVersionWithTargetExtendedLocationsSpecified() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion: GalleryImageVersion = { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + lun: 0 + }, + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + lun: 1 + } + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet" + } + }, + regionalReplicaCount: 1 + }, + { + name: "East US", + encryption: { + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + lun: 0 + }, + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + lun: 1 + } + ], + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet" + } + }, + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS" + } + ] + }, + storageProfile: { + source: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +createOrUpdateASimpleGalleryImageVersionWithTargetExtendedLocationsSpecified().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImageVersionsDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImageVersionsDeleteSample.ts new file mode 100644 index 000000000000..39b2c4eadb2c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImageVersionsDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a gallery image version. + * + * @summary Delete a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGalleryImageVersion.json + */ +async function deleteAGalleryImageVersion() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginDeleteAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName + ); + console.log(result); +} + +deleteAGalleryImageVersion().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImageVersionsGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImageVersionsGetSample.ts new file mode 100644 index 000000000000..6173ba957d00 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImageVersionsGetSample.ts @@ -0,0 +1,118 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + GalleryImageVersionsGetOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Retrieves information about a gallery image version. + * + * @summary Retrieves information about a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryImageVersionWithReplicationStatus.json + */ +async function getAGalleryImageVersionWithReplicationStatus() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const expand = "ReplicationStatus"; + const options: GalleryImageVersionsGetOptionalParams = { expand }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.get( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + options + ); + console.log(result); +} + +getAGalleryImageVersionWithReplicationStatus().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about a gallery image version. + * + * @summary Retrieves information about a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryImageVersionWithSnapshotsAsSource.json + */ +async function getAGalleryImageVersionWithSnapshotsAsASource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.get( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName + ); + console.log(result); +} + +getAGalleryImageVersionWithSnapshotsAsASource().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about a gallery image version. + * + * @summary Retrieves information about a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryImageVersionWithVhdAsSource.json + */ +async function getAGalleryImageVersionWithVhdAsASource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.get( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName + ); + console.log(result); +} + +getAGalleryImageVersionWithVhdAsASource().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about a gallery image version. + * + * @summary Retrieves information about a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryImageVersion.json + */ +async function getAGalleryImageVersion() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.get( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName + ); + console.log(result); +} + +getAGalleryImageVersion().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImageVersionsListByGalleryImageSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImageVersionsListByGalleryImageSample.ts new file mode 100644 index 000000000000..d62316ebf261 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImageVersionsListByGalleryImageSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List gallery image versions in a gallery image definition. + * + * @summary List gallery image versions in a gallery image definition. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleryImageVersionsInAGalleryImage.json + */ +async function listGalleryImageVersionsInAGalleryImageDefinition() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.galleryImageVersions.listByGalleryImage( + resourceGroupName, + galleryName, + galleryImageName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listGalleryImageVersionsInAGalleryImageDefinition().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImageVersionsUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImageVersionsUpdateSample.ts new file mode 100644 index 000000000000..e97a5f5f74f0 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImageVersionsUpdateSample.ts @@ -0,0 +1,98 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + GalleryImageVersionUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update a gallery image version. + * + * @summary Update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGalleryImageVersion.json + */ +async function updateASimpleGalleryImageVersionManagedImageAsSource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion: GalleryImageVersionUpdate = { + publishingProfile: { + targetRegions: [ + { name: "West US", regionalReplicaCount: 1 }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS" + } + ] + }, + storageProfile: { + source: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +updateASimpleGalleryImageVersionManagedImageAsSource().catch(console.error); + +/** + * This sample demonstrates how to Update a gallery image version. + * + * @summary Update a gallery image version. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGalleryImageVersionWithoutSourceId.json + */ +async function updateASimpleGalleryImageVersionWithoutSourceId() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "1.0.0"; + const galleryImageVersion: GalleryImageVersionUpdate = { + publishingProfile: { + targetRegions: [ + { name: "West US", regionalReplicaCount: 1 }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS" + } + ] + }, + storageProfile: {} + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.beginUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion + ); + console.log(result); +} + +updateASimpleGalleryImageVersionWithoutSourceId().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImagesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImagesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..08c9d4782be3 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImagesCreateOrUpdateSample.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { GalleryImage, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a gallery image definition. + * + * @summary Create or update a gallery image definition. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImage.json + */ +async function createOrUpdateASimpleGalleryImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImage: GalleryImage = { + hyperVGeneration: "V1", + identifier: { + offer: "myOfferName", + publisher: "myPublisherName", + sku: "mySkuName" + }, + location: "West US", + osState: "Generalized", + osType: "Windows" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImages.beginCreateOrUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImage + ); + console.log(result); +} + +createOrUpdateASimpleGalleryImage().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImagesDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImagesDeleteSample.ts new file mode 100644 index 000000000000..d96d1f87a2c1 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImagesDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a gallery image. + * + * @summary Delete a gallery image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGalleryImage.json + */ +async function deleteAGalleryImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImages.beginDeleteAndWait( + resourceGroupName, + galleryName, + galleryImageName + ); + console.log(result); +} + +deleteAGalleryImage().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImagesGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImagesGetSample.ts new file mode 100644 index 000000000000..991374111a3e --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImagesGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Retrieves information about a gallery image definition. + * + * @summary Retrieves information about a gallery image definition. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryImage.json + */ +async function getAGalleryImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImages.get( + resourceGroupName, + galleryName, + galleryImageName + ); + console.log(result); +} + +getAGalleryImage().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImagesListByGallerySample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImagesListByGallerySample.ts new file mode 100644 index 000000000000..f1a06e696573 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImagesListByGallerySample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List gallery image definitions in a gallery. + * + * @summary List gallery image definitions in a gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleryImagesInAGallery.json + */ +async function listGalleryImagesInAGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.galleryImages.listByGallery( + resourceGroupName, + galleryName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listGalleryImagesInAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImagesUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImagesUpdateSample.ts new file mode 100644 index 000000000000..6ff2814858aa --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/galleryImagesUpdateSample.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + GalleryImageUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update a gallery image definition. + * + * @summary Update a gallery image definition. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGalleryImage.json + */ +async function updateASimpleGalleryImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const galleryImageName = "myGalleryImageName"; + const galleryImage: GalleryImageUpdate = { + hyperVGeneration: "V1", + identifier: { + offer: "myOfferName", + publisher: "myPublisherName", + sku: "mySkuName" + }, + osState: "Generalized", + osType: "Windows" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImages.beginUpdateAndWait( + resourceGroupName, + galleryName, + galleryImageName, + galleryImage + ); + console.log(result); +} + +updateASimpleGalleryImage().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/gallerySharingProfileUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/gallerySharingProfileUpdateSample.ts new file mode 100644 index 000000000000..b87f7b7d12d9 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/gallerySharingProfileUpdateSample.ts @@ -0,0 +1,93 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { SharingUpdate, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update sharing profile of a gallery. + * + * @summary Update sharing profile of a gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/AddToSharingProfileInAGallery.json + */ +async function addSharingIdToTheSharingProfileOfAGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const sharingUpdate: SharingUpdate = { + groups: [ + { + type: "Subscriptions", + ids: [ + "34a4ab42-0d72-47d9-bd1a-aed207386dac", + "380fd389-260b-41aa-bad9-0a83108c370b" + ] + }, + { type: "AADTenants", ids: ["c24c76aa-8897-4027-9b03-8f7928b54ff6"] } + ], + operationType: "Add" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.gallerySharingProfile.beginUpdateAndWait( + resourceGroupName, + galleryName, + sharingUpdate + ); + console.log(result); +} + +addSharingIdToTheSharingProfileOfAGallery().catch(console.error); + +/** + * This sample demonstrates how to Update sharing profile of a gallery. + * + * @summary Update sharing profile of a gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ResetSharingProfileInAGallery.json + */ +async function resetSharingProfileOfAGallery() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const sharingUpdate: SharingUpdate = { operationType: "Reset" }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.gallerySharingProfile.beginUpdateAndWait( + resourceGroupName, + galleryName, + sharingUpdate + ); + console.log(result); +} + +resetSharingProfileOfAGallery().catch(console.error); + +/** + * This sample demonstrates how to Update sharing profile of a gallery. + * + * @summary Update sharing profile of a gallery. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/EnableACommunityGallery.json + */ +async function shareAGalleryToCommunity() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const galleryName = "myGalleryName"; + const sharingUpdate: SharingUpdate = { operationType: "EnableCommunity" }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.gallerySharingProfile.beginUpdateAndWait( + resourceGroupName, + galleryName, + sharingUpdate + ); + console.log(result); +} + +shareAGalleryToCommunity().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/imagesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/imagesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..94e2fd820d35 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/imagesCreateOrUpdateSample.ts @@ -0,0 +1,403 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { Image, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromABlobWithDiskEncryptionSet.json + */ +async function createAVirtualMachineImageFromABlobWithDiskEncryptionSetResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters: Image = { + location: "West US", + storageProfile: { + osDisk: { + blobUri: + "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + diskEncryptionSet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}" + }, + osState: "Generalized", + osType: "Linux" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageFromABlobWithDiskEncryptionSetResource().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromABlob.json + */ +async function createAVirtualMachineImageFromABlob() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters: Image = { + location: "West US", + storageProfile: { + osDisk: { + blobUri: + "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + osState: "Generalized", + osType: "Linux" + }, + zoneResilient: true + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageFromABlob().catch(console.error); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromAManagedDiskWithDiskEncryptionSet.json + */ +async function createAVirtualMachineImageFromAManagedDiskWithDiskEncryptionSetResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters: Image = { + location: "West US", + storageProfile: { + osDisk: { + diskEncryptionSet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}" + }, + managedDisk: { + id: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk" + }, + osState: "Generalized", + osType: "Linux" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageFromAManagedDiskWithDiskEncryptionSetResource().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromAManagedDisk.json + */ +async function createAVirtualMachineImageFromAManagedDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters: Image = { + location: "West US", + storageProfile: { + osDisk: { + managedDisk: { + id: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk" + }, + osState: "Generalized", + osType: "Linux" + }, + zoneResilient: true + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageFromAManagedDisk().catch(console.error); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromASnapshotWithDiskEncryptionSet.json + */ +async function createAVirtualMachineImageFromASnapshotWithDiskEncryptionSetResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters: Image = { + location: "West US", + storageProfile: { + osDisk: { + diskEncryptionSet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}" + }, + osState: "Generalized", + osType: "Linux", + snapshot: { + id: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageFromASnapshotWithDiskEncryptionSetResource().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromASnapshot.json + */ +async function createAVirtualMachineImageFromASnapshot() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters: Image = { + location: "West US", + storageProfile: { + osDisk: { + osState: "Generalized", + osType: "Linux", + snapshot: { + id: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot" + } + }, + zoneResilient: false + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageFromASnapshot().catch(console.error); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromAVM.json + */ +async function createAVirtualMachineImageFromAnExistingVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters: Image = { + location: "West US", + sourceVirtualMachine: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageFromAnExistingVirtualMachine().catch(console.error); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageThatIncludesADataDiskFromABlob.json + */ +async function createAVirtualMachineImageThatIncludesADataDiskFromABlob() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters: Image = { + location: "West US", + storageProfile: { + dataDisks: [ + { + blobUri: + "https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd", + lun: 1 + } + ], + osDisk: { + blobUri: + "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + osState: "Generalized", + osType: "Linux" + }, + zoneResilient: false + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageThatIncludesADataDiskFromABlob().catch(console.error); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageThatIncludesADataDiskFromAManagedDisk.json + */ +async function createAVirtualMachineImageThatIncludesADataDiskFromAManagedDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters: Image = { + location: "West US", + storageProfile: { + dataDisks: [ + { + lun: 1, + managedDisk: { + id: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk2" + } + } + ], + osDisk: { + managedDisk: { + id: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk" + }, + osState: "Generalized", + osType: "Linux" + }, + zoneResilient: false + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageThatIncludesADataDiskFromAManagedDisk().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update an image. + * + * @summary Create or update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageThatIncludesADataDiskFromASnapshot.json + */ +async function createAVirtualMachineImageThatIncludesADataDiskFromASnapshot() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters: Image = { + location: "West US", + storageProfile: { + dataDisks: [ + { + lun: 1, + snapshot: { + id: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2" + } + } + ], + osDisk: { + osState: "Generalized", + osType: "Linux", + snapshot: { + id: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot" + } + }, + zoneResilient: true + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginCreateOrUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +createAVirtualMachineImageThatIncludesADataDiskFromASnapshot().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/imagesDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/imagesDeleteSample.ts new file mode 100644 index 000000000000..7b764d869e9b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/imagesDeleteSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes an Image. + * + * @summary Deletes an Image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Images_Delete_MaximumSet_Gen.json + */ +async function imagesDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const imageName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginDeleteAndWait( + resourceGroupName, + imageName + ); + console.log(result); +} + +imagesDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Deletes an Image. + * + * @summary Deletes an Image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Images_Delete_MinimumSet_Gen.json + */ +async function imagesDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const imageName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginDeleteAndWait( + resourceGroupName, + imageName + ); + console.log(result); +} + +imagesDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/imagesGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/imagesGetSample.ts new file mode 100644 index 000000000000..08c83ce68c85 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/imagesGetSample.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets an image. + * + * @summary Gets an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetInformationAboutAnImage.json + */ +async function getInformationAboutAVirtualMachineImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.get(resourceGroupName, imageName); + console.log(result); +} + +getInformationAboutAVirtualMachineImage().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/imagesListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/imagesListByResourceGroupSample.ts new file mode 100644 index 000000000000..68395b74716b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/imagesListByResourceGroupSample.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of images under a resource group. + * + * @summary Gets the list of images under a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListImagesInAResourceGroup.json + */ +async function listAllVirtualMachineImagesInAResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.images.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listAllVirtualMachineImagesInAResourceGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/imagesListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/imagesListSample.ts new file mode 100644 index 000000000000..eef5642addb0 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/imagesListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. + * + * @summary Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListImagesInASubscription.json + */ +async function listAllVirtualMachineImagesInASubscription() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.images.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listAllVirtualMachineImagesInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/imagesUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/imagesUpdateSample.ts new file mode 100644 index 000000000000..c4de4ad0dced --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/imagesUpdateSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ImageUpdate, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update an image. + * + * @summary Update an image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateImage.json + */ +async function updatesTagsOfAnImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const imageName = "myImage"; + const parameters: ImageUpdate = { + hyperVGeneration: "V1", + sourceVirtualMachine: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM" + }, + tags: { department: "HR" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.beginUpdateAndWait( + resourceGroupName, + imageName, + parameters + ); + console.log(result); +} + +updatesTagsOfAnImage().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/logAnalyticsExportRequestRateByIntervalSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/logAnalyticsExportRequestRateByIntervalSample.ts new file mode 100644 index 000000000000..6877c36c4c5d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/logAnalyticsExportRequestRateByIntervalSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RequestRateByIntervalInput, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Export logs that show Api requests made by this subscription in the given time window to show throttling activities. + * + * @summary Export logs that show Api requests made by this subscription in the given time window to show throttling activities. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/LogAnalyticsRequestRateByInterval.json + */ +async function exportLogsWhichContainAllApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriodBrokenDownByIntervals() { + const subscriptionId = "{subscription-id}"; + const location = "westus"; + const parameters: RequestRateByIntervalInput = { + blobContainerSasUri: "https://somesasuri", + fromTime: new Date("2018-01-21T01:54:06.862601Z"), + groupByResourceName: true, + intervalLength: "FiveMins", + toTime: new Date("2018-01-23T01:54:06.862601Z") + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.logAnalytics.beginExportRequestRateByIntervalAndWait( + location, + parameters + ); + console.log(result); +} + +exportLogsWhichContainAllApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriodBrokenDownByIntervals().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/logAnalyticsExportThrottledRequestsSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/logAnalyticsExportThrottledRequestsSample.ts new file mode 100644 index 000000000000..5acaa5ad0a92 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/logAnalyticsExportThrottledRequestsSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + ThrottledRequestsInput, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @summary Export logs that show total throttled Api requests for this subscription in the given time window. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/LogAnalyticsThrottledRequests.json + */ +async function exportLogsWhichContainAllThrottledApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriod() { + const subscriptionId = "{subscription-id}"; + const location = "westus"; + const parameters: ThrottledRequestsInput = { + blobContainerSasUri: "https://somesasuri", + fromTime: new Date("2018-01-21T01:54:06.862601Z"), + groupByClientApplicationId: false, + groupByOperationName: true, + groupByResourceName: false, + groupByUserAgent: false, + toTime: new Date("2018-01-23T01:54:06.862601Z") + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.logAnalytics.beginExportThrottledRequestsAndWait( + location, + parameters + ); + console.log(result); +} + +exportLogsWhichContainAllThrottledApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriod().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/operationsListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/operationsListSample.ts new file mode 100644 index 000000000000..9f61666e374c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/operationsListSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of compute operations. + * + * @summary Gets a list of compute operations. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Operations_List_MaximumSet_Gen.json + */ +async function operationsListMaximumSetGen() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +operationsListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of compute operations. + * + * @summary Gets a list of compute operations. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Operations_List_MinimumSet_Gen.json + */ +async function operationsListMinimumSetGen() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +operationsListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/proximityPlacementGroupsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/proximityPlacementGroupsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..4781dda42344 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/proximityPlacementGroupsCreateOrUpdateSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ProximityPlacementGroup, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a proximity placement group. + * + * @summary Create or update a proximity placement group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAProximityPlacementGroup.json + */ +async function createOrUpdateAProximityPlacementGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const proximityPlacementGroupName = "myProximityPlacementGroup"; + const parameters: ProximityPlacementGroup = { + location: "westus", + proximityPlacementGroupType: "Standard" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.proximityPlacementGroups.createOrUpdate( + resourceGroupName, + proximityPlacementGroupName, + parameters + ); + console.log(result); +} + +createOrUpdateAProximityPlacementGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/proximityPlacementGroupsDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/proximityPlacementGroupsDeleteSample.ts new file mode 100644 index 000000000000..707c718f4ed9 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/proximityPlacementGroupsDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a proximity placement group. + * + * @summary Delete a proximity placement group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DeleteAProximityPlacementGroup.json + */ +async function createAProximityPlacementGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const proximityPlacementGroupName = "myProximityPlacementGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.proximityPlacementGroups.delete( + resourceGroupName, + proximityPlacementGroupName + ); + console.log(result); +} + +createAProximityPlacementGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/proximityPlacementGroupsGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/proximityPlacementGroupsGetSample.ts new file mode 100644 index 000000000000..b39874460ee1 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/proximityPlacementGroupsGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Retrieves information about a proximity placement group . + * + * @summary Retrieves information about a proximity placement group . + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetAProximityPlacementGroup.json + */ +async function createAProximityPlacementGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const proximityPlacementGroupName = "myProximityPlacementGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.proximityPlacementGroups.get( + resourceGroupName, + proximityPlacementGroupName + ); + console.log(result); +} + +createAProximityPlacementGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/proximityPlacementGroupsListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/proximityPlacementGroupsListByResourceGroupSample.ts new file mode 100644 index 000000000000..0b27e0845435 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/proximityPlacementGroupsListByResourceGroupSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all proximity placement groups in a resource group. + * + * @summary Lists all proximity placement groups in a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListProximityPlacementGroupsInAResourceGroup.json + */ +async function createAProximityPlacementGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.proximityPlacementGroups.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +createAProximityPlacementGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/proximityPlacementGroupsListBySubscriptionSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/proximityPlacementGroupsListBySubscriptionSample.ts new file mode 100644 index 000000000000..d1a01a5755d3 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/proximityPlacementGroupsListBySubscriptionSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all proximity placement groups in a subscription. + * + * @summary Lists all proximity placement groups in a subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListProximityPlacementGroupsInASubscription.json + */ +async function createAProximityPlacementGroup() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.proximityPlacementGroups.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +createAProximityPlacementGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/proximityPlacementGroupsUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/proximityPlacementGroupsUpdateSample.ts new file mode 100644 index 000000000000..e0fd0ba4d9d9 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/proximityPlacementGroupsUpdateSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + ProximityPlacementGroupUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update a proximity placement group. + * + * @summary Update a proximity placement group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/PatchAProximityPlacementGroup.json + */ +async function createAProximityPlacementGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const proximityPlacementGroupName = "myProximityPlacementGroup"; + const parameters: ProximityPlacementGroupUpdate = { + tags: { additionalProp1: "string" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.proximityPlacementGroups.update( + resourceGroupName, + proximityPlacementGroupName, + parameters + ); + console.log(result); +} + +createAProximityPlacementGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/resourceSkusListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/resourceSkusListSample.ts new file mode 100644 index 000000000000..31e00ad70c4b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/resourceSkusListSample.ts @@ -0,0 +1,78 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + ResourceSkusListOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @summary Gets the list of Microsoft.Compute SKUs available for your Subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/skus/ListAvailableResourceSkus.json + */ +async function listsAllAvailableResourceSkUs() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.resourceSkus.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listsAllAvailableResourceSkUs().catch(console.error); + +/** + * This sample demonstrates how to Gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @summary Gets the list of Microsoft.Compute SKUs available for your Subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/skus/ListAvailableResourceSkusForARegion.json + */ +async function listsAllAvailableResourceSkUsForTheSpecifiedRegion() { + const subscriptionId = "{subscription-id}"; + const filter = "location eq 'westus'"; + const options: ResourceSkusListOptionalParams = { filter }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.resourceSkus.list(options)) { + resArray.push(item); + } + console.log(resArray); +} + +listsAllAvailableResourceSkUsForTheSpecifiedRegion().catch(console.error); + +/** + * This sample demonstrates how to Gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @summary Gets the list of Microsoft.Compute SKUs available for your Subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/skus/ListAvailableResourceSkusWithExtendedLocations.json + */ +async function listsAllAvailableResourceSkUsWithExtendedLocationInformation() { + const subscriptionId = "{subscription-id}"; + const includeExtendedLocations = "true"; + const options: ResourceSkusListOptionalParams = { includeExtendedLocations }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.resourceSkus.list(options)) { + resArray.push(item); + } + console.log(resArray); +} + +listsAllAvailableResourceSkUsWithExtendedLocationInformation().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..16f73ab964b4 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsCreateOrUpdateSample.ts @@ -0,0 +1,75 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + RestorePointCollection, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. + * + * @summary The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateARestorePointCollectionForCrossRegionCopy.json + */ +async function createOrUpdateARestorePointCollectionForCrossRegionCopy() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "myRpc"; + const parameters: RestorePointCollection = { + location: "norwayeast", + source: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/sourceRpcName" + }, + tags: { myTag1: "tagValue1" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.createOrUpdate( + resourceGroupName, + restorePointCollectionName, + parameters + ); + console.log(result); +} + +createOrUpdateARestorePointCollectionForCrossRegionCopy().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. + * + * @summary The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateARestorePointCollection.json + */ +async function createOrUpdateARestorePointCollection() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "myRpc"; + const parameters: RestorePointCollection = { + location: "norwayeast", + source: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM" + }, + tags: { myTag1: "tagValue1" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.createOrUpdate( + resourceGroupName, + restorePointCollectionName, + parameters + ); + console.log(result); +} + +createOrUpdateARestorePointCollection().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsDeleteSample.ts new file mode 100644 index 000000000000..239f2a942ec5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsDeleteSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete the restore point collection. This operation will also delete all the contained restore points. + * + * @summary The operation to delete the restore point collection. This operation will also delete all the contained restore points. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Delete_MaximumSet_Gen.json + */ +async function restorePointCollectionsDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const restorePointCollectionName = "aaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.beginDeleteAndWait( + resourceGroupName, + restorePointCollectionName + ); + console.log(result); +} + +restorePointCollectionsDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to delete the restore point collection. This operation will also delete all the contained restore points. + * + * @summary The operation to delete the restore point collection. This operation will also delete all the contained restore points. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Delete_MinimumSet_Gen.json + */ +async function restorePointCollectionsDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const restorePointCollectionName = "aaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.beginDeleteAndWait( + resourceGroupName, + restorePointCollectionName + ); + console.log(result); +} + +restorePointCollectionsDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsGetSample.ts new file mode 100644 index 000000000000..2e6b3b765cc1 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsGetSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get the restore point collection. + * + * @summary The operation to get the restore point collection. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointCollection.json + */ +async function getARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "myRpc"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.get( + resourceGroupName, + restorePointCollectionName + ); + console.log(result); +} + +getARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to get the restore point collection. + * + * @summary The operation to get the restore point collection. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointCollectionWithContainedRestorePoints.json + */ +async function getARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpcName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.get( + resourceGroupName, + restorePointCollectionName + ); + console.log(result); +} + +getARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsListAllSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsListAllSample.ts new file mode 100644 index 000000000000..8bca8068a75f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsListAllSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. + * + * @summary Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointCollectionsInASubscription.json + */ +async function getsTheListOfRestorePointCollectionsInASubscription() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.restorePointCollections.listAll()) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfRestorePointCollectionsInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsListSample.ts new file mode 100644 index 000000000000..c594bdd449af --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsListSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of restore point collections in a resource group. + * + * @summary Gets the list of restore point collections in a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointCollectionsInAResourceGroup.json + */ +async function getsTheListOfRestorePointCollectionsInAResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.restorePointCollections.list( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfRestorePointCollectionsInAResourceGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsUpdateSample.ts new file mode 100644 index 000000000000..31878417ed01 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointCollectionsUpdateSample.ts @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + RestorePointCollectionUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update the restore point collection. + * + * @summary The operation to update the restore point collection. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Update_MaximumSet_Gen.json + */ +async function restorePointCollectionsUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const restorePointCollectionName = "aaaaaaaaaaaaaaaaaaaa"; + const parameters: RestorePointCollectionUpdate = { + source: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM" + }, + tags: { key8536: "aaaaaaaaaaaaaaaaaaa" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.update( + resourceGroupName, + restorePointCollectionName, + parameters + ); + console.log(result); +} + +restorePointCollectionsUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to update the restore point collection. + * + * @summary The operation to update the restore point collection. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Update_MinimumSet_Gen.json + */ +async function restorePointCollectionsUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const restorePointCollectionName = "aaaaaaaaaaaaaaaaaa"; + const parameters: RestorePointCollectionUpdate = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.update( + resourceGroupName, + restorePointCollectionName, + parameters + ); + console.log(result); +} + +restorePointCollectionsUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointsCreateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointsCreateSample.ts new file mode 100644 index 000000000000..a38b9421fcbe --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointsCreateSample.ts @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { RestorePoint, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create the restore point. Updating properties of an existing restore point is not allowed + * + * @summary The operation to create the restore point. Updating properties of an existing restore point is not allowed + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CopyRestorePointBetweenRegions.json + */ +async function copyARestorePointToADifferentRegion() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpcName"; + const restorePointName = "rpName"; + const parameters: RestorePoint = { + sourceRestorePoint: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/sourceRpcName/restorePoints/sourceRpName" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.beginCreateAndWait( + resourceGroupName, + restorePointCollectionName, + restorePointName, + parameters + ); + console.log(result); +} + +copyARestorePointToADifferentRegion().catch(console.error); + +/** + * This sample demonstrates how to The operation to create the restore point. Updating properties of an existing restore point is not allowed + * + * @summary The operation to create the restore point. Updating properties of an existing restore point is not allowed + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateARestorePoint.json + */ +async function createARestorePoint() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpcName"; + const restorePointName = "rpName"; + const parameters: RestorePoint = { + excludeDisks: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123" + } + ] + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.beginCreateAndWait( + resourceGroupName, + restorePointCollectionName, + restorePointName, + parameters + ); + console.log(result); +} + +createARestorePoint().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointsDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointsDeleteSample.ts new file mode 100644 index 000000000000..9c35853972ac --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointsDeleteSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete the restore point. + * + * @summary The operation to delete the restore point. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePoints_Delete_MaximumSet_Gen.json + */ +async function restorePointsDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const restorePointCollectionName = "aaaaaaaaaaaaaaaaaaaaaa"; + const restorePointName = "a"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.beginDeleteAndWait( + resourceGroupName, + restorePointCollectionName, + restorePointName + ); + console.log(result); +} + +restorePointsDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to delete the restore point. + * + * @summary The operation to delete the restore point. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePoints_Delete_MinimumSet_Gen.json + */ +async function restorePointsDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const restorePointCollectionName = "aaaaaaaaaaaaaaaaa"; + const restorePointName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.beginDeleteAndWait( + resourceGroupName, + restorePointCollectionName, + restorePointName + ); + console.log(result); +} + +restorePointsDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointsGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointsGetSample.ts new file mode 100644 index 000000000000..96f3de3fafcf --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/restorePointsGetSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get the restore point. + * + * @summary The operation to get the restore point. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePoint.json + */ +async function getARestorePoint() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpcName"; + const restorePointName = "rpName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.get( + resourceGroupName, + restorePointCollectionName, + restorePointName + ); + console.log(result); +} + +getARestorePoint().catch(console.error); + +/** + * This sample demonstrates how to The operation to get the restore point. + * + * @summary The operation to get the restore point. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointWithInstanceView.json + */ +async function getRestorePointWithInstanceView() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const restorePointCollectionName = "rpcName"; + const restorePointName = "rpName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.get( + resourceGroupName, + restorePointCollectionName, + restorePointName + ); + console.log(result); +} + +getRestorePointWithInstanceView().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/sharedGalleriesGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/sharedGalleriesGetSample.ts new file mode 100644 index 000000000000..ea613af712da --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/sharedGalleriesGetSample.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a shared gallery by subscription id or tenant id. + * + * @summary Get a shared gallery by subscription id or tenant id. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/GetASharedGallery.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const location = "myLocation"; + const galleryUniqueName = "galleryUniqueName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sharedGalleries.get(location, galleryUniqueName); + console.log(result); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/sharedGalleriesListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/sharedGalleriesListSample.ts new file mode 100644 index 000000000000..6574087be7c5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/sharedGalleriesListSample.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List shared galleries by subscription id or tenant id. + * + * @summary List shared galleries by subscription id or tenant id. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/ListSharedGalleries.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const location = "myLocation"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.sharedGalleries.list(location)) { + resArray.push(item); + } + console.log(resArray); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/sharedGalleryImageVersionsGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/sharedGalleryImageVersionsGetSample.ts new file mode 100644 index 000000000000..4459cec1f32d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/sharedGalleryImageVersionsGetSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a shared gallery image version by subscription id or tenant id. + * + * @summary Get a shared gallery image version by subscription id or tenant id. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/GetASharedGalleryImageVersion.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const location = "myLocation"; + const galleryUniqueName = "galleryUniqueName"; + const galleryImageName = "myGalleryImageName"; + const galleryImageVersionName = "myGalleryImageVersionName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sharedGalleryImageVersions.get( + location, + galleryUniqueName, + galleryImageName, + galleryImageVersionName + ); + console.log(result); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/sharedGalleryImageVersionsListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/sharedGalleryImageVersionsListSample.ts new file mode 100644 index 000000000000..c48b2c724085 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/sharedGalleryImageVersionsListSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List shared gallery image versions by subscription id or tenant id. + * + * @summary List shared gallery image versions by subscription id or tenant id. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/ListSharedGalleryImageVersions.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const location = "myLocation"; + const galleryUniqueName = "galleryUniqueName"; + const galleryImageName = "myGalleryImageName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.sharedGalleryImageVersions.list( + location, + galleryUniqueName, + galleryImageName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/sharedGalleryImagesGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/sharedGalleryImagesGetSample.ts new file mode 100644 index 000000000000..678635cb5e88 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/sharedGalleryImagesGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a shared gallery image by subscription id or tenant id. + * + * @summary Get a shared gallery image by subscription id or tenant id. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/GetASharedGalleryImage.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const location = "myLocation"; + const galleryUniqueName = "galleryUniqueName"; + const galleryImageName = "myGalleryImageName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sharedGalleryImages.get( + location, + galleryUniqueName, + galleryImageName + ); + console.log(result); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/sharedGalleryImagesListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/sharedGalleryImagesListSample.ts new file mode 100644 index 000000000000..12598847b5a4 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/sharedGalleryImagesListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List shared gallery images by subscription id or tenant id. + * + * @summary List shared gallery images by subscription id or tenant id. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/ListSharedGalleryImages.json + */ +async function getAGallery() { + const subscriptionId = "{subscription-id}"; + const location = "myLocation"; + const galleryUniqueName = "galleryUniqueName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.sharedGalleryImages.list( + location, + galleryUniqueName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAGallery().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..700a9979bffd --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsCreateOrUpdateSample.ts @@ -0,0 +1,142 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { Snapshot, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates or updates a snapshot. + * + * @summary Creates or updates a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription.json + */ +async function createASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot1"; + const snapshot: Snapshot = { + creationData: { + createOption: "Import", + sourceUri: + "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + storageAccountId: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount" + }, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginCreateOrUpdateAndWait( + resourceGroupName, + snapshotName, + snapshot + ); + console.log(result); +} + +createASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription().catch( + console.error +); + +/** + * This sample demonstrates how to Creates or updates a snapshot. + * + * @summary Creates or updates a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription.json + */ +async function createASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot1"; + const snapshot: Snapshot = { + creationData: { + createOption: "Import", + sourceUri: + "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd" + }, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginCreateOrUpdateAndWait( + resourceGroupName, + snapshotName, + snapshot + ); + console.log(result); +} + +createASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription().catch( + console.error +); + +/** + * This sample demonstrates how to Creates or updates a snapshot. + * + * @summary Creates or updates a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateASnapshotFromAnExistingSnapshotInDifferentRegion.json + */ +async function createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegion() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot2"; + const snapshot: Snapshot = { + creationData: { + createOption: "CopyStart", + sourceResourceId: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1" + }, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginCreateOrUpdateAndWait( + resourceGroupName, + snapshotName, + snapshot + ); + console.log(result); +} + +createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegion().catch( + console.error +); + +/** + * This sample demonstrates how to Creates or updates a snapshot. + * + * @summary Creates or updates a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateASnapshotFromAnExistingSnapshot.json + */ +async function createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscription() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot2"; + const snapshot: Snapshot = { + creationData: { + createOption: "Copy", + sourceResourceId: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1" + }, + location: "West US" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginCreateOrUpdateAndWait( + resourceGroupName, + snapshotName, + snapshot + ); + console.log(result); +} + +createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscription().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsDeleteSample.ts new file mode 100644 index 000000000000..1966a2782321 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes a snapshot. + * + * @summary Deletes a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteASnapshot.json + */ +async function deleteASnapshot() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginDeleteAndWait( + resourceGroupName, + snapshotName + ); + console.log(result); +} + +deleteASnapshot().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsGetSample.ts new file mode 100644 index 000000000000..92e46d1ef5bd --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsGetSample.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets information about a snapshot. + * + * @summary Gets information about a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutASnapshot.json + */ +async function getInformationAboutASnapshot() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.get(resourceGroupName, snapshotName); + console.log(result); +} + +getInformationAboutASnapshot().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsGrantAccessSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsGrantAccessSample.ts new file mode 100644 index 000000000000..d9dc5a0c85f4 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsGrantAccessSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { GrantAccessData, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Grants access to a snapshot. + * + * @summary Grants access to a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/BeginGetAccessSnapshot.json + */ +async function getASasOnASnapshot() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot"; + const grantAccessData: GrantAccessData = { + access: "Read", + durationInSeconds: 300 + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginGrantAccessAndWait( + resourceGroupName, + snapshotName, + grantAccessData + ); + console.log(result); +} + +getASasOnASnapshot().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsListByResourceGroupSample.ts new file mode 100644 index 000000000000..ce99623fbf1c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsListByResourceGroupSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists snapshots under a resource group. + * + * @summary Lists snapshots under a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListSnapshotsInAResourceGroup.json + */ +async function listAllSnapshotsInAResourceGroup() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.snapshots.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listAllSnapshotsInAResourceGroup().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsListSample.ts new file mode 100644 index 000000000000..7a8cb771da3c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists snapshots under a subscription. + * + * @summary Lists snapshots under a subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListSnapshotsInASubscription.json + */ +async function listAllSnapshotsInASubscription() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.snapshots.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listAllSnapshotsInASubscription().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsRevokeAccessSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsRevokeAccessSample.ts new file mode 100644 index 000000000000..50c6f34e8aac --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsRevokeAccessSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Revokes access to a snapshot. + * + * @summary Revokes access to a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/EndGetAccessSnapshot.json + */ +async function revokeAccessToASnapshot() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginRevokeAccessAndWait( + resourceGroupName, + snapshotName + ); + console.log(result); +} + +revokeAccessToASnapshot().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsUpdateSample.ts new file mode 100644 index 000000000000..50e372adedc2 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/snapshotsUpdateSample.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { SnapshotUpdate, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Updates (patches) a snapshot. + * + * @summary Updates (patches) a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateASnapshotWithAcceleratedNetwork.json + */ +async function updateASnapshotWithAcceleratedNetworking() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot"; + const snapshot: SnapshotUpdate = { + diskSizeGB: 20, + supportedCapabilities: { acceleratedNetwork: false }, + tags: { department: "Development", project: "UpdateSnapshots" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginUpdateAndWait( + resourceGroupName, + snapshotName, + snapshot + ); + console.log(result); +} + +updateASnapshotWithAcceleratedNetworking().catch(console.error); + +/** + * This sample demonstrates how to Updates (patches) a snapshot. + * + * @summary Updates (patches) a snapshot. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateASnapshot.json + */ +async function updateASnapshot() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const snapshotName = "mySnapshot"; + const snapshot: SnapshotUpdate = { + diskSizeGB: 20, + tags: { department: "Development", project: "UpdateSnapshots" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.beginUpdateAndWait( + resourceGroupName, + snapshotName, + snapshot + ); + console.log(result); +} + +updateASnapshot().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysCreateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysCreateSample.ts new file mode 100644 index 000000000000..bd487b8465ab --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysCreateSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + SshPublicKeyResource, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates a new SSH public key resource. + * + * @summary Creates a new SSH public key resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnSshPublicKey.json + */ +async function createANewSshPublicKeyResource() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const sshPublicKeyName = "mySshPublicKeyName"; + const parameters: SshPublicKeyResource = { + location: "westus", + publicKey: "{ssh-rsa public key}" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.create( + resourceGroupName, + sshPublicKeyName, + parameters + ); + console.log(result); +} + +createANewSshPublicKeyResource().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysDeleteSample.ts new file mode 100644 index 000000000000..1d162d183d65 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysDeleteSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete an SSH public key. + * + * @summary Delete an SSH public key. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Delete_MaximumSet_Gen.json + */ +async function sshPublicKeysDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const sshPublicKeyName = "aaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.delete( + resourceGroupName, + sshPublicKeyName + ); + console.log(result); +} + +sshPublicKeysDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Delete an SSH public key. + * + * @summary Delete an SSH public key. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Delete_MinimumSet_Gen.json + */ +async function sshPublicKeysDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const sshPublicKeyName = "aaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.delete( + resourceGroupName, + sshPublicKeyName + ); + console.log(result); +} + +sshPublicKeysDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysGenerateKeyPairSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysGenerateKeyPairSample.ts new file mode 100644 index 000000000000..5f915ddb80b7 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysGenerateKeyPairSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * + * @summary Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GenerateSshKeyPair.json + */ +async function generateAnSshKeyPair() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const sshPublicKeyName = "mySshPublicKeyName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.generateKeyPair( + resourceGroupName, + sshPublicKeyName + ); + console.log(result); +} + +generateAnSshKeyPair().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysGetSample.ts new file mode 100644 index 000000000000..dd269807a158 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Retrieves information about an SSH public key. + * + * @summary Retrieves information about an SSH public key. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetAnSshPublicKey.json + */ +async function getAnSshPublicKey() { + const subscriptionId = "{subscriptionId}"; + const resourceGroupName = "myResourceGroup"; + const sshPublicKeyName = "mySshPublicKeyName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.get( + resourceGroupName, + sshPublicKeyName + ); + console.log(result); +} + +getAnSshPublicKey().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysListByResourceGroupSample.ts new file mode 100644 index 000000000000..d2eb8c647e60 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysListByResourceGroupSample.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. + * + * @summary Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListByResourceGroup_MaximumSet_Gen.json + */ +async function sshPublicKeysListByResourceGroupMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.sshPublicKeys.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +sshPublicKeysListByResourceGroupMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. + * + * @summary Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListByResourceGroup_MinimumSet_Gen.json + */ +async function sshPublicKeysListByResourceGroupMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.sshPublicKeys.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +sshPublicKeysListByResourceGroupMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysListBySubscriptionSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysListBySubscriptionSample.ts new file mode 100644 index 000000000000..8daad97d40cd --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysListBySubscriptionSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. + * + * @summary Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListBySubscription_MaximumSet_Gen.json + */ +async function sshPublicKeysListBySubscriptionMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.sshPublicKeys.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +sshPublicKeysListBySubscriptionMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. + * + * @summary Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListBySubscription_MinimumSet_Gen.json + */ +async function sshPublicKeysListBySubscriptionMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.sshPublicKeys.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +sshPublicKeysListBySubscriptionMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysUpdateSample.ts new file mode 100644 index 000000000000..028194a5128d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/sshPublicKeysUpdateSample.ts @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + SshPublicKeyUpdateResource, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Updates a new SSH public key resource. + * + * @summary Updates a new SSH public key resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Update_MaximumSet_Gen.json + */ +async function sshPublicKeysUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const sshPublicKeyName = "aaaaaaaaaaaa"; + const parameters: SshPublicKeyUpdateResource = { + publicKey: "{ssh-rsa public key}", + tags: { key2854: "a" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.update( + resourceGroupName, + sshPublicKeyName, + parameters + ); + console.log(result); +} + +sshPublicKeysUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Updates a new SSH public key resource. + * + * @summary Updates a new SSH public key resource. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Update_MinimumSet_Gen.json + */ +async function sshPublicKeysUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const sshPublicKeyName = "aaaaaaaaaaa"; + const parameters: SshPublicKeyUpdateResource = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.update( + resourceGroupName, + sshPublicKeyName, + parameters + ); + console.log(result); +} + +sshPublicKeysUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/usageListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/usageListSample.ts new file mode 100644 index 000000000000..46c32c318167 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/usageListSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. + * + * @summary Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Usage_List_MaximumSet_Gen.json + */ +async function usageListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "4_."; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.usageOperations.list(location)) { + resArray.push(item); + } + console.log(resArray); +} + +usageListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. + * + * @summary Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Usage_List_MinimumSet_Gen.json + */ +async function usageListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "_--"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.usageOperations.list(location)) { + resArray.push(item); + } + console.log(resArray); +} + +usageListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionImagesGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionImagesGetSample.ts new file mode 100644 index 000000000000..1bed0c49623b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionImagesGetSample.ts @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a virtual machine extension image. + * + * @summary Gets a virtual machine extension image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_Get_MaximumSet_Gen.json + */ +async function virtualMachineExtensionImagesGetMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaa"; + const typeParam = "aaaaaaaaaaaaaaaaaa"; + const version = "aaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.get( + location, + publisherName, + typeParam, + version + ); + console.log(result); +} + +virtualMachineExtensionImagesGetMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a virtual machine extension image. + * + * @summary Gets a virtual machine extension image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_Get_MinimumSet_Gen.json + */ +async function virtualMachineExtensionImagesGetMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const typeParam = "aa"; + const version = "aaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.get( + location, + publisherName, + typeParam, + version + ); + console.log(result); +} + +virtualMachineExtensionImagesGetMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionImagesListTypesSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionImagesListTypesSample.ts new file mode 100644 index 000000000000..bb871104f16d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionImagesListTypesSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of virtual machine extension image types. + * + * @summary Gets a list of virtual machine extension image types. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListTypes_MaximumSet_Gen.json + */ +async function virtualMachineExtensionImagesListTypesMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.listTypes( + location, + publisherName + ); + console.log(result); +} + +virtualMachineExtensionImagesListTypesMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of virtual machine extension image types. + * + * @summary Gets a list of virtual machine extension image types. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListTypes_MinimumSet_Gen.json + */ +async function virtualMachineExtensionImagesListTypesMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaa"; + const publisherName = "aa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.listTypes( + location, + publisherName + ); + console.log(result); +} + +virtualMachineExtensionImagesListTypesMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionImagesListVersionsSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionImagesListVersionsSample.ts new file mode 100644 index 000000000000..f35d74b4c0d1 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionImagesListVersionsSample.ts @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineExtensionImagesListVersionsOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of virtual machine extension image versions. + * + * @summary Gets a list of virtual machine extension image versions. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListVersions_MaximumSet_Gen.json + */ +async function virtualMachineExtensionImagesListVersionsMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaa"; + const typeParam = "aaaaaaaaaaaaaaaaaa"; + const filter = "aaaaaaaaaaaaaaaaaaaaaaaaa"; + const top = 22; + const orderby = "a"; + const options: VirtualMachineExtensionImagesListVersionsOptionalParams = { + filter, + top, + orderby + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.listVersions( + location, + publisherName, + typeParam, + options + ); + console.log(result); +} + +virtualMachineExtensionImagesListVersionsMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of virtual machine extension image versions. + * + * @summary Gets a list of virtual machine extension image versions. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListVersions_MinimumSet_Gen.json + */ +async function virtualMachineExtensionImagesListVersionsMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const typeParam = "aaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.listVersions( + location, + publisherName, + typeParam + ); + console.log(result); +} + +virtualMachineExtensionImagesListVersionsMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..3336b8cd47b8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsCreateOrUpdateSample.ts @@ -0,0 +1,100 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineExtension, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create or update the extension. + * + * @summary The operation to create or update the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_CreateOrUpdate_MaximumSet_Gen.json + */ +async function virtualMachineExtensionsCreateOrUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const vmExtensionName = "aaaaaaaaaaaaa"; + const extensionParameters: VirtualMachineExtension = { + typePropertiesType: "extType", + autoUpgradeMinorVersion: true, + enableAutomaticUpgrade: true, + forceUpdateTag: "a", + instanceView: { + name: "aaaaaaaaaaaaaaaaa", + type: "aaaaaaaaa", + statuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z") + } + ], + substatuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z") + } + ], + typeHandlerVersion: "aaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + location: "westus", + protectedSettings: {}, + publisher: "extPublisher", + settings: {}, + suppressFailures: true, + tags: { key9183: "aa" }, + typeHandlerVersion: "1.2" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + vmExtensionName, + extensionParameters + ); + console.log(result); +} + +virtualMachineExtensionsCreateOrUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update the extension. + * + * @summary The operation to create or update the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_CreateOrUpdate_MinimumSet_Gen.json + */ +async function virtualMachineExtensionsCreateOrUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaa"; + const vmExtensionName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const extensionParameters: VirtualMachineExtension = { location: "westus" }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + vmExtensionName, + extensionParameters + ); + console.log(result); +} + +virtualMachineExtensionsCreateOrUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsDeleteSample.ts new file mode 100644 index 000000000000..f5cc2e0d982e --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsDeleteSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete the extension. + * + * @summary The operation to delete the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Delete_MaximumSet_Gen.json + */ +async function virtualMachineExtensionsDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaa"; + const vmExtensionName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.beginDeleteAndWait( + resourceGroupName, + vmName, + vmExtensionName + ); + console.log(result); +} + +virtualMachineExtensionsDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to delete the extension. + * + * @summary The operation to delete the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Delete_MinimumSet_Gen.json + */ +async function virtualMachineExtensionsDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmExtensionName = "aa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.beginDeleteAndWait( + resourceGroupName, + vmName, + vmExtensionName + ); + console.log(result); +} + +virtualMachineExtensionsDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsGetSample.ts new file mode 100644 index 000000000000..6d9635e1f4db --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsGetSample.ts @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineExtensionsGetOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get the extension. + * + * @summary The operation to get the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Get_MaximumSet_Gen.json + */ +async function virtualMachineExtensionsGetMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmExtensionName = "aaaaaaa"; + const expand = "aaaaaa"; + const options: VirtualMachineExtensionsGetOptionalParams = { expand }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.get( + resourceGroupName, + vmName, + vmExtensionName, + options + ); + console.log(result); +} + +virtualMachineExtensionsGetMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to get the extension. + * + * @summary The operation to get the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Get_MinimumSet_Gen.json + */ +async function virtualMachineExtensionsGetMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "a"; + const vmExtensionName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.get( + resourceGroupName, + vmName, + vmExtensionName + ); + console.log(result); +} + +virtualMachineExtensionsGetMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsListSample.ts new file mode 100644 index 000000000000..add31895f74d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsListSample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineExtensionsListOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get all extensions of a Virtual Machine. + * + * @summary The operation to get all extensions of a Virtual Machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_List_MaximumSet_Gen.json + */ +async function virtualMachineExtensionsListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaa"; + const expand = "aaaaaaaaaaaaaaaaa"; + const options: VirtualMachineExtensionsListOptionalParams = { expand }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.list( + resourceGroupName, + vmName, + options + ); + console.log(result); +} + +virtualMachineExtensionsListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to get all extensions of a Virtual Machine. + * + * @summary The operation to get all extensions of a Virtual Machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_List_MinimumSet_Gen.json + */ +async function virtualMachineExtensionsListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.list( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachineExtensionsListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsUpdateSample.ts new file mode 100644 index 000000000000..6c2ff2fd1e56 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineExtensionsUpdateSample.ts @@ -0,0 +1,55 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineExtensionUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update the extension. + * + * @summary The operation to update the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateVMExtension.json + */ +async function updateVMExtension() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const vmExtensionName = "myVMExtension"; + const extensionParameters: VirtualMachineExtensionUpdate = { + type: "extType", + autoUpgradeMinorVersion: true, + protectedSettingsFromKeyVault: { + secretUrl: + "https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e", + sourceVault: { + id: + "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName" + } + }, + publisher: "extPublisher", + settings: { UserName: "xyz@microsoft.com" }, + suppressFailures: true, + typeHandlerVersion: "1.2" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.beginUpdateAndWait( + resourceGroupName, + vmName, + vmExtensionName, + extensionParameters + ); + console.log(result); +} + +updateVMExtension().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneGetSample.ts new file mode 100644 index 000000000000..155e7b17bff9 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneGetSample.ts @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a virtual machine image in an edge zone. + * + * @summary Gets a virtual machine image in an edge zone. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneGetMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const edgeZone = "aaaaaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaaaaa"; + const offer = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const skus = "aaaaaaaaaa"; + const version = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.get( + location, + edgeZone, + publisherName, + offer, + skus, + version + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneGetMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a virtual machine image in an edge zone. + * + * @summary Gets a virtual machine image in an edge zone. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_Get_MinimumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneGetMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaaaaaaaaaa"; + const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const offer = "aaaaaaaaaaa"; + const skus = "aaaaaaaaaaaaaaaaaa"; + const version = "aa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.get( + location, + edgeZone, + publisherName, + offer, + skus, + version + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneGetMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneListOffersSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneListOffersSample.ts new file mode 100644 index 000000000000..f899bec05fcc --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneListOffersSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * + * @summary Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListOffersMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaaaaa"; + const edgeZone = "aaaaaaaaaaaaaaaaaaa"; + const publisherName = "aaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.listOffers( + location, + edgeZone, + publisherName + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneListOffersMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * + * @summary Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListOffers_MinimumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListOffersMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaa"; + const edgeZone = "aaaaaaaaaaaaaaaaaaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.listOffers( + location, + edgeZone, + publisherName + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneListOffersMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneListPublishersSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneListPublishersSample.ts new file mode 100644 index 000000000000..4f3daffe1ba0 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneListPublishersSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * + * @summary Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListPublishersMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaa"; + const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.listPublishers( + location, + edgeZone + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneListPublishersMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * + * @summary Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListPublishers_MinimumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListPublishersMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaa"; + const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.listPublishers( + location, + edgeZone + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneListPublishersMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneListSample.ts new file mode 100644 index 000000000000..740ca646643c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneListSample.ts @@ -0,0 +1,78 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineImagesEdgeZoneListOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. + * + * @summary Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaa"; + const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaaaa"; + const publisherName = "aaaa"; + const offer = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const skus = "aaaaaaaaaaaaaaaaaaaaaaa"; + const expand = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const top = 12; + const orderby = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const options: VirtualMachineImagesEdgeZoneListOptionalParams = { + expand, + top, + orderby + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.list( + location, + edgeZone, + publisherName, + offer, + skus, + options + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. + * + * @summary Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_List_MinimumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const edgeZone = "aaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaa"; + const offer = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const skus = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.list( + location, + edgeZone, + publisherName, + offer, + skus + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneListSkusSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneListSkusSample.ts new file mode 100644 index 000000000000..17de38322abf --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesEdgeZoneListSkusSample.ts @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * + * @summary Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListSkusMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaa"; + const edgeZone = "aaaaa"; + const publisherName = "aaaaaaaaaaaa"; + const offer = "aaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.listSkus( + location, + edgeZone, + publisherName, + offer + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneListSkusMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * + * @summary Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListSkus_MinimumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListSkusMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaaaaaaa"; + const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const publisherName = "aaaaaaaaa"; + const offer = "aaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.listSkus( + location, + edgeZone, + publisherName, + offer + ); + console.log(result); +} + +virtualMachineImagesEdgeZoneListSkusMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesGetSample.ts new file mode 100644 index 000000000000..69c8109aa383 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesGetSample.ts @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a virtual machine image. + * + * @summary Gets a virtual machine image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_Get_MaximumSet_Gen.json + */ +async function virtualMachineImagesGetMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaa"; + const publisherName = "aaa"; + const offer = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const skus = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const version = "aaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.get( + location, + publisherName, + offer, + skus, + version + ); + console.log(result); +} + +virtualMachineImagesGetMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a virtual machine image. + * + * @summary Gets a virtual machine image. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_Get_MinimumSet_Gen.json + */ +async function virtualMachineImagesGetMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaa"; + const publisherName = "aaaaaaaaaaa"; + const offer = "aa"; + const skus = "aaaaaaaaa"; + const version = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.get( + location, + publisherName, + offer, + skus, + version + ); + console.log(result); +} + +virtualMachineImagesGetMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesListOffersSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesListOffersSample.ts new file mode 100644 index 000000000000..6a002ba248e6 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesListOffersSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of virtual machine image offers for the specified location and publisher. + * + * @summary Gets a list of virtual machine image offers for the specified location and publisher. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListOffers_MaximumSet_Gen.json + */ +async function virtualMachineImagesListOffersMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaa"; + const publisherName = "aaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listOffers( + location, + publisherName + ); + console.log(result); +} + +virtualMachineImagesListOffersMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of virtual machine image offers for the specified location and publisher. + * + * @summary Gets a list of virtual machine image offers for the specified location and publisher. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListOffers_MinimumSet_Gen.json + */ +async function virtualMachineImagesListOffersMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listOffers( + location, + publisherName + ); + console.log(result); +} + +virtualMachineImagesListOffersMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesListPublishersSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesListPublishersSample.ts new file mode 100644 index 000000000000..b30370da5192 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesListPublishersSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of virtual machine image publishers for the specified Azure location. + * + * @summary Gets a list of virtual machine image publishers for the specified Azure location. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListPublishers_MaximumSet_Gen.json + */ +async function virtualMachineImagesListPublishersMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listPublishers(location); + console.log(result); +} + +virtualMachineImagesListPublishersMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of virtual machine image publishers for the specified Azure location. + * + * @summary Gets a list of virtual machine image publishers for the specified Azure location. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListPublishers_MinimumSet_Gen.json + */ +async function virtualMachineImagesListPublishersMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listPublishers(location); + console.log(result); +} + +virtualMachineImagesListPublishersMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesListSample.ts new file mode 100644 index 000000000000..4addbfb4d73f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesListSample.ts @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineImagesListOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * + * @summary Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_List_MaximumSet_Gen.json + */ +async function virtualMachineImagesListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaaaaaaaaaa"; + const publisherName = "aaaaaa"; + const offer = "aaaaaaaaaaaaaaaa"; + const skus = "aaaaaaaaaaaaaaaaaaaaaaa"; + const expand = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const top = 18; + const orderby = "aa"; + const options: VirtualMachineImagesListOptionalParams = { + expand, + top, + orderby + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.list( + location, + publisherName, + offer, + skus, + options + ); + console.log(result); +} + +virtualMachineImagesListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * + * @summary Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_List_MinimumSet_Gen.json + */ +async function virtualMachineImagesListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaaaaa"; + const publisherName = "aaaaaaaaaaa"; + const offer = "aaaaaaaaaa"; + const skus = "aaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.list( + location, + publisherName, + offer, + skus + ); + console.log(result); +} + +virtualMachineImagesListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesListSkusSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesListSkusSample.ts new file mode 100644 index 000000000000..87d27949cc2c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineImagesListSkusSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * + * @summary Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListSkus_MaximumSet_Gen.json + */ +async function virtualMachineImagesListSkusMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaa"; + const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const offer = "aaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listSkus( + location, + publisherName, + offer + ); + console.log(result); +} + +virtualMachineImagesListSkusMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * + * @summary Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListSkus_MinimumSet_Gen.json + */ +async function virtualMachineImagesListSkusMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "aaaa"; + const publisherName = "aaaaaaaaaaaaa"; + const offer = "aaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listSkus( + location, + publisherName, + offer + ); + console.log(result); +} + +virtualMachineImagesListSkusMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..68649279a6ca --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsCreateOrUpdateSample.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineRunCommand, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create or update the run command. + * + * @summary The operation to create or update the run command. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/CreateOrUpdateRunCommand.json + */ +async function createOrUpdateARunCommand() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const runCommandName = "myRunCommand"; + const runCommand: VirtualMachineRunCommand = { + asyncExecution: false, + location: "West US", + parameters: [ + { name: "param1", value: "value1" }, + { name: "param2", value: "value2" } + ], + runAsPassword: "", + runAsUser: "user1", + source: { script: "Write-Host Hello World!" }, + timeoutInSeconds: 3600 + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineRunCommands.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + runCommandName, + runCommand + ); + console.log(result); +} + +createOrUpdateARunCommand().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsDeleteSample.ts new file mode 100644 index 000000000000..57dc92dc51f2 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete the run command. + * + * @summary The operation to delete the run command. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/DeleteRunCommand.json + */ +async function deleteARunCommand() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const runCommandName = "myRunCommand"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineRunCommands.beginDeleteAndWait( + resourceGroupName, + vmName, + runCommandName + ); + console.log(result); +} + +deleteARunCommand().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsGetByVirtualMachineSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsGetByVirtualMachineSample.ts new file mode 100644 index 000000000000..b8de17c9aa1d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsGetByVirtualMachineSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get the run command. + * + * @summary The operation to get the run command. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/GetRunCommand.json + */ +async function getARunCommand() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const runCommandName = "myRunCommand"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineRunCommands.getByVirtualMachine( + resourceGroupName, + vmName, + runCommandName + ); + console.log(result); +} + +getARunCommand().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsGetSample.ts new file mode 100644 index 000000000000..23bacdecdaee --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets specific run command for a subscription in a location. + * + * @summary Gets specific run command for a subscription in a location. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VirtualMachineRunCommandGet.json + */ +async function virtualMachineRunCommandGet() { + const subscriptionId = "24fb23e3-6ba3-41f0-9b6e-e41131d5d61e"; + const location = "SoutheastAsia"; + const commandId = "RunPowerShellScript"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineRunCommands.get( + location, + commandId + ); + console.log(result); +} + +virtualMachineRunCommandGet().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsListByVirtualMachineSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsListByVirtualMachineSample.ts new file mode 100644 index 000000000000..a7e0fad411da --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsListByVirtualMachineSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get all run commands of a Virtual Machine. + * + * @summary The operation to get all run commands of a Virtual Machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/ListRunCommandsInVM.json + */ +async function listRunCommandsInAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineRunCommands.listByVirtualMachine( + resourceGroupName, + vmName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listRunCommandsInAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsListSample.ts new file mode 100644 index 000000000000..00af68205fa7 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsListSample.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all available run commands for a subscription in a location. + * + * @summary Lists all available run commands for a subscription in a location. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VirtualMachineRunCommandList.json + */ +async function virtualMachineRunCommandList() { + const subscriptionId = "subid"; + const location = "SoutheastAsia"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineRunCommands.list(location)) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineRunCommandList().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsUpdateSample.ts new file mode 100644 index 000000000000..10d77d7ffe21 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineRunCommandsUpdateSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineRunCommandUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update the run command. + * + * @summary The operation to update the run command. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/UpdateRunCommand.json + */ +async function updateARunCommand() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const runCommandName = "myRunCommand"; + const runCommand: VirtualMachineRunCommandUpdate = { + source: { script: "Write-Host Script Source Updated!" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineRunCommands.beginUpdateAndWait( + resourceGroupName, + vmName, + runCommandName, + runCommand + ); + console.log(result); +} + +updateARunCommand().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..cedf83b64b45 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsCreateOrUpdateSample.ts @@ -0,0 +1,81 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetExtension, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create or update an extension. + * + * @summary The operation to create or update an extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_CreateOrUpdate_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsCreateOrUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaa"; + const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaaa"; + const extensionParameters: VirtualMachineScaleSetExtension = { + name: "{extension-name}", + typePropertiesType: "{extension-Type}", + autoUpgradeMinorVersion: true, + enableAutomaticUpgrade: true, + forceUpdateTag: "aaaaaaaaa", + protectedSettings: {}, + provisionAfterExtensions: ["aa"], + publisher: "{extension-Publisher}", + settings: {}, + suppressFailures: true, + typeHandlerVersion: "{handler-version}" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + extensionParameters + ); + console.log(result); +} + +virtualMachineScaleSetExtensionsCreateOrUpdateMaximumSetGen().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update an extension. + * + * @summary The operation to create or update an extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_CreateOrUpdate_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsCreateOrUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaa"; + const vmssExtensionName = "aaaaaaaaaaa"; + const extensionParameters: VirtualMachineScaleSetExtension = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + extensionParameters + ); + console.log(result); +} + +virtualMachineScaleSetExtensionsCreateOrUpdateMinimumSetGen().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsDeleteSample.ts new file mode 100644 index 000000000000..018ea2b824aa --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsDeleteSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete the extension. + * + * @summary The operation to delete the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Delete_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsDeleteMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.beginDeleteAndWait( + resourceGroupName, + vmScaleSetName, + vmssExtensionName + ); + console.log(result); +} + +virtualMachineScaleSetExtensionsDeleteMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to delete the extension. + * + * @summary The operation to delete the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Delete_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsDeleteMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaa"; + const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.beginDeleteAndWait( + resourceGroupName, + vmScaleSetName, + vmssExtensionName + ); + console.log(result); +} + +virtualMachineScaleSetExtensionsDeleteMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsGetSample.ts new file mode 100644 index 000000000000..f5a12418222b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsGetSample.ts @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetExtensionsGetOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get the extension. + * + * @summary The operation to get the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Get_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsGetMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaa"; + const expand = "aaaaaaa"; + const options: VirtualMachineScaleSetExtensionsGetOptionalParams = { expand }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.get( + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + options + ); + console.log(result); +} + +virtualMachineScaleSetExtensionsGetMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to get the extension. + * + * @summary The operation to get the extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Get_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsGetMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "a"; + const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.get( + resourceGroupName, + vmScaleSetName, + vmssExtensionName + ); + console.log(result); +} + +virtualMachineScaleSetExtensionsGetMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsListSample.ts new file mode 100644 index 000000000000..0c313f5c963a --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsListSample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of all extensions in a VM scale set. + * + * @summary Gets a list of all extensions in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_List_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSetExtensions.list( + resourceGroupName, + vmScaleSetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetExtensionsListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of all extensions in a VM scale set. + * + * @summary Gets a list of all extensions in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_List_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSetExtensions.list( + resourceGroupName, + vmScaleSetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetExtensionsListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsUpdateSample.ts new file mode 100644 index 000000000000..ff3a3317e151 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetExtensionsUpdateSample.ts @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetExtensionUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update an extension. + * + * @summary The operation to update an extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Update_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmssExtensionName = "aaaa"; + const extensionParameters: VirtualMachineScaleSetExtensionUpdate = { + typePropertiesType: "{extension-Type}", + autoUpgradeMinorVersion: true, + enableAutomaticUpgrade: true, + forceUpdateTag: "aaaaaaaaa", + protectedSettings: {}, + provisionAfterExtensions: ["aa"], + publisher: "{extension-Publisher}", + settings: {}, + suppressFailures: true, + typeHandlerVersion: "{handler-version}" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.beginUpdateAndWait( + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + extensionParameters + ); + console.log(result); +} + +virtualMachineScaleSetExtensionsUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to update an extension. + * + * @summary The operation to update an extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Update_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionsUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmssExtensionName = "aa"; + const extensionParameters: VirtualMachineScaleSetExtensionUpdate = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.beginUpdateAndWait( + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + extensionParameters + ); + console.log(result); +} + +virtualMachineScaleSetExtensionsUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetRollingUpgradesCancelSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetRollingUpgradesCancelSample.ts new file mode 100644 index 000000000000..9565766f0f01 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetRollingUpgradesCancelSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Cancels the current virtual machine scale set rolling upgrade. + * + * @summary Cancels the current virtual machine scale set rolling upgrade. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_Cancel_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetRollingUpgradesCancelMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetRollingUpgrades.beginCancelAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetRollingUpgradesCancelMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Cancels the current virtual machine scale set rolling upgrade. + * + * @summary Cancels the current virtual machine scale set rolling upgrade. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_Cancel_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetRollingUpgradesCancelMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetRollingUpgrades.beginCancelAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetRollingUpgradesCancelMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetRollingUpgradesGetLatestSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetRollingUpgradesGetLatestSample.ts new file mode 100644 index 000000000000..58048a23360a --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetRollingUpgradesGetLatestSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the status of the latest virtual machine scale set rolling upgrade. + * + * @summary Gets the status of the latest virtual machine scale set rolling upgrade. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_GetLatest_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetRollingUpgradesGetLatestMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetRollingUpgrades.getLatest( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetRollingUpgradesGetLatestMaximumSetGen().catch( + console.error +); + +/** + * This sample demonstrates how to Gets the status of the latest virtual machine scale set rolling upgrade. + * + * @summary Gets the status of the latest virtual machine scale set rolling upgrade. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_GetLatest_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetRollingUpgradesGetLatestMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetRollingUpgrades.getLatest( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetRollingUpgradesGetLatestMinimumSetGen().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.ts new file mode 100644 index 000000000000..40de1cd2bc21 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. + * + * @summary Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VMScaleSetExtensionRollingUpgrade.json + */ +async function startAnExtensionRollingUpgrade() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetRollingUpgrades.beginStartExtensionUpgradeAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +startAnExtensionRollingUpgrade().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.ts new file mode 100644 index 000000000000..dc5737a61e78 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. + * + * @summary Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_StartOSUpgrade_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetRollingUpgradesStartOSUpgradeMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetRollingUpgrades.beginStartOSUpgradeAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetRollingUpgradesStartOSUpgradeMaximumSetGen().catch( + console.error +); + +/** + * This sample demonstrates how to Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. + * + * @summary Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_StartOSUpgrade_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetRollingUpgradesStartOSUpgradeMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetRollingUpgrades.beginStartOSUpgradeAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetRollingUpgradesStartOSUpgradeMinimumSetGen().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..057f3f421b13 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineScaleSetVMExtension, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create or update the VMSS VM extension. + * + * @summary The operation to create or update the VMSS VM extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateVirtualMachineScaleSetVMExtensions.json + */ +async function createVirtualMachineScaleSetVMExtension() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const vmExtensionName = "myVMExtension"; + const extensionParameters: VirtualMachineScaleSetVMExtension = { + typePropertiesType: "extType", + autoUpgradeMinorVersion: true, + publisher: "extPublisher", + settings: { UserName: "xyz@microsoft.com" }, + typeHandlerVersion: "1.2" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMExtensions.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + extensionParameters + ); + console.log(result); +} + +createVirtualMachineScaleSetVMExtension().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMExtensionsDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMExtensionsDeleteSample.ts new file mode 100644 index 000000000000..f8a9a1d3af62 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMExtensionsDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete the VMSS VM extension. + * + * @summary The operation to delete the VMSS VM extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DeleteVirtualMachineScaleSetVMExtensions.json + */ +async function deleteVirtualMachineScaleSetVMExtension() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const vmExtensionName = "myVMExtension"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMExtensions.beginDeleteAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName + ); + console.log(result); +} + +deleteVirtualMachineScaleSetVMExtension().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMExtensionsGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMExtensionsGetSample.ts new file mode 100644 index 000000000000..016aca1f340f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMExtensionsGetSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get the VMSS VM extension. + * + * @summary The operation to get the VMSS VM extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetVMExtensions.json + */ +async function getVirtualMachineScaleSetVMExtension() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const vmExtensionName = "myVMExtension"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMExtensions.get( + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName + ); + console.log(result); +} + +getVirtualMachineScaleSetVMExtension().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMExtensionsListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMExtensionsListSample.ts new file mode 100644 index 000000000000..01ca02ce45d5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMExtensionsListSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get all extensions of an instance in Virtual Machine Scaleset. + * + * @summary The operation to get all extensions of an instance in Virtual Machine Scaleset. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListVirtualMachineScaleSetVMExtensions.json + */ +async function listExtensionsInVmssInstance() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMExtensions.list( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +listExtensionsInVmssInstance().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMExtensionsUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMExtensionsUpdateSample.ts new file mode 100644 index 000000000000..27ae8f7f0a8b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMExtensionsUpdateSample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineScaleSetVMExtensionUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update the VMSS VM extension. + * + * @summary The operation to update the VMSS VM extension. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateVirtualMachineScaleSetVMExtensions.json + */ +async function updateVirtualMachineScaleSetVMExtension() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const vmExtensionName = "myVMExtension"; + const extensionParameters: VirtualMachineScaleSetVMExtensionUpdate = { + typePropertiesType: "extType", + autoUpgradeMinorVersion: true, + publisher: "extPublisher", + settings: { UserName: "xyz@microsoft.com" }, + typeHandlerVersion: "1.2" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMExtensions.beginUpdateAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + extensionParameters + ); + console.log(result); +} + +updateVirtualMachineScaleSetVMExtension().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..ce13d7221ba0 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineRunCommand, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create or update the VMSS VM run command. + * + * @summary The operation to create or update the VMSS VM run command. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/CreateOrUpdateVirtualMachineScaleSetVMRunCommands.json + */ +async function createVirtualMachineScaleSetVMRunCommand() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const runCommandName = "myRunCommand"; + const runCommand: VirtualMachineRunCommand = { + asyncExecution: false, + location: "West US", + parameters: [ + { name: "param1", value: "value1" }, + { name: "param2", value: "value2" } + ], + runAsPassword: "", + runAsUser: "user1", + source: { script: "Write-Host Hello World!" }, + timeoutInSeconds: 3600 + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMRunCommands.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + runCommand + ); + console.log(result); +} + +createVirtualMachineScaleSetVMRunCommand().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMRunCommandsDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMRunCommandsDeleteSample.ts new file mode 100644 index 000000000000..b1132faf2882 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMRunCommandsDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete the VMSS VM run command. + * + * @summary The operation to delete the VMSS VM run command. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/DeleteVirtualMachineScaleSetVMRunCommands.json + */ +async function deleteVirtualMachineScaleSetVMRunCommand() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const runCommandName = "myRunCommand"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMRunCommands.beginDeleteAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName + ); + console.log(result); +} + +deleteVirtualMachineScaleSetVMRunCommand().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMRunCommandsGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMRunCommandsGetSample.ts new file mode 100644 index 000000000000..75419a001425 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMRunCommandsGetSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get the VMSS VM run command. + * + * @summary The operation to get the VMSS VM run command. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/GetVirtualMachineScaleSetVMRunCommands.json + */ +async function getVirtualMachineScaleSetVMRunCommands() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const runCommandName = "myRunCommand"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMRunCommands.get( + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName + ); + console.log(result); +} + +getVirtualMachineScaleSetVMRunCommands().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMRunCommandsListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMRunCommandsListSample.ts new file mode 100644 index 000000000000..ec19161d1048 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMRunCommandsListSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @summary The operation to get all run commands of an instance in Virtual Machine Scaleset. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/ListVirtualMachineScaleSetVMRunCommands.json + */ +async function listRunCommandsInVmssInstance() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSetVMRunCommands.list( + resourceGroupName, + vmScaleSetName, + instanceId + )) { + resArray.push(item); + } + console.log(resArray); +} + +listRunCommandsInVmssInstance().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMRunCommandsUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMRunCommandsUpdateSample.ts new file mode 100644 index 000000000000..c1d26113b76f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMRunCommandsUpdateSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineRunCommandUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update the VMSS VM run command. + * + * @summary The operation to update the VMSS VM run command. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/UpdateVirtualMachineScaleSetVMRunCommands.json + */ +async function updateVirtualMachineScaleSetVMRunCommand() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const runCommandName = "myRunCommand"; + const runCommand: VirtualMachineRunCommandUpdate = { + source: { script: "Write-Host Script Source Updated!" } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMRunCommands.beginUpdateAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + runCommand + ); + console.log(result); +} + +updateVirtualMachineScaleSetVMRunCommand().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSDeallocateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSDeallocateSample.ts new file mode 100644 index 000000000000..13f042e60ce4 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSDeallocateSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * + * @summary Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Deallocate_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSDeallocateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginDeallocateAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSDeallocateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * + * @summary Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Deallocate_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSDeallocateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const instanceId = "aaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginDeallocateAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSDeallocateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSDeleteSample.ts new file mode 100644 index 000000000000..a50b1ccc9022 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSDeleteSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineScaleSetVMsDeleteOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes a virtual machine from a VM scale set. + * + * @summary Deletes a virtual machine from a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ForceDeleteVirtualMachineScaleSetVM.json + */ +async function forceDeleteAVirtualMachineFromAVMScaleSet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const forceDeletion = true; + const options: VirtualMachineScaleSetVMsDeleteOptionalParams = { + forceDeletion + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginDeleteAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + options + ); + console.log(result); +} + +forceDeleteAVirtualMachineFromAVMScaleSet().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSGetInstanceViewSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSGetInstanceViewSample.ts new file mode 100644 index 000000000000..0126c9abc4dc --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSGetInstanceViewSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the status of a virtual machine from a VM scale set. + * + * @summary Gets the status of a virtual machine from a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetVMInstanceViewAutoPlacedOnDedicatedHostGroup.json + */ +async function getInstanceViewOfAVirtualMachineFromAVMScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myVirtualMachineScaleSet"; + const instanceId = "0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.getInstanceView( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +getInstanceViewOfAVirtualMachineFromAVMScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSGetSample.ts new file mode 100644 index 000000000000..200e7e5e8a8f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSGetSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a virtual machine from a VM scale set. + * + * @summary Gets a virtual machine from a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetVMWithUserData.json + */ +async function getVMScaleSetVMWithUserData() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const instanceId = "0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.get( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +getVMScaleSetVMWithUserData().catch(console.error); + +/** + * This sample demonstrates how to Gets a virtual machine from a VM scale set. + * + * @summary Gets a virtual machine from a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetVMWithVMSizeProperties.json + */ +async function getVMScaleSetVMWithVMSizeProperties() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const instanceId = "0"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.get( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +getVMScaleSetVMWithVMSizeProperties().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSListSample.ts new file mode 100644 index 000000000000..49999ac2d7f0 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSListSample.ts @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetVMsListOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of all virtual machines in a VM scale sets. + * + * @summary Gets a list of all virtual machines in a VM scale sets. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_List_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const virtualMachineScaleSetName = "aaaaaaaaaaaaaaaaaaaaaa"; + const filter = "aaaaaaaaaaaaaa"; + const select = "aaaaaaaaaaaaaaaaaaaaa"; + const expand = "aaaaaaaaaaaaa"; + const options: VirtualMachineScaleSetVMsListOptionalParams = { + filter, + select, + expand + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSetVMs.list( + resourceGroupName, + virtualMachineScaleSetName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetVMSListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of all virtual machines in a VM scale sets. + * + * @summary Gets a list of all virtual machines in a VM scale sets. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_List_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const virtualMachineScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSetVMs.list( + resourceGroupName, + virtualMachineScaleSetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetVMSListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSPerformMaintenanceSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSPerformMaintenanceSample.ts new file mode 100644 index 000000000000..1d7477b5e95b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSPerformMaintenanceSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Performs maintenance on a virtual machine in a VM scale set. + * + * @summary Performs maintenance on a virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PerformMaintenance_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSPerformMaintenanceMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginPerformMaintenanceAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSPerformMaintenanceMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Performs maintenance on a virtual machine in a VM scale set. + * + * @summary Performs maintenance on a virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PerformMaintenance_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSPerformMaintenanceMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaa"; + const instanceId = "aaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginPerformMaintenanceAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSPerformMaintenanceMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSPowerOffSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSPowerOffSample.ts new file mode 100644 index 000000000000..3ad5be723322 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSPowerOffSample.ts @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetVMsPowerOffOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @summary Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PowerOff_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSPowerOffMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaa"; + const instanceId = "aaaaaaaaa"; + const skipShutdown = true; + const options: VirtualMachineScaleSetVMsPowerOffOptionalParams = { + skipShutdown + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginPowerOffAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + options + ); + console.log(result); +} + +virtualMachineScaleSetVMSPowerOffMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @summary Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PowerOff_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSPowerOffMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginPowerOffAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSPowerOffMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSRedeploySample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSRedeploySample.ts new file mode 100644 index 000000000000..13cee85ededb --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSRedeploySample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @summary Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Redeploy_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSRedeployMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginRedeployAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSRedeployMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @summary Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Redeploy_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSRedeployMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginRedeployAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSRedeployMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSReimageAllSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSReimageAllSample.ts new file mode 100644 index 000000000000..d459d3f9228b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSReimageAllSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. + * + * @summary Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_ReimageAll_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSReimageAllMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginReimageAllAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSReimageAllMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. + * + * @summary Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_ReimageAll_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSReimageAllMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginReimageAllAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSReimageAllMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSReimageSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSReimageSample.ts new file mode 100644 index 000000000000..8c7936248be5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSReimageSample.ts @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetVMReimageParameters, + VirtualMachineScaleSetVMsReimageOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @summary Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Reimage_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSReimageMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmScaleSetVMReimageInput: VirtualMachineScaleSetVMReimageParameters = { + tempDisk: true + }; + const options: VirtualMachineScaleSetVMsReimageOptionalParams = { + vmScaleSetVMReimageInput + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginReimageAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + options + ); + console.log(result); +} + +virtualMachineScaleSetVMSReimageMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @summary Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Reimage_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSReimageMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaa"; + const instanceId = "aaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginReimageAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSReimageMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSRestartSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSRestartSample.ts new file mode 100644 index 000000000000..3514f8320138 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSRestartSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Restarts a virtual machine in a VM scale set. + * + * @summary Restarts a virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Restart_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSRestartMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aa"; + const instanceId = "aaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginRestartAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSRestartMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Restarts a virtual machine in a VM scale set. + * + * @summary Restarts a virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Restart_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSRestartMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaa"; + const instanceId = "aaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginRestartAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSRestartMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.ts new file mode 100644 index 000000000000..74c623ebc860 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. + * + * @summary The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RetrieveBootDiagnosticsDataVMScaleSetVM.json + */ +async function retrieveBootDiagnosticsDataOfAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const instanceId = "0"; + const sasUriExpirationTimeInMinutes = 60; + const options: VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams = { + sasUriExpirationTimeInMinutes + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.retrieveBootDiagnosticsData( + resourceGroupName, + vmScaleSetName, + instanceId, + options + ); + console.log(result); +} + +retrieveBootDiagnosticsDataOfAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSRunCommandSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSRunCommandSample.ts new file mode 100644 index 000000000000..af764bbc07fa --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSRunCommandSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { RunCommandInput, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Run command on a virtual machine in a VM scale set. + * + * @summary Run command on a virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VMScaleSetRunCommand.json + */ +async function virtualMachineScaleSetVMSRunCommand() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myVirtualMachineScaleSet"; + const instanceId = "0"; + const parameters: RunCommandInput = { + commandId: "RunPowerShellScript", + script: ["Write-Host Hello World!"] + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginRunCommandAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + parameters + ); + console.log(result); +} + +virtualMachineScaleSetVMSRunCommand().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSSimulateEvictionSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSSimulateEvictionSample.ts new file mode 100644 index 000000000000..2c36d474c5d3 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSSimulateEvictionSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to simulate the eviction of spot virtual machine in a VM scale set. + * + * @summary The operation to simulate the eviction of spot virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SimulateEvictionOfVmssVM.json + */ +async function simulateEvictionAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ResourceGroup"; + const vmScaleSetName = "VmScaleSetName"; + const instanceId = "InstanceId"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.simulateEviction( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +simulateEvictionAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSStartSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSStartSample.ts new file mode 100644 index 000000000000..1bb5ca5c5bea --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSStartSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Starts a virtual machine in a VM scale set. + * + * @summary Starts a virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Start_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSStartMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginStartAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSStartMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Starts a virtual machine in a VM scale set. + * + * @summary Starts a virtual machine in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Start_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSStartMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginStartAndWait( + resourceGroupName, + vmScaleSetName, + instanceId + ); + console.log(result); +} + +virtualMachineScaleSetVMSStartMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSUpdateSample.ts new file mode 100644 index 000000000000..ea2378b18925 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetVMSUpdateSample.ts @@ -0,0 +1,489 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetVM, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Updates a virtual machine of a VM scale set. + * + * @summary Updates a virtual machine of a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Update_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMSUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const parameters: VirtualMachineScaleSetVM = { + additionalCapabilities: { hibernationEnabled: true, ultraSSDEnabled: true }, + availabilitySet: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + }, + diagnosticsProfile: { + bootDiagnostics: { enabled: true, storageUri: "aaaaaaaaaaaaa" } + }, + hardwareProfile: { + vmSize: "Basic_A0", + vmSizeProperties: { vCPUsAvailable: 9, vCPUsPerCore: 12 } + }, + instanceView: { + bootDiagnostics: { + status: { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z") + } + }, + disks: [ + { + name: "aaaaaaaaaaa", + encryptionSettings: [ + { + diskEncryptionKey: { + secretUrl: "aaaaaaaa", + sourceVault: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + } + }, + enabled: true, + keyEncryptionKey: { + keyUrl: "aaaaaaaaaaaaaa", + sourceVault: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + } + } + } + ], + statuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z") + } + ] + } + ], + maintenanceRedeployStatus: { + isCustomerInitiatedMaintenanceAllowed: true, + lastOperationMessage: "aaaaaa", + lastOperationResultCode: "None", + maintenanceWindowEndTime: new Date("2021-11-30T12:58:26.531Z"), + maintenanceWindowStartTime: new Date("2021-11-30T12:58:26.531Z"), + preMaintenanceWindowEndTime: new Date("2021-11-30T12:58:26.531Z"), + preMaintenanceWindowStartTime: new Date("2021-11-30T12:58:26.531Z") + }, + placementGroupId: "aaa", + platformFaultDomain: 14, + platformUpdateDomain: 23, + rdpThumbPrint: "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + statuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z") + } + ], + vmAgent: { + extensionHandlers: [ + { + type: "aaaaaaaaaaaaa", + status: { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z") + }, + typeHandlerVersion: "aaaaa" + } + ], + statuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z") + } + ], + vmAgentVersion: "aaaaaaaaaaaaaaaaaaaaaaa" + }, + vmHealth: { + status: { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z") + } + }, + extensions: [ + { + name: "aaaaaaaaaaaaaaaaa", + type: "aaaaaaaaa", + statuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z") + } + ], + substatuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + displayStatus: "aaaaaa", + level: "Info", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z") + } + ], + typeHandlerVersion: "aaaaaaaaaaaaaaaaaaaaaaaaaa" + } + ] + }, + licenseType: "aaaaaaaaaa", + location: "westus", + networkProfile: { + networkApiVersion: "2020-11-01", + networkInterfaceConfigurations: [ + { + name: "aaaaaaaaaaa", + deleteOption: "Delete", + dnsSettings: { dnsServers: ["aaaaaa"] }, + dscpConfiguration: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + }, + enableAcceleratedNetworking: true, + enableFpga: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "aa", + applicationGatewayBackendAddressPools: [ + { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + } + ], + applicationSecurityGroups: [ + { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + } + ], + loadBalancerBackendAddressPools: [ + { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + } + ], + primary: true, + privateIPAddressVersion: "IPv4", + publicIPAddressConfiguration: { + name: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + deleteOption: "Delete", + dnsSettings: { domainNameLabel: "aaaaaaaaaaaaaaaaaaaaaaaaa" }, + idleTimeoutInMinutes: 2, + ipTags: [ + { + ipTagType: "aaaaaaaaaaaaaaaaaaaaaaaaa", + tag: "aaaaaaaaaaaaaaaaaaaa" + } + ], + publicIPAddressVersion: "IPv4", + publicIPAllocationMethod: "Dynamic", + publicIPPrefix: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + }, + sku: { name: "Basic", tier: "Regional" } + }, + subnet: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + } + } + ], + networkSecurityGroup: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + }, + primary: true + } + ], + networkInterfaces: [ + { + deleteOption: "Delete", + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0/networkInterfaces/vmsstestnetconfig5415", + primary: true + } + ] + }, + networkProfileConfiguration: { + networkInterfaceConfigurations: [ + { + name: "vmsstestnetconfig5415", + deleteOption: "Delete", + dnsSettings: { dnsServers: [] }, + enableAcceleratedNetworking: true, + enableFpga: true, + enableIPForwarding: true, + id: "aaaaaaaa", + ipConfigurations: [ + { + name: "vmsstestnetconfig9693", + applicationGatewayBackendAddressPools: [ + { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + } + ], + applicationSecurityGroups: [ + { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + } + ], + id: "aaaaaaaaa", + loadBalancerBackendAddressPools: [ + { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + } + ], + loadBalancerInboundNatPools: [ + { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + } + ], + primary: true, + privateIPAddressVersion: "IPv4", + publicIPAddressConfiguration: { + name: "aaaaaaaaaaaaaaaaaa", + deleteOption: "Delete", + dnsSettings: { domainNameLabel: "aaaaaaaaaaaaaaaaaa" }, + idleTimeoutInMinutes: 18, + ipTags: [ + { ipTagType: "aaaaaaa", tag: "aaaaaaaaaaaaaaaaaaaaaaaaaaa" } + ], + publicIPAddressVersion: "IPv4", + publicIPPrefix: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + }, + sku: { name: "Basic", tier: "Regional" } + }, + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vn4071/subnets/sn5503" + } + } + ], + networkSecurityGroup: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + }, + primary: true + } + ] + }, + osProfile: { + adminPassword: "aaaaaaaaaaaaaaaa", + adminUsername: "Foo12", + allowExtensionOperations: true, + computerName: "test000000", + customData: "aaaa", + linuxConfiguration: { + disablePasswordAuthentication: true, + patchSettings: { + assessmentMode: "ImageDefault", + patchMode: "ImageDefault" + }, + provisionVMAgent: true, + ssh: { publicKeys: [{ path: "aaa", keyData: "aaaaaa" }] } + }, + requireGuestProvisionSignal: true, + secrets: [], + windowsConfiguration: { + additionalUnattendContent: [ + { + componentName: "Microsoft-Windows-Shell-Setup", + content: "aaaaaaaaaaaaaaaaaaaa", + passName: "OobeSystem", + settingName: "AutoLogon" + } + ], + enableAutomaticUpdates: true, + patchSettings: { + assessmentMode: "ImageDefault", + enableHotpatching: true, + patchMode: "Manual" + }, + provisionVMAgent: true, + timeZone: "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + winRM: { + listeners: [ + { certificateUrl: "aaaaaaaaaaaaaaaaaaaaaa", protocol: "Http" } + ] + } + } + }, + plan: { + name: "aaaaaaaaaa", + product: "aaaaaaaaaaaaaaaaaaaa", + promotionCode: "aaaaaaaaaaaaaaaaaaaa", + publisher: "aaaaaaaaaaaaaaaaaaaaaa" + }, + protectionPolicy: { + protectFromScaleIn: true, + protectFromScaleSetActions: true + }, + securityProfile: { + encryptionAtHost: true, + securityType: "TrustedLaunch", + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true } + }, + sku: { name: "Classic", capacity: 29, tier: "aaaaaaaaaaaaaa" }, + storageProfile: { + dataDisks: [ + { + name: "vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", + caching: "None", + createOption: "Empty", + deleteOption: "Delete", + detachOption: "ForceDetach", + diskSizeGB: 128, + image: { + uri: + "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd" + }, + lun: 1, + managedDisk: { + diskEncryptionSet: { id: "aaaaaaaaaaaa" }, + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", + storageAccountType: "Standard_LRS" + }, + toBeDetached: true, + vhd: { + uri: + "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd" + }, + writeAcceleratorEnabled: true + } + ], + imageReference: { + id: "a", + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sharedGalleryImageId: "aaaaaaaaaaaaaaaaaaaa", + sku: "2012-R2-Datacenter", + version: "4.127.20180315" + }, + osDisk: { + name: "vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc", + caching: "None", + createOption: "FromImage", + deleteOption: "Delete", + diffDiskSettings: { option: "Local", placement: "CacheDisk" }, + diskSizeGB: 127, + encryptionSettings: { + diskEncryptionKey: { + secretUrl: "aaaaaaaa", + sourceVault: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + } + }, + enabled: true, + keyEncryptionKey: { + keyUrl: "aaaaaaaaaaaaaa", + sourceVault: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + } + } + }, + image: { + uri: + "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd" + }, + managedDisk: { + diskEncryptionSet: { id: "aaaaaaaaaaaa" }, + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc", + storageAccountType: "Standard_LRS" + }, + osType: "Windows", + vhd: { + uri: + "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd" + }, + writeAcceleratorEnabled: true + } + }, + tags: {}, + userData: "RXhhbXBsZSBVc2VyRGF0YQ==" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginUpdateAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + parameters + ); + console.log(result); +} + +virtualMachineScaleSetVMSUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Updates a virtual machine of a VM scale set. + * + * @summary Updates a virtual machine of a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Update_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMSUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaa"; + const instanceId = "aaaaaaaaaaaaaaaaaaaa"; + const parameters: VirtualMachineScaleSetVM = { location: "westus" }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.beginUpdateAndWait( + resourceGroupName, + vmScaleSetName, + instanceId, + parameters + ); + console.log(result); +} + +virtualMachineScaleSetVMSUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.ts new file mode 100644 index 000000000000..d0faa1c81458 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.ts @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VMScaleSetConvertToSinglePlacementGroupInput, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * + * @summary Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ConvertToSinglePlacementGroup_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsConvertToSinglePlacementGroupMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const parameters: VMScaleSetConvertToSinglePlacementGroupInput = { + activePlacementGroupId: "aaaaaaaaaaaaaaaaaaaaaaaaaaa" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.convertToSinglePlacementGroup( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +virtualMachineScaleSetsConvertToSinglePlacementGroupMaximumSetGen().catch( + console.error +); + +/** + * This sample demonstrates how to Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * + * @summary Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ConvertToSinglePlacementGroup_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsConvertToSinglePlacementGroupMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaa"; + const parameters: VMScaleSetConvertToSinglePlacementGroupInput = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.convertToSinglePlacementGroup( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +virtualMachineScaleSetsConvertToSinglePlacementGroupMinimumSetGen().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..7847acc7e40c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsCreateOrUpdateSample.ts @@ -0,0 +1,2421 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSet, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithExtensionsSuppressFailuresEnabled.json + */ +async function createAVmssWithAnExtensionThatHasSuppressFailuresEnabled() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: + "http://{existing-storage-account-name}.blob.core.windows.net" + } + }, + extensionProfile: { + extensions: [ + { + name: "{extension-name}", + typePropertiesType: "{extension-Type}", + autoUpgradeMinorVersion: false, + publisher: "{extension-Publisher}", + settings: {}, + suppressFailures: true, + typeHandlerVersion: "{handler-version}" + } + ] + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAVmssWithAnExtensionThatHasSuppressFailuresEnabled().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithProtectedSettingsFromKeyVault.json + */ +async function createAVmssWithAnExtensionWithProtectedSettingsFromKeyVault() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: + "http://{existing-storage-account-name}.blob.core.windows.net" + } + }, + extensionProfile: { + extensions: [ + { + name: "{extension-name}", + typePropertiesType: "{extension-Type}", + autoUpgradeMinorVersion: false, + protectedSettingsFromKeyVault: { + secretUrl: + "https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e", + sourceVault: { + id: + "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName" + } + }, + publisher: "{extension-Publisher}", + settings: {}, + typeHandlerVersion: "{handler-version}" + } + ] + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAVmssWithAnExtensionWithProtectedSettingsFromKeyVault().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateACustomImageScaleSetFromAnUnmanagedGeneralizedOsImage.json + */ +async function createACustomImageScaleSetFromAnUnmanagedGeneralizedOSImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + osDisk: { + name: "osDisk", + caching: "ReadWrite", + createOption: "FromImage", + image: { + uri: + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd" + } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createACustomImageScaleSetFromAnUnmanagedGeneralizedOSImage().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAPlatformImageScaleSetWithUnmanagedOsDisks.json + */ +async function createAPlatformImageScaleSetWithUnmanagedOSDisks() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "osDisk", + caching: "ReadWrite", + createOption: "FromImage", + vhdContainers: [ + "http://{existing-storage-account-name-0}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-1}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-2}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-3}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-4}.blob.core.windows.net/vhdContainer" + ] + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAPlatformImageScaleSetWithUnmanagedOSDisks().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetFromACustomImage.json + */ +async function createAScaleSetFromACustomImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetFromACustomImage().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetFromAGeneralizedSharedImage.json + */ +async function createAScaleSetFromAGeneralizedSharedImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetFromAGeneralizedSharedImage().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetFromASpecializedSharedImage.json + */ +async function createAScaleSetFromASpecializedSharedImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + storageProfile: { + imageReference: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetFromASpecializedSharedImage().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithApplicationProfile.json + */ +async function createAScaleSetWithApplicationProfile() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + applicationProfile: { + galleryApplications: [ + { + configurationReference: + "https://mystorageaccount.blob.core.windows.net/configurations/settings.config", + order: 1, + packageReferenceId: + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0", + tags: "myTag1" + }, + { + packageReferenceId: + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1" + } + ] + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithApplicationProfile().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScalesetWithDiskEncryptionSetResource.json + */ +async function createAScaleSetWithDiskEncryptionSetResourceInOSDiskAndDataDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + dataDisks: [ + { + caching: "ReadWrite", + createOption: "Empty", + diskSizeGB: 1023, + lun: 0, + managedDisk: { + diskEncryptionSet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}" + }, + storageAccountType: "Standard_LRS" + } + } + ], + imageReference: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { + diskEncryptionSet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}" + }, + storageAccountType: "Standard_LRS" + } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithDiskEncryptionSetResourceInOSDiskAndDataDisk().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetFromWithFpgaNetworkInterface.json + */ +async function createAScaleSetWithFpgaNetworkInterfaces() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + }, + { + name: "{fpgaNic-Name}", + enableAcceleratedNetworking: false, + enableFpga: true, + enableIPForwarding: false, + ipConfigurations: [ + { + name: "{fpgaNic-Name}", + primary: true, + privateIPAddressVersion: "IPv4", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name}" + } + } + ], + primary: false + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithFpgaNetworkInterfaces().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithEncryptionAtHost.json + */ +async function createAScaleSetWithHostEncryptionUsingEncryptionAtHostProperty() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads" + }, + sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + securityProfile: { encryptionAtHost: true }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest" + }, + osDisk: { + caching: "ReadOnly", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithHostEncryptionUsingEncryptionAtHostProperty().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithSecurityTypeConfidentialVM.json + */ +async function createAScaleSetWithSecurityTypeAsConfidentialVM() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_DC2as_v5", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + securityProfile: { + securityType: "ConfidentialVM", + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true } + }, + storageProfile: { + imageReference: { + offer: "2019-datacenter-cvm", + publisher: "MicrosoftWindowsServer", + sku: "windows-cvm", + version: "17763.2183.2109130127" + }, + osDisk: { + caching: "ReadOnly", + createOption: "FromImage", + managedDisk: { + securityProfile: { securityEncryptionType: "VMGuestStateOnly" }, + storageAccountType: "StandardSSD_LRS" + } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithSecurityTypeAsConfidentialVM().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithUefiSettings.json + */ +async function createAScaleSetWithUefiSettingsOfSecureBootAndVTpm() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D2s_v3", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + securityProfile: { + securityType: "TrustedLaunch", + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true } + }, + storageProfile: { + imageReference: { + offer: "windowsserver-gen2preview-preview", + publisher: "MicrosoftWindowsServer", + sku: "windows10-tvm", + version: "18363.592.2001092016" + }, + osDisk: { + caching: "ReadOnly", + createOption: "FromImage", + managedDisk: { storageAccountType: "StandardSSD_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithUefiSettingsOfSecureBootAndVTpm().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithAMarketplaceImagePlan.json + */ +async function createAScaleSetWithAMarketplaceImagePlan() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads" + }, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithAMarketplaceImagePlan().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithAnAzureApplicationGateway.json + */ +async function createAScaleSetWithAnAzureApplicationGateway() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + applicationGatewayBackendAddressPools: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/applicationGateways/{existing-application-gateway-name}/backendAddressPools/{existing-backend-address-pool-name}" + } + ], + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithAnAzureApplicationGateway().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithAnAzureLoadBalancer.json + */ +async function createAScaleSetWithAnAzureLoadBalancer() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + loadBalancerBackendAddressPools: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/backendAddressPools/{existing-backend-address-pool-name}" + } + ], + loadBalancerInboundNatPools: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/inboundNatPools/{existing-nat-pool-name}" + } + ], + publicIPAddressConfiguration: { + name: "{vmss-name}", + publicIPAddressVersion: "IPv4" + }, + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithAnAzureLoadBalancer().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithAutomaticRepairs.json + */ +async function createAScaleSetWithAutomaticRepairsEnabled() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + automaticRepairsPolicy: { enabled: true, gracePeriod: "PT10M" }, + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithAutomaticRepairsEnabled().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithBootDiagnostics.json + */ +async function createAScaleSetWithBootDiagnostics() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: + "http://{existing-storage-account-name}.blob.core.windows.net" + } + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithBootDiagnostics().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithEmptyDataDisksOnEachVm.json + */ +async function createAScaleSetWithEmptyDataDisksOnEachVM() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D2_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + dataDisks: [ + { createOption: "Empty", diskSizeGB: 1023, lun: 0 }, + { createOption: "Empty", diskSizeGB: 1023, lun: 1 } + ], + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + diskSizeGB: 512, + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithEmptyDataDisksOnEachVM().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithDiffOsDiskUsingDiffDiskPlacement.json + */ +async function createAScaleSetWithEphemeralOSDisksUsingPlacementProperty() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads" + }, + sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest" + }, + osDisk: { + caching: "ReadOnly", + createOption: "FromImage", + diffDiskSettings: { option: "Local", placement: "ResourceDisk" }, + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithEphemeralOSDisksUsingPlacementProperty().catch( + console.error +); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithDiffOsDisk.json + */ +async function createAScaleSetWithEphemeralOSDisks() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads" + }, + sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest" + }, + osDisk: { + caching: "ReadOnly", + createOption: "FromImage", + diffDiskSettings: { option: "Local" }, + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithEphemeralOSDisks().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithExtensionsTimeBudget.json + */ +async function createAScaleSetWithExtensionTimeBudget() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: + "http://{existing-storage-account-name}.blob.core.windows.net" + } + }, + extensionProfile: { + extensionsTimeBudget: "PT1H20M", + extensions: [ + { + name: "{extension-name}", + typePropertiesType: "{extension-Type}", + autoUpgradeMinorVersion: false, + publisher: "{extension-Publisher}", + settings: {}, + typeHandlerVersion: "{handler-version}" + } + ] + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithExtensionTimeBudget().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithManagedBootDiagnostics.json + */ +async function createAScaleSetWithManagedBootDiagnostics() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + diagnosticsProfile: { bootDiagnostics: { enabled: true } }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithManagedBootDiagnostics().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithPasswordAuthentication.json + */ +async function createAScaleSetWithPasswordAuthentication() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithPasswordAuthentication().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithPremiumStorage.json + */ +async function createAScaleSetWithPremiumStorage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithPremiumStorage().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithScaleInPolicy.json + */ +async function createAScaleSetWithScaleInPolicy() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + scaleInPolicy: { forceDeletion: true, rules: ["OldestVM"] }, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithScaleInPolicy().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithSpotRestorePolicy.json + */ +async function createAScaleSetWithSpotRestorePolicy() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_A8m_v2", capacity: 2, tier: "Standard" }, + spotRestorePolicy: { enabled: true, restoreTimeout: "PT1H" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + billingProfile: { maxPrice: -1 }, + evictionPolicy: "Deallocate", + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + priority: "Spot", + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithSpotRestorePolicy().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithSshAuthentication.json + */ +async function createAScaleSetWithSshAuthentication() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}", + linuxConfiguration: { + disablePasswordAuthentication: true, + ssh: { + publicKeys: [ + { + path: "/home/{your-username}/.ssh/authorized_keys", + keyData: + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1" + } + ] + } + } + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithSshAuthentication().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithTerminateScheduledEventEnabled.json + */ +async function createAScaleSetWithTerminateScheduledEventsEnabled() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + scheduledEventsProfile: { + terminateNotificationProfile: { enable: true, notBeforeTimeout: "PT5M" } + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithTerminateScheduledEventsEnabled().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAScaleSetWithUserData.json + */ +async function createAScaleSetWithUserData() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + }, + userData: "RXhhbXBsZSBVc2VyRGF0YQ==" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithUserData().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithVMsInDifferentZones.json + */ +async function createAScaleSetWithVirtualMachinesInDifferentZones() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "centralus", + overprovision: true, + sku: { name: "Standard_A1_v2", capacity: 2, tier: "Standard" }, + upgradePolicy: { mode: "Automatic" }, + virtualMachineProfile: { + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + dataDisks: [ + { createOption: "Empty", diskSizeGB: 1023, lun: 0 }, + { createOption: "Empty", diskSizeGB: 1023, lun: 1 } + ], + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + diskSizeGB: 512, + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }, + zones: ["1", "3"] + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithVirtualMachinesInDifferentZones().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAScaleSetWithVMSizeProperties.json + */ +async function createAScaleSetWithVMSizeProperties() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + hardwareProfile: { + vmSizeProperties: { vCPUsAvailable: 1, vCPUsPerCore: 1 } + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + }, + userData: "RXhhbXBsZSBVc2VyRGF0YQ==" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createAScaleSetWithVMSizeProperties().catch(console.error); + +/** + * This sample demonstrates how to Create or update a VM scale set. + * + * @summary Create or update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAScaleSetWithCapacityReservation.json + */ +async function createOrUpdateAScaleSetWithCapacityReservation() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "{vmss-name}"; + const parameters: VirtualMachineScaleSet = { + location: "westus", + overprovision: true, + sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + capacityReservation: { + capacityReservationGroup: { + id: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}" + } + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}" + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerNamePrefix: "{vmss-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +createOrUpdateAScaleSetWithCapacityReservation().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsDeallocateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsDeallocateSample.ts new file mode 100644 index 000000000000..d32d704143d9 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsDeallocateSample.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetVMInstanceIDs, + VirtualMachineScaleSetsDeallocateOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @summary Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Deallocate_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsDeallocateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaa"] + }; + const options: VirtualMachineScaleSetsDeallocateOptionalParams = { + vmInstanceIDs + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginDeallocateAndWait( + resourceGroupName, + vmScaleSetName, + options + ); + console.log(result); +} + +virtualMachineScaleSetsDeallocateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @summary Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Deallocate_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsDeallocateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginDeallocateAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsDeallocateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsDeleteInstancesSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsDeleteInstancesSample.ts new file mode 100644 index 000000000000..6c895d4d3632 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsDeleteInstancesSample.ts @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetVMInstanceRequiredIDs, + VirtualMachineScaleSetsDeleteInstancesOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes virtual machines in a VM scale set. + * + * @summary Deletes virtual machines in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_DeleteInstances_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsDeleteInstancesMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaa"; + const forceDeletion = true; + const vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"] + }; + const options: VirtualMachineScaleSetsDeleteInstancesOptionalParams = { + forceDeletion + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginDeleteInstancesAndWait( + resourceGroupName, + vmScaleSetName, + vmInstanceIDs, + options + ); + console.log(result); +} + +virtualMachineScaleSetsDeleteInstancesMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Deletes virtual machines in a VM scale set. + * + * @summary Deletes virtual machines in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_DeleteInstances_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsDeleteInstancesMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaa"; + const vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"] + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginDeleteInstancesAndWait( + resourceGroupName, + vmScaleSetName, + vmInstanceIDs + ); + console.log(result); +} + +virtualMachineScaleSetsDeleteInstancesMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsDeleteSample.ts new file mode 100644 index 000000000000..d8436549e0a3 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsDeleteSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineScaleSetsDeleteOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes a VM scale set. + * + * @summary Deletes a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ForceDeleteVirtualMachineScaleSets.json + */ +async function forceDeleteAVMScaleSet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myvmScaleSet"; + const forceDeletion = true; + const options: VirtualMachineScaleSetsDeleteOptionalParams = { + forceDeletion + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginDeleteAndWait( + resourceGroupName, + vmScaleSetName, + options + ); + console.log(result); +} + +forceDeleteAVMScaleSet().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.ts new file mode 100644 index 000000000000..76581bd5d5f6 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.ts @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * + * @summary Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaa"; + const platformUpdateDomain = 30; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.forceRecoveryServiceFabricPlatformUpdateDomainWalk( + resourceGroupName, + vmScaleSetName, + platformUpdateDomain + ); + console.log(result); +} + +virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkMaximumSetGen().catch( + console.error +); + +/** + * This sample demonstrates how to Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * + * @summary Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaa"; + const platformUpdateDomain = 9; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.forceRecoveryServiceFabricPlatformUpdateDomainWalk( + resourceGroupName, + vmScaleSetName, + platformUpdateDomain + ); + console.log(result); +} + +virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkMinimumSetGen().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsGetInstanceViewSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsGetInstanceViewSample.ts new file mode 100644 index 000000000000..360f0aef82a4 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsGetInstanceViewSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the status of a VM scale set instance. + * + * @summary Gets the status of a VM scale set instance. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetInstanceView_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsGetInstanceViewMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.getInstanceView( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsGetInstanceViewMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets the status of a VM scale set instance. + * + * @summary Gets the status of a VM scale set instance. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetInstanceView_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsGetInstanceViewMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.getInstanceView( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsGetInstanceViewMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsGetOSUpgradeHistorySample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsGetOSUpgradeHistorySample.ts new file mode 100644 index 000000000000..8c6d50ae7b5f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsGetOSUpgradeHistorySample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets list of OS upgrades on a VM scale set instance. + * + * @summary Gets list of OS upgrades on a VM scale set instance. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetOSUpgradeHistory_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsGetOSUpgradeHistoryMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSets.listOSUpgradeHistory( + resourceGroupName, + vmScaleSetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetsGetOSUpgradeHistoryMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets list of OS upgrades on a VM scale set instance. + * + * @summary Gets list of OS upgrades on a VM scale set instance. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetOSUpgradeHistory_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsGetOSUpgradeHistoryMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSets.listOSUpgradeHistory( + resourceGroupName, + vmScaleSetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetsGetOSUpgradeHistoryMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsGetSample.ts new file mode 100644 index 000000000000..f81cdd815830 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsGetSample.ts @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Display information about a virtual machine scale set. + * + * @summary Display information about a virtual machine scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSet.json + */ +async function getAVirtualMachineScaleSet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myVirtualMachineScaleSet"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.get( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +getAVirtualMachineScaleSet().catch(console.error); + +/** + * This sample demonstrates how to Display information about a virtual machine scale set. + * + * @summary Display information about a virtual machine scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetAutoPlacedOnDedicatedHostGroup.json + */ +async function getAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myVirtualMachineScaleSet"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.get( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +getAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement().catch( + console.error +); + +/** + * This sample demonstrates how to Display information about a virtual machine scale set. + * + * @summary Display information about a virtual machine scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetWithUserData.json + */ +async function getAVirtualMachineScaleSetWithUserData() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmScaleSetName = "myVirtualMachineScaleSet"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.get( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +getAVirtualMachineScaleSetWithUserData().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsListAllSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsListAllSample.ts new file mode 100644 index 000000000000..73aea06ea081 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsListAllSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. + * + * @summary Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListAll_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsListAllMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSets.listAll()) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetsListAllMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. + * + * @summary Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListAll_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsListAllMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSets.listAll()) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetsListAllMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsListByLocationSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsListByLocationSample.ts new file mode 100644 index 000000000000..f099d9414ed9 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsListByLocationSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets all the VM scale sets under the specified subscription for the specified location. + * + * @summary Gets all the VM scale sets under the specified subscription for the specified location. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListVirtualMachineScaleSetsInASubscriptionByLocation.json + */ +async function listsAllTheVMScaleSetsUnderTheSpecifiedSubscriptionForTheSpecifiedLocation() { + const subscriptionId = "{subscription-id}"; + const location = "eastus"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSets.listByLocation( + location + )) { + resArray.push(item); + } + console.log(resArray); +} + +listsAllTheVMScaleSetsUnderTheSpecifiedSubscriptionForTheSpecifiedLocation().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsListSample.ts new file mode 100644 index 000000000000..89457ab9cf80 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsListSample.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of all VM scale sets under a resource group. + * + * @summary Gets a list of all VM scale sets under a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_List_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSets.list( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetsListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of all VM scale sets under a resource group. + * + * @summary Gets a list of all VM scale sets under a resource group. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_List_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSets.list( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetsListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsListSkusSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsListSkusSample.ts new file mode 100644 index 000000000000..f30409a2e132 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsListSkusSample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. + * + * @summary Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListSkus_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsListSkusMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSets.listSkus( + resourceGroupName, + vmScaleSetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetsListSkusMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. + * + * @summary Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListSkus_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsListSkusMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineScaleSets.listSkus( + resourceGroupName, + vmScaleSetName + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineScaleSetsListSkusMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsPerformMaintenanceSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsPerformMaintenanceSample.ts new file mode 100644 index 000000000000..da92f944c988 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsPerformMaintenanceSample.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetVMInstanceIDs, + VirtualMachineScaleSetsPerformMaintenanceOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + * + * @summary Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PerformMaintenance_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsPerformMaintenanceMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaa"; + const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaa"] + }; + const options: VirtualMachineScaleSetsPerformMaintenanceOptionalParams = { + vmInstanceIDs + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginPerformMaintenanceAndWait( + resourceGroupName, + vmScaleSetName, + options + ); + console.log(result); +} + +virtualMachineScaleSetsPerformMaintenanceMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + * + * @summary Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PerformMaintenance_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsPerformMaintenanceMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginPerformMaintenanceAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsPerformMaintenanceMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsPowerOffSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsPowerOffSample.ts new file mode 100644 index 000000000000..3bc149b4bd93 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsPowerOffSample.ts @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetVMInstanceIDs, + VirtualMachineScaleSetsPowerOffOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @summary Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PowerOff_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsPowerOffMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaa"; + const skipShutdown = true; + const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaa"] + }; + const options: VirtualMachineScaleSetsPowerOffOptionalParams = { + skipShutdown, + vmInstanceIDs + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginPowerOffAndWait( + resourceGroupName, + vmScaleSetName, + options + ); + console.log(result); +} + +virtualMachineScaleSetsPowerOffMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @summary Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PowerOff_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsPowerOffMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "a"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginPowerOffAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsPowerOffMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsRedeploySample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsRedeploySample.ts new file mode 100644 index 000000000000..157c63c1a51e --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsRedeploySample.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetVMInstanceIDs, + VirtualMachineScaleSetsRedeployOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. + * + * @summary Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Redeploy_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsRedeployMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaa"] + }; + const options: VirtualMachineScaleSetsRedeployOptionalParams = { + vmInstanceIDs + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginRedeployAndWait( + resourceGroupName, + vmScaleSetName, + options + ); + console.log(result); +} + +virtualMachineScaleSetsRedeployMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. + * + * @summary Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Redeploy_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsRedeployMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginRedeployAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsRedeployMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsReimageAllSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsReimageAllSample.ts new file mode 100644 index 000000000000..a09e9fcf54f3 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsReimageAllSample.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetVMInstanceIDs, + VirtualMachineScaleSetsReimageAllOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * + * @summary Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ReimageAll_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsReimageAllMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaa"; + const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaa"] + }; + const options: VirtualMachineScaleSetsReimageAllOptionalParams = { + vmInstanceIDs + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginReimageAllAndWait( + resourceGroupName, + vmScaleSetName, + options + ); + console.log(result); +} + +virtualMachineScaleSetsReimageAllMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * + * @summary Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ReimageAll_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsReimageAllMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginReimageAllAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsReimageAllMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsReimageSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsReimageSample.ts new file mode 100644 index 000000000000..44fd6b36938f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsReimageSample.ts @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetReimageParameters, + VirtualMachineScaleSetsReimageOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. + * + * @summary Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Reimage_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsReimageMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmScaleSetReimageInput: VirtualMachineScaleSetReimageParameters = { + instanceIds: ["aaaaaaaaaa"], + tempDisk: true + }; + const options: VirtualMachineScaleSetsReimageOptionalParams = { + vmScaleSetReimageInput + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginReimageAndWait( + resourceGroupName, + vmScaleSetName, + options + ); + console.log(result); +} + +virtualMachineScaleSetsReimageMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. + * + * @summary Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Reimage_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsReimageMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginReimageAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsReimageMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsRestartSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsRestartSample.ts new file mode 100644 index 000000000000..9e4583010dad --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsRestartSample.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetVMInstanceIDs, + VirtualMachineScaleSetsRestartOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Restarts one or more virtual machines in a VM scale set. + * + * @summary Restarts one or more virtual machines in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Restart_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsRestartMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaa"; + const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaa"] + }; + const options: VirtualMachineScaleSetsRestartOptionalParams = { + vmInstanceIDs + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginRestartAndWait( + resourceGroupName, + vmScaleSetName, + options + ); + console.log(result); +} + +virtualMachineScaleSetsRestartMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Restarts one or more virtual machines in a VM scale set. + * + * @summary Restarts one or more virtual machines in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Restart_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsRestartMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginRestartAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsRestartMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsSetOrchestrationServiceStateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsSetOrchestrationServiceStateSample.ts new file mode 100644 index 000000000000..bd7a00685130 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsSetOrchestrationServiceStateSample.ts @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + OrchestrationServiceStateInput, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Changes ServiceState property for a given service + * + * @summary Changes ServiceState property for a given service + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_SetOrchestrationServiceState_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsSetOrchestrationServiceStateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaa"; + const parameters: OrchestrationServiceStateInput = { + action: "Resume", + serviceName: "AutomaticRepairs" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginSetOrchestrationServiceStateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +virtualMachineScaleSetsSetOrchestrationServiceStateMaximumSetGen().catch( + console.error +); + +/** + * This sample demonstrates how to Changes ServiceState property for a given service + * + * @summary Changes ServiceState property for a given service + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_SetOrchestrationServiceState_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsSetOrchestrationServiceStateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const parameters: OrchestrationServiceStateInput = { + action: "Resume", + serviceName: "AutomaticRepairs" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginSetOrchestrationServiceStateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +virtualMachineScaleSetsSetOrchestrationServiceStateMinimumSetGen().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsStartSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsStartSample.ts new file mode 100644 index 000000000000..db299ba398ba --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsStartSample.ts @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetVMInstanceIDs, + VirtualMachineScaleSetsStartOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Starts one or more virtual machines in a VM scale set. + * + * @summary Starts one or more virtual machines in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Start_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsStartMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaa"] + }; + const options: VirtualMachineScaleSetsStartOptionalParams = { vmInstanceIDs }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginStartAndWait( + resourceGroupName, + vmScaleSetName, + options + ); + console.log(result); +} + +virtualMachineScaleSetsStartMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Starts one or more virtual machines in a VM scale set. + * + * @summary Starts one or more virtual machines in a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Start_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsStartMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginStartAndWait( + resourceGroupName, + vmScaleSetName + ); + console.log(result); +} + +virtualMachineScaleSetsStartMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsUpdateInstancesSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsUpdateInstancesSample.ts new file mode 100644 index 000000000000..efe53a6ffb4f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsUpdateInstancesSample.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetVMInstanceRequiredIDs, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @summary Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_UpdateInstances_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsUpdateInstancesMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; + const vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"] + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginUpdateInstancesAndWait( + resourceGroupName, + vmScaleSetName, + vmInstanceIDs + ); + console.log(result); +} + +virtualMachineScaleSetsUpdateInstancesMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @summary Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_UpdateInstances_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsUpdateInstancesMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs = { + instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"] + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginUpdateInstancesAndWait( + resourceGroupName, + vmScaleSetName, + vmInstanceIDs + ); + console.log(result); +} + +virtualMachineScaleSetsUpdateInstancesMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsUpdateSample.ts new file mode 100644 index 000000000000..dc1cdc9626b1 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineScaleSetsUpdateSample.ts @@ -0,0 +1,302 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineScaleSetUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update a VM scale set. + * + * @summary Update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Update_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsUpdateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaa"; + const parameters: VirtualMachineScaleSetUpdate = { + additionalCapabilities: { hibernationEnabled: true, ultraSSDEnabled: true }, + automaticRepairsPolicy: { enabled: true, gracePeriod: "PT30M" }, + doNotRunExtensionsOnOverprovisionedVMs: true, + identity: { + type: "SystemAssigned", + userAssignedIdentities: { key3951: {} } + }, + overprovision: true, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + promotionCode: "aaaaaaaaaa", + publisher: "microsoft-ads" + }, + proximityPlacementGroup: { + id: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot" + }, + scaleInPolicy: { forceDeletion: true, rules: ["OldestVM"] }, + singlePlacementGroup: true, + sku: { name: "DSv3-Type1", capacity: 7, tier: "aaa" }, + tags: { key246: "aaaaaaaaaaaaaaaaaaaaaaaa" }, + upgradePolicy: { + automaticOSUpgradePolicy: { + disableAutomaticRollback: true, + enableAutomaticOSUpgrade: true + }, + mode: "Manual", + rollingUpgradePolicy: { + enableCrossZoneUpgrade: true, + maxBatchInstancePercent: 49, + maxUnhealthyInstancePercent: 81, + maxUnhealthyUpgradedInstancePercent: 98, + pauseTimeBetweenBatches: "aaaaaaaaaaaaaaa", + prioritizeUnhealthyInstances: true + } + }, + virtualMachineProfile: { + billingProfile: { maxPrice: -1 }, + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: + "http://{existing-storage-account-name}.blob.core.windows.net" + } + }, + extensionProfile: { + extensionsTimeBudget: "PT1H20M", + extensions: [ + { + name: "{extension-name}", + typePropertiesType: "{extension-Type}", + autoUpgradeMinorVersion: true, + enableAutomaticUpgrade: true, + forceUpdateTag: "aaaaaaaaa", + protectedSettings: {}, + provisionAfterExtensions: ["aa"], + publisher: "{extension-Publisher}", + settings: {}, + suppressFailures: true, + typeHandlerVersion: "{handler-version}" + } + ] + }, + licenseType: "aaaaaaaaaaaa", + networkProfile: { + healthProbe: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123" + }, + networkApiVersion: "2020-11-01", + networkInterfaceConfigurations: [ + { + name: "aaaaaaaa", + deleteOption: "Delete", + dnsSettings: { dnsServers: [] }, + enableAcceleratedNetworking: true, + enableFpga: true, + enableIPForwarding: true, + id: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + ipConfigurations: [ + { + name: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + applicationGatewayBackendAddressPools: [ + { + id: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot" + } + ], + applicationSecurityGroups: [ + { + id: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot" + } + ], + id: "aaaaaaaaaaaaaaaa", + loadBalancerBackendAddressPools: [ + { + id: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot" + } + ], + loadBalancerInboundNatPools: [ + { + id: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot" + } + ], + primary: true, + privateIPAddressVersion: "IPv4", + publicIPAddressConfiguration: { + name: "a", + deleteOption: "Delete", + dnsSettings: { domainNameLabel: "aaaaaaaaaaaaaaaaaa" }, + idleTimeoutInMinutes: 3 + }, + subnet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123" + } + } + ], + networkSecurityGroup: { + id: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot" + }, + primary: true + } + ] + }, + osProfile: { + customData: "aaaaaaaaaaaaaaaaaaaaaaaaaa", + linuxConfiguration: { + disablePasswordAuthentication: true, + patchSettings: { + assessmentMode: "ImageDefault", + patchMode: "ImageDefault" + }, + provisionVMAgent: true, + ssh: { + publicKeys: [ + { + path: "/home/{your-username}/.ssh/authorized_keys", + keyData: + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1" + } + ] + } + }, + secrets: [ + { + sourceVault: { + id: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" + }, + vaultCertificates: [ + { + certificateStore: "aaaaaaaaaaaaaaaaaaaaaaaaa", + certificateUrl: "aaaaaaa" + } + ] + } + ], + windowsConfiguration: { + additionalUnattendContent: [ + { + componentName: "Microsoft-Windows-Shell-Setup", + content: "aaaaaaaaaaaaaaaaaaaa", + passName: "OobeSystem", + settingName: "AutoLogon" + } + ], + enableAutomaticUpdates: true, + patchSettings: { + assessmentMode: "ImageDefault", + enableHotpatching: true, + patchMode: "AutomaticByOS" + }, + provisionVMAgent: true, + timeZone: "aaaaaaaaaaaaaaaa", + winRM: { + listeners: [ + { certificateUrl: "aaaaaaaaaaaaaaaaaaaaaa", protocol: "Http" } + ] + } + } + }, + scheduledEventsProfile: { + terminateNotificationProfile: { + enable: true, + notBeforeTimeout: "PT10M" + } + }, + securityProfile: { + encryptionAtHost: true, + securityType: "TrustedLaunch", + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true } + }, + storageProfile: { + dataDisks: [ + { + name: "aaaaaaaaaaaaaaaaaaaaaaaaaa", + caching: "None", + createOption: "Empty", + diskIopsReadWrite: 28, + diskMBpsReadWrite: 15, + diskSizeGB: 1023, + lun: 26, + managedDisk: { + diskEncryptionSet: { id: "aaaaaaaaaaaa" }, + storageAccountType: "Standard_LRS" + }, + writeAcceleratorEnabled: true + } + ], + imageReference: { + id: "aaaaaaaaaaaaaaaaaaa", + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sharedGalleryImageId: "aaaaaa", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + caching: "ReadWrite", + diskSizeGB: 6, + image: { + uri: + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd" + }, + managedDisk: { + diskEncryptionSet: { id: "aaaaaaaaaaaa" }, + storageAccountType: "Standard_LRS" + }, + vhdContainers: ["aa"], + writeAcceleratorEnabled: true + } + }, + userData: "aaaaaaaaaaaaa" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +virtualMachineScaleSetsUpdateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Update a VM scale set. + * + * @summary Update a VM scale set. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Update_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsUpdateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmScaleSetName = "aaaaaaaaaaaaaa"; + const parameters: VirtualMachineScaleSetUpdate = {}; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.beginUpdateAndWait( + resourceGroupName, + vmScaleSetName, + parameters + ); + console.log(result); +} + +virtualMachineScaleSetsUpdateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineSizesListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineSizesListSample.ts new file mode 100644 index 000000000000..db96db0e8cfa --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachineSizesListSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) + * + * @summary This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineSizes_List_MaximumSet_Gen.json + */ +async function virtualMachineSizesListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "-e"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineSizes.list(location)) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineSizesListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) + * + * @summary This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineSizes_List_MinimumSet_Gen.json + */ +async function virtualMachineSizesListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const location = "._.."; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachineSizes.list(location)) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachineSizesListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesAssessPatchesSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesAssessPatchesSample.ts new file mode 100644 index 000000000000..f118e41f0225 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesAssessPatchesSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Assess patches on the VM. + * + * @summary Assess patches on the VM. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineAssessPatches.json + */ +async function assessPatchStateOfAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroupName"; + const vmName = "myVMName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginAssessPatchesAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +assessPatchStateOfAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesCaptureSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesCaptureSample.ts new file mode 100644 index 000000000000..57e9b6916e99 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesCaptureSample.ts @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineCaptureParameters, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. + * + * @summary Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Capture_MaximumSet_Gen.json + */ +async function virtualMachinesCaptureMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaaaaaa"; + const parameters: VirtualMachineCaptureParameters = { + destinationContainerName: "aaaaaaa", + overwriteVhds: true, + vhdPrefix: "aaaaaaaaa" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCaptureAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +virtualMachinesCaptureMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. + * + * @summary Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Capture_MinimumSet_Gen.json + */ +async function virtualMachinesCaptureMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaa"; + const parameters: VirtualMachineCaptureParameters = { + destinationContainerName: "aaaaaaa", + overwriteVhds: true, + vhdPrefix: "aaaaaaaaa" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCaptureAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +virtualMachinesCaptureMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesConvertToManagedDisksSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesConvertToManagedDisksSample.ts new file mode 100644 index 000000000000..ff28265090c8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesConvertToManagedDisksSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * + * @summary Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ConvertToManagedDisks_MaximumSet_Gen.json + */ +async function virtualMachinesConvertToManagedDisksMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginConvertToManagedDisksAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesConvertToManagedDisksMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * + * @summary Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ConvertToManagedDisks_MinimumSet_Gen.json + */ +async function virtualMachinesConvertToManagedDisksMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginConvertToManagedDisksAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesConvertToManagedDisksMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..d53dcd71c033 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesCreateOrUpdateSample.ts @@ -0,0 +1,2456 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { VirtualMachine, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateALinuxVmWithPatchSettingAssessmentModeOfImageDefault.json + */ +async function createALinuxVMWithAPatchSettingAssessmentModeOfImageDefault() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + linuxConfiguration: { + patchSettings: { assessmentMode: "ImageDefault" }, + provisionVMAgent: true + } + }, + storageProfile: { + imageReference: { + offer: "UbuntuServer", + publisher: "Canonical", + sku: "16.04-LTS", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createALinuxVMWithAPatchSettingAssessmentModeOfImageDefault().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateALinuxVmWithPatchSettingModeOfImageDefault.json + */ +async function createALinuxVMWithAPatchSettingPatchModeOfImageDefault() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + linuxConfiguration: { + patchSettings: { patchMode: "ImageDefault" }, + provisionVMAgent: true + } + }, + storageProfile: { + imageReference: { + offer: "UbuntuServer", + publisher: "Canonical", + sku: "16.04-LTS", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createALinuxVMWithAPatchSettingPatchModeOfImageDefault().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateALinuxVmWithPatchSettingModesOfAutomaticByPlatform.json + */ +async function createALinuxVMWithAPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + linuxConfiguration: { + patchSettings: { + assessmentMode: "AutomaticByPlatform", + patchMode: "AutomaticByPlatform" + }, + provisionVMAgent: true + } + }, + storageProfile: { + imageReference: { + offer: "UbuntuServer", + publisher: "Canonical", + sku: "16.04-LTS", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createALinuxVMWithAPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmFromACommunityGalleryImage.json + */ +async function createAVMFromACommunityGalleryImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + imageReference: { + communityGalleryImageId: + "/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMFromACommunityGalleryImage().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmFromASharedGalleryImage.json + */ +async function createAVMFromASharedGalleryImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + imageReference: { + sharedGalleryImageId: + "/SharedGalleries/sharedGalleryName/Images/sharedGalleryImageName/Versions/sharedGalleryImageVersionName" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMFromASharedGalleryImage().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAVmWithHibernationEnabled.json + */ +async function createAVMWithHibernationEnabled() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "{vm-name}"; + const parameters: VirtualMachine = { + additionalCapabilities: { hibernationEnabled: true }, + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: + "http://{existing-storage-account-name}.blob.core.windows.net" + } + }, + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + location: "eastus2euap", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "{vm-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2019-Datacenter", + version: "latest" + }, + osDisk: { + name: "vmOSdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithHibernationEnabled().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithUefiSettings.json + */ +async function createAVMWithUefiSettingsOfSecureBootAndVTpm() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + securityProfile: { + securityType: "TrustedLaunch", + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true } + }, + storageProfile: { + imageReference: { + offer: "windowsserver-gen2preview-preview", + publisher: "MicrosoftWindowsServer", + sku: "windows10-tvm", + version: "18363.592.2001092016" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadOnly", + createOption: "FromImage", + managedDisk: { storageAccountType: "StandardSSD_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithUefiSettingsOfSecureBootAndVTpm().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAVmWithUserData.json + */ +async function createAVMWithUserData() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "{vm-name}"; + const parameters: VirtualMachine = { + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: + "http://{existing-storage-account-name}.blob.core.windows.net" + } + }, + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "{vm-name}" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "vmOSdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + }, + userData: "RXhhbXBsZSBVc2VyRGF0YQ==" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithUserData().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAVmWithVMSizeProperties.json + */ +async function createAVMWithVMSizeProperties() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: + "http://{existing-storage-account-name}.blob.core.windows.net" + } + }, + hardwareProfile: { + vmSize: "Standard_D4_v3", + vmSizeProperties: { vCPUsAvailable: 1, vCPUsPerCore: 1 } + }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + }, + userData: "U29tZSBDdXN0b20gRGF0YQ==" + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithVMSizeProperties().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithNetworkInterfaceConfiguration.json + */ +async function createAVMWithNetworkInterfaceConfiguration() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkApiVersion: "2020-11-01", + networkInterfaceConfigurations: [ + { + name: "{nic-config-name}", + deleteOption: "Delete", + ipConfigurations: [ + { + name: "{ip-config-name}", + primary: true, + publicIPAddressConfiguration: { + name: "{publicIP-config-name}", + deleteOption: "Detach", + publicIPAllocationMethod: "Static", + sku: { name: "Basic", tier: "Global" } + } + } + ], + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithNetworkInterfaceConfiguration().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithSecurityTypeConfidentialVMWithCustomerManagedKeys.json + */ +async function createAVMWithSecurityTypeConfidentialVMWithCustomerManagedKeys() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_DC2as_v5" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + securityProfile: { + securityType: "ConfidentialVM", + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true } + }, + storageProfile: { + imageReference: { + offer: "2019-datacenter-cvm", + publisher: "MicrosoftWindowsServer", + sku: "windows-cvm", + version: "17763.2183.2109130127" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadOnly", + createOption: "FromImage", + managedDisk: { + securityProfile: { + diskEncryptionSet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}" + }, + securityEncryptionType: "DiskWithVMGuestState" + }, + storageAccountType: "StandardSSD_LRS" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithSecurityTypeConfidentialVMWithCustomerManagedKeys().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithSecurityTypeConfidentialVM.json + */ +async function createAVMWithSecurityTypeConfidentialVMWithPlatformManagedKeys() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_DC2as_v5" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + securityProfile: { + securityType: "ConfidentialVM", + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true } + }, + storageProfile: { + imageReference: { + offer: "2019-datacenter-cvm", + publisher: "MicrosoftWindowsServer", + sku: "windows-cvm", + version: "17763.2183.2109130127" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadOnly", + createOption: "FromImage", + managedDisk: { + securityProfile: { securityEncryptionType: "DiskWithVMGuestState" }, + storageAccountType: "StandardSSD_LRS" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithSecurityTypeConfidentialVMWithPlatformManagedKeys().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAWindowsVmWithPatchSettingAssessmentModeOfImageDefault.json + */ +async function createAWindowsVMWithAPatchSettingAssessmentModeOfImageDefault() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + windowsConfiguration: { + enableAutomaticUpdates: true, + patchSettings: { assessmentMode: "ImageDefault" }, + provisionVMAgent: true + } + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAWindowsVMWithAPatchSettingAssessmentModeOfImageDefault().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAWindowsVmWithPatchSettingModeOfAutomaticByOS.json + */ +async function createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByOS() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + windowsConfiguration: { + enableAutomaticUpdates: true, + patchSettings: { patchMode: "AutomaticByOS" }, + provisionVMAgent: true + } + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByOS().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAWindowsVmWithPatchSettingModeOfAutomaticByPlatformAndEnableHotPatchingTrue.json + */ +async function createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + windowsConfiguration: { + enableAutomaticUpdates: true, + patchSettings: { + enableHotpatching: true, + patchMode: "AutomaticByPlatform" + }, + provisionVMAgent: true + } + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAWindowsVmWithPatchSettingModeOfManual.json + */ +async function createAWindowsVMWithAPatchSettingPatchModeOfManual() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + windowsConfiguration: { + enableAutomaticUpdates: true, + patchSettings: { patchMode: "Manual" }, + provisionVMAgent: true + } + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAWindowsVMWithAPatchSettingPatchModeOfManual().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAWindowsVmWithPatchSettingModesOfAutomaticByPlatform.json + */ +async function createAWindowsVMWithPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM", + windowsConfiguration: { + enableAutomaticUpdates: true, + patchSettings: { + assessmentMode: "AutomaticByPlatform", + patchMode: "AutomaticByPlatform" + }, + provisionVMAgent: true + } + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAWindowsVMWithPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateACustomImageVmFromAnUnmanagedGeneralizedOsImage.json + */ +async function createACustomImageVMFromAnUnmanagedGeneralizedOSImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "{vm-name}"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + image: { + uri: + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd" + }, + osType: "Windows", + vhd: { + uri: + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createACustomImageVMFromAnUnmanagedGeneralizedOSImage().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAPlatformImageVmWithUnmanagedOsAndDataDisks.json + */ +async function createAPlatformImageVMWithUnmanagedOSAndDataDisks() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "{vm-name}"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D2_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + dataDisks: [ + { + createOption: "Empty", + diskSizeGB: 1023, + lun: 0, + vhd: { + uri: + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk0.vhd" + } + }, + { + createOption: "Empty", + diskSizeGB: 1023, + lun: 1, + vhd: { + uri: + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk1.vhd" + } + } + ], + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + vhd: { + uri: + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAPlatformImageVMWithUnmanagedOSAndDataDisks().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmFromACustomImage.json + */ +async function createAVMFromACustomImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + imageReference: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMFromACustomImage().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmFromAGeneralizedSharedImage.json + */ +async function createAVMFromAGeneralizedSharedImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + imageReference: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMFromAGeneralizedSharedImage().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmFromASpecializedSharedImage.json + */ +async function createAVMFromASpecializedSharedImage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + storageProfile: { + imageReference: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMFromASpecializedSharedImage().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain.json + */ +async function createAVMInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + platformFaultDomain: 1, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + }, + virtualMachineScaleSet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{existing-flex-vmss-name-with-platformFaultDomainCount-greater-than-1}" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmInAnAvailabilitySet.json + */ +async function createAVMInAnAvailabilitySet() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + availabilitySet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/{existing-availability-set-name}" + }, + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMInAnAvailabilitySet().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithApplicationProfile.json + */ +async function createAVMWithApplicationProfile() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + applicationProfile: { + galleryApplications: [ + { + configurationReference: + "https://mystorageaccount.blob.core.windows.net/configurations/settings.config", + order: 1, + packageReferenceId: + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0", + tags: "myTag1" + }, + { + packageReferenceId: + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1" + } + ] + }, + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + imageReference: { + offer: "{image_offer}", + publisher: "{image_publisher}", + sku: "{image_sku}", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithApplicationProfile().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithDiskEncryptionSetResource.json + */ +async function createAVMWithDiskEncryptionSetResourceIdInTheOSDiskAndDataDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + dataDisks: [ + { + caching: "ReadWrite", + createOption: "Empty", + diskSizeGB: 1023, + lun: 0, + managedDisk: { + diskEncryptionSet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}" + }, + storageAccountType: "Standard_LRS" + } + }, + { + caching: "ReadWrite", + createOption: "Attach", + diskSizeGB: 1023, + lun: 1, + managedDisk: { + diskEncryptionSet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}" + }, + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-managed-disk-name}", + storageAccountType: "Standard_LRS" + } + } + ], + imageReference: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { + diskEncryptionSet: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}" + }, + storageAccountType: "Standard_LRS" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithDiskEncryptionSetResourceIdInTheOSDiskAndDataDisk().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithEncryptionAtHost.json + */ +async function createAVMWithHostEncryptionUsingEncryptionAtHostProperty() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_DS1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads" + }, + securityProfile: { encryptionAtHost: true }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadOnly", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithHostEncryptionUsingEncryptionAtHostProperty().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithScheduledEventsProfile.json + */ +async function createAVMWithScheduledEventsProfile() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: + "http://{existing-storage-account-name}.blob.core.windows.net" + } + }, + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + scheduledEventsProfile: { + terminateNotificationProfile: { enable: true, notBeforeTimeout: "PT10M" } + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithScheduledEventsProfile().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithAMarketplaceImagePlan.json + */ +async function createAVMWithAMarketplaceImagePlan() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads" + }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithAMarketplaceImagePlan().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithExtensionsTimeBudget.json + */ +async function createAVMWithAnExtensionsTimeBudget() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: + "http://{existing-storage-account-name}.blob.core.windows.net" + } + }, + extensionsTimeBudget: "PT30M", + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithAnExtensionsTimeBudget().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithBootDiagnostics.json + */ +async function createAVMWithBootDiagnostics() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + diagnosticsProfile: { + bootDiagnostics: { + enabled: true, + storageUri: + "http://{existing-storage-account-name}.blob.core.windows.net" + } + }, + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithBootDiagnostics().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithEmptyDataDisks.json + */ +async function createAVMWithEmptyDataDisks() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D2_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + dataDisks: [ + { createOption: "Empty", diskSizeGB: 1023, lun: 0 }, + { createOption: "Empty", diskSizeGB: 1023, lun: 1 } + ], + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithEmptyDataDisks().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithADiffOsDiskUsingDiffDiskPlacementAsCacheDisk.json + */ +async function createAVMWithEphemeralOSDiskProvisioningInCacheDiskUsingPlacementProperty() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_DS1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads" + }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadOnly", + createOption: "FromImage", + diffDiskSettings: { option: "Local", placement: "CacheDisk" }, + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithEphemeralOSDiskProvisioningInCacheDiskUsingPlacementProperty().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithADiffOsDiskUsingDiffDiskPlacementAsResourceDisk.json + */ +async function createAVMWithEphemeralOSDiskProvisioningInResourceDiskUsingPlacementProperty() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_DS1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads" + }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadOnly", + createOption: "FromImage", + diffDiskSettings: { option: "Local", placement: "ResourceDisk" }, + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithEphemeralOSDiskProvisioningInResourceDiskUsingPlacementProperty().catch( + console.error +); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithADiffOsDisk.json + */ +async function createAVMWithEphemeralOSDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_DS1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads" + }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadOnly", + createOption: "FromImage", + diffDiskSettings: { option: "Local" }, + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithEphemeralOSDisk().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithManagedBootDiagnostics.json + */ +async function createAVMWithManagedBootDiagnostics() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + diagnosticsProfile: { bootDiagnostics: { enabled: true } }, + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithManagedBootDiagnostics().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithPasswordAuthentication.json + */ +async function createAVMWithPasswordAuthentication() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithPasswordAuthentication().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithPremiumStorage.json + */ +async function createAVMWithPremiumStorage() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Premium_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithPremiumStorage().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithSshAuthentication.json + */ +async function createAVMWithSshAuthentication() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + hardwareProfile: { vmSize: "Standard_D1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + linuxConfiguration: { + disablePasswordAuthentication: true, + ssh: { + publicKeys: [ + { + path: "/home/{your-username}/.ssh/authorized_keys", + keyData: + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1" + } + ] + } + } + }, + storageProfile: { + imageReference: { + offer: "{image_offer}", + publisher: "{image_publisher}", + sku: "{image_sku}", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createAVMWithSshAuthentication().catch(console.error); + +/** + * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAVmWithCapacityReservation.json + */ +async function createOrUpdateAVMWithCapacityReservation() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachine = { + capacityReservation: { + capacityReservationGroup: { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}" + } + }, + hardwareProfile: { vmSize: "Standard_DS1_v2" }, + location: "westus", + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + plan: { + name: "windows2016", + product: "windows-data-science-vm", + publisher: "microsoft-ads" + }, + storageProfile: { + imageReference: { + offer: "windows-data-science-vm", + publisher: "microsoft-ads", + sku: "windows2016", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadOnly", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +createOrUpdateAVMWithCapacityReservation().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesDeallocateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesDeallocateSample.ts new file mode 100644 index 000000000000..b777f113cd58 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesDeallocateSample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachinesDeallocateOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * + * @summary Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Deallocate_MaximumSet_Gen.json + */ +async function virtualMachinesDeallocateMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaa"; + const hibernate = true; + const options: VirtualMachinesDeallocateOptionalParams = { hibernate }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginDeallocateAndWait( + resourceGroupName, + vmName, + options + ); + console.log(result); +} + +virtualMachinesDeallocateMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * + * @summary Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Deallocate_MinimumSet_Gen.json + */ +async function virtualMachinesDeallocateMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginDeallocateAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesDeallocateMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesDeleteSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesDeleteSample.ts new file mode 100644 index 000000000000..de69b3160191 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesDeleteSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachinesDeleteOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete a virtual machine. + * + * @summary The operation to delete a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ForceDeleteVirtualMachine.json + */ +async function forceDeleteAVM() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const forceDeletion = true; + const options: VirtualMachinesDeleteOptionalParams = { forceDeletion }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginDeleteAndWait( + resourceGroupName, + vmName, + options + ); + console.log(result); +} + +forceDeleteAVM().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesGeneralizeSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesGeneralizeSample.ts new file mode 100644 index 000000000000..c1462ef25e6c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesGeneralizeSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation.
For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource).
For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * + * @summary Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation.
For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource).
For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GeneralizeVirtualMachine.json + */ +async function generalizeAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVMName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.generalize( + resourceGroupName, + vmName + ); + console.log(result); +} + +generalizeAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesGetSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesGetSample.ts new file mode 100644 index 000000000000..c5238b229396 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesGetSample.ts @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Retrieves information about the model view or the instance view of a virtual machine. + * + * @summary Retrieves information about the model view or the instance view of a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachine.json + */ +async function getAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.get(resourceGroupName, vmName); + console.log(result); +} + +getAVirtualMachine().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about the model view or the instance view of a virtual machine. + * + * @summary Retrieves information about the model view or the instance view of a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineAutoPlacedOnDedicatedHostGroup.json + */ +async function getAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.get(resourceGroupName, vmName); + console.log(result); +} + +getAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement().catch( + console.error +); + +/** + * This sample demonstrates how to Retrieves information about the model view or the instance view of a virtual machine. + * + * @summary Retrieves information about the model view or the instance view of a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineWithVMSizeProperties.json + */ +async function getAVirtualMachineWithVMSizeProperties() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.get(resourceGroupName, vmName); + console.log(result); +} + +getAVirtualMachineWithVMSizeProperties().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesInstallPatchesSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesInstallPatchesSample.ts new file mode 100644 index 000000000000..53cbea757362 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesInstallPatchesSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineInstallPatchesParameters, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Installs patches on the VM. + * + * @summary Installs patches on the VM. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineInstallPatches.json + */ +async function installPatchStateOfAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroupName"; + const vmName = "myVMName"; + const installPatchesInput: VirtualMachineInstallPatchesParameters = { + maximumDuration: "PT4H", + rebootSetting: "IfRequired", + windowsParameters: { + classificationsToInclude: ["Critical", "Security"], + maxPatchPublishDate: new Date("2020-11-19T02:36:43.0539904+00:00") + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginInstallPatchesAndWait( + resourceGroupName, + vmName, + installPatchesInput + ); + console.log(result); +} + +installPatchStateOfAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesInstanceViewSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesInstanceViewSample.ts new file mode 100644 index 000000000000..2b35f68928e5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesInstanceViewSample.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Retrieves information about the run-time state of a virtual machine. + * + * @summary Retrieves information about the run-time state of a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineInstanceView.json + */ +async function getVirtualMachineInstanceView() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.instanceView( + resourceGroupName, + vmName + ); + console.log(result); +} + +getVirtualMachineInstanceView().catch(console.error); + +/** + * This sample demonstrates how to Retrieves information about the run-time state of a virtual machine. + * + * @summary Retrieves information about the run-time state of a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineInstanceViewAutoPlacedOnDedicatedHostGroup.json + */ +async function getInstanceViewOfAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.instanceView( + resourceGroupName, + vmName + ); + console.log(result); +} + +getInstanceViewOfAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesListAllSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesListAllSample.ts new file mode 100644 index 000000000000..04df95761858 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesListAllSample.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachinesListAllOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. + * + * @summary Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ListAll_MaximumSet_Gen.json + */ +async function virtualMachinesListAllMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const statusOnly = "aaaaaa"; + const filter = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const options: VirtualMachinesListAllOptionalParams = { statusOnly, filter }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachines.listAll(options)) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachinesListAllMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. + * + * @summary Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ListAll_MinimumSet_Gen.json + */ +async function virtualMachinesListAllMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachines.listAll()) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachinesListAllMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesListAvailableSizesSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesListAvailableSizesSample.ts new file mode 100644 index 000000000000..5140c7ecc1cb --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesListAvailableSizesSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * + * @summary Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListAvailableVmSizes_VirtualMachines.json + */ +async function listsAllAvailableVirtualMachineSizesToWhichTheSpecifiedVirtualMachineCanBeResized() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVmName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachines.listAvailableSizes( + resourceGroupName, + vmName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listsAllAvailableVirtualMachineSizesToWhichTheSpecifiedVirtualMachineCanBeResized().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesListByLocationSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesListByLocationSample.ts new file mode 100644 index 000000000000..06c7c707fda6 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesListByLocationSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets all the virtual machines under the specified subscription for the specified location. + * + * @summary Gets all the virtual machines under the specified subscription for the specified location. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListVirtualMachinesInASubscriptionByLocation.json + */ +async function listsAllTheVirtualMachinesUnderTheSpecifiedSubscriptionForTheSpecifiedLocation() { + const subscriptionId = "{subscriptionId}"; + const location = "eastus"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachines.listByLocation(location)) { + resArray.push(item); + } + console.log(resArray); +} + +listsAllTheVirtualMachinesUnderTheSpecifiedSubscriptionForTheSpecifiedLocation().catch( + console.error +); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesListSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesListSample.ts new file mode 100644 index 000000000000..b529ce24e8da --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesListSample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachinesListOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. + * + * @summary Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_List_MaximumSet_Gen.json + */ +async function virtualMachinesListMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const filter = "aaaaaaaaaaaaaaaaaaaaaaa"; + const options: VirtualMachinesListOptionalParams = { filter }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachines.list( + resourceGroupName, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachinesListMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. + * + * @summary Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_List_MinimumSet_Gen.json + */ +async function virtualMachinesListMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachines.list(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +virtualMachinesListMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesPerformMaintenanceSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesPerformMaintenanceSample.ts new file mode 100644 index 000000000000..6f09d1f9ac09 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesPerformMaintenanceSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to perform maintenance on a virtual machine. + * + * @summary The operation to perform maintenance on a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PerformMaintenance_MaximumSet_Gen.json + */ +async function virtualMachinesPerformMaintenanceMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginPerformMaintenanceAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesPerformMaintenanceMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to perform maintenance on a virtual machine. + * + * @summary The operation to perform maintenance on a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PerformMaintenance_MinimumSet_Gen.json + */ +async function virtualMachinesPerformMaintenanceMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginPerformMaintenanceAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesPerformMaintenanceMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesPowerOffSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesPowerOffSample.ts new file mode 100644 index 000000000000..84a514159ecd --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesPowerOffSample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachinesPowerOffOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. + * + * @summary The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PowerOff_MaximumSet_Gen.json + */ +async function virtualMachinesPowerOffMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const skipShutdown = true; + const options: VirtualMachinesPowerOffOptionalParams = { skipShutdown }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginPowerOffAndWait( + resourceGroupName, + vmName, + options + ); + console.log(result); +} + +virtualMachinesPowerOffMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. + * + * @summary The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PowerOff_MinimumSet_Gen.json + */ +async function virtualMachinesPowerOffMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginPowerOffAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesPowerOffMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesReapplySample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesReapplySample.ts new file mode 100644 index 000000000000..2c82c1c07314 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesReapplySample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to reapply a virtual machine's state. + * + * @summary The operation to reapply a virtual machine's state. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ReapplyVirtualMachine.json + */ +async function reapplyTheStateOfAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ResourceGroup"; + const vmName = "VMName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginReapplyAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +reapplyTheStateOfAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesRedeploySample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesRedeploySample.ts new file mode 100644 index 000000000000..77ef28ff2edc --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesRedeploySample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @summary Shuts down the virtual machine, moves it to a new node, and powers it back on. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Redeploy_MaximumSet_Gen.json + */ +async function virtualMachinesRedeployMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "a"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginRedeployAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesRedeployMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @summary Shuts down the virtual machine, moves it to a new node, and powers it back on. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Redeploy_MinimumSet_Gen.json + */ +async function virtualMachinesRedeployMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginRedeployAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesRedeployMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesReimageSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesReimageSample.ts new file mode 100644 index 000000000000..db8b1595b25d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesReimageSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { + VirtualMachineReimageParameters, + VirtualMachinesReimageOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @summary Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ReimageVirtualMachine.json + */ +async function reimageAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVMName"; + const parameters: VirtualMachineReimageParameters = { tempDisk: true }; + const options: VirtualMachinesReimageOptionalParams = { parameters }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginReimageAndWait( + resourceGroupName, + vmName, + options + ); + console.log(result); +} + +reimageAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesRestartSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesRestartSample.ts new file mode 100644 index 000000000000..d8ff5884d744 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesRestartSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to restart a virtual machine. + * + * @summary The operation to restart a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Restart_MaximumSet_Gen.json + */ +async function virtualMachinesRestartMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginRestartAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesRestartMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to restart a virtual machine. + * + * @summary The operation to restart a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Restart_MinimumSet_Gen.json + */ +async function virtualMachinesRestartMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginRestartAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesRestartMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesRetrieveBootDiagnosticsDataSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesRetrieveBootDiagnosticsDataSample.ts new file mode 100644 index 000000000000..04f569c8f448 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesRetrieveBootDiagnosticsDataSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachinesRetrieveBootDiagnosticsDataOptionalParams, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + * + * @summary The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RetrieveBootDiagnosticsDataVirtualMachine.json + */ +async function retrieveBootDiagnosticsDataOfAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ResourceGroup"; + const vmName = "VMName"; + const sasUriExpirationTimeInMinutes = 60; + const options: VirtualMachinesRetrieveBootDiagnosticsDataOptionalParams = { + sasUriExpirationTimeInMinutes + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.retrieveBootDiagnosticsData( + resourceGroupName, + vmName, + options + ); + console.log(result); +} + +retrieveBootDiagnosticsDataOfAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesRunCommandSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesRunCommandSample.ts new file mode 100644 index 000000000000..a63a90b43b3b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesRunCommandSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { RunCommandInput, ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Run command on the VM. + * + * @summary Run command on the VM. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VirtualMachineRunCommand.json + */ +async function virtualMachineRunCommand() { + const subscriptionId = "24fb23e3-6ba3-41f0-9b6e-e41131d5d61e"; + const resourceGroupName = "crptestar98131"; + const vmName = "vm3036"; + const parameters: RunCommandInput = { commandId: "RunPowerShellScript" }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginRunCommandAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +virtualMachineRunCommand().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesSimulateEvictionSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesSimulateEvictionSample.ts new file mode 100644 index 000000000000..a9221dc440ef --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesSimulateEvictionSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to simulate the eviction of spot virtual machine. + * + * @summary The operation to simulate the eviction of spot virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SimulateEvictionOfVM.json + */ +async function simulateEvictionAVirtualMachine() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "ResourceGroup"; + const vmName = "VMName"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.simulateEviction( + resourceGroupName, + vmName + ); + console.log(result); +} + +simulateEvictionAVirtualMachine().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesStartSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesStartSample.ts new file mode 100644 index 000000000000..e5384fe4470b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesStartSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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 { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to start a virtual machine. + * + * @summary The operation to start a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Start_MaximumSet_Gen.json + */ +async function virtualMachinesStartMaximumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaaaaaaaaaaaaaaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginStartAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesStartMaximumSetGen().catch(console.error); + +/** + * This sample demonstrates how to The operation to start a virtual machine. + * + * @summary The operation to start a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Start_MinimumSet_Gen.json + */ +async function virtualMachinesStartMinimumSetGen() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "rgcompute"; + const vmName = "aaaaa"; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginStartAndWait( + resourceGroupName, + vmName + ); + console.log(result); +} + +virtualMachinesStartMinimumSetGen().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesUpdateSample.ts b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesUpdateSample.ts new file mode 100644 index 000000000000..1948b5afbf6f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v17/typescript/src/virtualMachinesUpdateSample.ts @@ -0,0 +1,135 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineUpdate, + ComputeManagementClient +} from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update a virtual machine. + * + * @summary The operation to update a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateVMDetachDataDiskUsingToBeDetachedProperty.json + */ +async function updateAVMByDetachingDataDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachineUpdate = { + hardwareProfile: { vmSize: "Standard_D2_v2" }, + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + dataDisks: [ + { createOption: "Empty", diskSizeGB: 1023, lun: 0, toBeDetached: true }, + { createOption: "Empty", diskSizeGB: 1023, lun: 1, toBeDetached: false } + ], + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +updateAVMByDetachingDataDisk().catch(console.error); + +/** + * This sample demonstrates how to The operation to update a virtual machine. + * + * @summary The operation to update a virtual machine. + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateVMForceDetachDataDisk.json + */ +async function updateAVMByForceDetachingDataDisk() { + const subscriptionId = "{subscription-id}"; + const resourceGroupName = "myResourceGroup"; + const vmName = "myVM"; + const parameters: VirtualMachineUpdate = { + hardwareProfile: { vmSize: "Standard_D2_v2" }, + networkProfile: { + networkInterfaces: [ + { + id: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true + } + ] + }, + osProfile: { + adminPassword: "{your-password}", + adminUsername: "{your-username}", + computerName: "myVM" + }, + storageProfile: { + dataDisks: [ + { + createOption: "Empty", + detachOption: "ForceDetach", + diskSizeGB: 1023, + lun: 0, + toBeDetached: true + }, + { createOption: "Empty", diskSizeGB: 1023, lun: 1, toBeDetached: false } + ], + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter", + version: "latest" + }, + osDisk: { + name: "myVMosdisk", + caching: "ReadWrite", + createOption: "FromImage", + managedDisk: { storageAccountType: "Standard_LRS" } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.beginUpdateAndWait( + resourceGroupName, + vmName, + parameters + ); + console.log(result); +} + +updateAVMByForceDetachingDataDisk().catch(console.error); diff --git a/sdk/compute/arm-compute/src/computeManagementClient.ts b/sdk/compute/arm-compute/src/computeManagementClient.ts index ce49bdd68231..869e344e577b 100644 --- a/sdk/compute/arm-compute/src/computeManagementClient.ts +++ b/sdk/compute/arm-compute/src/computeManagementClient.ts @@ -144,7 +144,7 @@ export class ComputeManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-compute/17.2.0`; + const packageDetails = `azsdk-js-arm-compute/17.3.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` diff --git a/sdk/compute/arm-compute/src/models/index.ts b/sdk/compute/arm-compute/src/models/index.ts index 78c946b28dfb..4abb76fcfb79 100644 --- a/sdk/compute/arm-compute/src/models/index.ts +++ b/sdk/compute/arm-compute/src/models/index.ts @@ -2688,10 +2688,12 @@ export interface PurchasePlanAutoGenerated { promotionCode?: string; } -/** List of supported capabilities (like accelerated networking) persisted on the disk resource for VM use. */ +/** List of supported capabilities persisted on the disk resource for VM use. */ export interface SupportedCapabilities { /** True if the image from which the OS disk is created supports accelerated networking. */ acceleratedNetwork?: boolean; + /** CPU architecture supported by an OS disk. */ + architecture?: Architecture; } /** Data used when creating a disk. */ @@ -2833,7 +2835,7 @@ export interface DiskUpdate { burstingEnabled?: boolean; /** Purchase plan information to be added on the OS disk */ purchasePlan?: PurchasePlanAutoGenerated; - /** List of supported capabilities (like accelerated networking) to be added on the OS disk. */ + /** List of supported capabilities to be added on the OS disk. */ supportedCapabilities?: SupportedCapabilities; /** * Properties of the disk for which update is pending. @@ -2844,6 +2846,8 @@ export interface DiskUpdate { supportsHibernation?: boolean; /** Policy for controlling export on the disk. */ publicNetworkAccess?: PublicNetworkAccess; + /** Additional authentication requirements when exporting or uploading to a disk or snapshot. */ + dataAccessAuthMode?: DataAccessAuthMode; } /** The List Disks operation response. */ @@ -2910,7 +2914,9 @@ export interface SnapshotUpdate { supportsHibernation?: boolean; /** Policy for controlling export on the disk. */ publicNetworkAccess?: PublicNetworkAccess; - /** List of supported capabilities (like accelerated networking) for the image from which the OS disk was created. */ + /** Additional authentication requirements when exporting or uploading to a disk or snapshot. */ + dataAccessAuthMode?: DataAccessAuthMode; + /** List of supported capabilities for the image from which the OS disk was created. */ supportedCapabilities?: SupportedCapabilities; } @@ -4912,6 +4918,8 @@ export type Disk = Resource & { completionPercent?: number; /** Policy for controlling export on the disk. */ publicNetworkAccess?: PublicNetworkAccess; + /** Additional authentication requirements when exporting or uploading to a disk or snapshot. */ + dataAccessAuthMode?: DataAccessAuthMode; }; /** Snapshot resource. */ @@ -4936,7 +4944,7 @@ export type Snapshot = Resource & { hyperVGeneration?: HyperVGeneration; /** Purchase plan information for the image from which the source disk for the snapshot was originally created. */ purchasePlan?: PurchasePlanAutoGenerated; - /** List of supported capabilities (like Accelerated Networking) for the image from which the source disk from the snapshot was originally created. */ + /** List of supported capabilities for the image from which the source disk from the snapshot was originally created. */ supportedCapabilities?: SupportedCapabilities; /** Disk source information. CreationData information cannot be changed after the disk has been created. */ creationData?: CreationData; @@ -4980,6 +4988,8 @@ export type Snapshot = Resource & { publicNetworkAccess?: PublicNetworkAccess; /** Percentage complete for the background copy when a resource is created via the CopyStart operation. */ completionPercent?: number; + /** Additional authentication requirements when exporting or uploading to a disk or snapshot. */ + dataAccessAuthMode?: DataAccessAuthMode; }; /** disk encryption set resource. */ @@ -5090,6 +5100,8 @@ export type GalleryImage = Resource & { readonly provisioningState?: GalleryImagePropertiesProvisioningState; /** A list of gallery image features. */ features?: GalleryImageFeature[]; + /** The architecture of the image. Applicable to OS disks only. */ + architecture?: Architecture; }; /** Specifies information about the gallery image version that you want to create or update. */ @@ -5736,7 +5748,7 @@ export type DiskRestorePoint = ProxyOnlyResource & { hyperVGeneration?: HyperVGeneration; /** Purchase plan information for the the image from which the OS disk was created. */ purchasePlan?: PurchasePlanAutoGenerated; - /** List of supported capabilities (like accelerated networking) for the image from which the OS disk was created. */ + /** List of supported capabilities for the image from which the OS disk was created. */ supportedCapabilities?: SupportedCapabilities; /** * id of the backing snapshot's MIS family @@ -5830,6 +5842,8 @@ export type GalleryImageUpdate = UpdateResourceDefinition & { readonly provisioningState?: GalleryImagePropertiesProvisioningState; /** A list of gallery image features. */ features?: GalleryImageFeature[]; + /** The architecture of the image. Applicable to OS disks only. */ + architecture?: Architecture; }; /** Specifies information about the gallery image version that you want to update. */ @@ -5968,6 +5982,8 @@ export type VirtualMachineImage = VirtualMachineImageResource & { /** Specifies disallowed configuration for the VirtualMachine created from the image */ disallowed?: DisallowedConfiguration; features?: VirtualMachineImageFeature[]; + /** Specifies the Architecture Type */ + architecture?: ArchitectureTypes; }; /** Describes a Virtual Machine Scale Set VM Reimage Parameters. */ @@ -6057,6 +6073,22 @@ export enum KnownVmDiskTypes { */ export type VmDiskTypes = string; +/** Known values of {@link ArchitectureTypes} that the service accepts. */ +export enum KnownArchitectureTypes { + X64 = "x64", + Arm64 = "Arm64" +} + +/** + * Defines values for ArchitectureTypes. \ + * {@link KnownArchitectureTypes} can be used interchangeably with ArchitectureTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **x64** \ + * **Arm64** + */ +export type ArchitectureTypes = string; + /** Known values of {@link ExtendedLocationTypes} that the service accepts. */ export enum KnownExtendedLocationTypes { EdgeZone = "EdgeZone" @@ -7253,6 +7285,22 @@ export enum KnownHyperVGeneration { */ export type HyperVGeneration = string; +/** Known values of {@link Architecture} that the service accepts. */ +export enum KnownArchitecture { + X64 = "x64", + Arm64 = "Arm64" +} + +/** + * Defines values for Architecture. \ + * {@link KnownArchitecture} can be used interchangeably with Architecture, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **x64** \ + * **Arm64** + */ +export type Architecture = string; + /** Known values of {@link DiskCreateOption} that the service accepts. */ export enum KnownDiskCreateOption { /** Create an empty data disk of a size given by diskSizeGB. */ @@ -7415,6 +7463,24 @@ export enum KnownPublicNetworkAccess { */ export type PublicNetworkAccess = string; +/** Known values of {@link DataAccessAuthMode} that the service accepts. */ +export enum KnownDataAccessAuthMode { + /** When export/upload URL is used, the system checks if the user has an identity in Azure Active Directory and has necessary permissions to export/upload the data. Please refer to aka.ms/DisksAzureADAuth. */ + AzureActiveDirectory = "AzureActiveDirectory", + /** No additional authentication would be performed when accessing export/upload URL. */ + None = "None" +} + +/** + * Defines values for DataAccessAuthMode. \ + * {@link KnownDataAccessAuthMode} can be used interchangeably with DataAccessAuthMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **AzureActiveDirectory**: When export\/upload URL is used, the system checks if the user has an identity in Azure Active Directory and has necessary permissions to export\/upload the data. Please refer to aka.ms\/DisksAzureADAuth. \ + * **None**: No additional authentication would be performed when accessing export\/upload URL. + */ +export type DataAccessAuthMode = string; + /** Known values of {@link AccessLevel} that the service accepts. */ export enum KnownAccessLevel { None = "None", diff --git a/sdk/compute/arm-compute/src/models/mappers.ts b/sdk/compute/arm-compute/src/models/mappers.ts index 387dfffc0b7b..12978d03ca18 100644 --- a/sdk/compute/arm-compute/src/models/mappers.ts +++ b/sdk/compute/arm-compute/src/models/mappers.ts @@ -6986,6 +6986,12 @@ export const SupportedCapabilities: coreClient.CompositeMapper = { type: { name: "Boolean" } + }, + architecture: { + serializedName: "architecture", + type: { + name: "String" + } } } } @@ -7409,6 +7415,12 @@ export const DiskUpdate: coreClient.CompositeMapper = { type: { name: "String" } + }, + dataAccessAuthMode: { + serializedName: "properties.dataAccessAuthMode", + type: { + name: "String" + } } } } @@ -7586,6 +7598,12 @@ export const SnapshotUpdate: coreClient.CompositeMapper = { name: "String" } }, + dataAccessAuthMode: { + serializedName: "properties.dataAccessAuthMode", + type: { + name: "String" + } + }, supportedCapabilities: { serializedName: "properties.supportedCapabilities", type: { @@ -12712,6 +12730,12 @@ export const Disk: coreClient.CompositeMapper = { type: { name: "String" } + }, + dataAccessAuthMode: { + serializedName: "properties.dataAccessAuthMode", + type: { + name: "String" + } } } } @@ -12875,6 +12899,12 @@ export const Snapshot: coreClient.CompositeMapper = { type: { name: "Number" } + }, + dataAccessAuthMode: { + serializedName: "properties.dataAccessAuthMode", + type: { + name: "String" + } } } } @@ -13147,6 +13177,12 @@ export const GalleryImage: coreClient.CompositeMapper = { } } } + }, + architecture: { + serializedName: "properties.architecture", + type: { + name: "String" + } } } } @@ -15030,6 +15066,12 @@ export const GalleryImageUpdate: coreClient.CompositeMapper = { } } } + }, + architecture: { + serializedName: "properties.architecture", + type: { + name: "String" + } } } } @@ -15439,6 +15481,12 @@ export const VirtualMachineImage: coreClient.CompositeMapper = { } } } + }, + architecture: { + serializedName: "properties.architecture", + type: { + name: "String" + } } } } diff --git a/sdk/compute/arm-compute/src/models/parameters.ts b/sdk/compute/arm-compute/src/models/parameters.ts index 8bf5b25e1450..3b84e2941ec9 100644 --- a/sdk/compute/arm-compute/src/models/parameters.ts +++ b/sdk/compute/arm-compute/src/models/parameters.ts @@ -940,7 +940,7 @@ export const diskName: OperationURLParameter = { export const apiVersion2: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-08-01", + defaultValue: "2021-12-01", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/compute/arm-compute/tsconfig.json b/sdk/compute/arm-compute/tsconfig.json index 481f8c36ccdc..b84abc8423ab 100644 --- a/sdk/compute/arm-compute/tsconfig.json +++ b/sdk/compute/arm-compute/tsconfig.json @@ -24,7 +24,8 @@ }, "include": [ "./src/**/*.ts", - "./test/**/*.ts" + "./test/**/*.ts", + "samples-dev/**/*.ts" ], "exclude": [ "node_modules" diff --git a/sdk/compute/ci.mgmt.yml b/sdk/compute/ci.mgmt.yml index c029d21afe01..d4d25787274a 100644 --- a/sdk/compute/ci.mgmt.yml +++ b/sdk/compute/ci.mgmt.yml @@ -1,5 +1,5 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - + trigger: branches: include: @@ -9,7 +9,7 @@ trigger: paths: include: - sdk/compute/ci.mgmt.yml - - sdk/compute/arm-compute/ + - sdk/compute/arm-compute pr: branches: include: @@ -22,12 +22,11 @@ pr: paths: include: - sdk/compute/ci.mgmt.yml - - sdk/compute/arm-compute/ - + - sdk/compute/arm-compute extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: ServiceDirectory: compute Artifacts: - name: azure-arm-compute - safeName: azurearmcompute \ No newline at end of file + safeName: azurearmcompute