use of org.openstack4j.model.common.ActionResponse in project camel by apache.
the class VolumeProducer method doUpdate.
private void doUpdate(Exchange exchange) {
final Message msg = exchange.getIn();
final String id = msg.getHeader(OpenstackConstants.ID, msg.getHeader(CinderConstants.VOLUME_ID, String.class), String.class);
final Volume vol = messageToVolume(msg);
ObjectHelper.notEmpty(id, "Cinder Volume ID");
ObjectHelper.notEmpty(vol.getDescription(), "Cinder Volume Description");
ObjectHelper.notEmpty(vol.getName(), "Cinder Volume Name");
final ActionResponse out = os.blockStorage().volumes().update(id, vol.getName(), vol.getDescription());
checkFailure(out, msg, "Update volume " + id);
}
use of org.openstack4j.model.common.ActionResponse in project camel by apache.
the class GlanceProducer method doDelete.
private void doDelete(Exchange exchange) {
final Message msg = exchange.getIn();
final String imageId = msg.getHeader(OpenstackConstants.ID, String.class);
ObjectHelper.notEmpty(imageId, "ImageID");
final ActionResponse response = os.compute().images().delete(imageId);
checkFailure(response, msg, "Delete image " + imageId);
}
use of org.openstack4j.model.common.ActionResponse in project camel by apache.
the class GroupProducer method doRemoveUserFromGroup.
private void doRemoveUserFromGroup(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().removeUserFromGroup(groupId, userId);
checkFailure(response, msg, String.format("Delete user %s from group %s", userId, groupId));
}
use of org.openstack4j.model.common.ActionResponse in project camel by apache.
the class GroupProducer method doCheckUserGroup.
private void doCheckUserGroup(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().checkGroupUser(groupId, userId);
msg.setBody(response.isSuccess());
}
use of org.openstack4j.model.common.ActionResponse in project camel by apache.
the class ProjectProducer method doDelete.
private void doDelete(Exchange exchange) {
final Message msg = exchange.getIn();
final String id = msg.getHeader(OpenstackConstants.ID, String.class);
ObjectHelper.notEmpty(id, "Project ID");
final ActionResponse response = osV3Client.identity().projects().delete(id);
checkFailure(response, msg, "Delete project with ID " + id);
}
Aggregations