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

43 строки
1.3 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 Gets the status of operation.
*
* @summary Gets the status of operation.
* x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/OperationsStatusGet.json
*/
async function operationsStatusGet() {
const subscriptionId =
process.env["REDISENTERPRISE_SUBSCRIPTION_ID"] ||
"e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f";
const location = "West US";
const operationId = "testoperationid";
const credential = new DefaultAzureCredential();
const client = new RedisEnterpriseManagementClient(
credential,
subscriptionId,
);
const result = await client.operationsStatus.get(location, operationId);
console.log(result);
}
async function main() {
operationsStatusGet();
}
main().catch(console.error);