use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class BlockProvider method constructSnapshotOptions.
protected List<AssetOption> constructSnapshotOptions(ViPRCoreClient client, URI project, List<BlockSnapshotRestRep> snapshots) {
List<AssetOption> options = Lists.newArrayList();
Map<URI, VolumeRestRep> volumeNames = getProjectVolumeNames(client, project);
for (BlockSnapshotRestRep snapshot : snapshots) {
options.add(new AssetOption(snapshot.getId(), getBlockObjectLabel(client, snapshot, volumeNames)));
}
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class BlockProvider method getExportPortGroups.
@Asset("exportChangePortGroup")
@AssetDependencies({ "host", "exportPathStorageSystem", "exportPathVirtualArray", "exportCurrentPortGroup" })
public List<AssetOption> getExportPortGroups(AssetOptionsContext ctx, URI hostOrClusterId, URI storageSystemId, URI varrayId, URI exportCurrentPortGroupId) {
final ViPRCoreClient client = api(ctx);
List<AssetOption> options = Lists.newArrayList();
SimpleValueRep value = client.customConfigs().getCustomConfigTypeValue(VMAX_PORT_GROUP_ENABLED, VMAX);
if (value.getValue().equalsIgnoreCase("true")) {
StoragePortGroupRestRepList portGroupsRestRep = client.varrays().getStoragePortGroups(varrayId, null, storageSystemId, null, null, true);
// Get a handle of the actual port group list
List<StoragePortGroupRestRep> portGroups = portGroupsRestRep.getStoragePortGroups();
// Filter out the current port group as we do not want the user to see this an a valid option
ResourceFilter<StoragePortGroupRestRep> filterExistingPG = new DefaultResourceFilter<StoragePortGroupRestRep>() {
@Override
public boolean accept(StoragePortGroupRestRep pg) {
return !pg.getId().equals(exportCurrentPortGroupId);
}
};
ResourceUtils.applyFilter(portGroups, filterExistingPG);
return createPortGroupOptions(portGroups);
}
return options;
}
use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class BlockProvider method createVirtualPoolResourceOptions.
public static List<AssetOption> createVirtualPoolResourceOptions(Collection<? extends VirtualPoolCommonRestRep> virtualPools) {
List<AssetOption> options = Lists.newArrayList();
for (VirtualPoolCommonRestRep virtualPool : virtualPools) {
options.add(createVirtualPoolResourceOption(virtualPool));
}
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class BlockProvider method constructSnapshotSessionOptions.
protected List<AssetOption> constructSnapshotSessionOptions(ViPRCoreClient client, URI project, List<BlockSnapshotSessionRestRep> snapshotSessions) {
List<AssetOption> options = Lists.newArrayList();
Map<URI, VolumeRestRep> volumeNames = getProjectVolumeNames(client, project);
for (BlockSnapshotSessionRestRep snapshotSession : snapshotSessions) {
options.add(new AssetOption(snapshotSession.getId(), getBlockObjectLabel(client, snapshotSession, volumeNames)));
}
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class BlockProvider method constructSnapshotOptions.
protected List<AssetOption> constructSnapshotOptions(List<BlockSnapshotRestRep> snapshots) {
List<AssetOption> options = Lists.newArrayList();
for (BlockSnapshotRestRep snapshot : snapshots) {
options.add(new AssetOption(snapshot.getId(), getMessage("block.snapshot.labelNoVolume", snapshot.getName(), snapshot.getWwn())));
}
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
Aggregations