use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class FileProvider method getCIFSFileShares.
@Asset("fileShares")
@AssetDependencies("fileCIFSFilesystem")
public List<AssetOption> getCIFSFileShares(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 getFailoverFileTarget.
@Asset("failoverFileTarget")
@AssetDependencies("protectedRemoteFileSystem")
public List<AssetOption> getFailoverFileTarget(AssetOptionsContext ctx, URI protectedFileSystem) {
if (protectedFileSystem != null) {
ViPRCoreClient client = api(ctx);
List<AssetOption> options = Lists.newArrayList();
debug("getting failoverFileTargets (protectedFileSystem=%s)", protectedFileSystem);
FileShareRestRep file = client.fileSystems().get(protectedFileSystem);
FileProtectionRestRep protection = file.getProtection();
if (protection != null) {
List<VirtualArrayRelatedResourceRep> targets = protection.getTargetFileSystems();
for (VirtualArrayRelatedResourceRep target : targets) {
FileShareRestRep fileshare = client.fileSystems().get(target.getId());
options.add(new AssetOption(fileshare.getId(), fileshare.getName()));
}
}
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
return Lists.newArrayList();
}
use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class ProjectProvider method getProjectFilters.
public List<AssetOption> getProjectFilters(AssetOptionsContext ctx) {
List<AssetOption> options = createBaseResourceOptions(api(ctx).projects().getByTenant(ctx.getTenant()));
options.add(0, new AssetOption("All", "All"));
return options;
}
use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class VirtualArrayProvider method getFileTargetVirtualArrays.
@Asset("fileTargetVirtualArray")
@AssetDependencies({ "fileFilePolicy", "fileFilesystemAssociation" })
public List<AssetOption> getFileTargetVirtualArrays(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.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class VirtualDataCenterProvider method getUnmanagedVolume.
@Asset("unmanagedVolume")
@AssetDependencies({ "host", "unmanagedBlockVirtualPool", "volumeFilter" })
public List<AssetOption> getUnmanagedVolume(AssetOptionsContext ctx, URI host, URI vpool, int volumePage) {
List<AssetOption> options = Lists.newArrayList();
for (UnManagedVolumeRestRep volume : listUnmanagedVolumesByHost(ctx, host)) {
if (matchesVpool(volume, vpool)) {
options.add(toAssetOption(volume));
}
}
AssetOptionsUtils.sortOptionsByLabel(options);
return getVolumeSublist(volumePage, options);
}
Aggregations