use of models.datatable.VirtualNasServerDataTable.VirtualNasServerInfo in project coprhd-controller by CoprHD.
the class StorageSystems method virtualNasServersJson.
public static void virtualNasServersJson(String storageId) {
List<VirtualNasServerInfo> results = Lists.newArrayList();
List<VirtualNASRestRep> vNasServers = getViprClient().virtualNasServers().getByStorageSystem(uri(storageId));
boolean isProjectAccessible = false;
if (isTenantAdmin() || isProjectAdmin()) {
isProjectAccessible = true;
}
for (VirtualNASRestRep vNasServer : vNasServers) {
results.add(new VirtualNasServerInfo(vNasServer, isProjectAccessible));
}
renderArgs.put("storageId", storageId);
renderArgs.put("expectedGeoVersion", VCenterUtils.checkCompatibleVDCVersion(EXPECTED_GEO_VERSION_FOR_VNAS_SUPPORT));
renderJSON(DataTablesSupport.createJSON(results, params));
}
use of models.datatable.VirtualNasServerDataTable.VirtualNasServerInfo in project coprhd-controller by CoprHD.
the class VirtualNasServers method getVirtualNasServers.
private static List<VirtualNasServerInfo> getVirtualNasServers(String projectId) {
if (projectId == null) {
return Collections.EMPTY_LIST;
}
List<VirtualNasServerInfo> vNasServers = Lists.newArrayList();
ProjectRestRep projRestRep = getViprClient().projects().get(uri(projectId));
Set<String> vNasIds = projRestRep.getAssignedVNasServers();
List<URI> vNasUris = Lists.newArrayList();
if (vNasIds != null) {
for (String id : vNasIds) {
vNasUris.add(uri(id));
}
if (!vNasUris.isEmpty()) {
List<VirtualNASRestRep> vNas = getViprClient().virtualNasServers().getByIds(vNasUris);
for (VirtualNASRestRep vNasServer : vNas) {
vNasServers.add(new VirtualNasServerInfo(vNasServer, true));
}
}
}
return vNasServers;
}
Aggregations