Examples of DescribeSnapshotsResult


Examples of com.amazonaws.services.ec2.model.DescribeSnapshotsResult

            while (true)
            {
                log.info("Sleeping for " + snapshotSleep.get() + " ms");
                Thread.sleep(snapshotSleep.get());

                DescribeSnapshotsResult describeSnapshotsResult = ec2Client.describeSnapshots(describeSnapshotsRequest);
                String state = describeSnapshotsResult.getSnapshots().get(0).getState();
                log.info("Snapshot State = " + state);
                if ("error".equals(state))
                {
                    return Optional.absent();
                }
                if ("completed".equals(state))
                {
                    snapshot = describeSnapshotsResult.getSnapshots().get(0);
                    break;
                }
            }

            ec2Client.deleteVolume(new DeleteVolumeRequest().
View Full Code Here

Examples of com.amazonaws.services.ec2.model.DescribeSnapshotsResult

        // Set the owner id to self to avoid getting snapshots from other accounts.
        request.withOwnerIds(Arrays.<String>asList("self"));
        if (snapshotIds != null) {
            request.setSnapshotIds(Arrays.asList(snapshotIds));
        }
        DescribeSnapshotsResult result = ec2Client.describeSnapshots(request);
        List<Snapshot> snapshots = result.getSnapshots();

        LOGGER.info(String.format("Got %d EBS snapshots in region %s.", snapshots.size(), region));
        return snapshots;
    }
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.