mirror of
https://github.com/hanzoai/azure-sdk-for-js.git
synced 2026-10-30 19:51:51 +00:00
56 lines
1.9 KiB
JavaScript
56 lines
1.9 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 Update a loadtest resource.
|
|
*
|
|
* @summary Update a loadtest resource.
|
|
* x-ms-original-file: specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/LoadTests_Update.json
|
|
*/
|
|
async function loadTestsUpdate() {
|
|
const subscriptionId =
|
|
process.env["LOADTESTSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
|
|
const resourceGroupName = process.env["LOADTESTSERVICE_RESOURCE_GROUP"] || "dummyrg";
|
|
const loadTestName = "myLoadTest";
|
|
const loadTestResourcePatchRequestBody = {
|
|
description: "This is new load test resource",
|
|
encryption: {
|
|
identity: { type: "SystemAssigned", resourceId: undefined },
|
|
keyUrl: "https://dummy.vault.azure.net/keys/dummykey1",
|
|
},
|
|
identity: {
|
|
type: "SystemAssigned,UserAssigned",
|
|
userAssignedIdentities: {
|
|
"/subscriptions/00000000000000000000000000000000/resourceGroups/dummyrg/providers/MicrosoftManagedIdentity/userAssignedIdentities/id1":
|
|
{},
|
|
},
|
|
},
|
|
tags: { division: "LT", team: "Dev Exp" },
|
|
};
|
|
const credential = new DefaultAzureCredential();
|
|
const client = new LoadTestClient(credential, subscriptionId);
|
|
const result = await client.loadTests.beginUpdateAndWait(
|
|
resourceGroupName,
|
|
loadTestName,
|
|
loadTestResourcePatchRequestBody
|
|
);
|
|
console.log(result);
|
|
}
|
|
|
|
async function main() {
|
|
loadTestsUpdate();
|
|
}
|
|
|
|
main().catch(console.error);
|