Search in sources :

Example 6 with ISCSIName

use of com.emc.storageos.hds.model.ISCSIName in project coprhd-controller by CoprHD.

the class HDSApiExportManager method constructAddiSCSIInitiatorHostQuery.

/**
 * Constructs the addHostQuery.
 *
 * @param hostName
 * @param ipAddress
 * @param portWWNList
 * @return
 */
private String constructAddiSCSIInitiatorHostQuery(HDSHost hdshost, List<String> portWWNList) {
    Map<String, Object> attributeMap = new HashMap<String, Object>();
    List<ISCSIName> wwnList = new ArrayList<ISCSIName>();
    Add addOp = new Add(HDSConstants.HOST);
    attributeMap.put(HDSConstants.HOST, hdshost);
    attributeMap.put(HDSConstants.ADD, addOp);
    if (null != portWWNList && !portWWNList.isEmpty()) {
        for (String portWWN : portWWNList) {
            ISCSIName wwn = new ISCSIName(portWWN, null);
            wwnList.add(wwn);
        }
    }
    attributeMap.put(HDSConstants.ISCSINAME_LIST, wwnList);
    String addHostWithISCSINamesQuery = InputXMLGenerationClient.getInputXMLString(HDSConstants.ADD_HOST_WITH_ISCSINAMES_OP, attributeMap, HDSConstants.HITACHI_INPUT_XML_CONTEXT_FILE, HDSConstants.HITACHI_SMOOKS_CONFIG_FILE);
    return addHostWithISCSINamesQuery;
}
Also used : Add(com.emc.storageos.hds.model.Add) HashMap(java.util.HashMap) ISCSIName(com.emc.storageos.hds.model.ISCSIName) ArrayList(java.util.ArrayList)

Example 7 with ISCSIName

use of com.emc.storageos.hds.model.ISCSIName in project coprhd-controller by CoprHD.

the class HDSApiExportManager method constructISCSIQuery.

/**
 * Construct the iSCSINames Query by adding multiple WWNs.
 * This query should be used to add the iSCSI initiators to the iSCSI HSD.
 *
 * @param systemId
 * @param hsdId
 * @param wwnList
 * @return
 */
private String constructISCSIQuery(String systemId, String hsdId, List<String> scsiNameList, String model) {
    Map<String, Object> attributeMap = new HashMap<String, Object>();
    StorageArray array = new StorageArray(systemId);
    Add addOp = new Add(HDSConstants.ISCSI_NAME_FOR_HSD_TARGET);
    attributeMap.put(HDSConstants.STORAGEARRAY, array);
    attributeMap.put(HDSConstants.ADD, addOp);
    attributeMap.put(HDSConstants.MODEL, model);
    HostStorageDomain hsd = new HostStorageDomain(hsdId);
    attributeMap.put(HDSConstants.HOST_STORAGE_DOMAIN, hsd);
    List<ISCSIName> iSCSIObjList = new ArrayList<ISCSIName>();
    if (null != scsiNameList && !scsiNameList.isEmpty()) {
        for (String iScsiName : scsiNameList) {
            ISCSIName iSCSIName = new ISCSIName(iScsiName, null);
            iSCSIObjList.add(iSCSIName);
        }
    }
    attributeMap.put(HDSConstants.ISCSINAME_LIST, iSCSIObjList);
    String addISCSINamesToHSDQuery = InputXMLGenerationClient.getInputXMLString(HDSConstants.ADD_ISCSI_NAME_TO_HSD_OP, attributeMap, HDSConstants.HITACHI_INPUT_XML_CONTEXT_FILE, HDSConstants.HITACHI_SMOOKS_CONFIG_FILE);
    return addISCSINamesToHSDQuery;
}
Also used : Add(com.emc.storageos.hds.model.Add) HashMap(java.util.HashMap) HostStorageDomain(com.emc.storageos.hds.model.HostStorageDomain) ISCSIName(com.emc.storageos.hds.model.ISCSIName) ArrayList(java.util.ArrayList) StorageArray(com.emc.storageos.hds.model.StorageArray)

Aggregations

ISCSIName (com.emc.storageos.hds.model.ISCSIName)7 ArrayList (java.util.ArrayList)7 HostStorageDomain (com.emc.storageos.hds.model.HostStorageDomain)3 WorldWideName (com.emc.storageos.hds.model.WorldWideName)3 HashMap (java.util.HashMap)3 Add (com.emc.storageos.hds.model.Add)2 StorageArray (com.emc.storageos.hds.model.StorageArray)2 StringSet (com.emc.storageos.db.client.model.StringSet)1 Delete (com.emc.storageos.hds.model.Delete)1 URI (java.net.URI)1 HashSet (java.util.HashSet)1 Set (java.util.Set)1