use of org.apache.camel.Message 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);
}
use of org.apache.camel.Message in project camel by apache.
the class VolumeProducer method doCreate.
private void doCreate(Exchange exchange) {
final Message msg = exchange.getIn();
final Volume in = messageToVolume(msg);
final Volume out = os.blockStorage().volumes().create(in);
msg.setBody(out);
}
use of org.apache.camel.Message in project camel by apache.
the class GlanceProducer method doUpload.
private void doUpload(Exchange exchange) {
final Message msg = exchange.getIn();
final String imageId = msg.getHeader(OpenstackConstants.ID, String.class);
ObjectHelper.notEmpty(imageId, "Image ID");
final Image in = messageHeadersToImage(msg, false);
final Payload payload = createPayload(msg);
final Image out = os.images().upload(imageId, payload, in);
msg.setBody(out);
}
use of org.apache.camel.Message 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);
}
use of org.apache.camel.Message 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");
}
Aggregations