Search in sources :

Example 16 with Restrictions

use of controllers.deadbolt.Restrictions in project coprhd-controller by CoprHD.

the class AdminDashboard method disasterRecovery.

@Restrictions({ @Restrict("SYSTEM_MONITOR"), @Restrict("SECURITY_ADMIN"), @Restrict("RESTRICTED_SECURITY_ADMIN"), @Restrict("SYSTEM_ADMIN"), @Restrict("RESTRICTED_SYSTEM_ADMIN") })
public static void disasterRecovery() {
    Date disasterRecoveryLastUpdated = AdminDashboardUtils.getNodeHealthListLastUpdated();
    List<SiteRestRep> drsites = DisasterRecoveryUtils.getSites();
    render(disasterRecoveryLastUpdated, drsites);
}
Also used : SiteRestRep(com.emc.storageos.model.dr.SiteRestRep) Date(java.util.Date) Restrictions(controllers.deadbolt.Restrictions)

Example 17 with Restrictions

use of controllers.deadbolt.Restrictions in project coprhd-controller by CoprHD.

the class AdminDashboard method clusterPoweroff.

@Restrictions({ @Restrict("SYSTEM_ADMIN"), @Restrict("SECURITY_ADMIN"), @Restrict("RESTRICTED_SECURITY_ADMIN") })
public static void clusterPoweroff() {
    new PoweroffJob(getSysClient()).in(3);
    flash.success(MessagesUtils.get("adminDashboard.clusterPoweroff.description"));
    flash("isShuttingDown", true);
    Maintenance.maintenance(Common.reverseRoute(AdminDashboard.class, "dashboard"));
}
Also used : PoweroffJob(jobs.PoweroffJob) Restrictions(controllers.deadbolt.Restrictions)

Example 18 with Restrictions

use of controllers.deadbolt.Restrictions in project coprhd-controller by CoprHD.

the class AdminDashboard method nodeReboot.

@Restrictions({ @Restrict("SYSTEM_ADMIN"), @Restrict("SECURITY_ADMIN"), @Restrict("RESTRICTED_SECURITY_ADMIN") })
public static void nodeReboot(@Required String nodeId) {
    new RebootNodeJob(getSysClient(), nodeId).in(3);
    flash.success(Messages.get("adminDashboard.nodeRebooting", nodeId));
    Maintenance.maintenance(Common.reverseRoute(AdminDashboard.class, "dashboard"));
}
Also used : RebootNodeJob(jobs.RebootNodeJob) Restrictions(controllers.deadbolt.Restrictions)

Example 19 with Restrictions

use of controllers.deadbolt.Restrictions in project coprhd-controller by CoprHD.

the class DisasterRecovery method retry.

@FlashException("list")
@Restrictions({ @Restrict("SECURITY_ADMIN"), @Restrict("RESTRICTED_SECURITY_ADMIN"), @Restrict("SYSTEM_ADMIN"), @Restrict("RESTRICTED_SYSTEM_ADMIN") })
public static void retry(String id) {
    SiteRestRep result = DisasterRecoveryUtils.getSite(id);
    if (result != null) {
        SiteRestRep siteretry = DisasterRecoveryUtils.retryStandby(id);
        if (siteretry.getState().equals(SiteState.STANDBY_FAILING_OVER.name())) {
            String standby_name = siteretry.getName();
            String standby_vip = siteretry.getVipEndpoint();
            String active_name = null;
            for (SiteRestRep site : DisasterRecoveryUtils.getStandbySites()) {
                if (site.getState().equals(SiteState.ACTIVE_FAILING_OVER.name()) || site.getState().equals(SiteState.ACTIVE_DEGRADED.name())) {
                    active_name = site.getName();
                    break;
                }
            }
            Boolean isSwitchover = false;
            String site_uuid = id;
            maintenance(active_name, standby_name, standby_vip, site_uuid, isSwitchover);
        } else {
            flash.success(MessagesUtils.get(RETRY_SUCCESS, siteretry.getName()));
            list();
        }
    } else {
        flash.error(MessagesUtils.get(UNKNOWN, id));
        list();
    }
}
Also used : SiteRestRep(com.emc.storageos.model.dr.SiteRestRep) FlashException(controllers.util.FlashException) Restrictions(controllers.deadbolt.Restrictions)

