@Override public Region region() { return Region.findByLabelOrName(this.regionName()); }
/** * 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; } }
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); }
@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); }
.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)