本文整理汇总了Java中com.microsoft.azure.management.compute.PurchasePlan类的典型用法代码示例。如果您正苦于以下问题:Java PurchasePlan类的具体用法?Java PurchasePlan怎么用?Java PurchasePlan使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PurchasePlan类属于com.microsoft.azure.management.compute包,在下文中一共展示了PurchasePlan类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: withPlan
import com.microsoft.azure.management.compute.PurchasePlan; //导入依赖的package包/类
@Override
public VirtualMachineImpl withPlan(PurchasePlan plan) {
this.inner().withPlan(new Plan());
this.inner().plan()
.withPublisher(plan.publisher())
.withProduct(plan.product())
.withName(plan.name());
return this;
}
示例2: parseCustomImagePurchasePlanFromConfig
import com.microsoft.azure.management.compute.PurchasePlan; //导入依赖的package包/类
/**
* Parses and constructs a custom image purchase plan from instance config. The custom image plan
* config must have the format: /publisher/<value>/product/<value>/name/<value>
*
* @param template instance config
* @param templateLocalizationContext localization context
* @return null when no purchase plan is specified or a constructed PurchasePlan object
* @throws ValidationException when the custom image purchase plan config is not valid
*/
public static PurchasePlan parseCustomImagePurchasePlanFromConfig(final Configured template,
LocalizationContext templateLocalizationContext) throws ValidationException {
final String customImagePlan = template.getConfigurationValue(
AzureComputeInstanceTemplateConfigurationProperty.CUSTOM_IMAGE_PLAN,
templateLocalizationContext);
final String invalidConfigErrMsg = "Invalid Custom Image Purchase Plan configuration: %s. " +
"Allowed configs are 1) <empty string> (for no plan specified); or 2) string with the " +
"format: /publisher/<publisher>/product/<product>/name/<name>.";
if (customImagePlan == null || customImagePlan.isEmpty()) {
return null;
}
String[] splitPath = customImagePlan.split("/");
if (splitPath.length != 7) {
throw new ValidationException(String.format(invalidConfigErrMsg, customImagePlan));
}
Map<String, String> customImagePlanCfgMap = new HashMap<>();
for (int i = 1; i < splitPath.length; i += 2) {
customImagePlanCfgMap.put(splitPath[i], splitPath[i + 1]);
}
String name = customImagePlanCfgMap.get(CUSTOM_IMAGE_PLAN_NAME_KEY);
String product = customImagePlanCfgMap.get(CUSTOM_IMAGE_PLAN_PRODUCT_KEY);
String publisher = customImagePlanCfgMap.get(CUSTOM_IMAGE_PLAN_PUBLISHER_KEY);
if (name == null || product == null || publisher == null) {
throw new ValidationException(String.format(invalidConfigErrMsg, customImagePlan));
}
PurchasePlan plan = new PurchasePlan()
.withName(name)
.withProduct(product)
.withPublisher(publisher);
return plan;
}
示例3: plan
import com.microsoft.azure.management.compute.PurchasePlan; //导入依赖的package包/类
@Override
public PurchasePlan plan() {
return inner().plan();
}
示例4: withPromotionalPlan
import com.microsoft.azure.management.compute.PurchasePlan; //导入依赖的package包/类
@Override
public VirtualMachineImpl withPromotionalPlan(PurchasePlan plan, String promotionCode) {
this.withPlan(plan);
this.inner().plan().withPromotionCode(promotionCode);
return this;
}
示例5: plan
import com.microsoft.azure.management.compute.PurchasePlan; //导入依赖的package包/类
/**
* Get the plan value.
*
* @return the plan value
*/
public PurchasePlan plan() {
return this.plan;
}
示例6: withPlan
import com.microsoft.azure.management.compute.PurchasePlan; //导入依赖的package包/类
/**
* Set the plan value.
*
* @param plan the plan value to set
* @return the VirtualMachineImageInner object itself.
*/
public VirtualMachineImageInner withPlan(PurchasePlan plan) {
this.plan = plan;
return this;
}