azure-rest-api-specs-examples/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples-java/CreateVirtualMachineTemplat...

30 строки
1.3 KiB
Java

import com.azure.resourcemanager.scvmm.models.ExtendedLocation;
/** Samples for VirtualMachineTemplates CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/CreateVirtualMachineTemplate.json
*/
/**
* Sample code: CreateVirtualMachineTemplate.
*
* @param manager Entry point to ScvmmManager.
*/
public static void createVirtualMachineTemplate(com.azure.resourcemanager.scvmm.ScvmmManager manager) {
manager
.virtualMachineTemplates()
.define("HRVirtualMachineTemplate")
.withRegion("East US")
.withExistingResourceGroup("testrg")
.withExtendedLocation(
new ExtendedLocation()
.withType("customLocation")
.withName(
"/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"))
.withUuid("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
.withVmmServerId(
"/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer")
.create();
}
}