mirror of
https://github.com/hanzoai/azure-sdk-for-js.git
synced 2026-10-30 19:51:51 +00:00
* datacatalog * datadog * datalake-analytics * datamigration * depolymentmanager * desktopvirtualization * deviceprovisioningservices * devtestlabs * update * update * update * refresh-7 * update * update * update * update * update
41 lines
1.6 KiB
JavaScript
41 lines
1.6 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 { DevTestLabsClient } = require("@azure/arm-devtestlabs");
|
|
const { DefaultAzureCredential } = require("@azure/identity");
|
|
|
|
/**
|
|
* This sample demonstrates how to Updates a schedule's target resource Id. This operation can take a while to complete.
|
|
*
|
|
* @summary Updates a schedule's target resource Id. This operation can take a while to complete.
|
|
* x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Retarget.json
|
|
*/
|
|
async function globalSchedulesRetarget() {
|
|
const subscriptionId = "{subscriptionId}";
|
|
const resourceGroupName = "resourceGroupName";
|
|
const name = "{scheduleName}";
|
|
const retargetScheduleProperties = {
|
|
currentResourceId:
|
|
"/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{targetLab}",
|
|
targetResourceId:
|
|
"/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{currentLab}",
|
|
};
|
|
const credential = new DefaultAzureCredential();
|
|
const client = new DevTestLabsClient(credential, subscriptionId);
|
|
const result = await client.globalSchedules.beginRetargetAndWait(
|
|
resourceGroupName,
|
|
name,
|
|
retargetScheduleProperties
|
|
);
|
|
console.log(result);
|
|
}
|
|
|
|
globalSchedulesRetarget().catch(console.error);
|