@Test public void getLbHourRate() throws Exception { Ec2PriceList instance = new Ec2PriceList(); Price hourRate = instance.getLbHourRate("eu-west-1"); System.out.println("Lb " + hourRate); }
public Price getLbHourRate(String regionName) throws IOException { getLoadBalancerPrices(); Map<String, Object> region = getRegion(regionName, lbPrices); List<Map<String, Object>> types = getSubList(region,"types"); for (Map<String, Object> type : types) { Map<String, Object> prices = getJsonElementFromList(type, "values", "rate", "perELBHour"); if (prices != null){ String price = (String) getSubElement(prices, "prices").get("USD"); return Price.createUsdHourly(new BigDecimal(price)); } } return null; }
Ec2PriceList extends AbstractPriceList { public Price getLbHourRate(String regionName) throws IOException { getLoadBalancerPrices(); Map<String, Object> region = getRegion(regionName, lbPrices); List<Map<String, Object>> types = getSubList(region,"types"); for (Map<String, Object> type : types) { Map<String, Object> prices = getJsonElementFromList(type, "values", "rate", "perELBHour"); if (prices != null){ String price = (String) getSubElement(prices, "prices").get("USD"); return Price.createUsdHourly(new BigDecimal(price)); } } return null; } }
Ec2PriceList extends AbstractPriceList { public Price getLbHourRate(String regionName) throws IOException { getLoadBalancerPrices(); Map<String, Object> region = getRegion(regionName, lbPrices); List<Map<String, Object>> types = getSubList(region,"types"); for (Map<String, Object> type : types) { Map<String, Object> prices = getJsonElementFromList(type, "values", "rate", "perELBHour"); if (prices != null){ String price = (String) getSubElement(prices, "prices").get("USD"); return Price.createUsdHourly(new BigDecimal(price)); } } return null; } Ec2PriceList(); }
Ec2PriceList extends AbstractPriceList { public Price getLbHourRate(String regionName) throws IOException { getLoadBalancerPrices(); Map<String, Object> region = getRegion(regionName, lbPrices); List<Map<String, Object>> types = getSubList(region,"types"); for (Map<String, Object> type : types) { Map<String, Object> prices = getJsonElementFromList(type, "values", "rate", "perELBHour"); if (prices != null){ String price = (String) getSubElement(prices, "prices").get("USD"); return Price.createUsdHourly(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 getLbHourRate(String regionName) throws IOException { getLoadBalancerPrices(); Map<String, Object> region = getRegion(regionName, lbPrices); List<Map<String, Object>> types = getSubList(region,"types"); for (Map<String, Object> type : types) { Map<String, Object> prices = getJsonElementFromList(type, "values", "rate", "perELBHour"); if (prices != null){ String price = (String) getSubElement(prices, "prices").get("USD"); return Price.createUsdHourly(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);  }