47 строки
1.4 KiB
TypeScript
47 строки
1.4 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 { DevCenterClient } from "@azure/arm-devcenter";
|
|
import { DefaultAzureCredential } from "@azure/identity";
|
|
import * as dotenv from "dotenv";
|
|
|
|
dotenv.config();
|
|
|
|
/**
|
|
* This sample demonstrates how to Deletes a Scheduled.
|
|
*
|
|
* @summary Deletes a Scheduled.
|
|
* x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Schedules_Delete.json
|
|
*/
|
|
async function schedulesDelete() {
|
|
const subscriptionId =
|
|
process.env["DEVCENTER_SUBSCRIPTION_ID"] ||
|
|
"0ac520ee-14c0-480f-b6c9-0a90c58ffff";
|
|
const resourceGroupName = process.env["DEVCENTER_RESOURCE_GROUP"] || "rg1";
|
|
const projectName = "TestProject";
|
|
const poolName = "DevPool";
|
|
const scheduleName = "autoShutdown";
|
|
const credential = new DefaultAzureCredential();
|
|
const client = new DevCenterClient(credential, subscriptionId);
|
|
const result = await client.schedules.beginDeleteAndWait(
|
|
resourceGroupName,
|
|
projectName,
|
|
poolName,
|
|
scheduleName,
|
|
);
|
|
console.log(result);
|
|
}
|
|
|
|
async function main() {
|
|
schedulesDelete();
|
|
}
|
|
|
|
main().catch(console.error);
|