Example 20 with Restrictions

use of controllers.deadbolt.Restrictions in project coprhd-controller by CoprHD.

the class DisasterRecovery method save.

@FlashException(keep = true, referrer = { "create", "edit" })
@Restrictions({ @Restrict("SECURITY_ADMIN"), @Restrict("RESTRICTED_SECURITY_ADMIN") })
public static void save(DisasterRecoveryForm disasterRecovery) {
    if (disasterRecovery != null) {
        disasterRecovery.validate("disasterRecovery");
        if (Validation.hasErrors()) {
            Common.handleError();
        }
        if (disasterRecovery.isNew()) {
            SiteAddParam standbySite = new SiteAddParam();
            standbySite.setName(disasterRecovery.name);
            standbySite.setVip(disasterRecovery.VirtualIP);
            standbySite.setUsername(disasterRecovery.userName);
            standbySite.setPassword(disasterRecovery.userPassword);
            standbySite.setDescription(disasterRecovery.description);
            SiteRestRep result = DisasterRecoveryUtils.addStandby(standbySite);
            flash.success(MessagesUtils.get(SAVED_SUCCESS, result.getName()));
            list();
        } else {
            SiteUpdateParam siteUpdateParam = new SiteUpdateParam();
            siteUpdateParam.setName(disasterRecovery.name);
            siteUpdateParam.setDescription(disasterRecovery.description);
            DisasterRecoveryUtils.updateSite(disasterRecovery.id, siteUpdateParam);
            flash.success(MessagesUtils.get(UPDATE_SUCCESS, disasterRecovery.name));
            list();
        }
    }
}
Also used : SiteAddParam(com.emc.storageos.model.dr.SiteAddParam) SiteRestRep(com.emc.storageos.model.dr.SiteRestRep) SiteUpdateParam(com.emc.storageos.model.dr.SiteUpdateParam) FlashException(controllers.util.FlashException) Restrictions(controllers.deadbolt.Restrictions)

Aggregations

Restrictions (controllers.deadbolt.Restrictions)29 FlashException (controllers.util.FlashException)8 SiteRestRep (com.emc.storageos.model.dr.SiteRestRep)7 BackupDataTable (models.datatable.BackupDataTable)4 RoleAssignmentEntry (com.emc.storageos.model.auth.RoleAssignmentEntry)2 SiteIdListParam (com.emc.storageos.model.dr.SiteIdListParam)2 VirtualDataCenterRestRep (com.emc.storageos.model.vdc.VirtualDataCenterRestRep)2 ViPRSystemClient (com.emc.vipr.client.ViPRSystemClient)2 BackupRestoreStatus (com.emc.vipr.model.sys.backup.BackupRestoreStatus)2 NodeHealth (com.emc.vipr.model.sys.healthmonitor.NodeHealth)2 RecoveryStatus (com.emc.vipr.model.sys.recovery.RecoveryStatus)2 Date (java.util.Date)2 RebootNodeJob (jobs.RebootNodeJob)2 TenantRoleAssignmentDataTable (models.datatable.TenantRoleAssignmentDataTable)2 DateTime (org.joda.time.DateTime)2 RoleAssignmentUtils.createRoleAssignmentEntry (util.RoleAssignmentUtils.createRoleAssignmentEntry)2 SiteActive (com.emc.storageos.model.dr.SiteActive)1 SiteAddParam (com.emc.storageos.model.dr.SiteAddParam)1 SiteDetailRestRep (com.emc.storageos.model.dr.SiteDetailRestRep)1 SiteUpdateParam (com.emc.storageos.model.dr.SiteUpdateParam)1