use of org.openstack4j.model.common.ActionResponse in project camel by apache.
the class UserProducer method doDelete.
private void doDelete(Exchange exchange) {
final Message msg = exchange.getIn();
final String id = msg.getHeader(OpenstackConstants.ID, msg.getHeader(KeystoneConstants.USER_ID, String.class), String.class);
ObjectHelper.notEmpty(id, "User ID");
final ActionResponse response = osV3Client.identity().users().delete(id);
checkFailure(response, msg, "Delete user with ID " + id);
}
use of org.openstack4j.model.common.ActionResponse in project camel by apache.
the class NetworkProducer method doDelete.
private void doDelete(Exchange exchange) {
final Message msg = exchange.getIn();
final String id = msg.getHeader(OpenstackConstants.ID, msg.getHeader(NeutronConstants.NETWORK_ID, String.class), String.class);
ObjectHelper.notEmpty(id, "Network ID");
final ActionResponse response = os.networking().network().delete(id);
checkFailure(response, msg, "Delete network" + id);
}
use of org.openstack4j.model.common.ActionResponse in project camel by apache.
the class PortProducer method doDelete.
private void doDelete(Exchange exchange) {
final Message msg = exchange.getIn();
final String id = msg.getHeader(OpenstackConstants.ID, msg.getHeader(NeutronConstants.PORT_ID, String.class), String.class);
ObjectHelper.notEmpty(id, "Port ID");
final ActionResponse response = os.networking().port().delete(id);
checkFailure(response, msg, "Delete port with ID " + id);
}
use of org.openstack4j.model.common.ActionResponse in project camel by apache.
the class ContainerProducer method doUpdate.
private void doUpdate(Exchange exchange) {
final Message msg = exchange.getIn();
final String name = msg.getHeader(OpenstackConstants.NAME, msg.getHeader(SwiftConstants.CONTAINER_NAME, String.class), String.class);
ObjectHelper.notEmpty(name, "Container name");
final CreateUpdateContainerOptions options = messageToCreateUpdateOptions(msg);
final ActionResponse out = os.objectStorage().containers().update(name, options);
checkFailure(out, msg, "Update container " + name);
}
use of org.openstack4j.model.common.ActionResponse in project camel by apache.
the class ObjectProducer method doDelete.
private void doDelete(Exchange exchange) {
final Message msg = exchange.getIn();
final String containerName = msg.getHeader(SwiftConstants.CONTAINER_NAME, String.class);
final String objectName = msg.getHeader(SwiftConstants.OBJECT_NAME, String.class);
ObjectHelper.notEmpty(containerName, "Container name");
ObjectHelper.notEmpty(objectName, "Object name");
final ActionResponse out = os.objectStorage().objects().delete(containerName, objectName);
msg.setBody(out.getFault());
msg.setFault(!out.isSuccess());
}
Aggregations