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);
}
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();
}
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);
}
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);
}
Aggregations