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

56 строки
1.6 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 {
ClusterUpdate,
RedisEnterpriseManagementClient,
} from "@azure/arm-redisenterprisecache";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Updates an existing Redis Enterprise cluster
*
* @summary Updates an existing Redis Enterprise cluster
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseUpdate.json
*/
async function redisEnterpriseUpdate() {
const subscriptionId =
process.env["REDISENTERPRISE_SUBSCRIPTION_ID"] ||
"e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f";
const resourceGroupName =
process.env["REDISENTERPRISE_RESOURCE_GROUP"] || "rg1";
const clusterName = "cache1";
const parameters: ClusterUpdate = {
minimumTlsVersion: "1.2",
sku: { name: "EnterpriseFlash_F300", capacity: 9 },
tags: { tag1: "value1" },
};
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId,
);
const result = await client.redisEnterprise.beginUpdateAndWait(
resourceGroupName,
clusterName,
parameters,
);
console.log(result);
}
async function main() {
redisEnterpriseUpdate();
}
main().catch(console.error);