mirror of https://github.com/apache/jclouds.git
openstack-nova: binding missing fields to CreateVolume requests
This commit is contained in:
parent
0e7c963b05
commit
082ec6f008
|
@ -46,12 +46,12 @@ public class CreateVolumeOptions implements MapBinder {
|
||||||
@Inject
|
@Inject
|
||||||
private BindToJsonPayload jsonBinder;
|
private BindToJsonPayload jsonBinder;
|
||||||
|
|
||||||
private String name;
|
protected String name;
|
||||||
private String description;
|
protected String description;
|
||||||
private String volumeType;
|
protected String volumeType;
|
||||||
private String availabilityZone;
|
protected String availabilityZone;
|
||||||
private String snapshotId;
|
protected String snapshotId;
|
||||||
private Map<String, String> metadata = ImmutableMap.of();
|
protected Map<String, String> metadata = ImmutableMap.of();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <R extends HttpRequest> R bindToRequest(R request, Map<String, Object> postParams) {
|
public <R extends HttpRequest> R bindToRequest(R request, Map<String, Object> postParams) {
|
||||||
|
@ -61,6 +61,12 @@ public class CreateVolumeOptions implements MapBinder {
|
||||||
image.put("display_name", name);
|
image.put("display_name", name);
|
||||||
if (description != null)
|
if (description != null)
|
||||||
image.put("display_description", description);
|
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())
|
if (!metadata.isEmpty())
|
||||||
image.put("metadata", metadata);
|
image.put("metadata", metadata);
|
||||||
return jsonBinder.bindToRequest(request, ImmutableMap.of("volume", image));
|
return jsonBinder.bindToRequest(request, ImmutableMap.of("volume", image));
|
||||||
|
|
Loading…
Reference in New Issue