Search in sources :

Example 1 with Restrictions

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

the class Backup method list.

@Restrictions({ @Restrict("SYSTEM_ADMIN"), @Restrict("SYSTEM_MONITOR"), @Restrict("RESTRICTED_SYSTEM_ADMIN") })
public static void list(Type type) {
    if (type == null) {
        type = Type.LOCAL;
    }
    BackupDataTable dataTable = new BackupDataTable(type);
    renderArgs.put("type", type);
    render(dataTable);
}
Also used : BackupDataTable(models.datatable.BackupDataTable) Restrictions(controllers.deadbolt.Restrictions)

Example 2 with Restrictions

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

the class Backup method getUploadStatus.

@Restrictions({ @Restrict("SYSTEM_ADMIN"), @Restrict("SYSTEM_MONITOR"), @Restrict("RESTRICTED_SYSTEM_ADMIN") })
public static void getUploadStatus(String id) {
    BackupUploadStatus status = BackupUtils.getUploadStatus(id);
    renderJSON(status);
}
Also used : BackupUploadStatus(com.emc.vipr.model.sys.backup.BackupUploadStatus) Restrictions(controllers.deadbolt.Restrictions)

Example 3 with Restrictions

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

the class Backup method itemsJson.

/**
 * Get local backup info
 * @param ids
 */
@Restrictions({ @Restrict("SYSTEM_ADMIN"), @Restrict("SYSTEM_MONITOR"), @Restrict("RESTRICTED_SYSTEM_ADMIN") })
public static void itemsJson(@As(",") String[] ids) {
    List<BackupDataTable.Backup> results = Lists.newArrayList();
    if (ids != null) {
        for (String id : ids) {
            if (StringUtils.isNotBlank(id)) {
                BackupSet backupSet = BackupUtils.getBackup(id);
                if (backupSet != null) {
                    BackupDataTable.Backup backup = new BackupDataTable.Backup(backupSet);
                    BackupRestoreStatus restoreStatus = BackupUtils.getRestoreStatus(id, true);
                    backup.alterLocalBackupRestoreStatus(restoreStatus);
                    results.add(backup);
                }
            }
        }
    }
    renderJSON(results);
}
Also used : BackupDataTable(models.datatable.BackupDataTable) BackupRestoreStatus(com.emc.vipr.model.sys.backup.BackupRestoreStatus) BackupSet(com.emc.vipr.model.sys.backup.BackupSets.BackupSet) Restrictions(controllers.deadbolt.Restrictions)

Example 4 with Restrictions

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

the class AdminDashboard method dbStatus.

@Restrictions({ @Restrict("SYSTEM_MONITOR"), @Restrict("SYSTEM_ADMIN"), @Restrict("RESTRICTED_SYSTEM_ADMIN") })
public static void dbStatus() {
    DbRepairStatus dbstatus = AdminDashboardUtils.gethealthdb();
    if (dbstatus.getLastCompletionTime() != null) {
        DateTime endTime = new DateTime(dbstatus.getLastCompletionTime().getTime());
        renderArgs.put("endTime", endTime);
    }
    if (dbstatus.getStartTime() != null) {
        DateTime startTime = new DateTime(dbstatus.getStartTime().getTime());
        renderArgs.put("startTime", startTime);
    }
    render(dbstatus);
}
Also used : DbRepairStatus(com.emc.vipr.model.sys.recovery.DbRepairStatus) DateTime(org.joda.time.DateTime) Restrictions(controllers.deadbolt.Restrictions)

Example 5 with Restrictions

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

the class AdminDashboard method version.

@Restrictions({ @Restrict("SYSTEM_MONITOR"), @Restrict("SYSTEM_ADMIN"), @Restrict("RESTRICTED_SYSTEM_ADMIN") })
public static void version() {
    License license = AdminDashboardUtils.getLicense();
    Map<String, Promise<?>> promises = Maps.newHashMap();
    promises.put("clusterInfo", AdminDashboardUtils.clusterInfo());
    trySetRenderArgs(promises);
    // Add lastUpdated render args after promises are redeemed
    Date clusterInfoLastUpdated = AdminDashboardUtils.getClusterInfoLastUpdated();
    render(license, clusterInfoLastUpdated);
}
Also used : Promise(play.libs.F.Promise) License(com.emc.vipr.model.sys.licensing.License) Date(java.util.Date) 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