@Test public void getSnapshotGigabyteRate() throws Exception { Ec2PriceList instance = new Ec2PriceList(); Price gbRate = instance.getVolumeSnapshotGigabyteRate("eu-west-1"); System.out.println("Snapshot: " + gbRate); }
public Price getVolumeSnapshotGigabyteRate(String regionName) throws IOException { getEc2OnDemandPrices(); Map<String, Object> region = getRegion(regionName, ebsPrices); Map<String, Object> ebsVols = getJsonElementFromList(region, "types", "name", "ebsSnapsToS3"); Map<String, Object> prices = getJsonElementFromList(ebsVols, "values", "rate", "perGBmoDataStored"); if (prices != null){ String price = (String) getSubElement(prices, "prices").get("USD"); return Price.createUsdMonthly(new BigDecimal(price)); } return null; }
Ec2PriceList extends AbstractPriceList { public Price getVolumeSnapshotGigabyteRate(String regionName) throws IOException { getEc2OnDemandPrices(); Map<String, Object> region = getRegion(regionName, ebsPrices); Map<String, Object> ebsVols = getJsonElementFromList(region, "types", "name", "ebsSnapsToS3"); Map<String, Object> prices = getJsonElementFromList(ebsVols, "values", "rate", "perGBmoDataStored"); if (prices != null){ String price = (String) getSubElement(prices, "prices").get("USD"); return Price.createUsdMonthly(new BigDecimal(price)); } return null; } }
Ec2PriceList extends AbstractPriceList { public Price getVolumeSnapshotGigabyteRate(String regionName) throws IOException { getEc2OnDemandPrices(); Map<String, Object> region = getRegion(regionName, ebsPrices); Map<String, Object> ebsVols = getJsonElementFromList(region, "types", "name", "ebsSnapsToS3"); Map<String, Object> prices = getJsonElementFromList(ebsVols, "values", "rate", "perGBmoDataStored"); if (prices != null){ String price = (String) getSubElement(prices, "prices").get("USD"); return Price.createUsdMonthly(new BigDecimal(price)); } return null; } Ec2PriceList(); }
Ec2PriceList extends AbstractPriceList { public Price getVolumeSnapshotGigabyteRate(String regionName) throws IOException { getEc2OnDemandPrices(); Map<String, Object> region = getRegion(regionName, ebsPrices); Map<String, Object> ebsVols = getJsonElementFromList(region, "types", "name", "ebsSnapsToS3"); Map<String, Object> prices = getJsonElementFromList(ebsVols, "values", "rate", "perGBmoDataStored"); if (prices != null){ String price = (String) getSubElement(prices, "prices").get("USD"); return Price.createUsdMonthly(new BigDecimal(price)); } return null; } Ec2PriceList(); Price getVolumeGigabyteRate(String regionName); Price getVolumeSnapshotGigabyteRate(String regionName); Price getLbHourRate(String regionName); Price getEc2HourRate(String regionName, String instanceType, String platform); }
Ec2PriceList extends AbstractPriceList { public Price getVolumeSnapshotGigabyteRate(String regionName) throws IOException { getEc2OnDemandPrices(); Map<String, Object> region = getRegion(regionName, ebsPrices); Map<String, Object> ebsVols = getJsonElementFromList(region, "types", "name", "ebsSnapsToS3"); Map<String, Object> prices = getJsonElementFromList(ebsVols, "values", "rate", "perGBmoDataStored"); if (prices != null){ String price = (String) getSubElement(prices, "prices").get("USD"); return Price.createUsdMonthly(new BigDecimal(price)); } return null; } Ec2PriceList(); Price getVolumeGigabyteRate(String regionName); Price getVolumeSnapshotGigabyteRate(String regionName); Price getLbHourRate(String regionName); Price getEc2HourRate(String regionName, String instanceType, String platform);  }