use of com.emc.storageos.model.file.FileShareRestRep in project coprhd-controller by CoprHD.
the class FileProvider method getUnprotectedFileSystems.
@Asset("unprotectedFilesystem")
@AssetDependencies({ "project" })
public List<AssetOption> getUnprotectedFileSystems(AssetOptionsContext ctx, URI project) {
debug("getting unprotected file system (project=%s)", project);
ViPRCoreClient client = api(ctx);
List<AssetOption> options = Lists.newArrayList();
List<FileShareRestRep> fileSystems = client.fileSystems().findByProject(project);
for (FileShareRestRep fileShare : fileSystems) {
if (fileShare.getProtection() != null && fileShare.getProtection().getPersonality() == null) {
options.add(new AssetOption(fileShare.getId(), fileShare.getName()));
}
}
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
use of com.emc.storageos.model.file.FileShareRestRep in project coprhd-controller by CoprHD.
the class FileProvider method getSnapshotFilesystems.
@Asset("fileSnapshotFilesystem")
@AssetDependencies({ "project" })
public List<AssetOption> getSnapshotFilesystems(AssetOptionsContext ctx, URI project) {
ViPRCoreClient client = api(ctx);
Collection<FileShareRestRep> filesystems = client.fileSystems().findByProject(project);
Map<URI, FileVirtualPoolRestRep> pools = getFileVirtualPools(client, filesystems);
return createFilesystemOptions(filesystems, new SnapableFilesystemsPredicate(pools));
}
use of com.emc.storageos.model.file.FileShareRestRep in project coprhd-controller by CoprHD.
the class FileProvider method getProtectedFileSystems.
@Asset("protectedRemoteFileSystem")
@AssetDependencies({ "project" })
public List<AssetOption> getProtectedFileSystems(AssetOptionsContext ctx, URI project) {
debug("getting protected remote file system (project=%s)", project);
ViPRCoreClient client = api(ctx);
List<AssetOption> options = Lists.newArrayList();
List<FileShareRestRep> fileSystems = client.fileSystems().findByProject(project);
for (FileShareRestRep fileShare : fileSystems) {
if (fileShare.getProtection() != null && StringUtils.equals(FileShare.PersonalityTypes.SOURCE.toString(), fileShare.getProtection().getPersonality())) {
options.add(new AssetOption(fileShare.getId(), fileShare.getName()));
}
}
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
use of com.emc.storageos.model.file.FileShareRestRep in project coprhd-controller by CoprHD.
the class VirtualArrayProvider method getTargetVirtualArrays.
@Asset("fileTargetVirtualArray")
@AssetDependencies({ "fileFilePolicy", "unprotectedFilesystem" })
public List<AssetOption> getTargetVirtualArrays(AssetOptionsContext context, URI filePolicy, URI fsId) {
ViPRCoreClient client = api(context);
FilePolicyRestRep policyRest = client.fileProtectionPolicies().getFilePolicy(filePolicy);
if (policyRest.getType().equals("file_snapshot")) {
VirtualArrayRestRep vArray = null;
List<AssetOption> options = Lists.newArrayList();
FileShareRestRep fsObj = client.fileSystems().get(fsId);
if (fsObj != null) {
vArray = client.varrays().get(fsObj.getVirtualArray().getId());
options.add(createBaseResourceOption(vArray));
}
return options;
} else {
return getFileVirtualArrays(context);
}
}
use of com.emc.storageos.model.file.FileShareRestRep in project coprhd-controller by CoprHD.
the class VMwareDatastoreTagger method removeDatastoreTagsFromFilesystem.
private void removeDatastoreTagsFromFilesystem(URI filesystemId, Integer index) {
final FileShareRestRep filesystem = client.fileSystems().get(filesystemId);
final MachineTagsCollection tags = getFileSystemTags(filesystem);
final MachineTagsCollection removeTags = tags.findTags(NAMESPACE, index, DATASTORE, MOUNT_POINT, VCENTER, DATACENTER);
client.fileSystems().removeTags(filesystemId, removeTags.generateRawTags());
}
Aggregations