Package com.amazon.ec2

Examples of com.amazon.ec2.GroupSetType$Factory


            EC2TagsFilterSet tfs = new EC2TagsFilterSet();
            for (int i = 0; i < filterSet.length; i++)
                tfs.addFilter(filterSet[i]);
            ec2Request.setFilterSet(tfs);
        }
        DescribeTagsResponse EC2Response = EC2SoapServiceImpl.toDescribeTagsResponse(ServiceProvider.getInstance().getEC2Engine().describeTags(ec2Request));
        serializeResponse(response, EC2Response);
    }
View Full Code Here


            EC2request.setFilterSet( vfs );
        }

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

            EC2request.setFilterSet(vfs);
        }

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

        String[] device = request.getParameterValues( "Device" );
        if ( null != device && 0 < device.length )
            EC2request.setDevice( device[0] );

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

        String[] device = request.getParameterValues("Device");
        if (null != device && 0 < device.length)
            EC2request.setDevice(device[0]);

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

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

        DisassociateAddressResponse ec2Response = EC2SoapServiceImpl.toDisassociateAddressResponse( engine.disassociateAddress( ec2Request ) );

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

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

        DisassociateAddressResponse ec2Response = EC2SoapServiceImpl.toDisassociateAddressResponse(engine.disassociateAddress(ec2Request));

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

        String instanceId = request.getParameter("InstanceId");
        if (instanceId==null) {
            throw new EC2ServiceException( ClientError.MissingParamter, "Missing required parameter - InstanceId");
        }

        GetPasswordDataResponse EC2Response = EC2SoapServiceImpl.toGetPasswordData(
                ServiceProvider.getInstance().getEC2Engine().getPasswordData(instanceId));
        serializeResponse(response, EC2Response);
    }
View Full Code Here

        String instanceId = request.getParameter("InstanceId");
        if (instanceId == null) {
            throw new EC2ServiceException(ClientError.MissingParamter, "Missing required parameter - InstanceId");
        }

        GetPasswordDataResponse EC2Response = EC2SoapServiceImpl.toGetPasswordData(ServiceProvider.getInstance().getEC2Engine().getPasswordData(instanceId));
        serializeResponse(response, EC2Response);
    }
View Full Code Here

     *
     * @see <a href="http://docs.amazonwebservices.com/AWSEC2/2010-11-15/APIReference/index.html?ApiReference-query-RunInstances.html">RunInstances</a>
     */
    public RunInstancesResponse runInstances(RunInstances runInstances) {
        RunInstancesType rit = runInstances.getRunInstances();
        GroupSetType gst = rit.getGroupSet();
        PlacementRequestType prt = rit.getPlacement();
        UserDataType userData = rit.getUserData();
        String type = rit.getInstanceType();
        String keyName = rit.getKeyName();

        EC2RunInstances request = new EC2RunInstances();

        request.setTemplateId(rit.getImageId());

        if (rit.getMinCount() < 1) {
            throw new EC2ServiceException(ClientError.InvalidParameterValue, "Value of parameter MinCount should be greater than 0");
        } else
            request.setMinCount(rit.getMinCount());

        if (rit.getMaxCount() < 1) {
            throw new EC2ServiceException(ClientError.InvalidParameterValue, "Value of parameter MaxCount should be greater than 0");
        } else
            request.setMaxCount(rit.getMaxCount());

        if (null != type)
            request.setInstanceType(type);
        if (null != prt)
            request.setZoneName(prt.getAvailabilityZone());
        if (null != userData)
            request.setUserData(userData.getData());
        if (null != keyName)
            request.setKeyName(rit.getKeyName());

        // -> we can only support one group per instance
        if (null != gst) {
            GroupItemType[] items = gst.getItem();
            if (null != items) {
                for (int i = 0; i < items.length; i++) {
                    if (items[i].getGroupName() != null) // either SG-name or SG-id can be provided
                        request.addSecuritGroupName(items[i].getGroupName());
                    else
View Full Code Here

TOP

Related Classes of com.amazon.ec2.GroupSetType$Factory

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.