Examples of DescribeSpotPriceHistoryType


Examples of org.nimbustools.messaging.gt4_0_elastic.generated.v2010_08_31.DescribeSpotPriceHistoryType

    public DescribeSpotPriceHistoryResponseType handleGet(
                                            @Context UriInfo uriInfo) {

        MultivaluedMap<String, String> form = uriInfo.getQueryParameters();
       
        final DescribeSpotPriceHistoryType request = new DescribeSpotPriceHistoryType();
        if(form != null && !form.isEmpty()){
            List<String> startTime = form.remove("StartTime");
           
            if(startTime != null && startTime.size() == 1){
                String startTimeStr = startTime.get(0);
                try {
                    Calendar startDate = convertTimeStampToCalendar(startTimeStr);
                    request.setStartTime(startDate);
                } catch (IllegalArgumentException e) {
                    logger.warn("Could not convert DescribeSpotPriceHistory's " +
                            "start time String: " + startTimeStr, e);
                }
            }
           
            List<String> endTime = form.remove("EndTime");
           
            if(endTime != null && endTime.size() == 1){
                String endTimeStr = endTime.get(0);
                try {
                    Calendar endDate = convertTimeStampToCalendar(endTimeStr);
                    request.setEndTime(endDate);
                } catch (IllegalArgumentException e) {
                    logger.warn("Could not convert DescribeSpotPriceHistory's " +
                                "end time String: " + endTimeStr, e);
                }
            }           
           
            //not used yet
            form.remove("ProductDescription");
           
            ArrayList<InstanceTypeSetItemType> itsit = new ArrayList<InstanceTypeSetItemType>();           
           
            for (Entry<String,List<String>> entrySet : form.entrySet()) {
                List<String> instanceType = entrySet.getValue();
                if(entrySet.getKey().startsWith(INSTANCE_TYPE_VAR) && instanceType.size() == 1) {
                    InstanceTypeSetItemType instType = new InstanceTypeSetItemType();
                    instType.setInstanceType(instanceType.get(0));
                    itsit.add(instType);                  
                }
            }
           
            InstanceTypeSetType instanceTypeSet = new InstanceTypeSetType();
            instanceTypeSet.setItem(itsit.toArray(new InstanceTypeSetItemType[0]));
           
            request.setInstanceTypeSet(instanceTypeSet);
        }

        try {
            return serviceRM.describeSpotPriceHistory(request);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.