.withRegion(rgRegion) .create();
/** * Create Azure resource Group. * * @param azureClient * @param locationName * @param resourceGroupName */ private void createAzureResourceGroup( Azure azureClient, String locationName, String resourceGroupName) throws AzureCloudException { try { azureClient.resourceGroups() .define(resourceGroupName) .withRegion(locationName) .create(); } catch (Exception e) { throw AzureCloudException.create( String.format( " Failed to create resource group with group name %s, location %s", resourceGroupName, locationName), e); } }
ResourceGroup resourceGroup = azureClient.resourceGroups() .define(newHost.hostVM.resourceGroupName) .withRegion(newHost.hostVM.region) .create();
VirtualMachine.DefinitionStages.WithNetwork withNetwork; if (withNewResourceGroup) { newResourceGroup = azure.resourceGroups().define(resourceGroup).withRegion(region); withNetwork = withGroup.withNewResourceGroup(newResourceGroup); } else {
.withRegion(Region.UK_WEST) .create(); PolicyAssignment assignment = resourceManager.policyAssignments().define("assignment1")
.withRegion(Region.US_SOUTH_CENTRAL) .withTag("department", "finance") .withTag("tagname", "tagvalue")
@Override protected void initializeClients(RestClient restClient, String defaultSubscription, String domain) { testId = SdkContext.randomResourceName("", 9); rgName = "rg" + testId; newRgName = "rgB" + testId; super.initializeClients(restClient, defaultSubscription, domain); resourceGroups = resourceClient.resourceGroups(); genericResources = resourceClient.genericResources(); resourceGroups.define(rgName) .withRegion(Region.US_EAST) .create(); resourceGroups.define(newRgName) .withRegion(Region.US_SOUTH_CENTRAL) .create(); }
/** * Creates a new resource group to put the resource in. * <p> * The group will be created in the same location as the resource. * * @param groupName the name of the new group * @param region the region where resource group needs to be created * @return the next stage of the definition */ public final FluentModelImplT withNewResourceGroup(String groupName, Region region) { return this.withNewResourceGroup( this.myManager.resourceManager().resourceGroups().define(groupName).withRegion(region)); }
/** * Creates a new resource group to put the resource in. * <p> * The group will be created in the same location as the resource. * * @param groupName the name of the new group * @param region the region where resource group needs to be created * @return the next stage of the definition */ public final FluentModelImplT withNewResourceGroup(String groupName, Region region) { return this.withNewResourceGroup( this.myManager.resourceManager().resourceGroups().define(groupName).withRegion(region)); }
@Override protected void initializeClients(RestClient restClient, String defaultSubscription, String domain) { super.initializeClients(restClient, defaultSubscription, domain); testId = SdkContext.randomResourceName("", 9); resourceGroups = resourceClient.resourceGroups(); rgName = "rg" + testId; resourceGroup = resourceGroups.define(rgName) .withRegion(Region.US_SOUTH_CENTRAL) .create(); }
/** * Creates a new resource group to put the resource in. * <p> * The group will be created in the same location as the resource. * @param groupName the name of the new group * @return the next stage of the definition */ public final FluentModelImplT withNewResourceGroup(String groupName) { return this.withNewResourceGroup( this.myManager.resourceManager().resourceGroups().define(groupName).withRegion(this.regionName())); }
@Override public ResourceGroup internalCreate(String key) { return azure.resourceGroups().define(key).withRegion(azureProperties.getRegion()).create(); } }
/** * Creates a new resource group to put the resource in. * <p> * The group will be created in the same location as the resource. * @param groupName the name of the new group * @return the next stage of the definition */ public final FluentModelImplT withNewResourceGroup(String groupName) { return this.withNewResourceGroup( this.myManager.resourceManager().resourceGroups().define(groupName).withRegion(this.regionName())); }
@Override protected void initializeClients(RestClient restClient, String defaultSubscription, String domain) { testId = SdkContext.randomResourceName("", 9); rgName = "rg429" + testId; super.initializeClients(restClient, defaultSubscription, domain); resourceGroups = resourceClient.resourceGroups(); rg = resourceGroups.define(rgName) .withRegion(Region.US_EAST) .create(); }
@Override public DeploymentImpl withNewResourceGroup(String resourceGroupName, Region region) { this.creatableResourceGroup = this.resourceManager.resourceGroups() .define(resourceGroupName) .withRegion(region); this.addDependency(this.creatableResourceGroup); this.resourceGroupName = resourceGroupName; return this; }
@Override public DeploymentImpl withNewResourceGroup(String resourceGroupName, Region region) { this.creatableResourceGroup = this.resourceManager.resourceGroups() .define(resourceGroupName) .withRegion(region); this.addDependency(this.creatableResourceGroup); this.resourceGroupName = resourceGroupName; return this; }