Search in sources :

Example 26 with SOSFailure

use of com.emc.storageos.vasa.fault.SOSFailure in project coprhd-controller by CoprHD.

the class SyncManager method getProviderTenantId.

/**
 * Makes call to Bourne to get tenant provider Uri
 *
 * @return tenant provider Uri
 * @throws SOSFailure
 *             if call to Bourne fails
 */
private String getProviderTenantId() throws SOSFailure {
    final String methodName = "getProviderTenantId(): ";
    log.trace(methodName + "Entry");
    String rootTenantUri = null;
    final String ROOT_TENANT_URI = "/tenant";
    try {
        Tenant tenant = _client.queryObject(ROOT_TENANT_URI, Tenant.class);
        rootTenantUri = tenant.getId();
    } catch (NoSuchAlgorithmException e) {
        log.error(methodName + "NoSuchAlgorithmException occured", e);
        throw new SOSFailure(e);
    } catch (UniformInterfaceException e) {
        log.error(methodName + "UniformInterfaceException occured", e);
        throw new SOSFailure(e);
    }
    log.trace(methodName + "Exit returing tenant uri[" + rootTenantUri + "]");
    return rootTenantUri;
}
Also used : Tenant(com.emc.storageos.vasa.data.internal.Tenant) UniformInterfaceException(com.sun.jersey.api.client.UniformInterfaceException) SOSFailure(com.emc.storageos.vasa.fault.SOSFailure) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException)

Example 27 with SOSFailure

use of com.emc.storageos.vasa.fault.SOSFailure in project coprhd-controller by CoprHD.

the class SyncManager method fetchStoragePortByHref.

private StoragePort fetchStoragePortByHref(String href) throws SOSFailure {
    final String methodName = "fetchStoragePortByHref(): ";
    log.trace(methodName + "Entry with input: href[" + href + "]");
    StoragePort storagePort = null;
    try {
        storagePort = _client.queryObject(href, StoragePort.class);
        if (storagePort == null) {
            storagePort = new StoragePort();
        }
    } catch (NoSuchAlgorithmException e) {
        log.error(methodName + "NoSuchAlgorithmException occured", e);
        throw new SOSFailure(e);
    } catch (UniformInterfaceException e) {
        log.error(methodName + "UniformInterfaceException occured", e);
        throw new SOSFailure(e);
    }
    log.trace(methodName + "Exit returning storage port :[" + storagePort + "]");
    return storagePort;
}
Also used : UniformInterfaceException(com.sun.jersey.api.client.UniformInterfaceException) SOSFailure(com.emc.storageos.vasa.fault.SOSFailure) StoragePort(com.emc.storageos.vasa.data.internal.StoragePort) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException)

Example 28 with SOSFailure

use of com.emc.storageos.vasa.fault.SOSFailure in project coprhd-controller by CoprHD.

the class SyncManager method fetchExportITLS.

private List<Itls> fetchExportITLS(String csvSeparatedInitiatorList) throws SOSFailure {
    final String methodName = "fetchExportITLS(): ";
    log.trace(methodName + "Entry with input: csvSeparatedInitiatorList[" + csvSeparatedInitiatorList + "]");
    final String ITL_LIST_URI = "/block/exports/?initiators=%s";
    List<Itls> itlList = new ArrayList<Itls>();
    try {
        Itls itlObj = _client.queryObject(String.format(ITL_LIST_URI, csvSeparatedInitiatorList), Itls.class);
        if (itlObj != null && itlObj.getItls() != null) {
            itlList.add(itlObj);
        }
    } catch (NoSuchAlgorithmException e) {
        log.error(methodName + "NoSuchAlgorithmException occured", e);
        throw new SOSFailure(e);
    } catch (UniformInterfaceException e) {
        /*
             * if (e.getMessage().contains("400 Bad Request")) {
             * 
             * log.debug(methodName +
             * "No export information is available for initiator[" + initiatorId
             * + "]"); continue; } else {
             */
        log.error(methodName + "UniformInterfaceException occured", e);
        throw new SOSFailure(e);
    // }
    }
    // }
    log.trace(methodName + "Exit ITL list of size[" + itlList.size() + "]");
    return itlList;
}
Also used : Itls(com.emc.storageos.vasa.data.internal.Volume.Itls) UniformInterfaceException(com.sun.jersey.api.client.UniformInterfaceException) SOSFailure(com.emc.storageos.vasa.fault.SOSFailure) ArrayList(java.util.ArrayList) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException)

Example 29 with SOSFailure

use of com.emc.storageos.vasa.fault.SOSFailure in project coprhd-controller by CoprHD.

the class SyncManager method fetchStoragePool.

public synchronized StoragePool fetchStoragePool(String storageSystemId, String storagePoolId) throws SOSFailure {
    final String methodName = "fetchStoragePool(): ";
    final String STORAGE_POOL_DETAIL_URI = "/vdc/storage-systems/%s/storage-pools/%s";
    log.trace(methodName + "Entry with storageSystemId[" + storageSystemId + "] storagePoolId[" + storagePoolId + "]");
    StoragePool storagePool = null;
    try {
        storagePool = _client.queryObject(String.format(STORAGE_POOL_DETAIL_URI, storageSystemId, storagePoolId), StoragePool.class);
    } catch (NoSuchAlgorithmException e) {
        log.error(methodName + "NoSuchAlgorithmException occured", e);
        throw new SOSFailure(e);
    } catch (UniformInterfaceException e) {
        log.error(methodName + "UniformInterfaceException occured", e);
        throw new SOSFailure(e);
    }
    log.trace(methodName + "Exit returning storagePool[ " + storagePool + "]");
    return storagePool;
}
Also used : StoragePool(com.emc.storageos.vasa.data.internal.StoragePool) UniformInterfaceException(com.sun.jersey.api.client.UniformInterfaceException) SOSFailure(com.emc.storageos.vasa.fault.SOSFailure) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException)

Aggregations

SOSFailure (com.emc.storageos.vasa.fault.SOSFailure)29 UniformInterfaceException (com.sun.jersey.api.client.UniformInterfaceException)18 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)18 ArrayList (java.util.ArrayList)15 InvalidArgument (com.vmware.vim.vasa._1_0.InvalidArgument)7 NotImplemented (com.vmware.vim.vasa._1_0.NotImplemented)6 FileShare (com.emc.storageos.vasa.data.internal.FileShare)5 CoS (com.emc.storageos.vasa.data.internal.CoS)4 StoragePool (com.emc.storageos.vasa.data.internal.StoragePool)4 Volume (com.emc.storageos.vasa.data.internal.Volume)4 AssociatedPool (com.emc.storageos.vasa.data.internal.Volume.AssociatedPool)4 EventList (com.emc.storageos.vasa.data.internal.Event.EventList)3 BaseStorageEntity (com.vmware.vim.vasa._1_0.data.xsd.BaseStorageEntity)3 VasaAssociationObject (com.vmware.vim.vasa._1_0.data.xsd.VasaAssociationObject)3 CoSElement (com.emc.storageos.vasa.data.internal.CoS.CoSElement)2 CoSList (com.emc.storageos.vasa.data.internal.CoS.CoSList)2 FileSystemExports (com.emc.storageos.vasa.data.internal.FileShare.FileSystemExports)2 List (java.util.List)2 Event (com.emc.storageos.vasa.data.internal.Event)1 AssociatedResource (com.emc.storageos.vasa.data.internal.FileShare.AssociatedResource)1