use of com.emc.storageos.model.file.FileShareRestRep in project coprhd-controller by CoprHD.
the class CreateNfsExportAndDatastoreService method execute.
@Override
public void execute() throws Exception {
URI fileSystemId = createNfsExportHelper.createNfsExport();
List<Datastore> datastores = Lists.newArrayList();
FileShareRestRep fileSystem = FileStorageUtils.getFileSystem(fileSystemId);
FileSystemExportParam export = createNfsExportHelper.getNfsExport(fileSystemId);
connectAndInitializeHost();
if (cluster != null) {
datastores.addAll(vmware.createNfsDatastore(cluster, fileSystem, export, datacenterId, datastoreName));
} else {
datastores.add(vmware.createNfsDatastore(host, fileSystem, export, datacenterId, datastoreName));
}
if (hostId != null) {
ExecutionUtils.addAffectedResource(hostId.toString());
}
for (Datastore datastore : datastores) {
vmware.setStorageIOControl(datastore, storageIOControl, true);
}
}
use of com.emc.storageos.model.file.FileShareRestRep in project coprhd-controller by CoprHD.
the class AffectedResources method getFileMirror.
private static List<FileShareRestRep> getFileMirror(ViPRCoreClient client, URI id) {
try {
if (id != null) {
List<FileShareRestRep> fileMirrors = new ArrayList<FileShareRestRep>();
FileProtectionRestRep targetFileSystems = client.fileSystems().get(id).getProtection();
for (VirtualArrayRelatedResourceRep virtualResource : targetFileSystems.getTargetFileSystems()) {
fileMirrors.add(client.fileSystems().get(virtualResource.getId()));
}
return fileMirrors;
}
} catch (Exception e) {
Logger.debug(e, "Failed to retrieve file system: %s", id);
}
return null;
}
use of com.emc.storageos.model.file.FileShareRestRep in project coprhd-controller by CoprHD.
the class FileStorageUtils method getFileProtectionPolicies.
public static List<URI> getFileProtectionPolicies(URI fileSytem) {
List<URI> policyURI = new ArrayList<>();
FileShareRestRep resp = getFileSystem(fileSytem);
if (resp.getFilePolicies() != null && !resp.getFilePolicies().isEmpty()) {
Set<String> policySet = resp.getFilePolicies();
for (String policy : policySet) {
policyURI.add(URIUtil.uri(policy));
}
}
return policyURI;
}
use of com.emc.storageos.model.file.FileShareRestRep in project coprhd-controller by CoprHD.
the class FileStorageUtils method createFileSystem.
public static URI createFileSystem(URI project, URI virtualArray, URI virtualPool, String label, double sizeInGb, int advisoryLimit, int softLimit, int gracePeriod) {
Task<FileShareRestRep> task = execute(new CreateFileSystem(label, sizeInGb, advisoryLimit, softLimit, gracePeriod, virtualPool, virtualArray, project));
addAffectedResource(task);
URI fileSystemId = task.getResourceId();
addRollback(new DeactivateFileSystem(fileSystemId, FileControllerConstants.DeleteTypeEnum.FULL));
logInfo("file.storage.filesystem.task", task.getResourceId(), task.getOpId());
return fileSystemId;
}
use of com.emc.storageos.model.file.FileShareRestRep in project coprhd-controller by CoprHD.
the class FileStorageUtils method getMirrorFileSystems.
public static List<URI> getMirrorFileSystems(URI fileSystem) {
FileShareRestRep fileShare = getFileSystem(fileSystem);
List<URI> targetFS = new ArrayList<>();
if (fileShare.getProtection() != null && fileShare.getProtection().getTargetFileSystems() != null) {
List<VirtualArrayRelatedResourceRep> responses = fileShare.getProtection().getTargetFileSystems();
for (VirtualArrayRelatedResourceRep resp : responses) {
targetFS.add(resp.getId());
}
}
return targetFS;
}
Aggregations