From 082ec6f00879a859d3f604cc176f67b610186090 Mon Sep 17 00:00:00 2001 From: Adam Lowe Date: Wed, 8 Aug 2012 09:37:30 +0100 Subject: [PATCH] openstack-nova: binding missing fields to CreateVolume requests --- .../nova/v2_0/options/CreateVolumeOptions.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/options/CreateVolumeOptions.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/options/CreateVolumeOptions.java index 03422e19d7..097b0a94cc 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/options/CreateVolumeOptions.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/options/CreateVolumeOptions.java @@ -46,12 +46,12 @@ public class CreateVolumeOptions implements MapBinder { @Inject private BindToJsonPayload jsonBinder; - private String name; - private String description; - private String volumeType; - private String availabilityZone; - private String snapshotId; - private Map metadata = ImmutableMap.of(); + protected String name; + protected String description; + protected String volumeType; + protected String availabilityZone; + protected String snapshotId; + protected Map metadata = ImmutableMap.of(); @Override public R bindToRequest(R request, Map postParams) { @@ -61,6 +61,12 @@ public class CreateVolumeOptions implements MapBinder { image.put("display_name", name); if (description != null) image.put("display_description", description); + if (volumeType != null) + image.put("volume_type", volumeType); + if (availabilityZone != null) + image.put("availability_zone", availabilityZone); + if (snapshotId != null) + image.put("snapshot_id", snapshotId); if (!metadata.isEmpty()) image.put("metadata", metadata); return jsonBinder.bindToRequest(request, ImmutableMap.of("volume", image));