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;
}
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;
}
Aggregations