Search in sources :

Example 91 with FlashException

use of controllers.util.FlashException in project coprhd-controller by CoprHD.

the class BlockSnapshotSessions method deleteSnapshotSession.

@FlashException(referrer = { "snapshotSessionDetails" })
public static void deleteSnapshotSession(String snapshotId, VolumeDeleteTypeEnum deleteType) {
    if (StringUtils.isNotBlank(snapshotId)) {
        ViPRCoreClient client = BourneUtil.getViprClient();
        Tasks<BlockSnapshotSessionRestRep> task = client.blockSnapshotSessions().deactivate(uri(snapshotId), deleteType);
        flash.put("info", MessagesUtils.get("resources.snapshot.deactivate", snapshotId));
    }
    snapshotSessionDetails(snapshotId);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) BlockSnapshotSessionRestRep(com.emc.storageos.model.block.BlockSnapshotSessionRestRep) FlashException(controllers.util.FlashException)

Example 92 with FlashException

use of controllers.util.FlashException in project coprhd-controller by CoprHD.

the class BlockVolumes method stopContinuousCopy.

@FlashException(referrer = { "volume" })
public static void stopContinuousCopy(String volumeId, String continuousCopyId) {
    if (StringUtils.isNotBlank(volumeId) && StringUtils.isNotBlank(continuousCopyId)) {
        ViPRCoreClient client = BourneUtil.getViprClient();
        CopiesParam input = createCopiesParam(continuousCopyId);
        Tasks<VolumeRestRep> tasks = client.blockVolumes().stopContinuousCopies(uri(volumeId), input);
        flash.put("info", MessagesUtils.get("resources.continuouscopy.stop"));
    }
    volume(volumeId, null);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) CopiesParam(com.emc.storageos.model.block.CopiesParam) VolumeRestRep(com.emc.storageos.model.block.VolumeRestRep) FlashException(controllers.util.FlashException)

Example 93 with FlashException

use of controllers.util.FlashException in project coprhd-controller by CoprHD.

the class BlockVolumes method deleteVolume.

@FlashException(referrer = { "volume" })
public static void deleteVolume(String volumeId, VolumeDeleteTypeEnum type) {
    if (StringUtils.isNotBlank(volumeId)) {
        ViPRCoreClient client = BourneUtil.getViprClient();
        Task<VolumeRestRep> task = client.blockVolumes().deactivate(uri(volumeId), type);
        flash.put("info", MessagesUtils.get("resources.volume.deactivate"));
    }
    volume(volumeId, null);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) VolumeRestRep(com.emc.storageos.model.block.VolumeRestRep) FlashException(controllers.util.FlashException)

Example 94 with FlashException

use of controllers.util.FlashException in project coprhd-controller by CoprHD.

the class BlockVolumes method resumeMigration.

@FlashException(referrer = { "volume" })
public static void resumeMigration(String volumeId, String migrationId) {
    if (StringUtils.isNotBlank(volumeId) && StringUtils.isNotBlank(migrationId)) {
        ViPRCoreClient client = BourneUtil.getViprClient();
        client.blockMigrations().resume(uri(migrationId));
        flash.put("info", MessagesUtils.get("resources.migrations.resume"));
    }
    volume(volumeId, null);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) FlashException(controllers.util.FlashException)

Example 95 with FlashException

use of controllers.util.FlashException in project coprhd-controller by CoprHD.

the class ConsistencyGroups method save.

@FlashException(referrer = { "create", "edit" })
public static void save(ConsistencyGroupForm consistencyGroup) {
    flash.put(ACTIVE_PROJECT_ID, consistencyGroup.projectId);
    consistencyGroup.validate("consistencyGroup");
    if (Validation.hasErrors()) {
        Common.handleError();
    }
    // NOTE : Only Create is supported at this time
    if (consistencyGroup.isNew()) {
        BlockConsistencyGroupCreate createParam = new BlockConsistencyGroupCreate();
        createParam.setName(consistencyGroup.name);
        createParam.setProject(uri(consistencyGroup.projectId));
        createParam.setArrayConsistency(consistencyGroup.arrayConsistency);
        BlockConsistencyGroupUtils.create(createParam);
    }
    flash.success(MessagesUtils.get("consistencyGroups.saved", consistencyGroup.name));
    if (StringUtils.isNotBlank(consistencyGroup.referrerUrl)) {
        redirect(consistencyGroup.referrerUrl);
    } else {
        list();
    }
}
Also used : BlockConsistencyGroupCreate(com.emc.storageos.model.block.BlockConsistencyGroupCreate) FlashException(controllers.util.FlashException)

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