Search in sources :

Example 1 with Volumes

use of com.woorea.openstack.cinder.model.Volumes in project so by onap.

the class CinderClientImpl method queryVolumes.

/**
 * Query images
 *
 * @param cloudSiteId the cloud site id
 * @param tenantId the tenant id
 * @param limit limits the number of records returned
 * @param marker the last viewed record
 * @return the list of images in openstack
 * @throws CinderClientException the glance client exception
 */
public Volumes queryVolumes(String cloudSiteId, String tenantId, int limit, String marker) throws CinderClientException {
    try {
        Cinder cinderClient = getCinderClient(cloudSiteId, tenantId);
        // list is set to false, otherwise an invalid URL is appended
        OpenStackRequest<Volumes> request = cinderClient.volumes().list(false).queryParam("limit", limit).queryParam("marker", marker);
        return executeAndRecordOpenstackRequest(request, false);
    } catch (MsoException e) {
        String errorMsg = "Error building Cinder Client";
        logger.error(errorMsg, e);
        throw new CinderClientException(errorMsg, e);
    }
}
Also used : Volumes(com.woorea.openstack.cinder.model.Volumes) MsoException(org.onap.so.openstack.exceptions.MsoException) Cinder(com.woorea.openstack.cinder.Cinder)

Aggregations

Cinder (com.woorea.openstack.cinder.Cinder)1 Volumes (com.woorea.openstack.cinder.model.Volumes)1 MsoException (org.onap.so.openstack.exceptions.MsoException)1