* vmwarecloudsimple-refresh

* update
This commit is contained in:
colawwj 2022-05-11 16:58:44 +08:00 коммит произвёл GitHub
Родитель 854b7516e6
Коммит b60a9e433a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
129 изменённых файлов: 4304 добавлений и 165 удалений

Просмотреть файл

@ -13859,27 +13859,28 @@ packages:
dev: false
file:projects/arm-vmwarecloudsimple.tgz:
resolution: {integrity: sha512-OpcyWoUfElyQYJQYfGNqVGvoxgrX9PAHruILhdEUq2OETSzy/UBRLhOE4pHgxA5EdWGGKY9fUD/1EllraxuD4Q==, tarball: file:projects/arm-vmwarecloudsimple.tgz}
resolution: {integrity: sha512-pkLpYUn6X8dMwRvRn3fitJHhFvpdtlVBbWYZwVjIdfBPWvQzzrQcxkWKdM+41oHbpHnQNMJrab3fX9oStvTPWg==, tarball: file:projects/arm-vmwarecloudsimple.tgz}
name: '@rush-temp/arm-vmwarecloudsimple'
version: 0.0.0
dependencies:
'@azure-tools/test-recorder': 1.0.2
'@azure/identity': 2.0.4
'@microsoft/api-extractor': 7.18.11
'@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.1.0_rollup@2.70.2
'@rollup/plugin-json': 4.1.0_rollup@2.70.2
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.2
'@rollup/plugin-node-resolve': 13.2.1_rollup@2.70.2
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.70.2
rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.2
tslib: 2.4.0
typescript: 4.2.4
uglify-js: 3.15.4
transitivePeerDependencies:
- '@types/node'
- debug
- encoding
- supports-color

Просмотреть файл

@ -1,5 +1,24 @@
# Release History
## 3.0.0 (2022-05-05)
**Breaking Changes**
- Operation DedicatedCloudNodes.beginCreateOrUpdate has a new signature
- Operation DedicatedCloudNodes.beginCreateOrUpdateAndWait has a new signature
- Operation Operations.get has a new signature
- Operation VirtualMachines.beginCreateOrUpdate has a new signature
- Operation VirtualMachines.beginCreateOrUpdateAndWait has a new signature
- Operation VirtualMachines.beginDelete has a new signature
- Operation VirtualMachines.beginDeleteAndWait has a new signature
- Operation VirtualMachines.beginStart has a new signature
- Operation VirtualMachines.beginStartAndWait has a new signature
- Operation VirtualMachines.beginStop has a new signature
- Operation VirtualMachines.beginStopAndWait has a new signature
- Class VMwareCloudSimple has a new signature
- Class VMwareCloudSimple no longer has parameter referer
## 2.0.0 (2022-01-21)
The package of @azure/arm-vmwarecloudsimple is using our next generation design principles since version 2.0.0, which contains breaking changes.

Просмотреть файл

@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) 2019 Microsoft
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Просмотреть файл

