Search in sources :

Example 21 with VNXeLun

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

the class VNXeApiClient method deleteConsistencyGroup.

/**
 * Delete Consistency group.
 * if isForceVolumeDeletion is true, it would delete all the volumes in the Consistency group
 * and the Consistency group.
 * if isForceVolumeDeletion is false, it would remove all the volumes from the Consistency group,
 * then delete the Consistency group.
 *
 * @param cgId
 * @param isForceSnapDeletion
 *            if to delete snaps
 * @param isForceVolumeDeletion
 *            if to delete all volumes in the CG
 * @return
 */
public VNXeCommandResult deleteConsistencyGroup(String cgId, boolean isForceSnapDeletion, boolean isForceVolumeDeletion) {
    if (isForceVolumeDeletion) {
        DeleteStorageResourceRequest deleteReq = new DeleteStorageResourceRequest(_khClient);
        return deleteReq.deleteLunGroup(cgId, isForceSnapDeletion);
    } else {
        BlockLunRequests lunReq = new BlockLunRequests(_khClient);
        List<VNXeLun> luns = lunReq.getLunsInLunGroup(cgId);
        if (luns != null && !luns.isEmpty()) {
            List<String> lunIds = new ArrayList<String>();
            for (VNXeLun lun : luns) {
                lunIds.add(lun.getId());
            }
            removeLunsFromConsistencyGroup(cgId, lunIds);
        }
        DeleteStorageResourceRequest deleteReq = new DeleteStorageResourceRequest(_khClient);
        return deleteReq.deleteLunGroup(cgId, isForceSnapDeletion);
    }
}
Also used : DeleteStorageResourceRequest(com.emc.storageos.vnxe.requests.DeleteStorageResourceRequest) BlockLunRequests(com.emc.storageos.vnxe.requests.BlockLunRequests) ArrayList(java.util.ArrayList) VNXeLun(com.emc.storageos.vnxe.models.VNXeLun)

Example 22 with VNXeLun

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

the class BlockLunRequests method getByLunGroup.

/**
 * get lun with lungroup Id and lun name
 *
 * @param lunGroupId
 * @param lunName
 * @return
 */
public VNXeLun getByLunGroup(String lunGroupId, String lunName) {
    _url = URL_LUNS;
    String filter = null;
    if (_client.isUnity()) {
        filter = VNXeConstants.STORAGE_RESOURCE_FILTER + "\"" + lunGroupId + "\"";
    } else {
        filter = VNXeConstants.STORAGE_RESOURCE_FILTER + lunGroupId;
    }
    setFilter(filter);
    VNXeLun vnxeLun = null;
    List<VNXeLun> luns = getDataForObjects(VNXeLun.class);
    for (VNXeLun lun : luns) {
        String name = lun.getName();
        if (name != null && name.equals(lunName)) {
            vnxeLun = lun;
            break;
        }
    }
    return vnxeLun;
}
Also used : VNXeLun(com.emc.storageos.vnxe.models.VNXeLun)

Aggregations

VNXeLun (com.emc.storageos.vnxe.models.VNXeLun)22 ArrayList (java.util.ArrayList)9 VNXeBase (com.emc.storageos.vnxe.models.VNXeBase)7 BlockLunRequests (com.emc.storageos.vnxe.requests.BlockLunRequests)7 StorageSystem (com.emc.storageos.db.client.model.StorageSystem)5 Volume (com.emc.storageos.db.client.model.Volume)5 VNXeApiClient (com.emc.storageos.vnxe.VNXeApiClient)5 HostLunModifyParam (com.emc.storageos.vnxe.models.HostLunModifyParam)5 LunGroupModifyParam (com.emc.storageos.vnxe.models.LunGroupModifyParam)5 LunModifyParam (com.emc.storageos.vnxe.models.LunModifyParam)5 LunParam (com.emc.storageos.vnxe.models.LunParam)5 ConsistencyGroupRequests (com.emc.storageos.vnxe.requests.ConsistencyGroupRequests)5 LunGroupRequests (com.emc.storageos.vnxe.requests.LunGroupRequests)5 HashMap (java.util.HashMap)5 StoragePool (com.emc.storageos.db.client.model.StoragePool)4 BlockHostAccess (com.emc.storageos.vnxe.models.BlockHostAccess)4 HostLun (com.emc.storageos.vnxe.models.HostLun)4 Snap (com.emc.storageos.vnxe.models.Snap)4 VNXeCommandJob (com.emc.storageos.vnxe.models.VNXeCommandJob)4 VNXeLunGroupSnap (com.emc.storageos.vnxe.models.VNXeLunGroupSnap)4