46 строки
1.8 KiB
TypeScript
46 строки
1.8 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 {
|
|
TriggerChangeDetectionParameters,
|
|
MicrosoftStorageSync
|
|
} from "@azure/arm-storagesync";
|
|
import { DefaultAzureCredential } from "@azure/identity";
|
|
|
|
/**
|
|
* This sample demonstrates how to Triggers detection of changes performed on Azure File share connected to the specified Azure File Sync Cloud Endpoint.
|
|
*
|
|
* @summary Triggers detection of changes performed on Azure File share connected to the specified Azure File Sync Cloud Endpoint.
|
|
* x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/CloudEndpoints_TriggerChangeDetection.json
|
|
*/
|
|
async function cloudEndpointsTriggerChangeDetection() {
|
|
const subscriptionId = "52b8da2f-61e0-4a1f-8dde-336911f367fb";
|
|
const resourceGroupName = "SampleResourceGroup_1";
|
|
const storageSyncServiceName = "SampleStorageSyncService_1";
|
|
const syncGroupName = "SampleSyncGroup_1";
|
|
const cloudEndpointName = "SampleCloudEndpoint_1";
|
|
const parameters: TriggerChangeDetectionParameters = {
|
|
changeDetectionMode: "Recursive",
|
|
directoryPath: "NewDirectory"
|
|
};
|
|
const credential = new DefaultAzureCredential();
|
|
const client = new MicrosoftStorageSync(credential, subscriptionId);
|
|
const result = await client.cloudEndpoints.beginTriggerChangeDetectionAndWait(
|
|
resourceGroupName,
|
|
storageSyncServiceName,
|
|
syncGroupName,
|
|
cloudEndpointName,
|
|
parameters
|
|
);
|
|
console.log(result);
|
|
}
|
|
|
|
cloudEndpointsTriggerChangeDetection().catch(console.error);
|