@ -16,6 +16,8 @@ Description of the new service
- [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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
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 VMwareCloudSimple(new DefaultAzureCredential(), subscriptionId);
// For client-side applications running in the browser, use this code instead:
// const credential = new InteractiveBrowserCredential({
// tenantId: "<YOUR_TENANT_ID>",
// clientId: "<YOUR_CLIENT_ID>"
// });
// const client = new VMwareCloudSimple(credential, subscriptionId);
```

Просмотреть файл

@ -1,7 +1,8 @@
{
"commit": "f9a6cb686bcc0f1b23761db19f2491c5c4df95cb",
"commit": "33b275f34b10bd73f7e86f280965c9478b028136",
"readme": "specification/vmwarecloudsimple/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/vmwarecloudsimple/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220114.1",
"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:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\vmwarecloudsimple\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1 --generate-sample=true",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"use": "@autorest/typescript@6.0.0-alpha.16.20220114.1"
"release_tool": "@azure-tools/js-sdk-release-tools@2.3.0",
"use": "@autorest/typescript@6.0.0-alpha.19.20220408.1"
}

Просмотреть файл

@ -1,18 +1,31 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "./dist-esm/src/index.d.ts",
"docModel": { "enabled": true },
"apiReport": { "enabled": true, "reportFolder": "./review" },
"docModel": {
"enabled": true
},
"apiReport": {
"enabled": true,
"reportFolder": "./review"
},
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
"publicTrimmedFilePath": "./types/arm-vmwarecloudsimple.d.ts"
},
"messages": {
"tsdocMessageReporting": { "default": { "logLevel": "none" } },
"tsdocMessageReporting": {
"default": {
"logLevel": "none"
}
},
"extractorMessageReporting": {
"ae-missing-release-tag": { "logLevel": "none" },
"ae-unresolved-link": { "logLevel": "none" }
"ae-missing-release-tag": {
"logLevel": "none"
},
"ae-unresolved-link": {
"logLevel": "none"
}
}
}
}
}

Просмотреть файл

@ -3,7 +3,7 @@
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for VMwareCloudSimple.",
"version": "2.0.0",
"version": "3.0.0",
"engines": {
"node": ">=12.0.0"
},
@ -11,9 +11,9 @@
"@azure/core-lro": "^2.2.0",
"@azure/abort-controller": "^1.0.0",
"@azure/core-paging": "^1.2.0",
"@azure/core-client": "^1.0.0",
"@azure/core-client": "^1.5.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-rest-pipeline": "^1.1.0",
"@azure/core-rest-pipeline": "^1.8.0",
"tslib": "^2.2.0"
},
"keywords": [
@ -29,13 +29,13 @@
"types": "./types/arm-vmwarecloudsimple.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",
@ -101,10 +101,18 @@
"//metadata": {
"constantPaths": [
{
"path": "src/VMwareCloudSimple.ts",
"path": "src/vMwareCloudSimple.ts",
"prefix": "packageDetails"
}
]
},
"autoPublish": true
"autoPublish": true,
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-vmwarecloudsimple?view=azure-node-preview"
}
}

Просмотреть файл

@ -203,8 +203,8 @@ export interface DedicatedCloudNodeListResponse {
// @public
export interface DedicatedCloudNodes {
beginCreateOrUpdate(resourceGroupName: string, dedicatedCloudNodeName: string, dedicatedCloudNodeRequest: DedicatedCloudNode, options?: DedicatedCloudNodesCreateOrUpdateOptionalParams): Promise<PollerLike<PollOperationState<DedicatedCloudNodesCreateOrUpdateResponse>, DedicatedCloudNodesCreateOrUpdateResponse>>;
beginCreateOrUpdateAndWait(resourceGroupName: string, dedicatedCloudNodeName: string, dedicatedCloudNodeRequest: DedicatedCloudNode, options?: DedicatedCloudNodesCreateOrUpdateOptionalParams): Promise<DedicatedCloudNodesCreateOrUpdateResponse>;
beginCreateOrUpdate(resourceGroupName: string, referer: string, dedicatedCloudNodeName: string, dedicatedCloudNodeRequest: DedicatedCloudNode, options?: DedicatedCloudNodesCreateOrUpdateOptionalParams): Promise<PollerLike<PollOperationState<DedicatedCloudNodesCreateOrUpdateResponse>, DedicatedCloudNodesCreateOrUpdateResponse>>;
beginCreateOrUpdateAndWait(resourceGroupName: string, referer: string, dedicatedCloudNodeName: string, dedicatedCloudNodeRequest: DedicatedCloudNode, options?: DedicatedCloudNodesCreateOrUpdateOptionalParams): Promise<DedicatedCloudNodesCreateOrUpdateResponse>;
delete(resourceGroupName: string, dedicatedCloudNodeName: string, options?: DedicatedCloudNodesDeleteOptionalParams): Promise<void>;
get(resourceGroupName: string, dedicatedCloudNodeName: string, options?: DedicatedCloudNodesGetOptionalParams): Promise<DedicatedCloudNodesGetResponse>;
listByResourceGroup(resourceGroupName: string, options?: DedicatedCloudNodesListByResourceGroupOptionalParams): PagedAsyncIterableIterator<DedicatedCloudNode>;
@ -511,7 +511,7 @@ export interface OperationResource {
// @public
export interface Operations {
get(regionId: string, operationId: string, options?: OperationsGetOptionalParams): Promise<OperationsGetResponse>;
get(regionId: string, referer: string, operationId: string, options?: OperationsGetOptionalParams): Promise<OperationsGetResponse>;
list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator<AvailableOperation>;
}
@ -818,14 +818,14 @@ export interface VirtualMachineListResponse {
// @public
export interface VirtualMachines {
beginCreateOrUpdate(resourceGroupName: string, virtualMachineName: string, virtualMachineRequest: VirtualMachine, options?: VirtualMachinesCreateOrUpdateOptionalParams): Promise<PollerLike<PollOperationState<VirtualMachinesCreateOrUpdateResponse>, VirtualMachinesCreateOrUpdateResponse>>;
beginCreateOrUpdateAndWait(resourceGroupName: string, virtualMachineName: string, virtualMachineRequest: VirtualMachine, options?: VirtualMachinesCreateOrUpdateOptionalParams): Promise<VirtualMachinesCreateOrUpdateResponse>;
beginDelete(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesDeleteOptionalParams): Promise<PollerLike<PollOperationState<VirtualMachinesDeleteResponse>, VirtualMachinesDeleteResponse>>;
beginDeleteAndWait(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesDeleteOptionalParams): Promise<VirtualMachinesDeleteResponse>;
beginStart(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesStartOptionalParams): Promise<PollerLike<PollOperationState<void>, void>>;
beginStartAndWait(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesStartOptionalParams): Promise<void>;
beginStop(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesStopOptionalParams): Promise<PollerLike<PollOperationState<void>, void>>;
beginStopAndWait(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesStopOptionalParams): Promise<void>;
beginCreateOrUpdate(resourceGroupName: string, referer: string, virtualMachineName: string, virtualMachineRequest: VirtualMachine, options?: VirtualMachinesCreateOrUpdateOptionalParams): Promise<PollerLike<PollOperationState<VirtualMachinesCreateOrUpdateResponse>, VirtualMachinesCreateOrUpdateResponse>>;
beginCreateOrUpdateAndWait(resourceGroupName: string, referer: string, virtualMachineName: string, virtualMachineRequest: VirtualMachine, options?: VirtualMachinesCreateOrUpdateOptionalParams): Promise<VirtualMachinesCreateOrUpdateResponse>;
beginDelete(resourceGroupName: string, referer: string, virtualMachineName: string, options?: VirtualMachinesDeleteOptionalParams): Promise<PollerLike<PollOperationState<VirtualMachinesDeleteResponse>, VirtualMachinesDeleteResponse>>;
beginDeleteAndWait(resourceGroupName: string, referer: string, virtualMachineName: string, options?: VirtualMachinesDeleteOptionalParams): Promise<VirtualMachinesDeleteResponse>;
beginStart(resourceGroupName: string, referer: string, virtualMachineName: string, options?: VirtualMachinesStartOptionalParams): Promise<PollerLike<PollOperationState<void>, void>>;
beginStartAndWait(resourceGroupName: string, referer: string, virtualMachineName: string, options?: VirtualMachinesStartOptionalParams): Promise<void>;
beginStop(resourceGroupName: string, referer: string, virtualMachineName: string, options?: VirtualMachinesStopOptionalParams): Promise<PollerLike<PollOperationState<void>, void>>;
beginStopAndWait(resourceGroupName: string, referer: string, virtualMachineName: string, options?: VirtualMachinesStopOptionalParams): Promise<void>;
beginUpdate(resourceGroupName: string, virtualMachineName: string, virtualMachineRequest: PatchPayload, options?: VirtualMachinesUpdateOptionalParams): Promise<PollerLike<PollOperationState<VirtualMachinesUpdateResponse>, VirtualMachinesUpdateResponse>>;
beginUpdateAndWait(resourceGroupName: string, virtualMachineName: string, virtualMachineRequest: PatchPayload, options?: VirtualMachinesUpdateOptionalParams): Promise<VirtualMachinesUpdateResponse>;
get(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesGetOptionalParams): Promise<VirtualMachinesGetResponse>;
@ -1097,7 +1097,7 @@ export interface VirtualNic {
export class VMwareCloudSimple extends coreClient.ServiceClient {
// (undocumented)
$host: string;
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, referer: string, options?: VMwareCloudSimpleOptionalParams);
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: VMwareCloudSimpleOptionalParams);
// (undocumented)
apiVersion: string;
// (undocumented)
@ -1111,8 +1111,6 @@ export class VMwareCloudSimple extends coreClient.ServiceClient {
// (undocumented)
privateClouds: PrivateClouds;
// (undocumented)
referer: string;
// (undocumented)
resourcePools: ResourcePools;
// (undocumented)
skusAvailability: SkusAvailability;

Просмотреть файл

@ -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];

Просмотреть файл

@ -0,0 +1,4 @@
# App registration secret for AAD authentication
AZURE_CLIENT_SECRET=
AZURE_CLIENT_ID=
AZURE_TENANT_ID=

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns customization policy by its name
*
* @summary Returns customization policy by its name
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetCustomizationPolicy.json
*/
async function getCustomizationPolicy() {
const subscriptionId = "{subscription-id}";
const regionId = "myResourceGroup";
const pcName = "myPrivateCloud";
const customizationPolicyName = "Linux1";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.customizationPolicies.get(
regionId,
pcName,
customizationPolicyName
);
console.log(result);
}
getCustomizationPolicy().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns list of customization policies in region for private cloud
*
* @summary Returns list of customization policies in region for private cloud
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListCustomizationPolicies.json
*/
async function listCustomizationPolicies() {
const subscriptionId = "{subscription-id}";
const regionId = "myResourceGroup";
const pcName = "myPrivateCloud";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.customizationPolicies.list(regionId, pcName)) {
resArray.push(item);
}
console.log(resArray);
}
listCustomizationPolicies().catch(console.error);

Просмотреть файл

@ -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 {
DedicatedCloudNode,
VMwareCloudSimple
} from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns dedicated cloud node by its name
*
* @summary Returns dedicated cloud node by its name
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/CreateDedicatedCloudNode.json
*/
async function createDedicatedCloudNode() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const referer = "https://management.azure.com/";
const dedicatedCloudNodeName = "myNode";
const dedicatedCloudNodeRequest: DedicatedCloudNode = {
namePropertiesSkuDescriptionName: "CS28-Node",
availabilityZoneId: "az1",
idPropertiesSkuDescriptionId: "general",
location: "westus",
nodesCount: 1,
placementGroupId: "n1",
purchaseId: "56acbd46-3d36-4bbf-9b08-57c30fdf6932",
sku: { name: "VMware_CloudSimple_CS28" }
};
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.dedicatedCloudNodes.beginCreateOrUpdateAndWait(
resourceGroupName,
referer,
dedicatedCloudNodeName,
dedicatedCloudNodeRequest
);
console.log(result);
}
createDedicatedCloudNode().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Delete dedicated cloud node
*
* @summary Delete dedicated cloud node
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/DeleteDedicatedCloudNode.json
*/
async function deleteDedicatedCloudNode() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const dedicatedCloudNodeName = "myNode";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.dedicatedCloudNodes.delete(
resourceGroupName,
dedicatedCloudNodeName
);
console.log(result);
}
deleteDedicatedCloudNode().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns dedicated cloud node
*
* @summary Returns dedicated cloud node
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetDedicatedCloudNode.json
*/
async function getDedicatedCloudNode() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const dedicatedCloudNodeName = "myNode";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.dedicatedCloudNodes.get(
resourceGroupName,
dedicatedCloudNodeName
);
console.log(result);
}
getDedicatedCloudNode().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns list of dedicate cloud nodes within resource group
*
* @summary Returns list of dedicate cloud nodes within resource group
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListRGDedicatedCloudNodes.json
*/
async function listRgDedicatedCloudNodes() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.dedicatedCloudNodes.listByResourceGroup(
resourceGroupName
)) {
resArray.push(item);
}
console.log(resArray);
}
listRgDedicatedCloudNodes().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns list of dedicate cloud nodes within subscription
*
* @summary Returns list of dedicate cloud nodes within subscription
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListDedicatedCloudNodes.json
*/
async function listDedicatedCloudNodes() {
const subscriptionId = "{subscription-id}";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.dedicatedCloudNodes.listBySubscription()) {
resArray.push(item);
}
console.log(resArray);
}
listDedicatedCloudNodes().catch(console.error);

Просмотреть файл

@ -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 { PatchPayload, VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Patches dedicated node properties
*
* @summary Patches dedicated node properties
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/PatchDedicatedCloudNode.json
*/
async function patchDedicatedCloudNode() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const dedicatedCloudNodeName = "myNode";
const dedicatedCloudNodeRequest: PatchPayload = {
tags: { myTag: "tagValue" }
};
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.dedicatedCloudNodes.update(
resourceGroupName,
dedicatedCloudNodeName,
dedicatedCloudNodeRequest
);
console.log(result);
}
patchDedicatedCloudNode().catch(console.error);

Просмотреть файл

@ -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 {
DedicatedCloudService,
VMwareCloudSimple
} from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Create dedicate cloud service
*
* @summary Create dedicate cloud service
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/CreateDedicatedCloudService.json
*/
async function createDedicatedCloudService() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const dedicatedCloudServiceName = "myService";
const dedicatedCloudServiceRequest: DedicatedCloudService = {
gatewaySubnet: "10.0.0.0",
location: "westus"
};
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.dedicatedCloudServices.createOrUpdate(
resourceGroupName,
dedicatedCloudServiceName,
dedicatedCloudServiceRequest
);
console.log(result);
}
createDedicatedCloudService().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Delete dedicate cloud service
*
* @summary Delete dedicate cloud service
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/DeleteDedicatedCloudService.json
*/
async function deleteDedicatedCloudService() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const dedicatedCloudServiceName = "myService";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.dedicatedCloudServices.beginDeleteAndWait(
resourceGroupName,
dedicatedCloudServiceName
);
console.log(result);
}
deleteDedicatedCloudService().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns Dedicate Cloud Service
*
* @summary Returns Dedicate Cloud Service
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetDedicatedCloudService.json
*/
async function getDedicatedCloudService() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const dedicatedCloudServiceName = "myService";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.dedicatedCloudServices.get(
resourceGroupName,
dedicatedCloudServiceName
);
console.log(result);
}
getDedicatedCloudService().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns list of dedicated cloud services within a resource group
*
* @summary Returns list of dedicated cloud services within a resource group
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListRGDedicatedCloudServices.json
*/
async function listRgDedicatedCloudServices() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.dedicatedCloudServices.listByResourceGroup(
resourceGroupName
)) {
resArray.push(item);
}
console.log(resArray);
}
listRgDedicatedCloudServices().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns list of dedicated cloud services within a subscription
*
* @summary Returns list of dedicated cloud services within a subscription
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListDedicatedCloudServices.json
*/
async function listDedicatedCloudServices() {
const subscriptionId = "{subscription-id}";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.dedicatedCloudServices.listBySubscription()) {
resArray.push(item);
}
console.log(resArray);
}
listDedicatedCloudServices().catch(console.error);

Просмотреть файл

@ -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 { PatchPayload, VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Patch dedicated cloud service's properties
*
* @summary Patch dedicated cloud service's properties
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/PatchDedicatedService.json
*/
async function patchDedicatedService() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const dedicatedCloudServiceName = "myService";
const dedicatedCloudServiceRequest: PatchPayload = {
tags: { myTag: "tagValue" }
};
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.dedicatedCloudServices.update(
resourceGroupName,
dedicatedCloudServiceName,
dedicatedCloudServiceRequest
);
console.log(result);
}
patchDedicatedService().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Return an async operation
*
* @summary Return an async operation
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetFailedOperationResult.json
*/
async function getFailedOperationResult() {
const subscriptionId = "{subscription-id}";
const regionId = "westus2";
const referer = "https://management.azure.com/";
const operationId = "d030bb3f-7d53-11e9-8e09-9a86872085ff";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.operations.get(regionId, referer, operationId);
console.log(result);
}
getFailedOperationResult().catch(console.error);
/**
* This sample demonstrates how to Return an async operation
*
* @summary Return an async operation
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetOperationResult.json
*/
async function getOperationResult() {
const subscriptionId = "{subscription-id}";
const regionId = "westus2";
const referer = "https://management.azure.com/";
const operationId = "f8e1c8f1-7d52-11e9-8e07-9a86872085ff";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.operations.get(regionId, referer, operationId);
console.log(result);
}
getOperationResult().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Return list of operations
*
* @summary Return list of operations
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListOperations.json
*/
async function listOperations() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.operations.list()) {
resArray.push(item);
}
console.log(resArray);
}
listOperations().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns private cloud by its name
*
* @summary Returns private cloud by its name
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetPrivateCloud.json
*/
async function getPrivateCloud() {
const subscriptionId = "{subscription-id}";
const pcName = "myPrivateCloud";
const regionId = "westus2";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.privateClouds.get(pcName, regionId);
console.log(result);
}
getPrivateCloud().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns list of private clouds in particular region
*
* @summary Returns list of private clouds in particular region
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListPrivateCloudInLocation.json
*/
async function listPrivateCloudInLocation() {
const subscriptionId = "{subscription-id}";
const regionId = "eastus";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.privateClouds.list(regionId)) {
resArray.push(item);
}
console.log(resArray);
}
listPrivateCloudInLocation().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns resource pool templates by its name
*
* @summary Returns resource pool templates by its name
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetResourcePool.json
*/
async function getResourcePool() {
const subscriptionId = "{subscription-id}";
const regionId = "westus2";
const pcName = "myPrivateCloud";
const resourcePoolName = "resgroup-26";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.resourcePools.get(
regionId,
pcName,
resourcePoolName
);
console.log(result);
}
getResourcePool().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns list of resource pools in region for private cloud
*
* @summary Returns list of resource pools in region for private cloud
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListResourcePools.json
*/
async function listResourcePools() {
const subscriptionId = "{subscription-id}";
const regionId = "westus2";
const pcName = "myPrivateCloud";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.resourcePools.list(regionId, pcName)) {
resArray.push(item);
}
console.log(resArray);
}
listResourcePools().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns list of available resources in region
*
* @summary Returns list of available resources in region
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListAvailabilities.json
*/
async function listAvailabilities() {
const subscriptionId = "{subscription-id}";
const regionId = "westus2";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.skusAvailability.list(regionId)) {
resArray.push(item);
}
console.log(resArray);
}
listAvailabilities().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns list of usage in region
*
* @summary Returns list of usage in region
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListUsages.json
*/
async function listUsages() {
const subscriptionId = "{subscription-id}";
const regionId = "westus2";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.usages.list(regionId)) {
resArray.push(item);
}
console.log(resArray);
}
listUsages().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns virtual machine templates by its name
*
* @summary Returns virtual machine templates by its name
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetVirtualMachineTemplate.json
*/
async function getVirtualMachineTemplate() {
const subscriptionId = "{subscription-id}";
const regionId = "westus2";
const pcName = "myPrivateCloud";
const virtualMachineTemplateName = "vm-34";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.virtualMachineTemplates.get(
regionId,
pcName,
virtualMachineTemplateName
);
console.log(result);
}
getVirtualMachineTemplate().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns list of virtual machine templates in region for private cloud
*
* @summary Returns list of virtual machine templates in region for private cloud
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListVirtualMachineTemplates.json
*/
async function listVirtualMachineTemplates() {
const subscriptionId = "{subscription-id}";
const pcName = "myPrivateCloud";
const regionId = "westus2";
const resourcePoolName =
"/subscriptions/{subscription-id}/providers/Microsoft.VMwareCloudSimple/locations/westus2/privateClouds/myPrivateCloud/resourcePools/resgroup-26";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.virtualMachineTemplates.list(
pcName,
regionId,
resourcePoolName
)) {
resArray.push(item);
}
console.log(resArray);
}
listVirtualMachineTemplates().catch(console.error);

Просмотреть файл

@ -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 {
VirtualMachine,
VMwareCloudSimple
} from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Create Or Update Virtual Machine
*
* @summary Create Or Update Virtual Machine
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/CreateVirtualMachine.json
*/
async function createVirtualMachine() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const referer = "https://management.azure.com/";
const virtualMachineName = "myVirtualMachine";
const virtualMachineRequest: VirtualMachine = {
amountOfRam: 4096,
disks: [
{
controllerId: "1000",
independenceMode: "persistent",
totalSize: 10485760,
virtualDiskId: "2000"
}
],
location: "westus2",
nics: [
{
network: {
id:
"/subscriptions/{subscription-id}/providers/Microsoft.VMwareCloudSimple/locations/westus2/privateClouds/myPrivateCloud/virtualNetworks/dvportgroup-19"
},
nicType: "E1000",
powerOnBoot: true,
virtualNicId: "4000"
}
],
numberOfCores: 2,
privateCloudId:
"/subscriptions/{subscription-id}/providers/Microsoft.VMwareCloudSimple/locations/westus2/privateClouds/myPrivateCloud",
resourcePool: {
id:
"/subscriptions/{subscription-id}/providers/Microsoft.VMwareCloudSimple/locations/westus2/privateClouds/myPrivateCloud/resourcePools/resgroup-26"
},
templateId:
"/subscriptions/{subscription-id}/providers/Microsoft.VMwareCloudSimple/locations/westus2/privateClouds/myPrivateCloud/virtualMachineTemplates/vm-34"
};
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.virtualMachines.beginCreateOrUpdateAndWait(
resourceGroupName,
referer,
virtualMachineName,
virtualMachineRequest
);
console.log(result);
}
createVirtualMachine().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Delete virtual machine
*
* @summary Delete virtual machine
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/DeleteVirtualMachine.json
*/
async function deleteVirtualMachine() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const referer = "https://management.azure.com/";
const virtualMachineName = "myVirtualMachine";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.virtualMachines.beginDeleteAndWait(
resourceGroupName,
referer,
virtualMachineName
);
console.log(result);
}
deleteVirtualMachine().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Get virtual machine
*
* @summary Get virtual machine
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetVirtualMachine.json
*/
async function getVirtualMachine() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const virtualMachineName = "myVirtualMachine";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.virtualMachines.get(
resourceGroupName,
virtualMachineName
);
console.log(result);
}
getVirtualMachine().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns list of virtual machine within resource group
*
* @summary Returns list of virtual machine within resource group
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListRGVirtualMachines.json
*/
async function listRgVirtualMachines() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.virtualMachines.listByResourceGroup(
resourceGroupName
)) {
resArray.push(item);
}
console.log(resArray);
}
listRgVirtualMachines().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns list virtual machine within subscription
*
* @summary Returns list virtual machine within subscription
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListVirtualMachines.json
*/
async function listVirtualMachines() {
const subscriptionId = "{subscription-id}";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.virtualMachines.listBySubscription()) {
resArray.push(item);
}
console.log(resArray);
}
listVirtualMachines().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Power on virtual machine
*
* @summary Power on virtual machine
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/StartVirtualMachine.json
*/
async function startVirtualMachine() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const referer = "https://management.azure.com/";
const virtualMachineName = "myVirtualMachine";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.virtualMachines.beginStartAndWait(
resourceGroupName,
referer,
virtualMachineName
);
console.log(result);
}
startVirtualMachine().catch(console.error);

Просмотреть файл

@ -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 {
VirtualMachineStopMode,
VirtualMachinesStopOptionalParams,
VMwareCloudSimple
} from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Power off virtual machine, options: shutdown, poweroff, and suspend
*
* @summary Power off virtual machine, options: shutdown, poweroff, and suspend
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/StopInBodyVirtualMachine.json
*/
async function stopInBodyVirtualMachine() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const referer = "https://management.azure.com/";
const virtualMachineName = "myVirtualMachine";
const m: VirtualMachineStopMode = {};
const options: VirtualMachinesStopOptionalParams = { m };
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.virtualMachines.beginStopAndWait(
resourceGroupName,
referer,
virtualMachineName,
options
);
console.log(result);
}
stopInBodyVirtualMachine().catch(console.error);
/**
* This sample demonstrates how to Power off virtual machine, options: shutdown, poweroff, and suspend
*
* @summary Power off virtual machine, options: shutdown, poweroff, and suspend
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/StopInQueryVirtualMachine.json
*/
async function stopInQueryVirtualMachine() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const referer = "https://management.azure.com/";
const virtualMachineName = "myVirtualMachine";
const mode = "suspend";
const options: VirtualMachinesStopOptionalParams = { mode };
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.virtualMachines.beginStopAndWait(
resourceGroupName,
referer,
virtualMachineName,
options
);
console.log(result);
}
stopInQueryVirtualMachine().catch(console.error);

Просмотреть файл

@ -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 { PatchPayload, VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Patch virtual machine properties
*
* @summary Patch virtual machine properties
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/PatchVirtualMachine.json
*/
async function patchVirtualMachine() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const virtualMachineName = "myVirtualMachine";
const virtualMachineRequest: PatchPayload = { tags: { myTag: "tagValue" } };
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.virtualMachines.beginUpdateAndWait(
resourceGroupName,
virtualMachineName,
virtualMachineRequest
);
console.log(result);
}
patchVirtualMachine().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Return virtual network by its name
*
* @summary Return virtual network by its name
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetVirtualNetwork.json
*/
async function getVirtualNetwork() {
const subscriptionId = "{subscription-id}";
const regionId = "westus2";
const pcName = "myPrivateCloud";
const virtualNetworkName = "dvportgroup-19";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.virtualNetworks.get(
regionId,
pcName,
virtualNetworkName
);
console.log(result);
}
getVirtualNetwork().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Return list of virtual networks in location for private cloud
*
* @summary Return list of virtual networks in location for private cloud
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListVirtualNetworks.json
*/
async function listVirtualNetworks() {
const subscriptionId = "{subscription-id}";
const regionId = "westus2";
const pcName = "myPrivateCloud";
const resourcePoolName =
"/subscriptions/{subscription-id}/providers/Microsoft.VMwareCloudSimple/locations/westus2/privateClouds/myPrivateCloud/resourcePools/resgroup-26";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.virtualNetworks.list(
regionId,
pcName,
resourcePoolName
)) {
resArray.push(item);
}
console.log(resArray);
}
listVirtualNetworks().catch(console.error);

Просмотреть файл

@ -0,0 +1,116 @@
# client library samples for JavaScript
These sample programs show how to use the JavaScript client libraries for in some common scenarios.
| **File Name** | **Description** |
| ----------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [customizationPoliciesGetSample.js][customizationpoliciesgetsample] | Returns customization policy by its name x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetCustomizationPolicy.json |
| [customizationPoliciesListSample.js][customizationpolicieslistsample] | Returns list of customization policies in region for private cloud x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListCustomizationPolicies.json |
| [dedicatedCloudNodesCreateOrUpdateSample.js][dedicatedcloudnodescreateorupdatesample] | Returns dedicated cloud node by its name x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/CreateDedicatedCloudNode.json |
| [dedicatedCloudNodesDeleteSample.js][dedicatedcloudnodesdeletesample] | Delete dedicated cloud node x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/DeleteDedicatedCloudNode.json |
| [dedicatedCloudNodesGetSample.js][dedicatedcloudnodesgetsample] | Returns dedicated cloud node x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetDedicatedCloudNode.json |
| [dedicatedCloudNodesListByResourceGroupSample.js][dedicatedcloudnodeslistbyresourcegroupsample] | Returns list of dedicate cloud nodes within resource group x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListRGDedicatedCloudNodes.json |
| [dedicatedCloudNodesListBySubscriptionSample.js][dedicatedcloudnodeslistbysubscriptionsample] | Returns list of dedicate cloud nodes within subscription x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListDedicatedCloudNodes.json |
| [dedicatedCloudNodesUpdateSample.js][dedicatedcloudnodesupdatesample] | Patches dedicated node properties x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/PatchDedicatedCloudNode.json |
| [dedicatedCloudServicesCreateOrUpdateSample.js][dedicatedcloudservicescreateorupdatesample] | Create dedicate cloud service x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/CreateDedicatedCloudService.json |
| [dedicatedCloudServicesDeleteSample.js][dedicatedcloudservicesdeletesample] | Delete dedicate cloud service x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/DeleteDedicatedCloudService.json |
| [dedicatedCloudServicesGetSample.js][dedicatedcloudservicesgetsample] | Returns Dedicate Cloud Service x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetDedicatedCloudService.json |
| [dedicatedCloudServicesListByResourceGroupSample.js][dedicatedcloudserviceslistbyresourcegroupsample] | Returns list of dedicated cloud services within a resource group x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListRGDedicatedCloudServices.json |
| [dedicatedCloudServicesListBySubscriptionSample.js][dedicatedcloudserviceslistbysubscriptionsample] | Returns list of dedicated cloud services within a subscription x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListDedicatedCloudServices.json |
| [dedicatedCloudServicesUpdateSample.js][dedicatedcloudservicesupdatesample] | Patch dedicated cloud service's properties x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/PatchDedicatedService.json |
| [operationsGetSample.js][operationsgetsample] | Return an async operation x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetFailedOperationResult.json |
| [operationsListSample.js][operationslistsample] | Return list of operations x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListOperations.json |
| [privateCloudsGetSample.js][privatecloudsgetsample] | Returns private cloud by its name x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetPrivateCloud.json |
| [privateCloudsListSample.js][privatecloudslistsample] | Returns list of private clouds in particular region x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListPrivateCloudInLocation.json |
| [resourcePoolsGetSample.js][resourcepoolsgetsample] | Returns resource pool templates by its name x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetResourcePool.json |
| [resourcePoolsListSample.js][resourcepoolslistsample] | Returns list of resource pools in region for private cloud x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListResourcePools.json |
| [skusAvailabilityListSample.js][skusavailabilitylistsample] | Returns list of available resources in region x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListAvailabilities.json |
| [usagesListSample.js][usageslistsample] | Returns list of usage in region x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListUsages.json |
| [virtualMachineTemplatesGetSample.js][virtualmachinetemplatesgetsample] | Returns virtual machine templates by its name x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetVirtualMachineTemplate.json |
| [virtualMachineTemplatesListSample.js][virtualmachinetemplateslistsample] | Returns list of virtual machine templates in region for private cloud x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListVirtualMachineTemplates.json |
| [virtualMachinesCreateOrUpdateSample.js][virtualmachinescreateorupdatesample] | Create Or Update Virtual Machine x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/CreateVirtualMachine.json |
| [virtualMachinesDeleteSample.js][virtualmachinesdeletesample] | Delete virtual machine x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/DeleteVirtualMachine.json |
| [virtualMachinesGetSample.js][virtualmachinesgetsample] | Get virtual machine x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetVirtualMachine.json |
| [virtualMachinesListByResourceGroupSample.js][virtualmachineslistbyresourcegroupsample] | Returns list of virtual machine within resource group x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListRGVirtualMachines.json |
| [virtualMachinesListBySubscriptionSample.js][virtualmachineslistbysubscriptionsample] | Returns list virtual machine within subscription x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListVirtualMachines.json |
| [virtualMachinesStartSample.js][virtualmachinesstartsample] | Power on virtual machine x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/StartVirtualMachine.json |
| [virtualMachinesStopSample.js][virtualmachinesstopsample] | Power off virtual machine, options: shutdown, poweroff, and suspend x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/StopInBodyVirtualMachine.json |
| [virtualMachinesUpdateSample.js][virtualmachinesupdatesample] | Patch virtual machine properties x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/PatchVirtualMachine.json |
| [virtualNetworksGetSample.js][virtualnetworksgetsample] | Return virtual network by its name x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetVirtualNetwork.json |
| [virtualNetworksListSample.js][virtualnetworkslistsample] | Return list of virtual networks in location for private cloud x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListVirtualNetworks.json |
## Prerequisites
The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/).
You need [an Azure subscription][freesub] to run these sample programs.
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
## Setup
To run the samples using the published version of the package:
1. Install the dependencies using `npm`:
```bash
npm install
```
2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
3. Run whichever samples you like (note that some samples may require additional setup, see the table above):
```bash
node customizationPoliciesGetSample.js
```
Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform):
```bash
npx cross-env node customizationPoliciesGetSample.js
```
## Next Steps
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
[customizationpoliciesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/customizationPoliciesGetSample.js
[customizationpolicieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/customizationPoliciesListSample.js
[dedicatedcloudnodescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/dedicatedCloudNodesCreateOrUpdateSample.js
[dedicatedcloudnodesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/dedicatedCloudNodesDeleteSample.js
[dedicatedcloudnodesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/dedicatedCloudNodesGetSample.js
[dedicatedcloudnodeslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/dedicatedCloudNodesListByResourceGroupSample.js
[dedicatedcloudnodeslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/dedicatedCloudNodesListBySubscriptionSample.js
[dedicatedcloudnodesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/dedicatedCloudNodesUpdateSample.js
[dedicatedcloudservicescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/dedicatedCloudServicesCreateOrUpdateSample.js
[dedicatedcloudservicesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/dedicatedCloudServicesDeleteSample.js
[dedicatedcloudservicesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/dedicatedCloudServicesGetSample.js
[dedicatedcloudserviceslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/dedicatedCloudServicesListByResourceGroupSample.js
[dedicatedcloudserviceslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/dedicatedCloudServicesListBySubscriptionSample.js
[dedicatedcloudservicesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/dedicatedCloudServicesUpdateSample.js
[operationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/operationsGetSample.js
[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/operationsListSample.js
[privatecloudsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/privateCloudsGetSample.js
[privatecloudslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/privateCloudsListSample.js
[resourcepoolsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/resourcePoolsGetSample.js
[resourcepoolslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/resourcePoolsListSample.js
[skusavailabilitylistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/skusAvailabilityListSample.js
[usageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/usagesListSample.js
[virtualmachinetemplatesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/virtualMachineTemplatesGetSample.js
[virtualmachinetemplateslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/virtualMachineTemplatesListSample.js
[virtualmachinescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/virtualMachinesCreateOrUpdateSample.js
[virtualmachinesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/virtualMachinesDeleteSample.js
[virtualmachinesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/virtualMachinesGetSample.js
[virtualmachineslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/virtualMachinesListByResourceGroupSample.js
[virtualmachineslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/virtualMachinesListBySubscriptionSample.js
[virtualmachinesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/virtualMachinesStartSample.js
[virtualmachinesstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/virtualMachinesStopSample.js
[virtualmachinesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/virtualMachinesUpdateSample.js
[virtualnetworksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/virtualNetworksGetSample.js
[virtualnetworkslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/javascript/virtualNetworksListSample.js
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-vmwarecloudsimple?view=azure-node-preview
[freesub]: https://azure.microsoft.com/free/
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/README.md

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Returns customization policy by its name
*
* @summary Returns customization policy by its name
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetCustomizationPolicy.json
*/
async function getCustomizationPolicy() {
const subscriptionId = "{subscription-id}";
const regionId = "myResourceGroup";
const pcName = "myPrivateCloud";
const customizationPolicyName = "Linux1";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.customizationPolicies.get(regionId, pcName, customizationPolicyName);
console.log(result);
}
getCustomizationPolicy().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Returns list of customization policies in region for private cloud
*
* @summary Returns list of customization policies in region for private cloud
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListCustomizationPolicies.json
*/
async function listCustomizationPolicies() {
const subscriptionId = "{subscription-id}";
const regionId = "myResourceGroup";
const pcName = "myPrivateCloud";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.customizationPolicies.list(regionId, pcName)) {
resArray.push(item);
}
console.log(resArray);
}
listCustomizationPolicies().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Returns dedicated cloud node by its name
*
* @summary Returns dedicated cloud node by its name
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/CreateDedicatedCloudNode.json
*/
async function createDedicatedCloudNode() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const referer = "https://management.azure.com/";
const dedicatedCloudNodeName = "myNode";
const dedicatedCloudNodeRequest = {
namePropertiesSkuDescriptionName: "CS28-Node",
availabilityZoneId: "az1",
idPropertiesSkuDescriptionId: "general",
location: "westus",
nodesCount: 1,
placementGroupId: "n1",
purchaseId: "56acbd46-3d36-4bbf-9b08-57c30fdf6932",
sku: { name: "VMware_CloudSimple_CS28" },
};
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.dedicatedCloudNodes.beginCreateOrUpdateAndWait(
resourceGroupName,
referer,
dedicatedCloudNodeName,
dedicatedCloudNodeRequest
);
console.log(result);
}
createDedicatedCloudNode().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Delete dedicated cloud node
*
* @summary Delete dedicated cloud node
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/DeleteDedicatedCloudNode.json
*/
async function deleteDedicatedCloudNode() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const dedicatedCloudNodeName = "myNode";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.dedicatedCloudNodes.delete(resourceGroupName, dedicatedCloudNodeName);
console.log(result);
}
deleteDedicatedCloudNode().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Returns dedicated cloud node
*
* @summary Returns dedicated cloud node
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetDedicatedCloudNode.json
*/
async function getDedicatedCloudNode() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const dedicatedCloudNodeName = "myNode";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.dedicatedCloudNodes.get(resourceGroupName, dedicatedCloudNodeName);
console.log(result);
}
getDedicatedCloudNode().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Returns list of dedicate cloud nodes within resource group
*
* @summary Returns list of dedicate cloud nodes within resource group
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListRGDedicatedCloudNodes.json
*/
async function listRgDedicatedCloudNodes() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.dedicatedCloudNodes.listByResourceGroup(resourceGroupName)) {
resArray.push(item);
}
console.log(resArray);
}
listRgDedicatedCloudNodes().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Returns list of dedicate cloud nodes within subscription
*
* @summary Returns list of dedicate cloud nodes within subscription
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListDedicatedCloudNodes.json
*/
async function listDedicatedCloudNodes() {
const subscriptionId = "{subscription-id}";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.dedicatedCloudNodes.listBySubscription()) {
resArray.push(item);
}
console.log(resArray);
}
listDedicatedCloudNodes().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Patches dedicated node properties
*
* @summary Patches dedicated node properties
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/PatchDedicatedCloudNode.json
*/
async function patchDedicatedCloudNode() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const dedicatedCloudNodeName = "myNode";
const dedicatedCloudNodeRequest = {
tags: { myTag: "tagValue" },
};
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.dedicatedCloudNodes.update(
resourceGroupName,
dedicatedCloudNodeName,
dedicatedCloudNodeRequest
);
console.log(result);
}
patchDedicatedCloudNode().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create dedicate cloud service
*
* @summary Create dedicate cloud service
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/CreateDedicatedCloudService.json
*/
async function createDedicatedCloudService() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const dedicatedCloudServiceName = "myService";
const dedicatedCloudServiceRequest = {
gatewaySubnet: "10.0.0.0",
location: "westus",
};
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.dedicatedCloudServices.createOrUpdate(
resourceGroupName,
dedicatedCloudServiceName,
dedicatedCloudServiceRequest
);
console.log(result);
}
createDedicatedCloudService().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Delete dedicate cloud service
*
* @summary Delete dedicate cloud service
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/DeleteDedicatedCloudService.json
*/
async function deleteDedicatedCloudService() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const dedicatedCloudServiceName = "myService";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.dedicatedCloudServices.beginDeleteAndWait(
resourceGroupName,
dedicatedCloudServiceName
);
console.log(result);
}
deleteDedicatedCloudService().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Returns Dedicate Cloud Service
*
* @summary Returns Dedicate Cloud Service
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetDedicatedCloudService.json
*/
async function getDedicatedCloudService() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const dedicatedCloudServiceName = "myService";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.dedicatedCloudServices.get(
resourceGroupName,
dedicatedCloudServiceName
);
console.log(result);
}
getDedicatedCloudService().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Returns list of dedicated cloud services within a resource group
*
* @summary Returns list of dedicated cloud services within a resource group
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListRGDedicatedCloudServices.json
*/
async function listRgDedicatedCloudServices() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.dedicatedCloudServices.listByResourceGroup(resourceGroupName)) {
resArray.push(item);
}
console.log(resArray);
}
listRgDedicatedCloudServices().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Returns list of dedicated cloud services within a subscription
*
* @summary Returns list of dedicated cloud services within a subscription
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListDedicatedCloudServices.json
*/
async function listDedicatedCloudServices() {
const subscriptionId = "{subscription-id}";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.dedicatedCloudServices.listBySubscription()) {
resArray.push(item);
}
console.log(resArray);
}
listDedicatedCloudServices().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Patch dedicated cloud service's properties
*
* @summary Patch dedicated cloud service's properties
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/PatchDedicatedService.json
*/
async function patchDedicatedService() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const dedicatedCloudServiceName = "myService";
const dedicatedCloudServiceRequest = {
tags: { myTag: "tagValue" },
};
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.dedicatedCloudServices.update(
resourceGroupName,
dedicatedCloudServiceName,
dedicatedCloudServiceRequest
);
console.log(result);
}
patchDedicatedService().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Return an async operation
*
* @summary Return an async operation
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetFailedOperationResult.json
*/
async function getFailedOperationResult() {
const subscriptionId = "{subscription-id}";
const regionId = "westus2";
const referer = "https://management.azure.com/";
const operationId = "d030bb3f-7d53-11e9-8e09-9a86872085ff";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.operations.get(regionId, referer, operationId);
console.log(result);
}
getFailedOperationResult().catch(console.error);
/**
* This sample demonstrates how to Return an async operation
*
* @summary Return an async operation
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetOperationResult.json
*/
async function getOperationResult() {
const subscriptionId = "{subscription-id}";
const regionId = "westus2";
const referer = "https://management.azure.com/";
const operationId = "f8e1c8f1-7d52-11e9-8e07-9a86872085ff";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.operations.get(regionId, referer, operationId);
console.log(result);
}
getOperationResult().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Return list of operations
*
* @summary Return list of operations
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListOperations.json
*/
async function listOperations() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.operations.list()) {
resArray.push(item);
}
console.log(resArray);
}
listOperations().catch(console.error);

Просмотреть файл

@ -0,0 +1,32 @@
{
"name": "@azure-samples/arm-vmwarecloudsimple-js",
"private": true,
"version": "1.0.0",
"description": " client library samples for JavaScript",
"engines": {
"node": ">=12.0.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
"directory": "sdk/vmwarecloudsimple/arm-vmwarecloudsimple"
},
"keywords": [
"node",
"azure",
"typescript",
"browser",
"isomorphic"
],
"author": "Microsoft Corporation",
"license": "MIT",
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple",
"dependencies": {
"@azure/arm-vmwarecloudsimple": "latest",
"dotenv": "latest",
"@azure/identity": "^2.0.1"
}
}

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Returns private cloud by its name
*
* @summary Returns private cloud by its name
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetPrivateCloud.json
*/
async function getPrivateCloud() {
const subscriptionId = "{subscription-id}";
const pcName = "myPrivateCloud";
const regionId = "westus2";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.privateClouds.get(pcName, regionId);
console.log(result);
}
getPrivateCloud().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Returns list of private clouds in particular region
*
* @summary Returns list of private clouds in particular region
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListPrivateCloudInLocation.json
*/
async function listPrivateCloudInLocation() {
const subscriptionId = "{subscription-id}";
const regionId = "eastus";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.privateClouds.list(regionId)) {
resArray.push(item);
}
console.log(resArray);
}
listPrivateCloudInLocation().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Returns resource pool templates by its name
*
* @summary Returns resource pool templates by its name
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetResourcePool.json
*/
async function getResourcePool() {
const subscriptionId = "{subscription-id}";
const regionId = "westus2";
const pcName = "myPrivateCloud";
const resourcePoolName = "resgroup-26";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.resourcePools.get(regionId, pcName, resourcePoolName);
console.log(result);
}
getResourcePool().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Returns list of resource pools in region for private cloud
*
* @summary Returns list of resource pools in region for private cloud
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListResourcePools.json
*/
async function listResourcePools() {
const subscriptionId = "{subscription-id}";
const regionId = "westus2";
const pcName = "myPrivateCloud";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.resourcePools.list(regionId, pcName)) {
resArray.push(item);
}
console.log(resArray);
}
listResourcePools().catch(console.error);

Просмотреть файл

@ -0,0 +1,4 @@
# App registration secret for AAD authentication
AZURE_CLIENT_SECRET=
AZURE_CLIENT_ID=
AZURE_TENANT_ID=

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Returns list of available resources in region
*
* @summary Returns list of available resources in region
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListAvailabilities.json
*/
async function listAvailabilities() {
const subscriptionId = "{subscription-id}";
const regionId = "westus2";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.skusAvailability.list(regionId)) {
resArray.push(item);
}
console.log(resArray);
}
listAvailabilities().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Returns list of usage in region
*
* @summary Returns list of usage in region
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListUsages.json
*/
async function listUsages() {
const subscriptionId = "{subscription-id}";
const regionId = "westus2";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.usages.list(regionId)) {
resArray.push(item);
}
console.log(resArray);
}
listUsages().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Returns virtual machine templates by its name
*
* @summary Returns virtual machine templates by its name
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetVirtualMachineTemplate.json
*/
async function getVirtualMachineTemplate() {
const subscriptionId = "{subscription-id}";
const regionId = "westus2";
const pcName = "myPrivateCloud";
const virtualMachineTemplateName = "vm-34";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.virtualMachineTemplates.get(
regionId,
pcName,
virtualMachineTemplateName
);
console.log(result);
}
getVirtualMachineTemplate().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Returns list of virtual machine templates in region for private cloud
*
* @summary Returns list of virtual machine templates in region for private cloud
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListVirtualMachineTemplates.json
*/
async function listVirtualMachineTemplates() {
const subscriptionId = "{subscription-id}";
const pcName = "myPrivateCloud";
const regionId = "westus2";
const resourcePoolName =
"/subscriptions/{subscription-id}/providers/Microsoft.VMwareCloudSimple/locations/westus2/privateClouds/myPrivateCloud/resourcePools/resgroup-26";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.virtualMachineTemplates.list(pcName, regionId, resourcePoolName)) {
resArray.push(item);
}
console.log(resArray);
}
listVirtualMachineTemplates().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create Or Update Virtual Machine
*
* @summary Create Or Update Virtual Machine
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/CreateVirtualMachine.json
*/
async function createVirtualMachine() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const referer = "https://management.azure.com/";
const virtualMachineName = "myVirtualMachine";
const virtualMachineRequest = {
amountOfRam: 4096,
disks: [
{
controllerId: "1000",
independenceMode: "persistent",
totalSize: 10485760,
virtualDiskId: "2000",
},
],
location: "westus2",
nics: [
{
network: {
id: "/subscriptions/{subscription-id}/providers/Microsoft.VMwareCloudSimple/locations/westus2/privateClouds/myPrivateCloud/virtualNetworks/dvportgroup-19",
},
nicType: "E1000",
powerOnBoot: true,
virtualNicId: "4000",
},
],
numberOfCores: 2,
privateCloudId:
"/subscriptions/{subscription-id}/providers/Microsoft.VMwareCloudSimple/locations/westus2/privateClouds/myPrivateCloud",
resourcePool: {
id: "/subscriptions/{subscription-id}/providers/Microsoft.VMwareCloudSimple/locations/westus2/privateClouds/myPrivateCloud/resourcePools/resgroup-26",
},
templateId:
"/subscriptions/{subscription-id}/providers/Microsoft.VMwareCloudSimple/locations/westus2/privateClouds/myPrivateCloud/virtualMachineTemplates/vm-34",
};
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.virtualMachines.beginCreateOrUpdateAndWait(
resourceGroupName,
referer,
virtualMachineName,
virtualMachineRequest
);
console.log(result);
}
createVirtualMachine().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Delete virtual machine
*
* @summary Delete virtual machine
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/DeleteVirtualMachine.json
*/
async function deleteVirtualMachine() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const referer = "https://management.azure.com/";
const virtualMachineName = "myVirtualMachine";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.virtualMachines.beginDeleteAndWait(
resourceGroupName,
referer,
virtualMachineName
);
console.log(result);
}
deleteVirtualMachine().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get virtual machine
*
* @summary Get virtual machine
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetVirtualMachine.json
*/
async function getVirtualMachine() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const virtualMachineName = "myVirtualMachine";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.virtualMachines.get(resourceGroupName, virtualMachineName);
console.log(result);
}
getVirtualMachine().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Returns list of virtual machine within resource group
*
* @summary Returns list of virtual machine within resource group
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListRGVirtualMachines.json
*/
async function listRgVirtualMachines() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.virtualMachines.listByResourceGroup(resourceGroupName)) {
resArray.push(item);
}
console.log(resArray);
}
listRgVirtualMachines().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Returns list virtual machine within subscription
*
* @summary Returns list virtual machine within subscription
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListVirtualMachines.json
*/
async function listVirtualMachines() {
const subscriptionId = "{subscription-id}";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.virtualMachines.listBySubscription()) {
resArray.push(item);
}
console.log(resArray);
}
listVirtualMachines().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Power on virtual machine
*
* @summary Power on virtual machine
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/StartVirtualMachine.json
*/
async function startVirtualMachine() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const referer = "https://management.azure.com/";
const virtualMachineName = "myVirtualMachine";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.virtualMachines.beginStartAndWait(
resourceGroupName,
referer,
virtualMachineName
);
console.log(result);
}
startVirtualMachine().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Power off virtual machine, options: shutdown, poweroff, and suspend
*
* @summary Power off virtual machine, options: shutdown, poweroff, and suspend
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/StopInBodyVirtualMachine.json
*/
async function stopInBodyVirtualMachine() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const referer = "https://management.azure.com/";
const virtualMachineName = "myVirtualMachine";
const m = {};
const options = { m };
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.virtualMachines.beginStopAndWait(
resourceGroupName,
referer,
virtualMachineName,
options
);
console.log(result);
}
stopInBodyVirtualMachine().catch(console.error);
/**
* This sample demonstrates how to Power off virtual machine, options: shutdown, poweroff, and suspend
*
* @summary Power off virtual machine, options: shutdown, poweroff, and suspend
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/StopInQueryVirtualMachine.json
*/
async function stopInQueryVirtualMachine() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const referer = "https://management.azure.com/";
const virtualMachineName = "myVirtualMachine";
const mode = "suspend";
const options = { mode };
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.virtualMachines.beginStopAndWait(
resourceGroupName,
referer,
virtualMachineName,
options
);
console.log(result);
}
stopInQueryVirtualMachine().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Patch virtual machine properties
*
* @summary Patch virtual machine properties
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/PatchVirtualMachine.json
*/
async function patchVirtualMachine() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const virtualMachineName = "myVirtualMachine";
const virtualMachineRequest = { tags: { myTag: "tagValue" } };
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.virtualMachines.beginUpdateAndWait(
resourceGroupName,
virtualMachineName,
virtualMachineRequest
);
console.log(result);
}
patchVirtualMachine().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Return virtual network by its name
*
* @summary Return virtual network by its name
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetVirtualNetwork.json
*/
async function getVirtualNetwork() {
const subscriptionId = "{subscription-id}";
const regionId = "westus2";
const pcName = "myPrivateCloud";
const virtualNetworkName = "dvportgroup-19";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.virtualNetworks.get(regionId, pcName, virtualNetworkName);
console.log(result);
}
getVirtualNetwork().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } = require("@azure/arm-vmwarecloudsimple");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Return list of virtual networks in location for private cloud
*
* @summary Return list of virtual networks in location for private cloud
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListVirtualNetworks.json
*/
async function listVirtualNetworks() {
const subscriptionId = "{subscription-id}";
const regionId = "westus2";
const pcName = "myPrivateCloud";
const resourcePoolName =
"/subscriptions/{subscription-id}/providers/Microsoft.VMwareCloudSimple/locations/westus2/privateClouds/myPrivateCloud/resourcePools/resgroup-26";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.virtualNetworks.list(regionId, pcName, resourcePoolName)) {
resArray.push(item);
}
console.log(resArray);
}
listVirtualNetworks().catch(console.error);

Просмотреть файл

@ -0,0 +1,129 @@
# client library samples for TypeScript
These sample programs show how to use the TypeScript client libraries for in some common scenarios.
| **File Name** | **Description** |
| ----------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [customizationPoliciesGetSample.ts][customizationpoliciesgetsample] | Returns customization policy by its name x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetCustomizationPolicy.json |
| [customizationPoliciesListSample.ts][customizationpolicieslistsample] | Returns list of customization policies in region for private cloud x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListCustomizationPolicies.json |
| [dedicatedCloudNodesCreateOrUpdateSample.ts][dedicatedcloudnodescreateorupdatesample] | Returns dedicated cloud node by its name x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/CreateDedicatedCloudNode.json |
| [dedicatedCloudNodesDeleteSample.ts][dedicatedcloudnodesdeletesample] | Delete dedicated cloud node x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/DeleteDedicatedCloudNode.json |
| [dedicatedCloudNodesGetSample.ts][dedicatedcloudnodesgetsample] | Returns dedicated cloud node x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetDedicatedCloudNode.json |
| [dedicatedCloudNodesListByResourceGroupSample.ts][dedicatedcloudnodeslistbyresourcegroupsample] | Returns list of dedicate cloud nodes within resource group x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListRGDedicatedCloudNodes.json |
| [dedicatedCloudNodesListBySubscriptionSample.ts][dedicatedcloudnodeslistbysubscriptionsample] | Returns list of dedicate cloud nodes within subscription x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListDedicatedCloudNodes.json |
| [dedicatedCloudNodesUpdateSample.ts][dedicatedcloudnodesupdatesample] | Patches dedicated node properties x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/PatchDedicatedCloudNode.json |
| [dedicatedCloudServicesCreateOrUpdateSample.ts][dedicatedcloudservicescreateorupdatesample] | Create dedicate cloud service x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/CreateDedicatedCloudService.json |
| [dedicatedCloudServicesDeleteSample.ts][dedicatedcloudservicesdeletesample] | Delete dedicate cloud service x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/DeleteDedicatedCloudService.json |
| [dedicatedCloudServicesGetSample.ts][dedicatedcloudservicesgetsample] | Returns Dedicate Cloud Service x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetDedicatedCloudService.json |
| [dedicatedCloudServicesListByResourceGroupSample.ts][dedicatedcloudserviceslistbyresourcegroupsample] | Returns list of dedicated cloud services within a resource group x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListRGDedicatedCloudServices.json |
| [dedicatedCloudServicesListBySubscriptionSample.ts][dedicatedcloudserviceslistbysubscriptionsample] | Returns list of dedicated cloud services within a subscription x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListDedicatedCloudServices.json |
| [dedicatedCloudServicesUpdateSample.ts][dedicatedcloudservicesupdatesample] | Patch dedicated cloud service's properties x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/PatchDedicatedService.json |
| [operationsGetSample.ts][operationsgetsample] | Return an async operation x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetFailedOperationResult.json |
| [operationsListSample.ts][operationslistsample] | Return list of operations x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListOperations.json |
| [privateCloudsGetSample.ts][privatecloudsgetsample] | Returns private cloud by its name x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetPrivateCloud.json |
| [privateCloudsListSample.ts][privatecloudslistsample] | Returns list of private clouds in particular region x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListPrivateCloudInLocation.json |
| [resourcePoolsGetSample.ts][resourcepoolsgetsample] | Returns resource pool templates by its name x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetResourcePool.json |
| [resourcePoolsListSample.ts][resourcepoolslistsample] | Returns list of resource pools in region for private cloud x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListResourcePools.json |
| [skusAvailabilityListSample.ts][skusavailabilitylistsample] | Returns list of available resources in region x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListAvailabilities.json |
| [usagesListSample.ts][usageslistsample] | Returns list of usage in region x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListUsages.json |
| [virtualMachineTemplatesGetSample.ts][virtualmachinetemplatesgetsample] | Returns virtual machine templates by its name x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetVirtualMachineTemplate.json |
| [virtualMachineTemplatesListSample.ts][virtualmachinetemplateslistsample] | Returns list of virtual machine templates in region for private cloud x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListVirtualMachineTemplates.json |
| [virtualMachinesCreateOrUpdateSample.ts][virtualmachinescreateorupdatesample] | Create Or Update Virtual Machine x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/CreateVirtualMachine.json |
| [virtualMachinesDeleteSample.ts][virtualmachinesdeletesample] | Delete virtual machine x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/DeleteVirtualMachine.json |
| [virtualMachinesGetSample.ts][virtualmachinesgetsample] | Get virtual machine x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetVirtualMachine.json |
| [virtualMachinesListByResourceGroupSample.ts][virtualmachineslistbyresourcegroupsample] | Returns list of virtual machine within resource group x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListRGVirtualMachines.json |
| [virtualMachinesListBySubscriptionSample.ts][virtualmachineslistbysubscriptionsample] | Returns list virtual machine within subscription x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListVirtualMachines.json |
| [virtualMachinesStartSample.ts][virtualmachinesstartsample] | Power on virtual machine x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/StartVirtualMachine.json |
| [virtualMachinesStopSample.ts][virtualmachinesstopsample] | Power off virtual machine, options: shutdown, poweroff, and suspend x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/StopInBodyVirtualMachine.json |
| [virtualMachinesUpdateSample.ts][virtualmachinesupdatesample] | Patch virtual machine properties x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/PatchVirtualMachine.json |
| [virtualNetworksGetSample.ts][virtualnetworksgetsample] | Return virtual network by its name x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetVirtualNetwork.json |
| [virtualNetworksListSample.ts][virtualnetworkslistsample] | Return list of virtual networks in location for private cloud x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListVirtualNetworks.json |
## Prerequisites
The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/).
Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using:
```bash
npm install -g typescript
```
You need [an Azure subscription][freesub] to run these sample programs.
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
## Setup
To run the samples using the published version of the package:
1. Install the dependencies using `npm`:
```bash
npm install
```
2. Compile the samples:
```bash
npm run build
```
3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
4. Run whichever samples you like (note that some samples may require additional setup, see the table above):
```bash
node dist/customizationPoliciesGetSample.js
```
Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform):
```bash
npx cross-env node dist/customizationPoliciesGetSample.js
```
## Next Steps
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
[customizationpoliciesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/customizationPoliciesGetSample.ts
[customizationpolicieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/customizationPoliciesListSample.ts
[dedicatedcloudnodescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/dedicatedCloudNodesCreateOrUpdateSample.ts
[dedicatedcloudnodesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/dedicatedCloudNodesDeleteSample.ts
[dedicatedcloudnodesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/dedicatedCloudNodesGetSample.ts
[dedicatedcloudnodeslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/dedicatedCloudNodesListByResourceGroupSample.ts
[dedicatedcloudnodeslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/dedicatedCloudNodesListBySubscriptionSample.ts
[dedicatedcloudnodesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/dedicatedCloudNodesUpdateSample.ts
[dedicatedcloudservicescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/dedicatedCloudServicesCreateOrUpdateSample.ts
[dedicatedcloudservicesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/dedicatedCloudServicesDeleteSample.ts
[dedicatedcloudservicesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/dedicatedCloudServicesGetSample.ts
[dedicatedcloudserviceslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/dedicatedCloudServicesListByResourceGroupSample.ts
[dedicatedcloudserviceslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/dedicatedCloudServicesListBySubscriptionSample.ts
[dedicatedcloudservicesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/dedicatedCloudServicesUpdateSample.ts
[operationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/operationsGetSample.ts
[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/operationsListSample.ts
[privatecloudsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/privateCloudsGetSample.ts
[privatecloudslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/privateCloudsListSample.ts
[resourcepoolsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/resourcePoolsGetSample.ts
[resourcepoolslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/resourcePoolsListSample.ts
[skusavailabilitylistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/skusAvailabilityListSample.ts
[usageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/usagesListSample.ts
[virtualmachinetemplatesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/virtualMachineTemplatesGetSample.ts
[virtualmachinetemplateslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/virtualMachineTemplatesListSample.ts
[virtualmachinescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/virtualMachinesCreateOrUpdateSample.ts
[virtualmachinesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/virtualMachinesDeleteSample.ts
[virtualmachinesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/virtualMachinesGetSample.ts
[virtualmachineslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/virtualMachinesListByResourceGroupSample.ts
[virtualmachineslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/virtualMachinesListBySubscriptionSample.ts
[virtualmachinesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/virtualMachinesStartSample.ts
[virtualmachinesstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/virtualMachinesStopSample.ts
[virtualmachinesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/virtualMachinesUpdateSample.ts
[virtualnetworksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/virtualNetworksGetSample.ts
[virtualnetworkslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/samples/v3/typescript/src/virtualNetworksListSample.ts
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-vmwarecloudsimple?view=azure-node-preview
[freesub]: https://azure.microsoft.com/free/
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple/README.md
[typescript]: https://www.typescriptlang.org/docs/home.html

Просмотреть файл

@ -0,0 +1,41 @@
{
"name": "@azure-samples/arm-vmwarecloudsimple-ts",
"private": true,
"version": "1.0.0",
"description": " client library samples for TypeScript",
"engines": {
"node": ">=12.0.0"
},
"scripts": {
"build": "tsc",
"prebuild": "rimraf dist/"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
"directory": "sdk/vmwarecloudsimple/arm-vmwarecloudsimple"
},
"keywords": [
"node",
"azure",
"typescript",
"browser",
"isomorphic"
],
"author": "Microsoft Corporation",
"license": "MIT",
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/vmwarecloudsimple/arm-vmwarecloudsimple",
"dependencies": {
"@azure/arm-vmwarecloudsimple": "latest",
"dotenv": "latest",
"@azure/identity": "^2.0.1"
},
"devDependencies": {
"@types/node": "^12.0.0",
"typescript": "~4.4.0",
"rimraf": "latest"
}
}

Просмотреть файл

@ -0,0 +1,4 @@
# App registration secret for AAD authentication
AZURE_CLIENT_SECRET=
AZURE_CLIENT_ID=
AZURE_TENANT_ID=

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns customization policy by its name
*
* @summary Returns customization policy by its name
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetCustomizationPolicy.json
*/
async function getCustomizationPolicy() {
const subscriptionId = "{subscription-id}";
const regionId = "myResourceGroup";
const pcName = "myPrivateCloud";
const customizationPolicyName = "Linux1";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.customizationPolicies.get(
regionId,
pcName,
customizationPolicyName
);
console.log(result);
}
getCustomizationPolicy().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns list of customization policies in region for private cloud
*
* @summary Returns list of customization policies in region for private cloud
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListCustomizationPolicies.json
*/
async function listCustomizationPolicies() {
const subscriptionId = "{subscription-id}";
const regionId = "myResourceGroup";
const pcName = "myPrivateCloud";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.customizationPolicies.list(regionId, pcName)) {
resArray.push(item);
}
console.log(resArray);
}
listCustomizationPolicies().catch(console.error);

Просмотреть файл

@ -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 {
DedicatedCloudNode,
VMwareCloudSimple
} from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns dedicated cloud node by its name
*
* @summary Returns dedicated cloud node by its name
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/CreateDedicatedCloudNode.json
*/
async function createDedicatedCloudNode() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const referer = "https://management.azure.com/";
const dedicatedCloudNodeName = "myNode";
const dedicatedCloudNodeRequest: DedicatedCloudNode = {
namePropertiesSkuDescriptionName: "CS28-Node",
availabilityZoneId: "az1",
idPropertiesSkuDescriptionId: "general",
location: "westus",
nodesCount: 1,
placementGroupId: "n1",
purchaseId: "56acbd46-3d36-4bbf-9b08-57c30fdf6932",
sku: { name: "VMware_CloudSimple_CS28" }
};
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.dedicatedCloudNodes.beginCreateOrUpdateAndWait(
resourceGroupName,
referer,
dedicatedCloudNodeName,
dedicatedCloudNodeRequest
);
console.log(result);
}
createDedicatedCloudNode().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Delete dedicated cloud node
*
* @summary Delete dedicated cloud node
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/DeleteDedicatedCloudNode.json
*/
async function deleteDedicatedCloudNode() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const dedicatedCloudNodeName = "myNode";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.dedicatedCloudNodes.delete(
resourceGroupName,
dedicatedCloudNodeName
);
console.log(result);
}
deleteDedicatedCloudNode().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns dedicated cloud node
*
* @summary Returns dedicated cloud node
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetDedicatedCloudNode.json
*/
async function getDedicatedCloudNode() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const dedicatedCloudNodeName = "myNode";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.dedicatedCloudNodes.get(
resourceGroupName,
dedicatedCloudNodeName
);
console.log(result);
}
getDedicatedCloudNode().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns list of dedicate cloud nodes within resource group
*
* @summary Returns list of dedicate cloud nodes within resource group
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListRGDedicatedCloudNodes.json
*/
async function listRgDedicatedCloudNodes() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.dedicatedCloudNodes.listByResourceGroup(
resourceGroupName
)) {
resArray.push(item);
}
console.log(resArray);
}
listRgDedicatedCloudNodes().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns list of dedicate cloud nodes within subscription
*
* @summary Returns list of dedicate cloud nodes within subscription
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListDedicatedCloudNodes.json
*/
async function listDedicatedCloudNodes() {
const subscriptionId = "{subscription-id}";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.dedicatedCloudNodes.listBySubscription()) {
resArray.push(item);
}
console.log(resArray);
}
listDedicatedCloudNodes().catch(console.error);

Просмотреть файл

@ -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 { PatchPayload, VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Patches dedicated node properties
*
* @summary Patches dedicated node properties
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/PatchDedicatedCloudNode.json
*/
async function patchDedicatedCloudNode() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const dedicatedCloudNodeName = "myNode";
const dedicatedCloudNodeRequest: PatchPayload = {
tags: { myTag: "tagValue" }
};
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.dedicatedCloudNodes.update(
resourceGroupName,
dedicatedCloudNodeName,
dedicatedCloudNodeRequest
);
console.log(result);
}
patchDedicatedCloudNode().catch(console.error);

Просмотреть файл

@ -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 {
DedicatedCloudService,
VMwareCloudSimple
} from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Create dedicate cloud service
*
* @summary Create dedicate cloud service
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/CreateDedicatedCloudService.json
*/
async function createDedicatedCloudService() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const dedicatedCloudServiceName = "myService";
const dedicatedCloudServiceRequest: DedicatedCloudService = {
gatewaySubnet: "10.0.0.0",
location: "westus"
};
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.dedicatedCloudServices.createOrUpdate(
resourceGroupName,
dedicatedCloudServiceName,
dedicatedCloudServiceRequest
);
console.log(result);
}
createDedicatedCloudService().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Delete dedicate cloud service
*
* @summary Delete dedicate cloud service
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/DeleteDedicatedCloudService.json
*/
async function deleteDedicatedCloudService() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const dedicatedCloudServiceName = "myService";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.dedicatedCloudServices.beginDeleteAndWait(
resourceGroupName,
dedicatedCloudServiceName
);
console.log(result);
}
deleteDedicatedCloudService().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns Dedicate Cloud Service
*
* @summary Returns Dedicate Cloud Service
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetDedicatedCloudService.json
*/
async function getDedicatedCloudService() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const dedicatedCloudServiceName = "myService";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.dedicatedCloudServices.get(
resourceGroupName,
dedicatedCloudServiceName
);
console.log(result);
}
getDedicatedCloudService().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns list of dedicated cloud services within a resource group
*
* @summary Returns list of dedicated cloud services within a resource group
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListRGDedicatedCloudServices.json
*/
async function listRgDedicatedCloudServices() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.dedicatedCloudServices.listByResourceGroup(
resourceGroupName
)) {
resArray.push(item);
}
console.log(resArray);
}
listRgDedicatedCloudServices().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns list of dedicated cloud services within a subscription
*
* @summary Returns list of dedicated cloud services within a subscription
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListDedicatedCloudServices.json
*/
async function listDedicatedCloudServices() {
const subscriptionId = "{subscription-id}";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.dedicatedCloudServices.listBySubscription()) {
resArray.push(item);
}
console.log(resArray);
}
listDedicatedCloudServices().catch(console.error);

Просмотреть файл

@ -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 { PatchPayload, VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Patch dedicated cloud service's properties
*
* @summary Patch dedicated cloud service's properties
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/PatchDedicatedService.json
*/
async function patchDedicatedService() {
const subscriptionId = "{subscription-id}";
const resourceGroupName = "myResourceGroup";
const dedicatedCloudServiceName = "myService";
const dedicatedCloudServiceRequest: PatchPayload = {
tags: { myTag: "tagValue" }
};
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.dedicatedCloudServices.update(
resourceGroupName,
dedicatedCloudServiceName,
dedicatedCloudServiceRequest
);
console.log(result);
}
patchDedicatedService().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Return an async operation
*
* @summary Return an async operation
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetFailedOperationResult.json
*/
async function getFailedOperationResult() {
const subscriptionId = "{subscription-id}";
const regionId = "westus2";
const referer = "https://management.azure.com/";
const operationId = "d030bb3f-7d53-11e9-8e09-9a86872085ff";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.operations.get(regionId, referer, operationId);
console.log(result);
}
getFailedOperationResult().catch(console.error);
/**
* This sample demonstrates how to Return an async operation
*
* @summary Return an async operation
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetOperationResult.json
*/
async function getOperationResult() {
const subscriptionId = "{subscription-id}";
const regionId = "westus2";
const referer = "https://management.azure.com/";
const operationId = "f8e1c8f1-7d52-11e9-8e07-9a86872085ff";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const result = await client.operations.get(regionId, referer, operationId);
console.log(result);
}
getOperationResult().catch(console.error);

Просмотреть файл

@ -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 { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Return list of operations
*
* @summary Return list of operations
* x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListOperations.json
*/
async function listOperations() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new VMwareCloudSimple(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.operations.list()) {
resArray.push(item);
}
console.log(resArray);
}
listOperations().catch(console.error);

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше