use of com.emc.storageos.model.NamedRelatedResourceRep in project coprhd-controller by CoprHD.
the class StorageSystemUtils method getProtectionConnectivityMap.
public static Map<String, Set<NamedRelatedResourceRep>> getProtectionConnectivityMap(StorageSystemRestRep storageSystem) {
Map<String, Set<NamedRelatedResourceRep>> connectivityMap = Maps.newTreeMap();
for (StorageSystemConnectivityRestRep connectivity : getConnectivity(storageSystem)) {
for (String type : connectivity.getConnectionTypes()) {
Set<NamedRelatedResourceRep> resources = connectivityMap.get(type);
if (resources == null) {
resources = Sets.newTreeSet(new NamedRelatedResourceComparator());
connectivityMap.put(type, resources);
}
resources.add(connectivity.getProtectionSystem());
}
}
return connectivityMap;
}
use of com.emc.storageos.model.NamedRelatedResourceRep in project coprhd-controller by CoprHD.
the class TenantUtils method getUnmappedNamespace.
public static List<StringOption> getUnmappedNamespace() {
ObjectNamespaceList objNamespaceList = getViprClient().objectNamespace().getObjectNamespaces();
List<StringOption> namespaceOptions = Lists.newArrayList();
List<NamedRelatedResourceRep> ObjNamedList = objNamespaceList.getNamespaces();
for (NamedRelatedResourceRep namedRes : ObjNamedList) {
URI uri = namedRes.getId();
ObjectNamespaceRestRep objNs = getViprClient().objectNamespace().getObjectNamespace(uri);
if (objNs != null && objNs.getMapped() == false) {
// only unmapped namespaces to be added to list
namespaceOptions.add(new StringOption(objNs.getNativeId(), objNs.getNsName()));
}
}
return namespaceOptions;
}
use of com.emc.storageos.model.NamedRelatedResourceRep in project coprhd-controller by CoprHD.
the class VirtualArrayUtils method getConnectivityMap.
public static Map<String, Set<NamedRelatedResourceRep>> getConnectivityMap(String id) {
Map<String, Set<NamedRelatedResourceRep>> connectivityMap = Maps.newTreeMap();
for (VirtualArrayConnectivityRestRep connectivity : getConnectivity(id)) {
for (String type : connectivity.getConnectionType()) {
Set<NamedRelatedResourceRep> virtualArrays = connectivityMap.get(type);
if (virtualArrays == null) {
virtualArrays = Sets.newTreeSet(new NamedRelatedResourceComparator());
connectivityMap.put(type, virtualArrays);
}
virtualArrays.add(connectivity.getVirtualArray());
}
}
return connectivityMap;
}
use of com.emc.storageos.model.NamedRelatedResourceRep in project coprhd-controller by CoprHD.
the class BlockVolumesDataTable method fetch.
public static List<Volume> fetch(URI projectId, URI applicationId) {
if (projectId == null && applicationId == null) {
return Collections.EMPTY_LIST;
}
ViPRCoreClient client = getViprClient();
List<VolumeRestRep> volumes = Lists.newArrayList();
List<Volume> results = Lists.newArrayList();
Map<URI, String> virtualArrays = ResourceUtils.mapNames(client.varrays().list());
Map<URI, String> virtualPools = ResourceUtils.mapNames(client.blockVpools().list());
if (projectId != null) {
volumes = client.blockVolumes().findByProject(projectId);
for (VolumeRestRep volume : volumes) {
results.add(new Volume(volume, virtualArrays, virtualPools));
}
} else if (applicationId != null) {
List<VolumeRestRep> result = Lists.newArrayList();
List<NamedRelatedResourceRep> groups = AppSupportUtil.getVolumesByApplication(applicationId.toString());
List<NamedRelatedResourceRep> clones = AppSupportUtil.getFullCopiesByApplication(applicationId.toString());
for (NamedRelatedResourceRep volume : groups) {
result.add(BourneUtil.getViprClient().blockVolumes().get((volume.getId())));
}
for (NamedRelatedResourceRep clone : clones) {
result.add(BourneUtil.getViprClient().blockVolumes().get((clone.getId())));
}
for (VolumeRestRep volumeApplication : result) {
results.add(new Volume(volumeApplication, virtualArrays, virtualPools));
}
}
return results;
}
use of com.emc.storageos.model.NamedRelatedResourceRep in project coprhd-controller by CoprHD.
the class BlockVirtualPoolForm method doSave.
protected BlockVirtualPoolRestRep doSave() {
BlockVirtualPoolRestRep virtualPool;
if (isNew()) {
BlockVirtualPoolBuilder builder = apply(new BlockVirtualPoolBuilder());
virtualPool = VirtualPoolUtils.create(builder.getVirtualPool());
this.id = ResourceUtils.stringId(virtualPool);
} else {
BlockVirtualPoolRestRep oldVirtualPool = VirtualPoolUtils.getBlockVirtualPool(id);
BlockVirtualPoolUpdateBuilder builder = apply(new BlockVirtualPoolUpdateBuilder(oldVirtualPool));
virtualPool = VirtualPoolUtils.update(id, builder.getVirtualPoolUpdate());
List<NamedRelatedResourceRep> matchingPools = VirtualPoolUtils.refreshMatchingPools(virtualPool);
Logger.info("Refreshed Block Virtual Pool '%s' matching pools: %d", virtualPool.getName(), matchingPools.size());
}
virtualPool = saveStoragePools(virtualPool);
return virtualPool;
}
Aggregations