Search in sources :

Example 1 with LunAddParam

use of com.emc.storageos.vnxe.models.LunAddParam in project coprhd-controller by CoprHD.

the class VNXeApiClient method addLunsToLunGroup.

/**
 * Add luns to LunGroup
 */
public VNXeCommandResult addLunsToLunGroup(String lunGroupId, List<String> luns) {
    LunGroupModifyParam param = new LunGroupModifyParam();
    List<LunAddParam> lunAdds = new ArrayList<LunAddParam>();
    for (String lunId : luns) {
        VNXeBase lun = new VNXeBase(lunId);
        LunAddParam lunAdd = new LunAddParam();
        lunAdd.setLun(lun);
        lunAdds.add(lunAdd);
    }
    param.setLunAdd(lunAdds);
    LunGroupRequests req = new LunGroupRequests(_khClient);
    return req.modifyLunGroupSync(lunGroupId, param);
}
Also used : VNXeBase(com.emc.storageos.vnxe.models.VNXeBase) LunAddParam(com.emc.storageos.vnxe.models.LunAddParam) LunGroupRequests(com.emc.storageos.vnxe.requests.LunGroupRequests) LunGroupModifyParam(com.emc.storageos.vnxe.models.LunGroupModifyParam) ArrayList(java.util.ArrayList)

Example 2 with LunAddParam

use of com.emc.storageos.vnxe.models.LunAddParam in project coprhd-controller by CoprHD.

the class VNXeApiClient method addLunsToConsistencyGroup.

/**
 * Add luns to consistency group
 *
 * @param cgId
 *            consistency group Id
 * @param luns
 *            luns to be added into the consistency group
 */
public VNXeCommandResult addLunsToConsistencyGroup(String cgId, List<String> luns) {
    LunGroupModifyParam param = new LunGroupModifyParam();
    List<LunAddParam> lunAdds = new ArrayList<LunAddParam>();
    for (String lunId : luns) {
        VNXeBase lun = new VNXeBase(lunId);
        LunAddParam lunAdd = new LunAddParam();
        lunAdd.setLun(lun);
        lunAdds.add(lunAdd);
    }
    param.setLunAdd(lunAdds);
    ConsistencyGroupRequests req = new ConsistencyGroupRequests(_khClient);
    return req.modifyConsistencyGroupSync(cgId, param);
}
Also used : VNXeBase(com.emc.storageos.vnxe.models.VNXeBase) LunAddParam(com.emc.storageos.vnxe.models.LunAddParam) LunGroupModifyParam(com.emc.storageos.vnxe.models.LunGroupModifyParam) ArrayList(java.util.ArrayList) ConsistencyGroupRequests(com.emc.storageos.vnxe.requests.ConsistencyGroupRequests)

Example 3 with LunAddParam

use of com.emc.storageos.vnxe.models.LunAddParam in project coprhd-controller by CoprHD.

the class VNXeApiClient method removeLunsFromConsistencyGroup.

/**
 * Remove luns from the consistency group
 *
 * @param cgId
 *            lun group id
 * @param luns
 *            list of lun IDs
 * @return
 */
public VNXeCommandResult removeLunsFromConsistencyGroup(String cgId, List<String> luns) {
    LunGroupModifyParam param = new LunGroupModifyParam();
    List<LunAddParam> lunRemoves = new ArrayList<LunAddParam>();
    for (String lunId : luns) {
        VNXeBase lun = new VNXeBase(lunId);
        LunAddParam lunAdd = new LunAddParam();
        lunAdd.setLun(lun);
        lunRemoves.add(lunAdd);
    }
    param.setLunRemove(lunRemoves);
    ConsistencyGroupRequests req = new ConsistencyGroupRequests(_khClient);
    return req.modifyConsistencyGroupSync(cgId, param);
}
Also used : VNXeBase(com.emc.storageos.vnxe.models.VNXeBase) LunAddParam(com.emc.storageos.vnxe.models.LunAddParam) LunGroupModifyParam(com.emc.storageos.vnxe.models.LunGroupModifyParam) ArrayList(java.util.ArrayList) ConsistencyGroupRequests(com.emc.storageos.vnxe.requests.ConsistencyGroupRequests)

Example 4 with LunAddParam

use of com.emc.storageos.vnxe.models.LunAddParam in project coprhd-controller by CoprHD.

the class VNXeApiClient method removeLunsFromLunGroup.

/**
 * Remove luns from the lun group
 *
 * @param lunGroupId
 *            lun group id
 * @param luns
 *            list of lun IDs
 * @return
 */
public VNXeCommandResult removeLunsFromLunGroup(String lunGroupId, List<String> luns) {
    LunGroupModifyParam param = new LunGroupModifyParam();
    List<LunAddParam> lunRemoves = new ArrayList<LunAddParam>();
    for (String lunId : luns) {
        VNXeBase lun = new VNXeBase(lunId);
        LunAddParam lunAdd = new LunAddParam();
        lunAdd.setLun(lun);
        lunRemoves.add(lunAdd);
    }
    param.setLunRemove(lunRemoves);
    LunGroupRequests req = new LunGroupRequests(_khClient);
    return req.modifyLunGroupSync(lunGroupId, param);
}
Also used : VNXeBase(com.emc.storageos.vnxe.models.VNXeBase) LunAddParam(com.emc.storageos.vnxe.models.LunAddParam) LunGroupRequests(com.emc.storageos.vnxe.requests.LunGroupRequests) LunGroupModifyParam(com.emc.storageos.vnxe.models.LunGroupModifyParam) ArrayList(java.util.ArrayList)

Example 5 with LunAddParam

use of com.emc.storageos.vnxe.models.LunAddParam in project coprhd-controller by CoprHD.

the class VNXeApiClient method deleteLunsFromLunGroup.

/**
 * Delete luns from lun group
 *
 * @param lunGroupId
 * @param luns
 * @return
 */
public VNXeCommandJob deleteLunsFromLunGroup(String lunGroupId, List<String> luns) {
    LunGroupModifyParam param = new LunGroupModifyParam();
    List<LunAddParam> lunDelete = new ArrayList<LunAddParam>();
    for (String lunId : luns) {
        VNXeBase lun = new VNXeBase(lunId);
        LunAddParam lunAdd = new LunAddParam();
        lunAdd.setLun(lun);
        lunDelete.add(lunAdd);
    }
    param.setLunDelete(lunDelete);
    LunGroupRequests req = new LunGroupRequests(_khClient);
    return req.modifyLunGroupAsync(lunGroupId, param);
}
Also used : VNXeBase(com.emc.storageos.vnxe.models.VNXeBase) LunAddParam(com.emc.storageos.vnxe.models.LunAddParam) LunGroupRequests(com.emc.storageos.vnxe.requests.LunGroupRequests) LunGroupModifyParam(com.emc.storageos.vnxe.models.LunGroupModifyParam) ArrayList(java.util.ArrayList)

Aggregations

LunAddParam (com.emc.storageos.vnxe.models.LunAddParam)6 LunGroupModifyParam (com.emc.storageos.vnxe.models.LunGroupModifyParam)6 VNXeBase (com.emc.storageos.vnxe.models.VNXeBase)6 ArrayList (java.util.ArrayList)6 ConsistencyGroupRequests (com.emc.storageos.vnxe.requests.ConsistencyGroupRequests)3 LunGroupRequests (com.emc.storageos.vnxe.requests.LunGroupRequests)3