use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.
the class BlockVolumes method volumeSnapshotSessions.
public static void volumeSnapshotSessions(String volumeId) {
ViPRCoreClient client = BourneUtil.getViprClient();
VolumeRestRep volume = client.blockVolumes().get(uri(volumeId));
List<BlockSnapshotSessionRestRep> snapshotSessions = Lists.newArrayList();
if (volume.getConsistencyGroup() != null) {
URI consistencygroup = volume.getConsistencyGroup().getId();
List<NamedRelatedResourceRep> cgSessions = client.blockConsistencyGroups().getSnapshotSessions(consistencygroup);
snapshotSessions = client.blockSnapshotSessions().getByRefs(cgSessions);
} else {
List<NamedRelatedResourceRep> refs = client.blockSnapshotSessions().listByVolume(uri(volumeId));
snapshotSessions = client.blockSnapshotSessions().getByRefs(refs);
}
render(snapshotSessions, volumeId);
}
use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.
the class BlockVolumes method volumeDetails.
public static void volumeDetails(String volumeId) {
ViPRCoreClient client = BourneUtil.getViprClient();
String consistencygroup = "";
VolumeRestRep volume = client.blockVolumes().get(uri(volumeId));
if (volume == null) {
error(MessagesUtils.get(UNKNOWN, volumeId));
}
if (volume.getConsistencyGroup() != null) {
consistencygroup = client.blockConsistencyGroups().get(volume.getConsistencyGroup().getId()).getName();
}
render(consistencygroup);
}
use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.
the class BlockVolumes method volumeContinuousCopies.
public static void volumeContinuousCopies(String volumeId) {
ViPRCoreClient client = BourneUtil.getViprClient();
List<BlockMirrorRestRep> continuousCopies = client.blockVolumes().getContinuousCopies(uri(volumeId));
render(continuousCopies);
}
use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.
the class FileSnapshots method deleteSnapshotShare.
@FlashException(referrer = { "snapshot" })
public static void deleteSnapshotShare(String snapshotId, String shareName) {
ViPRCoreClient client = BourneUtil.getViprClient();
Task<FileSnapshotRestRep> task = client.fileSnapshots().removeShare(uri(snapshotId), shareName);
flash.put("info", MessagesUtils.get("resources.filesnapshot.share.deactivate"));
snapshot(snapshotId);
}
use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.
the class FileSnapshots method removeSnapShotAcl.
/**
* This method called When user selects ACLs and hit delete button.
*
* @param aclURL
* URL of the snapshot share.
* @param ids
* ids of the selected ACL
*/
@FlashException(referrer = { "snapshot" })
public static void removeSnapShotAcl(String aclUrl, @As(",") String[] ids) {
ShareACLs aclsToDelete = new ShareACLs();
List<ShareACL> shareAcls = new ArrayList<ShareACL>();
String snapshotId = null;
String shareName = null;
if (ids != null && ids.length > 0) {
for (String id : ids) {
String type = SnapshotShareACLForm.extractTypeFromId(id);
String name = SnapshotShareACLForm.extractNameFromId(id);
String domain = SnapshotShareACLForm.extractDomainFromId(id);
snapshotId = SnapshotShareACLForm.extractSnapshotFromId(id);
shareName = SnapshotShareACLForm.extractShareNameFromId(id);
ShareACL ace = new ShareACL();
if (SnapshotShareACLForm.GROUP.equalsIgnoreCase(type)) {
ace.setGroup(name);
} else {
ace.setUser(name);
}
if (domain != null && !"".equals(domain) && !"null".equals(domain)) {
ace.setDomain(domain);
}
shareAcls.add(ace);
}
aclsToDelete.setShareACLs(shareAcls);
SnapshotCifsShareACLUpdateParams input = new SnapshotCifsShareACLUpdateParams();
input.setAclsToDelete(aclsToDelete);
ViPRCoreClient client = BourneUtil.getViprClient();
client.fileSnapshots().updateShareACL(uri(snapshotId), shareName, input);
}
flash.success(MessagesUtils.get("resources.filesystem.share.acl.deleted"));
listSnapshotAcl(snapshotId, shareName);
}
Aggregations