Search in sources :

Example 1 with SiteIdListParam

use of com.emc.storageos.model.dr.SiteIdListParam 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 2 with SiteIdListParam

use of com.emc.storageos.model.dr.SiteIdListParam 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)

Example 3 with SiteIdListParam

use of com.emc.storageos.model.dr.SiteIdListParam in project coprhd-controller by CoprHD.

the class DisasterRecoveryService method pauseStandby.

/**
 * Pause a standby site that is already sync'ed with the active
 *
 * @param uuid site UUID
 * @brief Pause a standby site
 * @return updated standby site representation
 */
@POST
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@CheckPermission(roles = { Role.SECURITY_ADMIN, Role.RESTRICTED_SECURITY_ADMIN, Role.SYSTEM_ADMIN, Role.RESTRICTED_SYSTEM_ADMIN }, blockProxies = true)
@Path("/{uuid}/pause")
public Response pauseStandby(@PathParam("uuid") String uuid) {
    SiteIdListParam param = new SiteIdListParam();
    param.getIds().add(uuid);
    return pause(param);
}
Also used : SiteIdListParam(com.emc.storageos.model.dr.SiteIdListParam) Path(javax.ws.rs.Path) ZkPath(com.emc.storageos.coordinator.common.impl.ZkPath) POST(javax.ws.rs.POST) Produces(javax.ws.rs.Produces) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Example 4 with SiteIdListParam

use of com.emc.storageos.model.dr.SiteIdListParam in project coprhd-controller by CoprHD.

the class DisasterRecoveryService method remove.

/**
 * Remove a standby. After successfully done, it stops data replication to this site
 *
 * @param uuid standby site uuid
 * @brief Remove a specific standby site
 * @return Response
 */
@DELETE
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@CheckPermission(roles = { Role.SECURITY_ADMIN, Role.RESTRICTED_SECURITY_ADMIN }, blockProxies = true)
@Path("/{uuid}")
public Response remove(@PathParam("uuid") String uuid) {
    SiteIdListParam param = new SiteIdListParam();
    param.getIds().add(uuid);
    return remove(param);
}
Also used : SiteIdListParam(com.emc.storageos.model.dr.SiteIdListParam) Path(javax.ws.rs.Path) ZkPath(com.emc.storageos.coordinator.common.impl.ZkPath) DELETE(javax.ws.rs.DELETE) Produces(javax.ws.rs.Produces) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Aggregations

SiteIdListParam (com.emc.storageos.model.dr.SiteIdListParam)4 ZkPath (com.emc.storageos.coordinator.common.impl.ZkPath)2 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)2 Restrictions (controllers.deadbolt.Restrictions)2 FlashException (controllers.util.FlashException)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2 ServiceErrorException (com.emc.vipr.client.exceptions.ServiceErrorException)1 DELETE (javax.ws.rs.DELETE)1 POST (javax.ws.rs.POST)1