Search in sources :

Example 6 with FileOrchestrationController

use of com.emc.storageos.fileorchestrationcontroller.FileOrchestrationController in project coprhd-controller by CoprHD.

the class AbstractFileServiceApiImpl method export.

@Override
public void export(URI storage, URI fsURI, List<FileShareExport> exports, String opId) throws InternalException {
    FileOrchestrationController controller = getController(FileOrchestrationController.class, FileOrchestrationController.FILE_ORCHESTRATION_DEVICE);
    controller.createNFSExport(storage, fsURI, exports, opId);
}
Also used : FileOrchestrationController(com.emc.storageos.fileorchestrationcontroller.FileOrchestrationController)

Example 7 with FileOrchestrationController

use of com.emc.storageos.fileorchestrationcontroller.FileOrchestrationController in project coprhd-controller by CoprHD.

the class AbstractFileServiceApiImpl method reduceFileShareQuota.

/**
 * Reduce fileshare provision capacity
 * @param fileshare file share object
 * @param newSize - new fileshare size
 * @param taskId - task id
 * return
 */
@Override
public void reduceFileShareQuota(FileShare fileshare, Long newSize, String taskId) throws InternalException {
    FileOrchestrationController controller = getController(FileOrchestrationController.class, FileOrchestrationController.FILE_ORCHESTRATION_DEVICE);
    final List<FileDescriptor> fileDescriptors = new ArrayList<FileDescriptor>();
    if (fileshare.getParentFileShare() != null && fileshare.getPersonality().equals(FileShare.PersonalityTypes.TARGET.name())) {
        throw APIException.badRequests.reduceMirrorFileSupportedOnlyOnSource(fileshare.getId());
    } else {
        List<String> targetfileUris = new ArrayList<String>();
        // if filesystem is target then throw exception
        if (fileshare.getMirrorfsTargets() != null && !fileshare.getMirrorfsTargets().isEmpty()) {
            targetfileUris.addAll(fileshare.getMirrorfsTargets());
        }
        FileDescriptor descriptor = new FileDescriptor(FileDescriptor.Type.FILE_DATA, fileshare.getStorageDevice(), fileshare.getId(), fileshare.getPool(), "", false, newSize);
        fileDescriptors.add(descriptor);
        // Prepare the descriptor for targets
        for (String target : targetfileUris) {
            FileShare targetFileShare = _dbClient.queryObject(FileShare.class, URI.create(target));
            descriptor = new FileDescriptor(FileDescriptor.Type.FILE_DATA, targetFileShare.getStorageDevice(), targetFileShare.getId(), targetFileShare.getPool(), "", false, newSize);
            fileDescriptors.add(descriptor);
        }
    }
    // place the reduce filesystem call in queue
    controller.reduceFileSystem(fileDescriptors, taskId);
}
Also used : FileOrchestrationController(com.emc.storageos.fileorchestrationcontroller.FileOrchestrationController) ArrayList(java.util.ArrayList) FileShare(com.emc.storageos.db.client.model.FileShare) FileDescriptor(com.emc.storageos.fileorchestrationcontroller.FileDescriptor)

Example 8 with FileOrchestrationController

use of com.emc.storageos.fileorchestrationcontroller.FileOrchestrationController in project coprhd-controller by CoprHD.

the class AbstractFileServiceApiImpl method failoverFileShare.

@Override
public void failoverFileShare(URI fsURI, StoragePort nfsPort, StoragePort cifsPort, boolean replicateConfiguration, String taskId) {
    FileOrchestrationController controller = getController(FileOrchestrationController.class, FileOrchestrationController.FILE_ORCHESTRATION_DEVICE);
    controller.failoverFileSystem(fsURI, nfsPort, cifsPort, replicateConfiguration, taskId);
}
Also used : FileOrchestrationController(com.emc.storageos.fileorchestrationcontroller.FileOrchestrationController)

Example 9 with FileOrchestrationController

use of com.emc.storageos.fileorchestrationcontroller.FileOrchestrationController in project coprhd-controller by CoprHD.

the class AbstractFileServiceApiImpl method deleteExportRules.

@Override
public void deleteExportRules(URI storage, URI uri, boolean allDirs, String subDirs, boolean unmountExport, String taskId) {
    FileOrchestrationController controller = getController(FileOrchestrationController.class, FileOrchestrationController.FILE_ORCHESTRATION_DEVICE);
    controller.deleteExportRules(storage, uri, allDirs, subDirs, unmountExport, taskId);
}
Also used : FileOrchestrationController(com.emc.storageos.fileorchestrationcontroller.FileOrchestrationController)

Example 10 with FileOrchestrationController

use of com.emc.storageos.fileorchestrationcontroller.FileOrchestrationController in project coprhd-controller by CoprHD.

the class AbstractFileServiceApiImpl method deleteShareACLs.

@Override
public void deleteShareACLs(URI storage, URI uri, String shareName, String taskId) {
    FileOrchestrationController controller = getController(FileOrchestrationController.class, FileOrchestrationController.FILE_ORCHESTRATION_DEVICE);
    controller.deleteShareACLs(storage, uri, shareName, taskId);
}
Also used : FileOrchestrationController(com.emc.storageos.fileorchestrationcontroller.FileOrchestrationController)

Aggregations

FileOrchestrationController (com.emc.storageos.fileorchestrationcontroller.FileOrchestrationController)28 FileShare (com.emc.storageos.db.client.model.FileShare)9 FileDescriptor (com.emc.storageos.fileorchestrationcontroller.FileDescriptor)8 ArrayList (java.util.ArrayList)7 APIException (com.emc.storageos.svcs.errorhandling.resources.APIException)6 InternalException (com.emc.storageos.svcs.errorhandling.resources.InternalException)6 Operation (com.emc.storageos.db.client.model.Operation)4 TaskMapper.toTask (com.emc.storageos.api.mapper.TaskMapper.toTask)3 MapFileShare (com.emc.storageos.api.mapper.functions.MapFileShare)3 FilePolicy (com.emc.storageos.db.client.model.FilePolicy)3 SMBFileShare (com.emc.storageos.db.client.model.SMBFileShare)3 Task (com.emc.storageos.db.client.model.Task)3 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)3 BadRequestException (com.emc.storageos.svcs.errorhandling.resources.BadRequestException)3 URI (java.net.URI)3 Path (javax.ws.rs.Path)3 Produces (javax.ws.rs.Produces)3 NamedURI (com.emc.storageos.db.client.model.NamedURI)2 StorageSystem (com.emc.storageos.db.client.model.StorageSystem)2 TenantOrg (com.emc.storageos.db.client.model.TenantOrg)2