64 lines
3.2 KiB
JavaScript
64 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 Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist.
|
|
*
|
|
* @summary Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist.
|
|
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/FileShareAclsPatch.json
|
|
*/
|
|
function updateShareAcls() {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
const subscriptionId = "{subscription-id}";
|
|
const resourceGroupName = "res3376";
|
|
const accountName = "sto328";
|
|
const shareName = "share6185";
|
|
const fileShare = {
|
|
signedIdentifiers: [
|
|
{
|
|
accessPolicy: {
|
|
expiryTime: new Date("2021-05-01T08:49:37.0000000Z"),
|
|
permission: "rwd",
|
|
startTime: new Date("2021-04-01T08:49:37.0000000Z")
|
|
},
|
|
id: "MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI"
|
|
}
|
|
]
|
|
};
|
|
const credential = new DefaultAzureCredential();
|
|
const client = new StorageManagementClient(credential, subscriptionId);
|
|
const result = yield client.fileShares.update(resourceGroupName, accountName, shareName, fileShare);
|
|
console.log(result);
|
|
});
|
|
}
|
|
updateShareAcls().catch(console.error);
|
|
/**
|
|
* This sample demonstrates how to Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist.
|
|
*
|
|
* @summary Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist.
|
|
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/FileSharesPatch.json
|
|
*/
|
|
function updateShares() {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
const subscriptionId = "{subscription-id}";
|
|
const resourceGroupName = "res3376";
|
|
const accountName = "sto328";
|
|
const shareName = "share6185";
|
|
const fileShare = { metadata: { type: "image" } };
|
|
const credential = new DefaultAzureCredential();
|
|
const client = new StorageManagementClient(credential, subscriptionId);
|
|
const result = yield client.fileShares.update(resourceGroupName, accountName, shareName, fileShare);
|
|
console.log(result);
|
|
});
|
|
}
|
|
updateShares().catch(console.error);
|
|
//# sourceMappingURL=fileSharesUpdateSample.js.map
|