Java 类com.amazonaws.services.ec2.model.CreateSnapshotRequest 实例源码

项目:photon-model    文件:TestAWSSetupUtils.java   
/**
 * Creates a snapshot and return the snapshot id.
 */
public static String createSnapshot(VerificationHost host, AmazonEC2Client client, String volumeId) {
    CreateSnapshotRequest req = new CreateSnapshotRequest()
            .withVolumeId(volumeId);
    CreateSnapshotResult res = client.createSnapshot(req);
    String snapshotId = res.getSnapshot().getSnapshotId();
    Filter filter = new Filter().withName(SNAPSHOT_ID_ATTRIBUTE).withValues(snapshotId);

    DescribeSnapshotsRequest snapshotsRequest = new DescribeSnapshotsRequest()
            .withSnapshotIds(snapshotId)
            .withFilters(filter);
    host.waitFor("Timeout waiting for creating snapshot", () -> {
        DescribeSnapshotsResult snapshotsResult = client.describeSnapshots(snapshotsRequest);
        String state = snapshotsResult.getSnapshots().get(0).getState();
        if (state.equalsIgnoreCase(SNAPSHOT_STATUS_COMPLETE)) {
            return true;
        }
        return false;
    });
    return snapshotId;
}
项目:aws-sdk-java-resources    文件:VolumeImpl.java   
@Override
public Snapshot createSnapshot(CreateSnapshotRequest request,
        ResultCapture<CreateSnapshotResult> extractor) {

    ActionResult result = resource.performAction("CreateSnapshot", request,
            extractor);

    if (result == null) return null;
    return new SnapshotImpl(result.getResource());
}
项目:aws-sdk-java-resources    文件:VolumeImpl.java   
@Override
public Snapshot createSnapshot(String description,
        ResultCapture<CreateSnapshotResult> extractor) {

    CreateSnapshotRequest request = new CreateSnapshotRequest()
        .withDescription(description);
    return createSnapshot(request, extractor);
}
项目:aws-sdk-java-resources    文件:EC2Impl.java   
@Override
public Snapshot createSnapshot(CreateSnapshotRequest request,
        ResultCapture<CreateSnapshotResult> extractor) {

    ActionResult result = service.performAction("CreateSnapshot", request,
            extractor);

    if (result == null) return null;
    return new SnapshotImpl(result.getResource());
}
项目:aws-sdk-java-resources    文件:EC2Impl.java   
@Override
public Snapshot createSnapshot(String description, String volumeId,
        ResultCapture<CreateSnapshotResult> extractor) {

    CreateSnapshotRequest request = new CreateSnapshotRequest()
        .withDescription(description)
        .withVolumeId(volumeId);
    return createSnapshot(request, extractor);
}
项目:elasticsearch_my    文件:AmazonEC2Mock.java   
@Override
public CreateSnapshotResult createSnapshot(CreateSnapshotRequest createSnapshotRequest) throws AmazonServiceException, AmazonClientException {
    throw new UnsupportedOperationException("Not supported in mock");
}
项目:aws-sdk-java-resources    文件:VolumeImpl.java   
@Override
public Snapshot createSnapshot(CreateSnapshotRequest request) {
    return createSnapshot(request, null);
}
项目:aws-sdk-java-resources    文件:EC2Impl.java   
@Override
public Snapshot createSnapshot(CreateSnapshotRequest request) {
    return createSnapshot(request, null);
}
项目:cloudbreak    文件:EncryptedSnapshotPreparator.java   
private CreateSnapshotRequest prepareCreateSnapshotRequest(CreateVolumeResult volumeResult) {
    return new CreateSnapshotRequest().withVolumeId(volumeResult.getVolume().getVolumeId()).withDescription(ENCRYPTED_SNAPSHOT);
}
项目:aws-sdk-java-resources    文件:EC2.java   
/**
 * Performs the <code>CreateSnapshot</code> action.
 *
 * <p>
 *
 * @return The <code>Snapshot</code> resource object associated with the
 *         result of this action.
 * @see CreateSnapshotRequest
 */
com.amazonaws.resources.ec2.Snapshot createSnapshot(CreateSnapshotRequest
        request);
项目:aws-sdk-java-resources    文件:EC2.java   
/**
 * Performs the <code>CreateSnapshot</code> action and use a ResultCapture
 * to retrieve the low-level client response.
 *
 * <p>
 *
 * @return The <code>Snapshot</code> resource object associated with the
 *         result of this action.
 * @see CreateSnapshotRequest
 */
com.amazonaws.resources.ec2.Snapshot createSnapshot(CreateSnapshotRequest
        request, ResultCapture<CreateSnapshotResult> extractor);
项目:aws-sdk-java-resources    文件:Volume.java   
/**
 * Performs the <code>CreateSnapshot</code> action.
 *
 * <p>
 * The following request parameters will be populated from the data of this
 * <code>Volume</code> resource, and any conflicting parameter value set in
 * the request will be overridden:
 * <ul>
 *   <li>
 *     <b><code>VolumeId</code></b>
 *         - mapped from the <code>Id</code> identifier.
 *   </li>
 * </ul>
 *
 * <p>
 *
 * @return The <code>Snapshot</code> resource object associated with the
 *         result of this action.
 * @see CreateSnapshotRequest
 */
Snapshot createSnapshot(CreateSnapshotRequest request);
项目:aws-sdk-java-resources    文件:Volume.java   
/**
 * Performs the <code>CreateSnapshot</code> action and use a ResultCapture
 * to retrieve the low-level client response.
 *
 * <p>
 * The following request parameters will be populated from the data of this
 * <code>Volume</code> resource, and any conflicting parameter value set in
 * the request will be overridden:
 * <ul>
 *   <li>
 *     <b><code>VolumeId</code></b>
 *         - mapped from the <code>Id</code> identifier.
 *   </li>
 * </ul>
 *
 * <p>
 *
 * @return The <code>Snapshot</code> resource object associated with the
 *         result of this action.
 * @see CreateSnapshotRequest
 */
Snapshot createSnapshot(CreateSnapshotRequest request,
        ResultCapture<CreateSnapshotResult> extractor);