use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class HostClusters method addHosts.
@FlashException(referrer = { "editHosts" })
public static void addHosts(String clusterId, @As(",") String[] ids) {
if (ids != null && ids.length > 0) {
for (String hostId : ids) {
HostUpdateParam hostUpdateParam = new HostUpdateParam();
hostUpdateParam.setCluster(uri(clusterId));
HostUtils.updateHost(uri(hostId), hostUpdateParam, false);
}
flash.success(MessagesUtils.get(ADDED_HOSTS));
}
editHosts(clusterId);
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class Hosts method discoverArrayAffinity.
@FlashException("list")
public static void discoverArrayAffinity(@As(",") String[] ids) {
ArrayAffinityHostParam param = new ArrayAffinityHostParam(uris(ids));
HostUtils.discoverHostArrayAffinity(param);
flash.success(MessagesUtils.get(DISCOVER_ARRAY_AFFINITY));
list();
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class VCenters method delete.
@FlashException("list")
public static void delete(@As(",") String[] ids, boolean detachStorage) {
for (URI id : ResourceUtils.uris(ids)) {
VCenterUtils.deactivateVCenter(id, detachStorage);
}
flash.success(MessagesUtils.get(DELETED));
list();
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class DisasterRecovery method switchover.
@FlashException("list")
@Restrictions({ @Restrict("SECURITY_ADMIN"), @Restrict("RESTRICTED_SECURITY_ADMIN") })
public static void switchover(String id) {
String standby_name = null;
String standby_vip = null;
String active_name = null;
Boolean isSwitchover = false;
// Get active site details
SiteRestRep activesite = DisasterRecoveryUtils.getActiveSite();
active_name = activesite == null ? "N/A" : activesite.getName();
SiteRestRep result = DisasterRecoveryUtils.getSite(id);
if (result != null) {
// Check Switchover or Failover
SiteActive currentSite = DisasterRecoveryUtils.checkActiveSite();
if (currentSite.getIsActive() == true) {
DisasterRecoveryUtils.doSwitchover(id);
isSwitchover = true;
} else {
DisasterRecoveryUtils.doFailover(id);
isSwitchover = false;
}
standby_name = result.getName();
standby_vip = result.getVipEndpoint();
}
String site_uuid = id;
maintenance(active_name, standby_name, standby_vip, site_uuid, isSwitchover);
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class DisasterRecovery method resume.
@FlashException("list")
@Restrictions({ @Restrict("SECURITY_ADMIN"), @Restrict("RESTRICTED_SECURITY_ADMIN"), @Restrict("SYSTEM_ADMIN"), @Restrict("RESTRICTED_SYSTEM_ADMIN") })
public static void resume(String id) {
SiteRestRep result = DisasterRecoveryUtils.getSite(id);
if (result != null) {
SiteRestRep siteresume = DisasterRecoveryUtils.resumeStandby(id);
flash.success(MessagesUtils.get(RESUMED_SUCCESS, siteresume.getName()));
}
list();
}
Aggregations