use of org.apache.cloudstack.storage.datastore.api.Volume in project cloudstack by apache.
the class ScaleIOGatewayClientImpl method getVolumeByName.
@Override
public Volume getVolumeByName(String name) {
Preconditions.checkArgument(StringUtils.isNotEmpty(name), "Volume name cannot be null");
Volume searchVolume = new Volume();
searchVolume.setName(name);
String volumeId = post("/types/Volume/instances/action/queryIdByKey", searchVolume, String.class);
if (StringUtils.isNotEmpty(volumeId)) {
return getVolume(volumeId.replace("\"", ""));
}
return null;
}
Aggregations