mirror of
https://github.com/hanzoai/azure-sdk-for-js.git
synced 2026-10-30 19:51:51 +00:00
30 lines
1.1 KiB
TypeScript
30 lines
1.1 KiB
TypeScript
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT License.
|
|
|
|
/**
|
|
* 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
|
|
*/
|
|
|
|
import { VMwareCloudSimple } from "@azure/arm-vmwarecloudsimple";
|
|
import { DefaultAzureCredential } from "@azure/identity";
|
|
import "dotenv/config";
|
|
|
|
async function deleteDedicatedCloudNode(): Promise<void> {
|
|
const subscriptionId = process.env["VMWARECLOUDSIMPLE_SUBSCRIPTION_ID"] || "{subscription-id}";
|
|
const resourceGroupName = process.env["VMWARECLOUDSIMPLE_RESOURCE_GROUP"] || "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);
|
|
}
|
|
|
|
async function main(): Promise<void> {
|
|
await deleteDedicatedCloudNode();
|
|
}
|
|
|
|
main().catch(console.error);
|