azure-sdk-for-js/sdk/redisenterprise/arm-redisenterprisecache/samples-dev/redisEnterpriseDeleteSample.ts

47 строки
1.4 KiB
TypeScript

/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { RedisEnterpriseManagementClient } from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Deletes a Redis Enterprise cache cluster.
*
* @summary Deletes a Redis Enterprise cache cluster.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDelete.json
*/
async function redisEnterpriseDelete() {
const subscriptionId =
process.env["REDISENTERPRISE_SUBSCRIPTION_ID"] ||
"e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f";
const resourceGroupName =
process.env["REDISENTERPRISE_RESOURCE_GROUP"] || "rg1";
const clusterName = "cache1";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId,
);
const result = await client.redisEnterprise.beginDeleteAndWait(
resourceGroupName,
clusterName,
);
console.log(result);
}
async function main() {
redisEnterpriseDelete();
}
main().catch(console.error);