use of org.openstack4j.model.common.ActionResponse in project camel by apache.
the class RegionProducer method doDelete.
private void doDelete(Exchange exchange) {
final Message msg = exchange.getIn();
final String id = msg.getHeader(OpenstackConstants.ID, String.class);
ObjectHelper.notEmpty(id, "Region ID");
final ActionResponse response = osV3Client.identity().regions().delete(id);
checkFailure(response, msg, "Delete network" + id);
}
use of org.openstack4j.model.common.ActionResponse in project camel by apache.
the class ContainerProducer method doCreate.
private void doCreate(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().create(name, options);
checkFailure(out, msg, "Create container " + name);
}
use of org.openstack4j.model.common.ActionResponse in project camel by apache.
the class ContainerProducer method doDelete.
private void doDelete(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 ActionResponse out = os.objectStorage().containers().delete(name);
checkFailure(out, msg, "Delete container " + name);
}
use of org.openstack4j.model.common.ActionResponse in project camel by apache.
the class DomainProducer method doDelete.
private void doDelete(Exchange exchange) {
final Message msg = exchange.getIn();
final String id = msg.getHeader(OpenstackConstants.ID, msg.getHeader(KeystoneConstants.DOMAIN_ID, String.class), String.class);
ObjectHelper.notEmpty(id, "Domain ID");
final ActionResponse response = osV3Client.identity().domains().delete(id);
checkFailure(response, msg, "Delete domain" + id);
}
use of org.openstack4j.model.common.ActionResponse in project camel by apache.
the class GroupProducer method doAddUser.
private void doAddUser(Exchange exchange) {
final Message msg = exchange.getIn();
final String userId = msg.getHeader(KeystoneConstants.USER_ID, String.class);
final String groupId = msg.getHeader(KeystoneConstants.GROUP_ID, String.class);
ObjectHelper.notEmpty(userId, "User ID");
ObjectHelper.notEmpty(groupId, "Group ID");
final ActionResponse response = osV3Client.identity().groups().addUserToGroup(groupId, userId);
checkFailure(response, msg, String.format("Add user %s to group %s", userId, groupId));
}
Aggregations