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);
}
}
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);
}
}
}
Aggregations