Search in sources :

Example 1 with VirtualNasServerInfo

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));
}
Also used : VirtualNasServerInfo(models.datatable.VirtualNasServerDataTable.VirtualNasServerInfo) VirtualNASRestRep(com.emc.storageos.model.vnas.VirtualNASRestRep)

Example 2 with VirtualNasServerInfo

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;
}
Also used : VirtualNasServerInfo(models.datatable.VirtualNasServerDataTable.VirtualNasServerInfo) ProjectRestRep(com.emc.storageos.model.project.ProjectRestRep) URI(java.net.URI) VirtualNASRestRep(com.emc.storageos.model.vnas.VirtualNASRestRep)

Aggregations

VirtualNASRestRep (com.emc.storageos.model.vnas.VirtualNASRestRep)2 VirtualNasServerInfo (models.datatable.VirtualNasServerDataTable.VirtualNasServerInfo)2 ProjectRestRep (com.emc.storageos.model.project.ProjectRestRep)1 URI (java.net.URI)1