Package com.amazon.ec2

Examples of com.amazon.ec2.DescribeSpotPriceHistoryType


        EC2ReleaseAddress ec2Request = new EC2ReleaseAddress();
        if (ec2Request != null) {
            ec2Request.setPublicIp(publicIp);
        }

        ReleaseAddressResponse EC2Response = EC2SoapServiceImpl.toReleaseAddressResponse(engine.releaseAddress(ec2Request));

        serializeResponse(response, EC2Response);
    }
View Full Code Here


        EC2ImageLaunchPermission launchPermission = new EC2ImageLaunchPermission();
        launchPermission.setLaunchPermOp(EC2ImageLaunchPermission.Operation.reset);
        ec2request.addLaunchPermission(launchPermission);

        // -> execute the request
        ResetImageAttributeResponse EC2response = EC2SoapServiceImpl.toResetImageAttributeResponse(
                ServiceProvider.getInstance().getEC2Engine().modifyImageAttribute( ec2request ));
        serializeResponse(response, EC2response);
    }
View Full Code Here

        EC2ImageLaunchPermission launchPermission = new EC2ImageLaunchPermission();
        launchPermission.setLaunchPermOp(EC2ImageLaunchPermission.Operation.reset);
        ec2request.addLaunchPermission(launchPermission);

        // -> execute the request
        ResetImageAttributeResponse EC2response =
            EC2SoapServiceImpl.toResetImageAttributeResponse(ServiceProvider.getInstance().getEC2Engine().modifyImageAttribute(ec2request));
        serializeResponse(response, EC2response);
    }
View Full Code Here

        if (1 == nCount) {
            throw new EC2ServiceException( ClientError.MissingParamter, "Missing required parameter - IpPermissions");
        }

        // -> execute the request
        RevokeSecurityGroupIngressResponse EC2response = EC2SoapServiceImpl.toRevokeSecurityGroupIngressResponse(
                ServiceProvider.getInstance().getEC2Engine().revokeSecurityGroup( EC2request ));
        serializeResponse(response, EC2response);
    }
View Full Code Here

        if (1 == nCount) {
            throw new EC2ServiceException(ClientError.MissingParamter, "Missing required parameter - IpPermissions");
        }

        // -> execute the request
        RevokeSecurityGroupIngressResponse EC2response =
            EC2SoapServiceImpl.toRevokeSecurityGroupIngressResponse(ServiceProvider.getInstance().getEC2Engine().revokeSecurityGroup(EC2request));
        serializeResponse(response, EC2response);
    }
View Full Code Here

            }
        }

        // -> execute the request
        EC2Engine engine = ServiceProvider.getInstance().getEC2Engine();
        RunInstancesResponse EC2response = EC2SoapServiceImpl.toRunInstancesResponse( engine.runInstances( EC2request ), engine);
        serializeResponse(response, EC2response);
    }
View Full Code Here

        if (0 == count) {
            throw new EC2ServiceException( ClientError.MissingParamter, "Missing required parameter - InstanceId");
        }

        // -> execute the request
        StartInstancesResponse EC2response = EC2SoapServiceImpl.toStartInstancesResponse( ServiceProvider.getInstance().getEC2Engine().startInstances(EC2request));
        serializeResponse(response, EC2response);
    }
View Full Code Here

        if ( force != null) {
            EC2request.setForce( Boolean.parseBoolean(force[0]));
        }

        // -> execute the request
        StopInstancesResponse EC2response = EC2SoapServiceImpl.toStopInstancesResponse( ServiceProvider.getInstance().getEC2Engine().stopInstances( EC2request ));
        serializeResponse(response, EC2response);
    }
View Full Code Here

            throw new EC2ServiceException( ClientError.MissingParamter, "Missing required parameter - InstanceId");
        }

        // -> execute the request
        EC2request.setDestroyInstances( true );
        TerminateInstancesResponse EC2response = EC2SoapServiceImpl.toTermInstancesResponse( ServiceProvider.getInstance().getEC2Engine().stopInstances( EC2request ));
        serializeResponse(response, EC2response);
    }
View Full Code Here

    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

Related Classes of com.amazon.ec2.DescribeSpotPriceHistoryType

Copyright © 2018 www.massapicom. 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.