Search in sources :

Example 6 with ScServerHba

use of com.emc.storageos.driver.dellsc.scapi.objects.ScServerHba in project coprhd-controller by CoprHD.

the class StorageCenterAPI method findServerHba.

/**
 * Find an initiator WWN or iSCSI IQN.
 *
 * @param ssn The Storage Center SN on which to check.
 * @param iqnOrWwn The FC WWN or iSCSI IQN.
 * @return The HBA object.
 */
private ScServerHba findServerHba(String ssn, String iqnOrWwn) {
    ScServerHba result = null;
    PayloadFilter filter = new PayloadFilter();
    filter.append("scSerialNumber", ssn);
    filter.append("instanceName", iqnOrWwn);
    RestResult rr = restClient.post("StorageCenter/ScServerHba/GetList", filter.toJson());
    if (checkResults(rr)) {
        ScServerHba[] hbas = gson.fromJson(rr.getResult(), ScServerHba[].class);
        for (ScServerHba hba : hbas) {
            // Should only return one if found, but just grab first from list
            result = hba;
            break;
        }
    }
    return result;
}
Also used : RestResult(com.emc.storageos.driver.dellsc.scapi.rest.RestResult) PayloadFilter(com.emc.storageos.driver.dellsc.scapi.rest.PayloadFilter) ScServerHba(com.emc.storageos.driver.dellsc.scapi.objects.ScServerHba)

Aggregations

ScServerHba (com.emc.storageos.driver.dellsc.scapi.objects.ScServerHba)6 ScServer (com.emc.storageos.driver.dellsc.scapi.objects.ScServer)4 RestResult (com.emc.storageos.driver.dellsc.scapi.rest.RestResult)3 StorageCenterAPIException (com.emc.storageos.driver.dellsc.scapi.StorageCenterAPIException)2 ScControllerPort (com.emc.storageos.driver.dellsc.scapi.objects.ScControllerPort)2 PayloadFilter (com.emc.storageos.driver.dellsc.scapi.rest.PayloadFilter)2 Initiator (com.emc.storageos.storagedriver.model.Initiator)2 StoragePort (com.emc.storageos.storagedriver.model.StoragePort)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 DellSCDriverException (com.emc.storageos.driver.dellsc.DellSCDriverException)1 DellSCDriverTask (com.emc.storageos.driver.dellsc.DellSCDriverTask)1 StorageCenterAPI (com.emc.storageos.driver.dellsc.scapi.StorageCenterAPI)1 ScMapping (com.emc.storageos.driver.dellsc.scapi.objects.ScMapping)1 ScMappingProfile (com.emc.storageos.driver.dellsc.scapi.objects.ScMappingProfile)1 ScServerOperatingSystem (com.emc.storageos.driver.dellsc.scapi.objects.ScServerOperatingSystem)1 ScVolume (com.emc.storageos.driver.dellsc.scapi.objects.ScVolume)1 ScVolumeConfiguration (com.emc.storageos.driver.dellsc.scapi.objects.ScVolumeConfiguration)1 HostExportInfo (com.emc.storageos.storagedriver.HostExportInfo)1 StorageVolume (com.emc.storageos.storagedriver.model.StorageVolume)1