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