@JsonValue @Override public String toString() { return name(); }
@Override public Region region() { return Region.fromName(this.name()); } }
/** * Specifies the region for the resource. * @param region The location for the resource * @return the next stage of the definition */ public final FluentModelImplT withRegion(Region region) { return this.withRegion(region.toString()); }
/** * Gets a final location name from a display name location. * * @param location * @return */ private static String getLocationName(String location) { try { return Region.findByLabelOrName(location).name(); } catch (Exception e) { return null; } }
@Override protected Region getRegion() throws MojoExecutionException { final String region = mojo.getRegion(); if (!StringUtils.isEmpty(region) && Region.findByLabelOrName(region) == null) { throw new MojoExecutionException("The value of <region> is not supported, please correct it in pom.xml."); } return Region.fromName(region); }
@Override protected Region getRegion() throws MojoExecutionException { if (StringUtils.isEmpty(mojo.getRegion())) { return Region.EUROPE_WEST; } if (!Arrays.asList(Region.values()).contains(Region.fromName(mojo.getRegion()))) { throw new MojoExecutionException("The value of <region> is not correct, please correct it in pom.xml."); } return Region.fromName(mojo.getRegion()); }
private String getCertificateUniqueName(String thumbprint, Region region) { return String.format("%s##%s#", thumbprint, region.label()); } }
@Override public Region region() { return Region.findByLabelOrName(this.regionName()); }
public ListBoxModel doFillAvailabilitySetItems( @RelativePath("../..") @QueryParameter String azureCredentialsId, @RelativePath("../..") @QueryParameter String resourceGroupReferenceType, @RelativePath("../..") @QueryParameter String newResourceGroupName, @RelativePath("../..") @QueryParameter String existingResourceGroupName, @RelativePath("..") @QueryParameter String location) { ListBoxModel model = new ListBoxModel(); model.add("--- Select Availability Set in current resource group and location ---", ""); if (StringUtils.isBlank(azureCredentialsId)) { return model; } //resourceGroupReferenceType passed wrong value in 2.60.1-LTS, we won't use this value until bug resolved. resourceGroupReferenceType = null; try { Azure azureClient = AzureClientHolder.get(azureCredentialsId); String resourceGroupName = AzureVMCloud.getResourceGroupName( resourceGroupReferenceType, newResourceGroupName, existingResourceGroupName); PagedList<AvailabilitySet> availabilitySets = azureClient.availabilitySets() .listByResourceGroup(resourceGroupName); for (AvailabilitySet set : availabilitySets) { String label = set.region().label(); if (label.equals(location)) { model.add(set.name()); } } } catch (Exception e) { LOGGER.log(Level.WARNING, "Cannot list availability set: ", e); } return model; }
private Region getRegion(String label) { Region region = Region.findByLabelOrName(label); if (region == null) { String msg = new StringBuffer() .append("invalid azure region: ") .append(label) .toString(); project.getLogger().error(msg); throw new GradleException(msg); } return (region); }
@JsonValue @Override public String toString() { return name(); }
@Override public DefinitionStages.Platform withLocation(Region location) { this.inner.withLocation(location.toString()); return this; }
@Override public Region region() { return Region.fromName(this.name()); } }
@Override public void offlineRegion(Region region) { this.manager().inner().databaseAccounts().offlineRegion(this.resourceGroupName(), this.name(), region.label()); }
.withRegion(Region.findByLabelOrName(model.getLocationName())) .withNewResourceGroup(model.getResourceGroupName()) .withPricingTier(pricingTier) .withOperatingSystem(OperatingSystem.LINUX); app = webAppDefinition .withRegion(Region.findByLabelOrName(model.getLocationName())) .withNewResourceGroup(model.getResourceGroupName()) .withNewLinuxPlan(asp) .withRegion(Region.findByLabelOrName(model.getLocationName())) .withExistingResourceGroup(model.getResourceGroupName()) .withPricingTier(pricingTier) .withOperatingSystem(OperatingSystem.LINUX); app = webAppDefinition .withRegion(Region.findByLabelOrName(model.getLocationName())) .withExistingResourceGroup(model.getResourceGroupName()) .withNewLinuxPlan(asp)
@Override public Observable<VirtualMachineExtensionImage> listByRegionAsync(Region region) { return listByRegionAsync(region.name()); }
/** * Specifies the region for the resource. * @param region The location for the resource * @return the next stage of the definition */ public final FluentModelImplT withRegion(Region region) { return this.withRegion(region.toString()); }
@Override public Region region() { return Region.fromName(this.regionName()); }
@Override public void onlineRegion(Region region) { this.manager().inner().databaseAccounts().onlineRegion(this.resourceGroupName(), this.name(), region.label()); }
@Override public Observable<NetworkUsage> listByRegionAsync(Region region) { return listByRegionAsync(region.name()); }