use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class Hosts method edit.
@FlashException("list")
public static void edit(String id) {
HostRestRep dbHost = HostUtils.getHost(uri(id));
if (dbHost != null) {
addReferenceData();
HostForm host = new HostForm(dbHost);
List<InitiatorRestRep> initiators = HostUtils.getInitiators(dbHost.getId());
List<IpInterfaceRestRep> ipInterfaces = HostUtils.getIpInterfaces(dbHost.getId());
render(host, dbHost, initiators, ipInterfaces);
} else {
flash.error(MessagesUtils.get(UNKNOWN, id));
list();
}
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class Hosts method delete.
@FlashException("list")
public static void delete(@As(",") String[] ids, boolean detachStorage) {
for (URI id : ResourceUtils.uris(ids)) {
HostUtils.deactivate(id, detachStorage);
}
flash.success(MessagesUtils.get(DELETED));
list();
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class ClusterInfo method ipReconfigStatusJson.
/**
* gets ip reconfigurations status in json format
*/
@FlashException()
public static void ipReconfigStatusJson() {
ViPRSystemClient client = BourneUtil.getSysClient();
ClusterNetworkReconfigStatus ipReconfigStatus = client.control().getClusterIpReconfigStatus();
Gson gson = new Gson();
String ipReconfigStatusJSON = gson.toJson(ipReconfigStatus);
renderJSON(ipReconfigStatusJSON);
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class DisasterRecovery method pause.
@FlashException("list")
@Restrictions({ @Restrict("SECURITY_ADMIN"), @Restrict("RESTRICTED_SECURITY_ADMIN"), @Restrict("SYSTEM_ADMIN"), @Restrict("RESTRICTED_SYSTEM_ADMIN") })
public static void pause(@As(",") String[] ids) {
List<String> uuids = Arrays.asList(ids);
for (String uuid : uuids) {
if (!DisasterRecoveryUtils.hasStandbySite(uuid)) {
flash.error(MessagesUtils.get(UNKNOWN, uuid));
list(true);
}
}
SiteIdListParam param = new SiteIdListParam();
param.getIds().addAll(uuids);
try {
DisasterRecoveryUtils.pauseStandby(param);
} catch (ServiceErrorException ex) {
flash.error(ex.getDetailedMessage());
list(true);
} catch (Exception ex) {
flash.error(ex.getMessage());
list(true);
}
flash.success(MessagesUtils.get(PAUSED_SUCCESS));
list(true);
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class DisasterRecovery method delete.
@FlashException("list")
@Restrictions({ @Restrict("SECURITY_ADMIN"), @Restrict("RESTRICTED_SECURITY_ADMIN") })
public static void delete(@As(",") String[] ids) {
List<String> uuids = Arrays.asList(ids);
for (String uuid : uuids) {
if (!DisasterRecoveryUtils.hasStandbySite(uuid)) {
flash.error(MessagesUtils.get(UNKNOWN, uuid));
list();
}
}
SiteIdListParam param = new SiteIdListParam();
param.getIds().addAll(uuids);
DisasterRecoveryUtils.deleteStandby(param);
flash.success(MessagesUtils.get(DELETED_SUCCESS));
list();
}
Aggregations