Search in sources :

Example 76 with FlashException

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

Example 77 with FlashException

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

Example 78 with FlashException

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

Example 79 with FlashException

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

Example 80 with FlashException

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();
}
Also used : SiteRestRep(com.emc.storageos.model.dr.SiteRestRep) 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