Package com.amazon.ec2

Examples of com.amazon.ec2.DescribeVolumesResponse


            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

        return ifs;
    }

    // toMethods
    public static DescribeVolumesResponse toDescribeVolumesResponse(EC2DescribeVolumesResponse engineResponse, EC2Engine engine) {
        DescribeVolumesResponse response = new DescribeVolumesResponse();
        DescribeVolumesResponseType param1 = new DescribeVolumesResponseType();
        DescribeVolumesSetResponseType param2 = new DescribeVolumesSetResponseType();

        EC2Volume[] volumes = engineResponse.getVolumeSet();
        for (EC2Volume vol : volumes) {
            DescribeVolumesSetItemResponseType param3 = new DescribeVolumesSetItemResponseType();
            param3.setVolumeId(vol.getId().toString());

            Long volSize = new Long(vol.getSize());
            param3.setSize(volSize.toString());
            String snapId = vol.getSnapshotId() != null ? vol.getSnapshotId().toString() : "";
            param3.setSnapshotId(snapId);
            param3.setAvailabilityZone(vol.getZoneName());
            param3.setStatus(vol.getState());
            param3.setVolumeType("standard");

            // -> CloudStack seems to have issues with timestamp formats so just in case
            Calendar cal = EC2RestAuth.parseDateString(vol.getCreated());
            if (cal == null) {
                cal = Calendar.getInstance();
                cal.set(1970, 1, 1);
            }
            param3.setCreateTime(cal);

            AttachmentSetResponseType param4 = new AttachmentSetResponseType();
            if (null != vol.getInstanceId()) {
                AttachmentSetItemResponseType param5 = new AttachmentSetItemResponseType();
                param5.setVolumeId(vol.getId().toString());
                param5.setInstanceId(vol.getInstanceId().toString());
                String devicePath = engine.cloudDeviceIdToDevicePath(vol.getHypervisor(), vol.getDeviceId());
                param5.setDevice(devicePath);
                param5.setStatus(vol.getAttachmentState());
                if (vol.getAttached() == null) {
                    param5.setAttachTime(cal);
                } else {
                    Calendar attachTime = EC2RestAuth.parseDateString(vol.getAttached());
                    param5.setAttachTime(attachTime);
                }
                param5.setDeleteOnTermination(false);
                param4.addItem(param5);
            }

            param3.setAttachmentSet(param4);

            EC2TagKeyValue[] tags = vol.getResourceTags();
            param3.setTagSet(setResourceTags(tags));
            param2.addItem(param3);
        }
        param1.setVolumeSet(param2);
        param1.setRequestId(UUID.randomUUID().toString());
        response.setDescribeVolumesResponse(param1);
        return response;
    }
View Full Code Here

          for( int i=0; i < filterSet.length; i++ ) vfs.addFilter( filterSet[i] );
          EC2request.setFilterSet( vfs );
        }
       
        // -> execute the request
        DescribeVolumesResponse EC2response = EC2SoapServiceImpl.toDescribeVolumesResponse( ServiceProvider.getInstance().getEC2Engine().handleRequest( EC2request ));
        serializeResponse(response, EC2response);
    }
View Full Code Here

          for( int i=0; i < filterSet.length; i++ ) vfs.addFilter( filterSet[i] );
          EC2request.setFilterSet( vfs );
        }
       
        // -> execute the request
        DescribeVolumesResponse EC2response = EC2SoapServiceImpl.toDescribeVolumesResponse( ServiceProvider.getInstance().getEC2Engine().handleRequest( 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

            for( int i=0; i < filterSet.length; i++ ) vfs.addFilter( filterSet[i] );
            EC2request.setFilterSet( vfs );
        }

        // -> execute the request
        DescribeVolumesResponse EC2response = EC2SoapServiceImpl.toDescribeVolumesResponse( ServiceProvider.getInstance().getEC2Engine().handleRequest( 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

        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

TOP

Related Classes of com.amazon.ec2.DescribeVolumesResponse

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.