Files
Minh-Anh PhanandGitHub 3181ad2806 [EngSys] Bump min-version to node 22 (#38887) ***NO_CI***
This pull request updates the Node.js version requirement across
multiple files and tools in the repository. The changes ensure
compatibility with Node.js version 22 and its corresponding type
definitions. Resolves #37945.

***NO_CI***
2026-06-23 16:25:55 -07:00
..

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 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 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 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 Delete dedicated cloud node x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/DeleteDedicatedCloudNode.json
dedicatedCloudNodesGetSample.js Returns dedicated cloud node x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetDedicatedCloudNode.json
dedicatedCloudNodesListByResourceGroupSample.js 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 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 Patches dedicated node properties x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/PatchDedicatedCloudNode.json
dedicatedCloudServicesCreateOrUpdateSample.js Create dedicate cloud service x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/CreateDedicatedCloudService.json
dedicatedCloudServicesDeleteSample.js Delete dedicate cloud service x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/DeleteDedicatedCloudService.json
dedicatedCloudServicesGetSample.js Returns Dedicate Cloud Service x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetDedicatedCloudService.json
dedicatedCloudServicesListByResourceGroupSample.js 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 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 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 Return an async operation x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetFailedOperationResult.json
operationsListSample.js Return list of operations x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/ListOperations.json
privateCloudsGetSample.js 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 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 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 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 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 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 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 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 Create Or Update Virtual Machine x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/CreateVirtualMachine.json
virtualMachinesDeleteSample.js Delete virtual machine x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/DeleteVirtualMachine.json
virtualMachinesGetSample.js Get virtual machine x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/GetVirtualMachine.json
virtualMachinesListByResourceGroupSample.js 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 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 Power on virtual machine x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/StartVirtualMachine.json
virtualMachinesStopSample.js 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 Patch virtual machine properties x-ms-original-file: specification/vmwarecloudsimple/resource-manager/Microsoft.VMwareCloudSimple/stable/2019-04-01/examples/PatchVirtualMachine.json
virtualNetworksGetSample.js 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 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.

You need an Azure subscription 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.

Setup

To run the samples using the published version of the package:

  1. Install the dependencies using npm:
npm install
  1. 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.

  2. Run whichever samples you like (note that some samples may require additional setup, see the table above):

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):

cross-env VMWARECLOUDSIMPLE_SUBSCRIPTION_ID="<vmwarecloudsimple subscription id>" node customizationPoliciesGetSample.js

Next Steps

Take a look at our API Documentation for more information about the APIs that are available in the clients.