use of controllers.deadbolt.Restrictions in project coprhd-controller by CoprHD.
the class VirtualDataCenters method edit.
@FlashException(value = "list", keep = true)
@Restrictions({ @Restrict("SYSTEM_ADMIN"), @Restrict("SECURITY_ADMIN"), @Restrict("RESTRICTED_SECURITY_ADMIN") })
public static void edit(String id) {
VirtualDataCenterRestRep viprVDC = VirtualDataCenterUtils.get(id);
if (viprVDC != null) {
VirtualDataCenterForm vdc = new VirtualDataCenterForm().from(viprVDC);
addRenderArgs();
render(vdc);
} else {
flash.error(MessagesUtils.get("vdcs.unknown", id));
list();
}
}
use of controllers.deadbolt.Restrictions in project coprhd-controller by CoprHD.
the class SystemHealth method minorityNodeRecovery.
@Restrictions({ @Restrict("SYSTEM_ADMIN"), @Restrict("SECURITY_ADMIN"), @Restrict("RESTRICTED_SECURITY_ADMIN") })
public static void minorityNodeRecovery() {
new MinorityNodeRecoveryJob(getSysClient()).in(3);
ViPRSystemClient client = BourneUtil.getSysClient();
List<NodeHealth> nodeHealthList = MonitorUtils.getNodeHealth();
ClusterInfo clusterInfo = AdminDashboardUtils.getClusterInfo();
if (PlatformUtils.isVMwareVapp()) {
RecoveryPrecheckStatus recoveryPrecheckStatus = client.control().getRecoveryPrecheckStatus();
String recoveringMsg = Messages.get("nodeRecovery.recovering.status", recoveryPrecheckStatus.getRecoverables().toString());
renderArgs.put("recoveringMsg", recoveringMsg);
}
RecoveryStatus recoveryStatus = client.control().getRecoveryStatus();
renderArgs.put("nodeHealthList", nodeHealthList);
renderArgs.put("clusterInfo", clusterInfo);
renderArgs.put("recoveryStatus", recoveryStatus);
if (PlatformUtils.isVMwareVapp()) {
render("@nodeRecoveryVapp");
} else {
render("@nodeRecovery");
}
}
use of controllers.deadbolt.Restrictions in project coprhd-controller by CoprHD.
the class SystemHealth method serviceRestart.
@Restrictions({ @Restrict("SYSTEM_ADMIN"), @Restrict("SECURITY_ADMIN"), @Restrict("RESTRICTED_SECURITY_ADMIN") })
public static void serviceRestart(@Required String nodeId, @Required String serviceName) {
new RestartServiceJob(getSysClient(), serviceName, nodeId).in(3);
String node = nodeId;
try {
node = MonitorUtils.getNodeHealth(nodeId).getNodeName();
} catch (NullPointerException e) {
Logger.warn("Could not determine node name.");
}
flash.success(Messages.get("adminDashboard.serviceRestarting", serviceName, node));
Maintenance.maintenance(Common.reverseRoute(SystemHealth.class, "services", "nodeId", nodeId));
}
use of controllers.deadbolt.Restrictions in project coprhd-controller by CoprHD.
the class Backup method externalStatusJson.
/**
* Only get the remote restore status
* @param ids
*/
@Restrictions({ @Restrict("SYSTEM_ADMIN"), @Restrict("SYSTEM_MONITOR"), @Restrict("RESTRICTED_SYSTEM_ADMIN") })
public static void externalStatusJson(@As(",") String[] ids) {
List<BackupDataTable.Backup> results = Lists.newArrayList();
for (String id : ids) {
if (StringUtils.isNotBlank(id)) {
BackupDataTable.Backup backup = new BackupDataTable.Backup(id, false);
BackupRestoreStatus restoreStatus = BackupUtils.getRestoreStatus(id, false);
backup.status = restoreStatus.getStatus().name();
if (restoreStatus.getStatus() == BackupRestoreStatus.Status.RESTORE_FAILED) {
backup.error = restoreStatus.getDetails();
}
results.add(backup);
}
}
renderJSON(results);
}
use of controllers.deadbolt.Restrictions in project coprhd-controller by CoprHD.
the class Backup method externalItemsJson.
/**
* Only get the remote backup info
* @param ids
*/
@Restrictions({ @Restrict("SYSTEM_ADMIN"), @Restrict("SYSTEM_MONITOR"), @Restrict("RESTRICTED_SYSTEM_ADMIN") })
public static void externalItemsJson(@As(",") String[] ids) {
List<BackupDataTable.Backup> results = Lists.newArrayList();
if (ids != null) {
for (String id : ids) {
if (StringUtils.isNotBlank(id)) {
BackupInfo backupInfo = BackupUtils.getBackupInfo(id, false);
BackupDataTable.Backup backup = new BackupDataTable.Backup(id, false);
backup.creationtime = backupInfo.getCreateTime();
backup.sitename = backupInfo.getSiteName();
backup.version = backupInfo.getVersion();
backup.size = backupInfo.getBackupSize();
results.add(backup);
}
}
}
renderJSON(results);
}
Aggregations