use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class ConsistencyGroupProvider method getConsistencyGroupFilters.
@Asset("consistencyGroupFilter")
public List<AssetOption> getConsistencyGroupFilters(AssetOptionsContext ctx) {
List<ProjectRestRep> projects = api(ctx).projects().getByTenant(ctx.getTenant());
List<BlockConsistencyGroupRestRep> cgs = Lists.newArrayList();
for (ProjectRestRep project : projects) {
cgs.addAll(api(ctx).blockConsistencyGroups().findByProject(project));
}
List<AssetOption> options = createBaseResourceOptions(cgs);
options.add(0, new AssetOption("None", "None"));
return options;
}
use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class FileProvider method getNFSFileExports.
@Asset("fileExports")
@AssetDependencies("fileNFSFilesystem")
public List<AssetOption> getNFSFileExports(AssetOptionsContext ctx, URI fileFilesystem) {
List<AssetOption> options = Lists.newArrayList();
for (FileSystemExportParam export : listFileExports(ctx, fileFilesystem)) {
options.add(new AssetOption(export.getMountPoint(), export.getMountPoint()));
}
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class FileProvider method getNFSFileShares.
@Asset("fileShares")
@AssetDependencies("fileNFSFilesystem")
public List<AssetOption> getNFSFileShares(AssetOptionsContext ctx, URI fileFilesystem) {
List<AssetOption> options = Lists.newArrayList();
for (SmbShareResponse share : listFileShares(ctx, fileFilesystem)) {
String label = String.format("%s [%s]", share.getShareName(), share.getMountPoint());
options.add(new AssetOption(share.getShareName(), label));
}
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class FileProvider method getFilesystemsWithPolicies.
@Asset("fileFilesystemWithPolicies")
@AssetDependencies("project")
public List<AssetOption> getFilesystemsWithPolicies(AssetOptionsContext ctx, URI project) {
List<AssetOption> options = Lists.newArrayList();
List<FilePolicyRestRep> fileSystemPolicies = getAllFileSystemLevelPolicies(ctx);
List<FileShareRestRep> fileSystems = api(ctx).fileSystems().findByProject(project);
for (FilePolicyRestRep policyRestRep : fileSystemPolicies) {
if (policyRestRep.getAssignedResources() != null && !policyRestRep.getAssignedResources().isEmpty()) {
for (FileShareRestRep fileSystem : fileSystems) {
for (NamedRelatedResourceRep resource : policyRestRep.getAssignedResources()) {
if (resource.getId().equals(fileSystem.getId())) {
options.add(new AssetOption(fileSystem.getId(), fileSystem.getName()));
break;
}
}
}
}
}
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class FileProvider method getFileContinuousCopies.
@Asset("fileContinuousCopies")
@AssetDependencies("fileWithContinuousCopies")
public List<AssetOption> getFileContinuousCopies(AssetOptionsContext ctx, URI fileId) {
ViPRCoreClient client = api(ctx);
List<AssetOption> options = Lists.newArrayList();
List<NamedRelatedResourceRep> mirrors = client.fileSystems().getFileContinuousCopies(fileId);
for (NamedRelatedResourceRep mirror : mirrors) {
FileShareRestRep fileShare = client.fileSystems().get(mirror.getId());
options.add(new AssetOption(fileShare.getId(), fileShare.getName()));
}
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
Aggregations