mirror of
https://github.com/hanzoai/azure-sdk-for-js.git
synced 2026-10-30 19:51:51 +00:00
71 lines
2.9 KiB
JavaScript
71 lines
2.9 KiB
JavaScript
/*
|
|
* 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.
|
|
const { LargeInstanceManagementClient } = require("@azure/arm-largeinstance");
|
|
const { DefaultAzureCredential } = require("@azure/identity");
|
|
require("dotenv").config();
|
|
|
|
/**
|
|
* This sample demonstrates how to Patches the Tags field of a Azure Large Storage Instance for the specified
|
|
subscription, resource group, and instance name.
|
|
*
|
|
* @summary Patches the Tags field of a Azure Large Storage Instance for the specified
|
|
subscription, resource group, and instance name.
|
|
* x-ms-original-file: specification/azurelargeinstance/resource-manager/Microsoft.AzureLargeInstance/preview/2023-07-20-preview/examples/AzureLargeStorageInstance_PatchTags_Delete.json
|
|
*/
|
|
async function azureLargeStorageInstanceDeleteTag() {
|
|
const subscriptionId =
|
|
process.env["LARGEINSTANCE_SUBSCRIPTION_ID"] || "f0f4887f-d13c-4943-a8ba-d7da28d2a3fd";
|
|
const resourceGroupName = process.env["LARGEINSTANCE_RESOURCE_GROUP"] || "myResourceGroup";
|
|
const azureLargeStorageInstanceName = "myALSInstance";
|
|
const tagsParameter = { tags: {} };
|
|
const credential = new DefaultAzureCredential();
|
|
const client = new LargeInstanceManagementClient(credential, subscriptionId);
|
|
const result = await client.azureLargeStorageInstanceOperations.update(
|
|
resourceGroupName,
|
|
azureLargeStorageInstanceName,
|
|
tagsParameter,
|
|
);
|
|
console.log(result);
|
|
}
|
|
|
|
/**
|
|
* This sample demonstrates how to Patches the Tags field of a Azure Large Storage Instance for the specified
|
|
subscription, resource group, and instance name.
|
|
*
|
|
* @summary Patches the Tags field of a Azure Large Storage Instance for the specified
|
|
subscription, resource group, and instance name.
|
|
* x-ms-original-file: specification/azurelargeinstance/resource-manager/Microsoft.AzureLargeInstance/preview/2023-07-20-preview/examples/AzureLargeStorageInstance_PatchTags.json
|
|
*/
|
|
async function azureLargeStorageInstanceUpdateTag() {
|
|
const subscriptionId =
|
|
process.env["LARGEINSTANCE_SUBSCRIPTION_ID"] || "f0f4887f-d13c-4943-a8ba-d7da28d2a3fd";
|
|
const resourceGroupName = process.env["LARGEINSTANCE_RESOURCE_GROUP"] || "myResourceGroup";
|
|
const azureLargeStorageInstanceName = "myALSInstance";
|
|
const tagsParameter = {
|
|
tags: { testkey: "testvalue" },
|
|
};
|
|
const credential = new DefaultAzureCredential();
|
|
const client = new LargeInstanceManagementClient(credential, subscriptionId);
|
|
const result = await client.azureLargeStorageInstanceOperations.update(
|
|
resourceGroupName,
|
|
azureLargeStorageInstanceName,
|
|
tagsParameter,
|
|
);
|
|
console.log(result);
|
|
}
|
|
|
|
async function main() {
|
|
azureLargeStorageInstanceDeleteTag();
|
|
azureLargeStorageInstanceUpdateTag();
|
|
}
|
|
|
|
main().catch(console.error);
|