56 lines
3.2 KiB
JavaScript
56 lines
3.2 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.
|
|
*/
|
|
import { __awaiter } from "tslib";
|
|
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT License.
|
|
import { StorageManagementClient } from "@azure/arm-storage";
|
|
import { DefaultAzureCredential } from "@azure/identity";
|
|
/**
|
|
* This sample demonstrates how to Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request.
|
|
*
|
|
* @summary Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request.
|
|
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/BlobContainersSetLegalHold.json
|
|
*/
|
|
function setLegalHoldContainers() {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
const subscriptionId = "{subscription-id}";
|
|
const resourceGroupName = "res4303";
|
|
const accountName = "sto7280";
|
|
const containerName = "container8723";
|
|
const legalHold = { tags: ["tag1", "tag2", "tag3"] };
|
|
const credential = new DefaultAzureCredential();
|
|
const client = new StorageManagementClient(credential, subscriptionId);
|
|
const result = yield client.blobContainers.setLegalHold(resourceGroupName, accountName, containerName, legalHold);
|
|
console.log(result);
|
|
});
|
|
}
|
|
setLegalHoldContainers().catch(console.error);
|
|
/**
|
|
* This sample demonstrates how to Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request.
|
|
*
|
|
* @summary Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request.
|
|
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/BlobContainersSetLegalHoldAllowProtectedAppendWritesAll.json
|
|
*/
|
|
function setLegalHoldContainersWithAllowProtectedAppendWritesAll() {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
const subscriptionId = "{subscription-id}";
|
|
const resourceGroupName = "res4303";
|
|
const accountName = "sto7280";
|
|
const containerName = "container8723";
|
|
const legalHold = {
|
|
allowProtectedAppendWritesAll: true,
|
|
tags: ["tag1", "tag2", "tag3"]
|
|
};
|
|
const credential = new DefaultAzureCredential();
|
|
const client = new StorageManagementClient(credential, subscriptionId);
|
|
const result = yield client.blobContainers.setLegalHold(resourceGroupName, accountName, containerName, legalHold);
|
|
console.log(result);
|
|
});
|
|
}
|
|
setLegalHoldContainersWithAllowProtectedAppendWritesAll().catch(console.error);
|
|
//# sourceMappingURL=blobContainersSetLegalHoldSample.js.map
|