Files
colawwjandGitHub df9f6dc804 Refresh 7 (#21441)
* datacatalog

* datadog

* datalake-analytics

* datamigration

* depolymentmanager

* desktopvirtualization

* deviceprovisioningservices

* devtestlabs

* update

* update

* update

* refresh-7

* update

* update

* update

* update

* update
2022-04-19 17:05:19 +08:00

54 lines
2.0 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 Create or replace an existing schedule.
*
* @summary Create or replace an existing schedule.
* x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_CreateOrUpdate.json
*/
async function schedulesCreateOrUpdate() {
const subscriptionId = "{subscriptionId}";
const resourceGroupName = "resourceGroupName";
const labName = "{labName}";
const name = "{scheduleName}";
const schedule = {
dailyRecurrence: { time: "{timeOfTheDayTheScheduleWillOccurEveryDay}" },
hourlyRecurrence: { minute: 30 },
location: "{location}",
notificationSettings: {
emailRecipient: "{email}",
notificationLocale: "EN",
status: "{Enabled|Disabled}",
timeInMinutes: 15,
webhookUrl: "{webhookUrl}",
},
status: "{Enabled|Disabled}",
tags: { tagName1: "tagValue1" },
targetResourceId:
"/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}",
taskType: "{myLabVmTaskType}",
timeZoneId: "Pacific Standard Time",
weeklyRecurrence: {
time: "{timeOfTheDayTheScheduleWillOccurOnThoseDays}",
weekdays: ["Monday", "Wednesday", "Friday"],
},
};
const credential = new DefaultAzureCredential();
const client = new DevTestLabsClient(credential, subscriptionId);
const result = await client.schedules.createOrUpdate(resourceGroupName, labName, name, schedule);
console.log(result);
}
schedulesCreateOrUpdate().catch(console.error);