Search in sources :

Example 6 with ExportUpdateParam

use of com.emc.storageos.model.block.export.ExportUpdateParam in project coprhd-controller by CoprHD.

the class BlockExportGroups method removeInitiator.

@FlashException(referrer = { "exportGroup" })
public static void removeInitiator(String exportGroupId, String initiatorId) {
    ViPRCoreClient client = BourneUtil.getViprClient();
    ExportUpdateParam exportUpdateParam = new ExportUpdateParam();
    exportUpdateParam.setInitiators(new InitiatorsUpdateParam());
    Set<URI> remove = Sets.newHashSet();
    remove.add(uri(initiatorId));
    exportUpdateParam.getInitiators().setRemove(remove);
    Task<ExportGroupRestRep> task = client.blockExports().update(uri(exportGroupId), exportUpdateParam);
    flash.put("info", MessagesUtils.get("resources.exportgroup.initiator.removed", task.getOpId()));
    exportGroup(exportGroupId);
}
Also used : InitiatorsUpdateParam(com.emc.storageos.model.block.export.InitiatorsUpdateParam) ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) ExportGroupRestRep(com.emc.storageos.model.block.export.ExportGroupRestRep) ExportUpdateParam(com.emc.storageos.model.block.export.ExportUpdateParam) URI(java.net.URI) FlashException(controllers.util.FlashException)

Example 7 with ExportUpdateParam

use of com.emc.storageos.model.block.export.ExportUpdateParam in project coprhd-controller by CoprHD.

the class BlockExportGroups method addInitiators.

@FlashException(referrer = { "exportGroup" })
public static void addInitiators(String exportId, @As(",") String[] ids) {
    ExportUpdateParam exportUpdateParam = new ExportUpdateParam();
    exportUpdateParam.setInitiators(new InitiatorsUpdateParam());
    if (ids != null && ids.length > 0) {
        for (String initiatorId : ids) {
            exportUpdateParam.getInitiators().getAdd().add(uri(initiatorId));
        }
    }
    Task<ExportGroupRestRep> task = getViprClient().blockExports().update(uri(exportId), exportUpdateParam);
    flash.put("info", MessagesUtils.get("resources.exportgroup.initiators.added", task.getOpId()));
    exportGroup(exportId);
}
Also used : InitiatorsUpdateParam(com.emc.storageos.model.block.export.InitiatorsUpdateParam) ExportGroupRestRep(com.emc.storageos.model.block.export.ExportGroupRestRep) ExportUpdateParam(com.emc.storageos.model.block.export.ExportUpdateParam) FlashException(controllers.util.FlashException)

Example 8 with ExportUpdateParam

use of com.emc.storageos.model.block.export.ExportUpdateParam in project coprhd-controller by CoprHD.

the class BlockExportGroups method removeHost.

@FlashException(referrer = { "exportGroup" })
public static void removeHost(String exportGroupId, String hostId) {
    ViPRCoreClient client = BourneUtil.getViprClient();
    ExportUpdateParam exportUpdateParam = new ExportUpdateParam();
    exportUpdateParam.setHosts(new HostsUpdateParam());
    exportUpdateParam.getHosts().getRemove().add(uri(hostId));
    Task<ExportGroupRestRep> task = client.blockExports().update(uri(exportGroupId), exportUpdateParam);
    flash.put("info", MessagesUtils.get("resources.exportgroup.host.removed", task.getOpId()));
    exportGroup(exportGroupId);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) ExportGroupRestRep(com.emc.storageos.model.block.export.ExportGroupRestRep) ExportUpdateParam(com.emc.storageos.model.block.export.ExportUpdateParam) HostsUpdateParam(com.emc.storageos.model.block.export.HostsUpdateParam) FlashException(controllers.util.FlashException)

Example 9 with ExportUpdateParam

use of com.emc.storageos.model.block.export.ExportUpdateParam in project coprhd-controller by CoprHD.

the class BlockExportGroups method removeVolume.

@FlashException(referrer = { "exportGroup" })
public static void removeVolume(String exportGroupId, String volumeId) {
    ViPRCoreClient client = BourneUtil.getViprClient();
    ExportUpdateParam exportUpdateParam = new ExportUpdateParam();
    exportUpdateParam.removeVolume(uri(volumeId));
    Task<ExportGroupRestRep> task = client.blockExports().update(uri(exportGroupId), exportUpdateParam);
    flash.put("info", MessagesUtils.get("resources.exportgroup.volume.removed", task.getOpId()));
    exportGroup(exportGroupId);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) ExportGroupRestRep(com.emc.storageos.model.block.export.ExportGroupRestRep) ExportUpdateParam(com.emc.storageos.model.block.export.ExportUpdateParam) FlashException(controllers.util.FlashException)

Example 10 with ExportUpdateParam

use of com.emc.storageos.model.block.export.ExportUpdateParam in project coprhd-controller by CoprHD.

the class BlockExportGroups method addHosts.

@FlashException(referrer = { "exportGroup" })
public static void addHosts(String exportId, @As(",") String[] ids) {
    ExportUpdateParam exportUpdateParam = new ExportUpdateParam();
    exportUpdateParam.setHosts(new HostsUpdateParam());
    if (ids != null && ids.length > 0) {
        for (String hostId : ids) {
            exportUpdateParam.getHosts().getAdd().add(uri(hostId));
        }
    }
    Task<ExportGroupRestRep> task = getViprClient().blockExports().update(uri(exportId), exportUpdateParam);
    flash.put("info", MessagesUtils.get("resources.exportgroup.hosts.added", task.getOpId()));
    exportGroup(exportId);
}
Also used : ExportGroupRestRep(com.emc.storageos.model.block.export.ExportGroupRestRep) ExportUpdateParam(com.emc.storageos.model.block.export.ExportUpdateParam) HostsUpdateParam(com.emc.storageos.model.block.export.HostsUpdateParam) FlashException(controllers.util.FlashException)

Aggregations

ExportUpdateParam (com.emc.storageos.model.block.export.ExportUpdateParam)13 ExportGroupRestRep (com.emc.storageos.model.block.export.ExportGroupRestRep)8 FlashException (controllers.util.FlashException)8 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)5 ExportPathParameters (com.emc.storageos.model.block.export.ExportPathParameters)4 HostsUpdateParam (com.emc.storageos.model.block.export.HostsUpdateParam)4 ClustersUpdateParam (com.emc.storageos.model.block.export.ClustersUpdateParam)3 InitiatorsUpdateParam (com.emc.storageos.model.block.export.InitiatorsUpdateParam)2 VolumeParam (com.emc.storageos.model.block.export.VolumeParam)2 VolumeUpdateParam (com.emc.storageos.model.block.export.VolumeUpdateParam)2 URI (java.net.URI)2 ArrayList (java.util.ArrayList)2