Search in sources :

Example 51 with MsoException

use of org.onap.so.openstack.exceptions.MsoException in project so by onap.

the class NovaClientImpl method getHypervisorDetails.

public Hypervisors getHypervisorDetails(String cloudSiteId, String tenantId) throws NovaClientException {
    Nova novaClient;
    try {
        novaClient = client.getNovaClient(cloudSiteId, tenantId);
        OpenStackRequest<Hypervisors> request = novaClient.hypervisors().listDetail();
        return executeAndRecordOpenstackRequest(request, false);
    } catch (MsoException e) {
        logger.error("Error building Nova Client", e);
        throw new NovaClientException("Error building Nova Client", e);
    }
}
Also used : Hypervisors(com.woorea.openstack.nova.model.Hypervisors) MsoException(org.onap.so.openstack.exceptions.MsoException) Nova(com.woorea.openstack.nova.Nova)

Example 52 with MsoException

use of org.onap.so.openstack.exceptions.MsoException in project so by onap.

the class NovaClientImpl method queryHostAggregates.

/**
 * Query Host Aggregates
 *
 * @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 host aggregates found in openstack
 * @throws MsoCloudSiteNotFound the mso cloud site not found
 * @throws NeutronClientException if the client cannot be built this is thrown
 */
public HostAggregates queryHostAggregates(String cloudSiteId, String tenantId, int limit, String marker) throws MsoCloudSiteNotFound, NovaClientException {
    try {
        Nova novaClient = client.getNovaClient(cloudSiteId, tenantId);
        OpenStackRequest<HostAggregates> request = novaClient.aggregates().list().queryParam("limit", limit).queryParam("marker", marker);
        return executeAndRecordOpenstackRequest(request, false);
    } catch (MsoException e) {
        logger.error("Error building Nova Client", e);
        throw new NovaClientException("Error building Nova Client", e);
    }
}
Also used : HostAggregates(com.woorea.openstack.nova.model.HostAggregates) MsoException(org.onap.so.openstack.exceptions.MsoException) Nova(com.woorea.openstack.nova.Nova)

Example 53 with MsoException

use of org.onap.so.openstack.exceptions.MsoException in project so by onap.

the class NovaClientImpl method detachVolume.

public void detachVolume(String cloudSiteId, String tenantId, String serverId, String volumeId) throws NovaClientException {
    Nova novaClient;
    try {
        novaClient = client.getNovaClient(cloudSiteId, tenantId);
        OpenStackRequest<Void> request = novaClient.servers().detachVolume(serverId, volumeId);
        executeAndRecordOpenstackRequest(request, false);
    } catch (MsoException e) {
        logger.error("Error building Nova Client", e);
        throw new NovaClientException("Error building Nova Client", e);
    }
}
Also used : MsoException(org.onap.so.openstack.exceptions.MsoException) Nova(com.woorea.openstack.nova.Nova)

Aggregations

MsoException (org.onap.so.openstack.exceptions.MsoException)53 OpenStackBaseException (com.woorea.openstack.base.client.OpenStackBaseException)12 CloudSite (org.onap.so.db.catalog.beans.CloudSite)12 MsoAdapterException (org.onap.so.openstack.exceptions.MsoAdapterException)12 Nova (com.woorea.openstack.nova.Nova)10 StackInfo (org.onap.so.openstack.beans.StackInfo)10 Quantum (com.woorea.openstack.quantum.Quantum)9 MsoOpenstackException (org.onap.so.openstack.exceptions.MsoOpenstackException)9 OpenStackConnectException (com.woorea.openstack.base.client.OpenStackConnectException)8 OpenStackResponseException (com.woorea.openstack.base.client.OpenStackResponseException)8 ArrayList (java.util.ArrayList)8 Test (org.junit.Test)8 BaseTest (org.onap.so.BaseTest)7 MsoIOException (org.onap.so.openstack.exceptions.MsoIOException)7 HashMap (java.util.HashMap)6 VnfException (org.onap.so.adapters.vnf.exceptions.VnfException)6 MsoCloudSiteNotFound (org.onap.so.openstack.exceptions.MsoCloudSiteNotFound)6 IOException (java.io.IOException)5 NetworkException (org.onap.so.adapters.network.exceptions.NetworkException)5 HeatTemplate (org.onap.so.db.catalog.beans.HeatTemplate)5