Search in sources :

Example 1 with ActionResponse

use of org.openstack4j.model.common.ActionResponse in project camel by apache.

the class RouterProducer method doDelete.

private void doDelete(Exchange exchange) {
    final Message msg = exchange.getIn();
    final String id = msg.getHeader(OpenstackConstants.ID, msg.getHeader(NeutronConstants.ROUTER_ID, String.class), String.class);
    ObjectHelper.notEmpty(id, "Router ID");
    final ActionResponse response = os.networking().router().delete(id);
    checkFailure(response, msg, "Delete router with ID " + id);
}
Also used : Message(org.apache.camel.Message) ActionResponse(org.openstack4j.model.common.ActionResponse)

Example 2 with ActionResponse

use of org.openstack4j.model.common.ActionResponse in project camel by apache.

the class VolumeProducer method doDelete.

private void doDelete(Exchange exchange) {
    final Message msg = exchange.getIn();
    final String id = msg.getHeader(OpenstackConstants.ID, msg.getHeader(CinderConstants.VOLUME_ID, String.class), String.class);
    ObjectHelper.notEmpty(id, "Cinder Volume ID");
    final ActionResponse out = os.blockStorage().volumes().delete(id);
    checkFailure(out, msg, "Delete volume " + id);
}
Also used : Message(org.apache.camel.Message) ActionResponse(org.openstack4j.model.common.ActionResponse)

Example 3 with ActionResponse

use of org.openstack4j.model.common.ActionResponse in project camel by apache.

the class SubnetProducer method doDelete.

private void doDelete(Exchange exchange) {
    final Message msg = exchange.getIn();
    final String id = msg.getHeader(OpenstackConstants.ID, msg.getHeader(NeutronConstants.SUBNET_ID, String.class), String.class);
    ObjectHelper.notEmpty(id, "Subnet ID");
    final ActionResponse response = os.networking().subnet().delete(id);
    checkFailure(response, msg, "Delete network " + id);
}
Also used : Message(org.apache.camel.Message) ActionResponse(org.openstack4j.model.common.ActionResponse)

Example 4 with ActionResponse

use of org.openstack4j.model.common.ActionResponse in project camel by apache.

the class FlavorsProducer method doDelete.

private void doDelete(Exchange exchange) {
    final Message msg = exchange.getIn();
    final String flavorId = msg.getHeader(OpenstackConstants.ID, msg.getHeader(NovaConstants.FLAVOR_ID, String.class), String.class);
    ObjectHelper.notEmpty(flavorId, "FlavorID");
    final ActionResponse response = os.compute().flavors().delete(flavorId);
    checkFailure(response, msg, "Delete flavor");
}
Also used : Message(org.apache.camel.Message) ActionResponse(org.openstack4j.model.common.ActionResponse)

Example 5 with ActionResponse

use of org.openstack4j.model.common.ActionResponse in project camel by apache.

the class KeypairProducer method doDelete.

private void doDelete(Exchange exchange) {
    final Message msg = exchange.getIn();
    final String keypairName = msg.getHeader(OpenstackConstants.NAME, String.class);
    ObjectHelper.notEmpty(keypairName, "Keypair name");
    final ActionResponse response = os.compute().keypairs().delete(keypairName);
    checkFailure(response, msg, "Delete keypair " + keypairName);
}
Also used : Message(org.apache.camel.Message) 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