Search in sources :

Example 16 with FileShareRestRep

use of com.emc.storageos.model.file.FileShareRestRep 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 17 with FileShareRestRep

use of com.emc.storageos.model.file.FileShareRestRep 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 18 with FileShareRestRep

use of com.emc.storageos.model.file.FileShareRestRep in project coprhd-controller by CoprHD.

the class FileSystems method listPolicySnapshot.

public static void listPolicySnapshot(String fileSystemId, String policyId, String policyName) {
    renderArgs.put("dataTable", new FilePolicySnapshotsDataTable());
    renderArgs.put("fileSystemId", uri(fileSystemId));
    renderArgs.put("policyId", uri(policyId));
    ViPRCoreClient client = BourneUtil.getViprClient();
    FileShareRestRep restRep = client.fileSystems().get(uri(fileSystemId));
    renderArgs.put("filePolicyName", policyName);
    renderArgs.put("fileSystemName", restRep.getName());
    renderArgs.put("fileSystemAndpolicyId", fileSystemId + "~~~" + policyId);
    render();
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) FileShareRestRep(com.emc.storageos.model.file.FileShareRestRep) FilePolicySnapshotsDataTable(models.datatable.FilePolicySnapshotsDataTable)

Example 19 with FileShareRestRep

use of com.emc.storageos.model.file.FileShareRestRep in project coprhd-controller by CoprHD.

the class FileSystems method deleteFileSystemShare.

@FlashException(referrer = { "fileSystem" })
public static void deleteFileSystemShare(String fileSystemId, String shareName) {
    ViPRCoreClient client = BourneUtil.getViprClient();
    Task<FileShareRestRep> task = client.fileSystems().removeShare(uri(fileSystemId), shareName);
    flash.put("info", MessagesUtils.get("resources.filesystem.share.deactivate"));
    fileSystem(fileSystemId);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) FileShareRestRep(com.emc.storageos.model.file.FileShareRestRep) FlashException(controllers.util.FlashException)

Example 20 with FileShareRestRep

use of com.emc.storageos.model.file.FileShareRestRep in project coprhd-controller by CoprHD.

the class FileSystems method listAcl.

/**
 * This method called when Access Control List page is loaded.
 *
 * @param fileSystem
 *            File System id of the provided File System.
 * @param shareName
 *            Name of the file share.
 */
public static void listAcl(String fileSystem, String shareName) {
    renderArgs.put("dataTable", new ShareACLDataTable());
    renderArgs.put("fileSystem", uri(fileSystem));
    renderArgs.put("shareName", shareName);
    renderArgs.put("aclURL", "/file/filesystems/" + uri(fileSystem) + "/shares/" + shareName + "/acl");
    renderArgs.put("permissionOptions", StringOption.options(new String[] { "Read", "Change", "FullControl" }));
    renderArgs.put("fileSystemId", uri(fileSystem));
    ViPRCoreClient client = BourneUtil.getViprClient();
    FileShareRestRep restRep = client.fileSystems().get(uri(fileSystem));
    renderArgs.put("fileSystemName", restRep.getName());
    ShareACLForm shareACL = new ShareACLForm();
    render(shareACL);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) FileShareRestRep(com.emc.storageos.model.file.FileShareRestRep) ShareACLDataTable(models.datatable.ShareACLDataTable)

Aggregations

FileShareRestRep (com.emc.storageos.model.file.FileShareRestRep)66 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)27 URI (java.net.URI)15 Asset (com.emc.sa.asset.annotation.Asset)13 AssetDependencies (com.emc.sa.asset.annotation.AssetDependencies)13 AssetOption (com.emc.vipr.model.catalog.AssetOption)10 ArrayList (java.util.ArrayList)7 VirtualArrayRelatedResourceRep (com.emc.storageos.model.VirtualArrayRelatedResourceRep)6 FileProtectionRestRep (com.emc.storageos.model.file.FileShareRestRep.FileProtectionRestRep)5 FilePolicyRestRep (com.emc.storageos.model.file.policy.FilePolicyRestRep)5 Task (com.emc.vipr.client.Task)4 FlashException (controllers.util.FlashException)4 CreateFileSystem (com.emc.sa.service.vipr.file.tasks.CreateFileSystem)3 DeactivateFileSystem (com.emc.sa.service.vipr.file.tasks.DeactivateFileSystem)3 DeactivateFileSystemExportRule (com.emc.sa.service.vipr.file.tasks.DeactivateFileSystemExportRule)3 FileSystemDeleteParam (com.emc.storageos.model.file.FileSystemDeleteParam)3 VirtualArrayRestRep (com.emc.storageos.model.varray.VirtualArrayRestRep)3 FileVirtualPoolRestRep (com.emc.storageos.model.vpool.FileVirtualPoolRestRep)3 MachineTagsCollection (com.emc.sa.machinetags.MachineTagsCollection)2 DeactivateFileSystemShare (com.emc.sa.service.vipr.file.tasks.DeactivateFileSystemShare)2