mirror of
https://github.com/hanzoai/azure-sdk-for-js.git
synced 2026-10-30 19:51:51 +00:00
47 lines
1.5 KiB
JavaScript
47 lines
1.5 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 { LoadTestClient } = require("@azure/arm-loadtesting");
|
|
const { DefaultAzureCredential } = require("@azure/identity");
|
|
require("dotenv").config();
|
|
|
|
/**
|
|
* This sample demonstrates how to Check Quota Availability on quota bucket per region per subscription.
|
|
*
|
|
* @summary Check Quota Availability on quota bucket per region per subscription.
|
|
* x-ms-original-file: specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/Quotas_CheckAvailability.json
|
|
*/
|
|
async function quotasCheckAvailability() {
|
|
const subscriptionId =
|
|
process.env["LOADTESTSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
|
|
const location = "westus";
|
|
const quotaBucketName = "testQuotaBucket";
|
|
const quotaBucketRequest = {
|
|
currentQuota: 40,
|
|
currentUsage: 20,
|
|
dimensions: { location: "westus", subscriptionId: "testsubscriptionId" },
|
|
newQuota: 50,
|
|
};
|
|
const credential = new DefaultAzureCredential();
|
|
const client = new LoadTestClient(credential, subscriptionId);
|
|
const result = await client.quotas.checkAvailability(
|
|
location,
|
|
quotaBucketName,
|
|
quotaBucketRequest
|
|
);
|
|
console.log(result);
|
|
}
|
|
|
|
async function main() {
|
|
quotasCheckAvailability();
|
|
}
|
|
|
|
main().catch(console.error);
|