Search in sources :

Example 6 with DDExportClient

use of com.emc.storageos.datadomain.restapi.model.DDExportClient in project coprhd-controller by CoprHD.

the class DataDomainFileStorageDevice method ddSetNewExportProperties.

private void ddSetNewExportProperties(FileExport fileExport, List<DDExportClient> ddExportClients, DDExportInfo ddExportInfo) {
    fileExport.setNativeId(ddExportInfo.getId());
    fileExport.setMountPath(ddExportInfo.getPath());
    List<String> clients = new ArrayList<>();
    for (DDExportClient ddExportClient : ddExportClients) {
        clients.add(ddExportClient.getName());
    }
    // Note: We store the fileExport permissions as available in the original
    // FileExport object. Only Clients, Protocol and Security Types are updated.
    fileExport.setClients(clients);
    fileExport.setProtocol(DataDomainApiConstants.NFS_PROTOCOL);
    String securityType = fileExport.getSecurityType();
    if (securityType == null) {
        fileExport.setSecurityType(DataDomainApiConstants.DEFAULT_SECURITY);
    }
}
Also used : DDExportClient(com.emc.storageos.datadomain.restapi.model.DDExportClient) ArrayList(java.util.ArrayList)

Example 7 with DDExportClient

use of com.emc.storageos.datadomain.restapi.model.DDExportClient in project coprhd-controller by CoprHD.

the class DataDomainFileStorageDevice method ddCreateExports.

private void ddCreateExports(DataDomainClient ddClient, String storagePoolId, FSExportMap exportMap, List<FileExport> createFileExports) throws DataDomainApiException {
    for (FileExport fileExport : createFileExports) {
        // Build export map for export create
        String exportName;
        if (!fileExport.getPath().startsWith(DataDomainApiConstants.FS_PATH_BASE)) {
            exportName = DataDomainApiConstants.FS_PATH_BASE + fileExport.getPath();
            fileExport.setPath(exportName);
        } else {
            exportName = fileExport.getPath();
        }
        List<DDExportClient> ddExportClients = ddBuildCreateExportClientList(fileExport);
        for (DDExportClient ddExpClient : ddExportClients) {
            _log.info("DD Export Client {}", ddExpClient.toString());
        }
        DDExportInfo ddExportInfo = ddClient.createExport(storagePoolId, exportName, ddExportClients);
        if (ddExportInfo.getPathStatus() != DataDomainApiConstants.PATH_EXISTS) {
            DDServiceStatus ddSvcStatus = ddClient.deleteExport(storagePoolId, ddExportInfo.getId());
            throw DataDomainApiException.exceptions.failedExportPathDoesNotExist(exportName);
        } else {
            ddSetNewExportProperties(fileExport, ddExportClients, ddExportInfo);
            String exportKey = fileExport.getFileExportKey();
            exportMap.put(exportKey, fileExport);
        }
    }
}
Also used : DDExportClient(com.emc.storageos.datadomain.restapi.model.DDExportClient) DDServiceStatus(com.emc.storageos.datadomain.restapi.model.DDServiceStatus) DDExportInfo(com.emc.storageos.datadomain.restapi.model.DDExportInfo) FileExport(com.emc.storageos.db.client.model.FileExport)

Aggregations

DDExportClient (com.emc.storageos.datadomain.restapi.model.DDExportClient)7 ArrayList (java.util.ArrayList)6 DDOptionInfo (com.emc.storageos.datadomain.restapi.DDOptionInfo)2 DDExportInfo (com.emc.storageos.datadomain.restapi.model.DDExportInfo)2 UnManagedFSExportMap (com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedFSExportMap)2 HashMap (java.util.HashMap)2 DDExportClientModify (com.emc.storageos.datadomain.restapi.model.DDExportClientModify)1 DDExportInfoDetail (com.emc.storageos.datadomain.restapi.model.DDExportInfoDetail)1 DDExportList (com.emc.storageos.datadomain.restapi.model.DDExportList)1 DDMTreeList (com.emc.storageos.datadomain.restapi.model.DDMTreeList)1 DDNetworkList (com.emc.storageos.datadomain.restapi.model.DDNetworkList)1 DDServiceStatus (com.emc.storageos.datadomain.restapi.model.DDServiceStatus)1 DDShareList (com.emc.storageos.datadomain.restapi.model.DDShareList)1 DDSystemList (com.emc.storageos.datadomain.restapi.model.DDSystemList)1 URIQueryResultList (com.emc.storageos.db.client.constraint.URIQueryResultList)1 FileExport (com.emc.storageos.db.client.model.FileExport)1 StringMap (com.emc.storageos.db.client.model.StringMap)1 StringSet (com.emc.storageos.db.client.model.StringSet)1 UnManagedFSExport (com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedFSExport)1 UnManagedFileExportRule (com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedFileExportRule)1