Search in sources :

Example 6 with FlashException

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();
    }
}
Also used : HostRestRep(com.emc.storageos.model.host.HostRestRep) InitiatorRestRep(com.emc.storageos.model.host.InitiatorRestRep) IpInterfaceRestRep(com.emc.storageos.model.host.IpInterfaceRestRep) FlashException(controllers.util.FlashException)

Example 7 with FlashException

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();
}
Also used : URI(java.net.URI) FlashException(controllers.util.FlashException)

Example 8 with FlashException

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);
}
Also used : ViPRSystemClient(com.emc.vipr.client.ViPRSystemClient) Gson(com.google.gson.Gson) ClusterNetworkReconfigStatus(com.emc.vipr.model.sys.ipreconfig.ClusterNetworkReconfigStatus) FlashException(controllers.util.FlashException)

Example 9 with FlashException

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);
}
Also used : SiteIdListParam(com.emc.storageos.model.dr.SiteIdListParam) ServiceErrorException(com.emc.vipr.client.exceptions.ServiceErrorException) FlashException(controllers.util.FlashException) ServiceErrorException(com.emc.vipr.client.exceptions.ServiceErrorException) FlashException(controllers.util.FlashException) Restrictions(controllers.deadbolt.Restrictions)

Example 10 with FlashException

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();
}
Also used : SiteIdListParam(com.emc.storageos.model.dr.SiteIdListParam) FlashException(controllers.util.FlashException) Restrictions(controllers.deadbolt.Restrictions)

Aggregations

FlashException (controllers.util.FlashException)122 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)45 ExportGroupRestRep (com.emc.storageos.model.block.export.ExportGroupRestRep)9 VirtualArrayRestRep (com.emc.storageos.model.varray.VirtualArrayRestRep)9 URI (java.net.URI)9 ExportUpdateParam (com.emc.storageos.model.block.export.ExportUpdateParam)8 Restrictions (controllers.deadbolt.Restrictions)8 ArrayList (java.util.ArrayList)7 FilePolicyRestRep (com.emc.storageos.model.file.policy.FilePolicyRestRep)6 VolumeRestRep (com.emc.storageos.model.block.VolumeRestRep)5 CopiesParam (com.emc.storageos.model.block.CopiesParam)4 SiteRestRep (com.emc.storageos.model.dr.SiteRestRep)4 ExportRule (com.emc.storageos.model.file.ExportRule)4 ExportRules (com.emc.storageos.model.file.ExportRules)4 FileShareRestRep (com.emc.storageos.model.file.FileShareRestRep)4 ProjectRestRep (com.emc.storageos.model.project.ProjectRestRep)4 ServiceErrorException (com.emc.vipr.client.exceptions.ServiceErrorException)4 JsonArray (com.google.gson.JsonArray)3 JsonObject (com.google.gson.JsonObject)3 TaskResourceRep (com.emc.storageos.model.TaskResourceRep)2