private List<PricingTier> correctPricingTiers(final List<PricingTier> pricingTiers) { pricingTiers.remove(PricingTier.PREMIUM_P1); pricingTiers.remove(PricingTier.PREMIUM_P2); pricingTiers.remove(PricingTier.PREMIUM_P3); pricingTiers.add(new PricingTier("Premium", "P1V2")); pricingTiers.add(new PricingTier("Premium", "P2V2")); pricingTiers.add(new PricingTier("Premium", "P3V2")); return pricingTiers; }
@Override public AppServicePlanImpl withPricingTier(PricingTier pricingTier) { if (pricingTier == null) { throw new IllegalArgumentException("pricingTier == null"); } inner().withSku(pricingTier.toSkuDescription()); return this; }
@Override public PricingTier pricingTier() { return PricingTier.fromSkuDescription(inner().sku()); }
/** * Load List of Pricing Tier. */ public void onLoadPricingTierList() { Observable.fromCallable(() -> AzureMvpModel.getInstance().listPricingTier()) .subscribeOn(getSchedulerProvider().io()) .subscribe(pricingTierList -> DefaultLoader.getIdeHelper().invokeLater(() -> { if (isViewDetached()) { return; } getMvpView().renderPricingTierList(pricingTierList.stream() .filter(item -> !item.equals(PricingTier.FREE_F1) && !item.equals(PricingTier.SHARED_D1)) .collect(Collectors.toList())); }), e -> errorHandler(CANNOT_LIST_PRICING_TIER, (Exception) e)); }
@Override public FunctionAppImpl withNewConsumptionPlan() { return withNewAppServicePlan(OperatingSystem.WINDOWS, new PricingTier("Dynamic", "Y1")); }
protected WebAppProperty generateProperty(@NotNull final WebAppBase webAppBase, @NotNull final AppServicePlan plan) { final Map<String, String> appSettingsMap = new HashMap<>(); final Map<String, AppSetting> appSetting = webAppBase.getAppSettings(); for (final String key : appSetting.keySet()) { final AppSetting setting = appSetting.get(key); if (setting != null) { appSettingsMap.put(setting.key(), setting.value()); } } final Map<String, Object> propertyMap = new HashMap<>(); propertyMap.put(KEY_NAME, webAppBase.name()); propertyMap.put(KEY_TYPE, webAppBase.type()); propertyMap.put(KEY_RESOURCE_GRP, webAppBase.resourceGroupName()); propertyMap.put(KEY_LOCATION, webAppBase.regionName()); propertyMap.put(KEY_SUB_ID, webAppBase.manager().subscriptionId()); propertyMap.put(KEY_STATUS, webAppBase.state()); propertyMap.put(KEY_PLAN, plan.name()); propertyMap.put(KEY_URL, webAppBase.defaultHostName()); propertyMap.put(KEY_PRICING, plan.pricingTier().toString()); final String javaVersion = webAppBase.javaVersion().toString(); if (!javaVersion.equals("null")) { propertyMap.put(KEY_JAVA_VERSION, webAppBase.javaVersion().toString()); propertyMap.put(KEY_JAVA_CONTAINER, webAppBase.javaContainer()); propertyMap.put(KEY_JAVA_CONTAINER_VERSION, webAppBase.javaContainerVersion()); } propertyMap.put(KEY_OPERATING_SYS, webAppBase.operatingSystem()); propertyMap.put(KEY_APP_SETTING, appSettingsMap); return new WebAppProperty(propertyMap); }
private FunctionAppImpl autoSetAlwaysOn(PricingTier pricingTier) { SkuDescription description = pricingTier.toSkuDescription(); if (description.tier().equalsIgnoreCase("Basic") || description.tier().equalsIgnoreCase("Standard") || description.tier().equalsIgnoreCase("Premium")) { return withWebAppAlwaysOn(true); } else { return withWebAppAlwaysOn(false); } }
public PricingTier getPricingTier() throws MojoExecutionException { return pricingTier == null ? new PricingTier("Premium", "P1V2") : pricingTier.toPricingTier(); }
/** * Parses a serialized value to an AppServicePricingTier instance. * * @param skuDescription the serialized value to parse. * @return the parsed AppServicePricingTier object, or null if unable to parse. */ public static PricingTier fromSkuDescription(SkuDescription skuDescription) { if (skuDescription == null) { return null; } return new PricingTier(skuDescription.tier(), skuDescription.size()); }
private AppServicePlan.DefinitionStages.WithCreate prepareWithCreate( @NotNull Azure azure, @NotNull WebAppSettingModel model) throws Exception { final String[] tierSize = model.getPricing().split("_"); if (tierSize.length != 2) { throw new Exception("Cannot get valid price tier"); } final PricingTier pricingTier = new PricingTier(tierSize[0], tierSize[1]); final AppServicePlan.DefinitionStages.WithGroup withGroup = azure .appServices() .appServicePlans() .define(model.getAppServicePlanName()) .withRegion(model.getRegion()); final AppServicePlan.DefinitionStages.WithPricingTier withPricingTier; final String resourceGroup = model.getResourceGroup(); if (model.isCreatingResGrp()) { withPricingTier = withGroup.withNewResourceGroup(resourceGroup); } else { withPricingTier = withGroup.withExistingResourceGroup(resourceGroup); } return withPricingTier.withPricingTier(pricingTier).withOperatingSystem(model.getOS()); }
WebApp app; Azure azure = AuthMethodManager.getInstance().getAzureClient(model.getSubscriptionId()); PricingTier pricingTier = new PricingTier(model.getPricingSkuTier(), model.getPricingSkuSize());