use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class ClusterProvider method getEsxClusterOptions.
@Asset("esxCluster")
public List<AssetOption> getEsxClusterOptions(AssetOptionsContext ctx) {
debug("getting esx clusters");
Collection<ClusterRestRep> clusters = getClusters(ctx);
List<AssetOption> options = Lists.newArrayList();
for (ClusterRestRep value : clusters) {
// If Cluster has an esx host - then add it to the list
List<HostRestRep> hostList = api(ctx).hosts().getByCluster(value.getId());
for (HostRestRep host : hostList) {
if (host.getType().equalsIgnoreCase(Host.HostType.Esx.name())) {
String dataCenterName = getDataCenterName(ctx, value);
options.add(createClusterOption(ctx, value, dataCenterName));
break;
}
}
}
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class ComputeProvider method getComputeVirtualPoolForVirtualArray.
@Asset("computeVirtualPool")
@AssetDependencies({ "blockVirtualArray" })
public List<AssetOption> getComputeVirtualPoolForVirtualArray(AssetOptionsContext ctx, URI virtualArray) {
debug("getting compute virtual pools");
Collection<ComputeVirtualPoolRestRep> computeVirtualPools = api(ctx).computeVpools().getByVirtualArrayAndTenant(virtualArray, ctx.getTenant());
List<AssetOption> options = Lists.newArrayList();
for (ComputeVirtualPoolRestRep value : computeVirtualPools) {
options.add(createComputeVirtualPoolOption(ctx, value));
}
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class FileProvider method getFileTargetVirtualPools.
@Asset("fileTargetVirtualPool")
@AssetDependencies({ "fileFilePolicy" })
public List<AssetOption> getFileTargetVirtualPools(AssetOptionsContext ctx, URI filePolicy) {
List<AssetOption> options = Lists.newArrayList();
ViPRCoreClient client = api(ctx);
FilePolicyRestRep policyRest = client.fileProtectionPolicies().getFilePolicy(filePolicy);
List<FileVirtualPoolRestRep> vpoolChanges = client.fileVpools().getByTenant(ctx.getTenant());
for (FileVirtualPoolRestRep vpool : vpoolChanges) {
if (vpool.getProtection() != null) {
if ((policyRest.getType().equals("file_snapshot") && vpool.getProtection().getScheduleSnapshots()) || (policyRest.getType().equals("file_replication") && vpool.getProtection().getReplicationSupported())) {
options.add(new AssetOption(vpool.getId(), vpool.getName()));
}
}
}
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class FileProvider method getFileSnapshotShares.
@Asset("fileSnapshotShares")
@AssetDependencies("fileSnapshot")
public List<AssetOption> getFileSnapshotShares(AssetOptionsContext ctx, URI fileSnapshot) {
List<AssetOption> options = Lists.newArrayList();
for (SmbShareResponse share : api(ctx).fileSnapshots().getShares(fileSnapshot)) {
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 getNFSMountsForHost.
@Asset("mountedNFSExport")
@AssetDependencies("linuxFileHost")
public List<AssetOption> getNFSMountsForHost(AssetOptionsContext ctx, URI host) {
List<AssetOption> options = Lists.newArrayList();
List<MountInfo> hostMounts = api(ctx).fileSystems().getNfsMountsByHost(host);
for (MountInfo mountInfo : hostMounts) {
String mountString = mountInfo.getMountString();
options.add(new AssetOption(mountString, getDisplayMount(ctx, mountInfo)));
}
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
Aggregations