Search in sources :

Example 41 with ViPRCoreClient

use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.

the class FileSystems method getStorageSystemJson.

/**
 * GEt StorageSystem for given fileSystem
 *
 * @param fileSystemId
 */
public static void getStorageSystemJson(String fileSystemId) {
    ViPRCoreClient client = BourneUtil.getViprClient();
    FileShareRestRep fs = client.fileSystems().get(uri(fileSystemId));
    StorageSystemRestRep sys = client.storageSystems().get(fs.getStorageSystem());
    renderJSON(sys);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) StorageSystemRestRep(com.emc.storageos.model.systems.StorageSystemRestRep) FileShareRestRep(com.emc.storageos.model.file.FileShareRestRep)

Example 42 with ViPRCoreClient

use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.

the class FileSystems method addSubDirectory.

/**
 * This method called when user adds sub directory.
 *
 * @param id
 *            id of the file system.
 * @param shareName
 *            shareName of the sub directory.
 * @param subDirectory
 *            name of the sub directory.
 * @param description
 *            Given description during creation of sub directory.
 */
@FlashException(referrer = { "fileSystem" })
public static void addSubDirectory(String id, String shareName, String subDirectroy, String description) {
    ViPRCoreClient client = BourneUtil.getViprClient();
    FileSystemShareParam param = new FileSystemShareParam();
    param.setShareName(shareName);
    if (subDirectroy != null && !"".equals(subDirectroy)) {
        param.setSubDirectory(subDirectroy);
    }
    if (description != null && !"".equals(description)) {
        param.setDescription(description);
    }
    client.fileSystems().share(uri(id), param);
    flash.put("info", MessagesUtils.get("resources.filesystem.subdir.add"));
    fileSystem(id);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) FileSystemShareParam(com.emc.storageos.model.file.FileSystemShareParam) FlashException(controllers.util.FlashException)

Example 43 with ViPRCoreClient

use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.

the class FileSystems method delete.

private static void delete(List<URI> ids, String deleteType) {
    if (ids != null) {
        ViPRCoreClient client = BourneUtil.getViprClient();
        List<Task<FileShareRestRep>> tasks = Lists.newArrayList();
        for (URI id : ids) {
            boolean forceDelete = false;
            Task<FileShareRestRep> task = client.fileSystems().deactivate(id, new FileSystemDeleteParam(forceDelete, deleteType));
            tasks.add(task);
        }
        if (!tasks.isEmpty()) {
            flash.put("info", MessagesUtils.get("resources.filesystems.deactivate", tasks.size()));
        }
    }
    fileSystems(null);
}
Also used : Task(com.emc.vipr.client.Task) ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) FileShareRestRep(com.emc.storageos.model.file.FileShareRestRep) FileSystemDeleteParam(com.emc.storageos.model.file.FileSystemDeleteParam) URI(java.net.URI)

Example 44 with ViPRCoreClient

use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.

the class FileSystems method fileSystemSnapshots.

public static void fileSystemSnapshots(String fileSystemId) {
    ViPRCoreClient client = BourneUtil.getViprClient();
    List<NamedRelatedResourceRep> refs = client.fileSnapshots().listByFileSystem(uri(fileSystemId));
    List<FileSnapshotRestRep> snapshots = client.fileSnapshots().getByRefs(refs);
    render(snapshots);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) FileSnapshotRestRep(com.emc.storageos.model.file.FileSnapshotRestRep) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep)

Example 45 with ViPRCoreClient

use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.

the class FileSystems method fileSystemShares.

public static void fileSystemShares(String fileSystemId) {
    ViPRCoreClient client = BourneUtil.getViprClient();
    List<SmbShareResponse> shares = client.fileSystems().getShares(uri(fileSystemId));
    render(shares);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) SmbShareResponse(com.emc.storageos.model.file.SmbShareResponse)

Aggregations

ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)225 Asset (com.emc.sa.asset.annotation.Asset)72 AssetDependencies (com.emc.sa.asset.annotation.AssetDependencies)66 URI (java.net.URI)66 VolumeRestRep (com.emc.storageos.model.block.VolumeRestRep)49 FlashException (controllers.util.FlashException)48 AssetOption (com.emc.vipr.model.catalog.AssetOption)41 ArrayList (java.util.ArrayList)34 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)29 FileShareRestRep (com.emc.storageos.model.file.FileShareRestRep)27 ExportGroupRestRep (com.emc.storageos.model.block.export.ExportGroupRestRep)24 BlockSnapshotRestRep (com.emc.storageos.model.block.BlockSnapshotRestRep)20 BlockConsistencyGroupRestRep (com.emc.storageos.model.block.BlockConsistencyGroupRestRep)15 VirtualArrayRestRep (com.emc.storageos.model.varray.VirtualArrayRestRep)15 StoragePortGroupRestRepList (com.emc.storageos.model.portgroup.StoragePortGroupRestRepList)13 HashSet (java.util.HashSet)13 Task (com.emc.vipr.client.Task)11 VirtualArrayRelatedResourceRep (com.emc.storageos.model.VirtualArrayRelatedResourceRep)10 ViPRHttpException (com.emc.vipr.client.exceptions.ViPRHttpException)10 RelatedResourceRep (com.emc.storageos.model.RelatedResourceRep)8