mirror of https://github.com/apache/jclouds.git
Use the VolumeType enum in ListVolumesOptions
This commit is contained in:
parent
ed9e4c8232
commit
78e36e7904
|
@ -649,7 +649,7 @@ public class Volume implements Comparable<Volume> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return name();
|
return name().toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static VolumeType fromValue(String resourceType) {
|
public static VolumeType fromValue(String resourceType) {
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
package org.jclouds.cloudstack.options;
|
package org.jclouds.cloudstack.options;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
import org.jclouds.cloudstack.domain.Volume;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Options used to control what volume
|
* Options used to control what volume
|
||||||
|
@ -84,8 +85,8 @@ public class ListVolumesOptions extends AccountInDomainOptions {
|
||||||
/**
|
/**
|
||||||
* @param type the type of the disk volume
|
* @param type the type of the disk volume
|
||||||
*/
|
*/
|
||||||
public ListVolumesOptions type(String type) {
|
public ListVolumesOptions type(Volume.VolumeType type) {
|
||||||
this.queryParameters.replaceValues("type", ImmutableSet.of(type + ""));
|
this.queryParameters.replaceValues("type", ImmutableSet.of(type .toString()));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,7 +179,7 @@ public class ListVolumesOptions extends AccountInDomainOptions {
|
||||||
/**
|
/**
|
||||||
* @see ListVolumesOptions#type
|
* @see ListVolumesOptions#type
|
||||||
*/
|
*/
|
||||||
public static ListVolumesOptions type(String type) {
|
public static ListVolumesOptions type(Volume.VolumeType type) {
|
||||||
ListVolumesOptions options = new ListVolumesOptions();
|
ListVolumesOptions options = new ListVolumesOptions();
|
||||||
return options.type(type);
|
return options.type(type);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue