Search in sources :

Example 6 with WorldWideName

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

the class HDSApiExportManager method constructDeleteWWNQuery.

/**
 * Construct the WWN Query by adding multiple WWNs.
 * This query should be used to add FC initiators to the FC HSD.
 *
 * @param systemId
 * @param hsdId
 * @param wwnList
 * @return
 */
private String constructDeleteWWNQuery(String systemId, String hsdId, List<String> wwnList, String model) {
    Map<String, Object> attributeMap = new HashMap<String, Object>();
    StorageArray array = new StorageArray(systemId);
    Delete deleteOp = new Delete(HDSConstants.ADD_WWN_TO_HSD_TARGET);
    attributeMap.put(HDSConstants.STORAGEARRAY, array);
    attributeMap.put(HDSConstants.DELETE, deleteOp);
    attributeMap.put(HDSConstants.MODEL, model);
    HostStorageDomain hsd = new HostStorageDomain(hsdId);
    attributeMap.put(HDSConstants.HOST_STORAGE_DOMAIN, hsd);
    List<WorldWideName> wwnObjList = new ArrayList<WorldWideName>();
    if (null != wwnList && !wwnList.isEmpty()) {
        for (String initiatorWWN : wwnList) {
            WorldWideName wwn = new WorldWideName(initiatorWWN);
            wwnObjList.add(wwn);
        }
    }
    attributeMap.put(HDSConstants.WWN_LIST, wwnObjList);
    String deleteWWNFromHSDQuery = InputXMLGenerationClient.getInputXMLString(HDSConstants.DELETE_WWN_FROM_HSD_OP, attributeMap, HDSConstants.HITACHI_INPUT_XML_CONTEXT_FILE, HDSConstants.HITACHI_SMOOKS_CONFIG_FILE);
    return deleteWWNFromHSDQuery;
}
Also used : Delete(com.emc.storageos.hds.model.Delete) HashMap(java.util.HashMap) HostStorageDomain(com.emc.storageos.hds.model.HostStorageDomain) ArrayList(java.util.ArrayList) WorldWideName(com.emc.storageos.hds.model.WorldWideName) StorageArray(com.emc.storageos.hds.model.StorageArray)

Example 7 with WorldWideName

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

the class HDSApiExportManager method constructWWNQuery.

/**
 * Construct the WWN Query by adding multiple WWNs.
 * This query should be used to add FC initiators to the FC HSD.
 *
 * @param systemId
 * @param hsdId
 * @param wwnList
 * @return
 */
private String constructWWNQuery(String systemId, String hsdId, List<String> wwnList, String model) {
    Map<String, Object> attributeMap = new HashMap<String, Object>();
    StorageArray array = new StorageArray(systemId);
    Add addOp = new Add(HDSConstants.ADD_WWN_TO_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<WorldWideName> wwnObjList = new ArrayList<WorldWideName>();
    if (null != wwnList && !wwnList.isEmpty()) {
        for (String initiatorWWN : wwnList) {
            WorldWideName wwn = new WorldWideName(initiatorWWN);
            wwnObjList.add(wwn);
        }
    }
    attributeMap.put(HDSConstants.WWN_LIST, wwnObjList);
    String addWWNQuery = InputXMLGenerationClient.getInputXMLString(HDSConstants.ADD_WWN_TO_HSD_OP, attributeMap, HDSConstants.HITACHI_INPUT_XML_CONTEXT_FILE, HDSConstants.HITACHI_SMOOKS_CONFIG_FILE);
    return addWWNQuery;
}
Also used : Add(com.emc.storageos.hds.model.Add) HashMap(java.util.HashMap) HostStorageDomain(com.emc.storageos.hds.model.HostStorageDomain) ArrayList(java.util.ArrayList) WorldWideName(com.emc.storageos.hds.model.WorldWideName) StorageArray(com.emc.storageos.hds.model.StorageArray)

Aggregations

WorldWideName (com.emc.storageos.hds.model.WorldWideName)7 ArrayList (java.util.ArrayList)7 HostStorageDomain (com.emc.storageos.hds.model.HostStorageDomain)3 ISCSIName (com.emc.storageos.hds.model.ISCSIName)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