51 строка
1.7 KiB
TypeScript
51 строка
1.7 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 {
|
|
ServerEndpointUpdateParameters,
|
|
ServerEndpointsUpdateOptionalParams,
|
|
MicrosoftStorageSync
|
|
} from "@azure/arm-storagesync";
|
|
import { DefaultAzureCredential } from "@azure/identity";
|
|
|
|
/**
|
|
* This sample demonstrates how to Patch a given ServerEndpoint.
|
|
*
|
|
* @summary Patch a given ServerEndpoint.
|
|
* x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/ServerEndpoints_Update.json
|
|
*/
|
|
async function serverEndpointsUpdate() {
|
|
const subscriptionId = "52b8da2f-61e0-4a1f-8dde-336911f367fb";
|
|
const resourceGroupName = "SampleResourceGroup_1";
|
|
const storageSyncServiceName = "SampleStorageSyncService_1";
|
|
const syncGroupName = "SampleSyncGroup_1";
|
|
const serverEndpointName = "SampleServerEndpoint_1";
|
|
const parameters: ServerEndpointUpdateParameters = {
|
|
cloudTiering: "off",
|
|
localCacheMode: "UpdateLocallyCachedFiles",
|
|
offlineDataTransfer: "off",
|
|
tierFilesOlderThanDays: 0,
|
|
volumeFreeSpacePercent: 100
|
|
};
|
|
const options: ServerEndpointsUpdateOptionalParams = { parameters };
|
|
const credential = new DefaultAzureCredential();
|
|
const client = new MicrosoftStorageSync(credential, subscriptionId);
|
|
const result = await client.serverEndpoints.beginUpdateAndWait(
|
|
resourceGroupName,
|
|
storageSyncServiceName,
|
|
syncGroupName,
|
|
serverEndpointName,
|
|
options
|
|
);
|
|
console.log(result);
|
|
}
|
|
|
|
serverEndpointsUpdate().catch(console.error);
|