Search in sources :

Example 56 with ActionResponse

use of org.openstack4j.model.common.ActionResponse in project openstack4j by ContainX.

the class SecurityServiceTests method delete.

@Test
public void delete() throws Exception {
    respondWith(202);
    ActionResponse response = osv3().share().securityServices().delete("32e921ed-f399-4e7a-b05b-786f482bd369");
    assertTrue(response.isSuccess());
}
Also used : ActionResponse(org.openstack4j.model.common.ActionResponse) AbstractTest(org.openstack4j.api.AbstractTest) Test(org.testng.annotations.Test)

Example 57 with ActionResponse

use of org.openstack4j.model.common.ActionResponse in project openstack4j by ContainX.

the class ShareInstanceTests method forceDelete.

@Test
public void forceDelete() throws Exception {
    respondWith(202);
    ActionResponse response = osv3().share().shareInstances().forceDelete("081f7030-c54f-42f5-98ee-93a37393e0f2");
    assertTrue(response.isSuccess());
}
Also used : ActionResponse(org.openstack4j.model.common.ActionResponse) AbstractTest(org.openstack4j.api.AbstractTest) Test(org.testng.annotations.Test)

Example 58 with ActionResponse

use of org.openstack4j.model.common.ActionResponse in project openstack4j by ContainX.

the class ShareInstanceTests method resetState.

@Test
public void resetState() throws Exception {
    respondWith(202);
    ActionResponse response = osv3().share().shareInstances().resetState("081f7030-c54f-42f5-98ee-93a37393e0f2", ShareInstance.Status.AVAILABLE);
    assertTrue(response.isSuccess());
}
Also used : ActionResponse(org.openstack4j.model.common.ActionResponse) AbstractTest(org.openstack4j.api.AbstractTest) Test(org.testng.annotations.Test)

Example 59 with ActionResponse

use of org.openstack4j.model.common.ActionResponse in project openstack4j by ContainX.

the class ImageV2Tests method testDeleteImage.

public void testDeleteImage() throws IOException {
    respondWith(204);
    ActionResponse delete = osv3().imagesV2().delete("8a2ea42d-06b5-42c2-a54d-97105420f2bb");
    assertTrue(delete.isSuccess());
}
Also used : ActionResponse(org.openstack4j.model.common.ActionResponse)

Example 60 with ActionResponse

use of org.openstack4j.model.common.ActionResponse in project openstack4j by ContainX.

the class ImageV2Tests method UploadImage.

public void UploadImage() throws IOException {
    respondWith(204);
    String imageId = "4b434528-032b-4467-946c-b5880ce15c06";
    InputStream s = new ByteArrayInputStream(BINARY_IMAGE_DATA.getBytes(StandardCharsets.UTF_8));
    Payload<InputStream> payload = Payloads.create(s);
    ActionResponse upload = osv3().imagesV2().upload(imageId, payload, null);
    assertTrue(upload.isSuccess());
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) ActionResponse(org.openstack4j.model.common.ActionResponse)

Aggregations

ActionResponse (org.openstack4j.model.common.ActionResponse)123 AbstractTest (org.openstack4j.api.AbstractTest)54 Test (org.testng.annotations.Test)54 Message (org.apache.camel.Message)25 ArrayList (java.util.ArrayList)2 CreateUpdateContainerOptions (org.openstack4j.model.storage.object.options.CreateUpdateContainerOptions)2 TroveBuilders (org.openstack4j.openstack.trove.builder.TroveBuilders)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 File (java.io.File)1 InputStream (java.io.InputStream)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 RecordedRequest (okhttp3.mockwebserver.RecordedRequest)1 ResponseToActionResponse (org.openstack4j.core.transport.functions.ResponseToActionResponse)1 Action (org.openstack4j.model.compute.Action)1 User (org.openstack4j.model.identity.v3.User)1 Volume (org.openstack4j.model.storage.block.Volume)1 VolumeSnapshot (org.openstack4j.model.storage.block.VolumeSnapshot)1 KeystoneUser (org.openstack4j.openstack.identity.v3.domain.KeystoneUser)1 TroveDatabase (org.openstack4j.openstack.trove.domain.TroveDatabase)1