@author Adrian Cole
@see
}
private void createSnapshot(Volume volume) throws TimeoutException {
System.out.println("Create Snapshot");
CreateSnapshotOptions options = CreateSnapshotOptions.Builder
.name(Constants.NAME)
.description("Snapshot of " + volume.getId());
Snapshot snapshot = snapshotApi.create(volume.getId(), options);
.payload(payloadFromResourceWithContentType("/snapshot_create.json", MediaType.APPLICATION_JSON))
.build(),
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/snapshot_create_response.json")).build()
).getSnapshotApiForZone("RegionOne");
CreateSnapshotOptions options = CreateSnapshotOptions.Builder
.name("jclouds-test-snapshot")
.description("jclouds test snapshot")
.force();
Snapshot snapshot = api.create("ea6f70ef-2784-40b9-9d14-d7f33c507c3f", options);
.payload(payloadFromResourceWithContentType("/snapshot_create.json", MediaType.APPLICATION_JSON))
.build(),
HttpResponse.builder().statusCode(404).build()
).getSnapshotApiForZone("RegionOne");
CreateSnapshotOptions options = CreateSnapshotOptions.Builder
.name("jclouds-test-snapshot")
.description("jclouds test snapshot")
.force();
api.create("ea6f70ef-2784-40b9-9d14-d7f33c507c3f", options);
.statusCode(400)
.payload("{\"badRequest\": {\"message\": \"Invalid volume: must be available\", \"code\": 400}}")
.build()
).getSnapshotApiForZone("RegionOne");
CreateSnapshotOptions options = CreateSnapshotOptions.Builder
.name("jclouds-test-snapshot")
.description("jclouds test snapshot")
.force();
api.create("ea6f70ef-2784-40b9-9d14-d7f33c507c3f", options);
.payload(payloadFromResourceWithContentType("/snapshot_create.json", MediaType.APPLICATION_JSON))
.build(),
HttpResponse.builder().statusCode(401).build()
).getSnapshotApiForZone("RegionOne");
CreateSnapshotOptions options = CreateSnapshotOptions.Builder
.name("jclouds-test-snapshot")
.description("jclouds test snapshot")
.force();
api.create("ea6f70ef-2784-40b9-9d14-d7f33c507c3f", options);
}
private void createSnapshot(Volume volume) throws TimeoutException {
System.out.format("Create Snapshot%n");
CreateSnapshotOptions options = CreateSnapshotOptions.Builder
.name(NAME)
.description("Snapshot of " + volume.getId());
Snapshot snapshot = snapshotApi.create(volume.getId(), options);
.payload(payloadFromResourceWithContentType("/snapshot_create.json", MediaType.APPLICATION_JSON))
.build(),
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/snapshot_create_response.json")).build()
).getSnapshotApi("RegionOne");
CreateSnapshotOptions options = CreateSnapshotOptions.Builder
.name("jclouds-test-snapshot")
.description("jclouds test snapshot")
.force();
Snapshot snapshot = api.create("ea6f70ef-2784-40b9-9d14-d7f33c507c3f", options);
.payload(payloadFromResourceWithContentType("/snapshot_create.json", MediaType.APPLICATION_JSON))
.build(),
HttpResponse.builder().statusCode(404).build()
).getSnapshotApi("RegionOne");
CreateSnapshotOptions options = CreateSnapshotOptions.Builder
.name("jclouds-test-snapshot")
.description("jclouds test snapshot")
.force();
api.create("ea6f70ef-2784-40b9-9d14-d7f33c507c3f", options);
.wrap("{\"badRequest\": {\"message\": \"Invalid volume: must be available\", \"code\": 400}}"
.getBytes())))
.build()
).getSnapshotApi("RegionOne");
CreateSnapshotOptions options = CreateSnapshotOptions.Builder
.name("jclouds-test-snapshot")
.description("jclouds test snapshot")
.force();
api.create("ea6f70ef-2784-40b9-9d14-d7f33c507c3f", options);
.payload(payloadFromResourceWithContentType("/snapshot_create.json", MediaType.APPLICATION_JSON))
.build(),
HttpResponse.builder().statusCode(401).build()
).getSnapshotApi("RegionOne");
CreateSnapshotOptions options = CreateSnapshotOptions.Builder
.name("jclouds-test-snapshot")
.description("jclouds test snapshot")
.force();
api.create("ea6f70ef-2784-40b9-9d14-d7f33c507c3f", options);
Related Classes of org.jclouds.ec2.options.CreateSnapshotOptions
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.