Search in sources :

Example 91 with ActionResponse

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

the class ServerProducer method doAction.

private void doAction(Exchange exchange) {
    final Message msg = exchange.getIn();
    final Action action = msg.getHeader(NovaConstants.ACTION, Action.class);
    final String serverId = msg.getHeader(OpenstackConstants.ID, String.class);
    ObjectHelper.notNull(action, "Server action");
    ObjectHelper.notEmpty(serverId, "Server ID");
    final ActionResponse response = os.compute().servers().action(serverId, action);
    checkFailure(response, msg, "Performing action " + action.name());
}
Also used : Action(org.openstack4j.model.compute.Action) Message(org.apache.camel.Message) ActionResponse(org.openstack4j.model.common.ActionResponse)

Example 92 with ActionResponse

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

the class ServerProducer method doDelete.

private void doDelete(Exchange exchange) {
    final Message msg = exchange.getIn();
    final String serverId = msg.getHeader(OpenstackConstants.ID, String.class);
    ObjectHelper.notEmpty(serverId, "Server ID");
    final ActionResponse response = os.compute().servers().delete(serverId);
    checkFailure(response, msg, "Delete server with ID " + serverId);
}
Also used : Message(org.apache.camel.Message) ActionResponse(org.openstack4j.model.common.ActionResponse)

Example 93 with ActionResponse

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

the class FirewallRuleTests method testDeleteFirewallRule.

public void testDeleteFirewallRule() {
    respondWith(200);
    ActionResponse result = osv3().networking().firewalls().firewallrule().delete("8722e0e0-9cc9-4490-9660-8c9a5732fbb0");
    assertTrue(result.isSuccess());
}
Also used : ActionResponse(org.openstack4j.model.common.ActionResponse)

Example 94 with ActionResponse

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

the class HealthMonitorV2Tests method testDeleteHealthMonitorV2.

public void testDeleteHealthMonitorV2() {
    respondWith(204);
    ActionResponse result = osv3().networking().lbaasV2().healthMonitor().delete("350576d8-5015-4d4e-b73f-23df2397e4c4");
    assertTrue(result.isSuccess());
}
Also used : ActionResponse(org.openstack4j.model.common.ActionResponse)

Example 95 with ActionResponse

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

the class LbPoolTests method testDeletePool.

public void testDeletePool() {
    respondWith(200);
    ActionResponse result = osv3().networking().loadbalancers().lbPool().delete("02ae87ec-5502-469e-8c41-f2c57d185054");
    assertTrue(result.isSuccess());
}
Also used : 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