Example usage for com.amazonaws.services.ec2.model ReservedInstancesOffering getCurrencyCode

List of usage examples for com.amazonaws.services.ec2.model ReservedInstancesOffering getCurrencyCode

Introduction

In this page you can find the example usage for com.amazonaws.services.ec2.model ReservedInstancesOffering getCurrencyCode.

Prototype


public String getCurrencyCode() 

Source Link

Document

The currency of the Reserved Instance offering you are purchasing.

Usage

From source file:com.kenlin.awsec2offering.Offering.java

License:Open Source License

public Offering(ReservedInstancesOffering offering) {
    availabilityZone = offering.getAvailabilityZone();
    offeringType = offering.getOfferingType();
    instanceType = offering.getInstanceType();
    productDescription = offering.getProductDescription();
    currencyCode = offering.getCurrencyCode();
    duration = offering.getDuration();//from   w  w w .ja  v  a  2 s. co m
    fixedPrice = offering.getFixedPrice();
    try {
        hourlyPrice = offering.getRecurringCharges().get(0).getAmount();
    } catch (IndexOutOfBoundsException e) {
        hourlyPrice = offering.getUsagePrice().doubleValue(); // e.g., c1.medium
    }
    /* totalMonthlyCost functionality has been offloaded to the client-side         
          totalMonthlyCost   = calculateTotalCost(duration, fixedPrice, hourlyPrice);
    */
}