}
glanceUploadUrl += "images";
String imageName = "image-" + System.currentTimeMillis();
Command command = Command.build("curl");
command.addLiteral("--fail");
command.addLiteral("--upload-file").addFile(imageFile);
command.addLiteral("-X").addLiteral("POST");
command.addLiteral("-H").addQuoted("X-Auth-Token: " + tokenId);
command.addLiteral("-H").addQuoted("Content-Type: application/octet-stream");
command.addLiteral("-H").addQuoted("X-Image-Meta-Name: " + imageName);
command.addLiteral("-H").addQuoted("X-Image-Meta-Is-Public: True");
// if (isQcow2) {
// command.addLiteral("-H").addQuoted("X-Image-Meta-Disk-Format: qcow2");
// } else {
if (diskFormat != null) {
command.addLiteral("-H").addQuoted("X-Image-Meta-Disk-Format: " + diskFormat);
}
command.addLiteral("-H").addQuoted("X-Image-Meta-Container-Format: bare");
// }
// command.addLiteral("-H").addQuoted("X-Image-Meta-Min-Disk: 0");
// command.addLiteral("-H").addQuoted("X-Image-Meta-Min-Ram: 0");
// command.addLiteral("-H").addQuoted("X-Image-Meta-Image-Size: " + rawImageFileSize);
command.addLiteral("-H").addQuoted("X-Image-Meta-Size: " + rawImageFileSize);
// image_meta = {'name': fields.pop('name'),
// 'is_public': utils.bool_from_string(
// fields.pop('is_public', False)),
// 'disk_format': fields.pop('disk_format', 'raw'),
// 'min_disk': fields.pop('min_disk', 0),
// 'min_ram': fields.pop('min_ram', 0),
// 'container_format': fields.pop('container_format', 'ovf')}
// glance add name=DebianSqueeze is_public=True disk_format=raw container_format=bare
// system_id="http://org.platformlayer/service/imagefactory/v1.0:bootstrap"
// image_size="${RAW_SIZE}" < disk.raw.gz
command.addQuoted(glanceUploadUrl);
command.setTimeout(TimeSpan.FIFTEEN_MINUTES);
ProcessExecution execution = target.executeCommand(command);
String imageId;
// String imageLocation;