Search in sources :

Example 11 with Volume

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;
}
Also used : Volume(org.apache.cloudstack.storage.datastore.api.Volume)

Aggregations

Volume (org.apache.cloudstack.storage.datastore.api.Volume)11 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)3 BasicCredentials (com.github.tomakehurst.wiremock.client.BasicCredentials)2 IOException (java.io.IOException)2 SocketTimeoutException (java.net.SocketTimeoutException)2 URISyntaxException (java.net.URISyntaxException)2 KeyManagementException (java.security.KeyManagementException)2 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)2 ServerApiException (org.apache.cloudstack.api.ServerApiException)2 SdcMappingInfo (org.apache.cloudstack.storage.datastore.api.SdcMappingInfo)2 VTreeMigrationInfo (org.apache.cloudstack.storage.datastore.api.VTreeMigrationInfo)2 ConnectTimeoutException (org.apache.http.conn.ConnectTimeoutException)2 Test (org.junit.Test)2 ArrayList (java.util.ArrayList)1 VolumeStatistics (org.apache.cloudstack.storage.datastore.api.VolumeStatistics)1