azure-sdk-for-js/sdk/storagemover/arm-storagemover/samples-dev/jobDefinitionsUpdateSample.ts

56 строки
1.9 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 {
JobDefinitionUpdateParameters,
StorageMoverClient,
} from "@azure/arm-storagemover";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Updates properties for a Job Definition resource. Properties not specified in the request body will be unchanged.
*
* @summary Updates properties for a Job Definition resource. Properties not specified in the request body will be unchanged.
* x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_Update.json
*/
async function jobDefinitionsUpdate() {
const subscriptionId =
process.env["STORAGEMOVER_SUBSCRIPTION_ID"] ||
"60bcfc77-6589-4da2-b7fd-f9ec9322cf95";
const resourceGroupName =
process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg";
const storageMoverName = "examples-storageMoverName";
const projectName = "examples-projectName";
const jobDefinitionName = "examples-jobDefinitionName";
const jobDefinition: JobDefinitionUpdateParameters = {
description: "Updated Job Definition Description",
agentName: "updatedAgentName",
};
const credential = new DefaultAzureCredential();
const client = new StorageMoverClient(credential, subscriptionId);
const result = await client.jobDefinitions.update(
resourceGroupName,
storageMoverName,
projectName,
jobDefinitionName,
jobDefinition,
);
console.log(result);
}
async function main() {
jobDefinitionsUpdate();
}
main().catch(console.error);