.allowMultimount(false) .jobs(ImmutableList.of(new Job.Builder() .resourceUri("/api/2.0/jobs/")
@Test public void testCreateDrive() throws Exception { CloudSigma2Api api = requestSendsResponse( postBuilder() .payload(payloadFromResourceWithContentType("/drives-create-request.json", MediaType.APPLICATION_JSON)) .endpoint(endpoint + "drives/") .build(), responseBuilder() .payload(payloadFromResourceWithContentType("/drives-single.json", MediaType.APPLICATION_JSON)) .build()); DriveInfo result = api.createDrive(new DriveInfo.Builder() .media(org.jclouds.cloudsigma2.domain.MediaType.DISK) .name("test_drive_0") .size(new BigInteger("1024000000")) .allowMultimount(false) .build()); assertNotNull(result); }
.name("test_drive_0") .size(new BigInteger("1024000000")) .allowMultimount(false) .build(), new DriveInfo.Builder() .name("test_drive_1") .size(new BigInteger("1024000000")) .allowMultimount(false) .build(), new DriveInfo.Builder() .name("test_drive_2") .size(new BigInteger("1024000000")) .allowMultimount(false) .build())); assertNotNull(result);
@Test public void testCloneDrive() throws Exception { String uuid = "92ca1450-417e-4cc1-983b-1015777e2591"; CloudSigma2Api api = requestSendsResponse( postBuilder() .payload(payloadFromResourceWithContentType("/drives-create-request.json", MediaType.APPLICATION_JSON)) .endpoint(endpoint + "drives/" + uuid + "/action/?do=clone") .build(), responseBuilder() .payload(payloadFromResourceWithContentType("/drive-cloned.json", MediaType.APPLICATION_JSON)) .build()); DriveInfo result = api.cloneDrive(uuid, new DriveInfo.Builder() .media(org.jclouds.cloudsigma2.domain.MediaType.DISK) .name("test_drive_0") .size(new BigInteger("1024000000")) .allowMultimount(false) .build()); assertNotNull(result); }
@Test public void testEditDrive() throws Exception { String uuid = "e96f3c63-6f50-47eb-9401-a56c5ccf6b32"; CloudSigma2Api api = requestSendsResponse( putBuilder() .payload(payloadFromResourceWithContentType("/drives-create-request.json", MediaType.APPLICATION_JSON)) .endpoint(endpoint + "drives/" + uuid + "/") .build(), responseBuilder() .payload(payloadFromResourceWithContentType("/drives-detail.json", MediaType.APPLICATION_JSON)) .build()); DriveInfo result = api.editDrive(uuid, new DriveInfo.Builder() .media(org.jclouds.cloudsigma2.domain.MediaType.DISK) .name("test_drive_0") .size(new BigInteger("1024000000")) .allowMultimount(false) .build()); assertNotNull(result); }
public static Builder fromDriveInfo(DriveInfo in) { return new Builder() .uuid(in.getUuid()) .name(in.getName()) .resourceUri(in.getResourceUri()) .owner(in.getOwner()) .status(in.getStatus()) .size(in.getSize()) .allowMultimount(in.isAllowMultimount()) .affinities(in.getAffinities()) .jobs(in.getJobs()) .licenses(in.getLicenses()) .media(in.getMedia()) .meta(in.getMeta()) .mountedOn(in.getMountedOn()) .tags(in.getTags()); }
public static Builder fromDriveInfo(DriveInfo in) { return new Builder() .uuid(in.getUuid()) .name(in.getName()) .resourceUri(in.getResourceUri()) .owner(in.getOwner()) .status(in.getStatus()) .size(in.getSize()) .allowMultimount(in.isAllowMultimount()) .affinities(in.getAffinities()) .jobs(in.getJobs()) .licenses(in.getLicenses()) .media(in.getMedia()) .meta(in.getMeta()) .mountedOn(in.getMountedOn()) .tags(in.getTags()); }
public static Builder fromDriveInfo(DriveInfo in) { return new Builder() .uuid(in.getUuid()) .name(in.getName()) .resourceUri(in.getResourceUri()) .owner(in.getOwner()) .status(in.getStatus()) .size(in.getSize()) .allowMultimount(in.isAllowMultimount()) .affinities(in.getAffinities()) .jobs(in.getJobs()) .licenses(in.getLicenses()) .media(in.getMedia()) .meta(in.getMeta()) .mountedOn(in.getMountedOn()) .tags(in.getTags()); }