use of com.emc.storageos.model.vnas.VirtualNASList in project coprhd-controller by CoprHD.
the class StorageSystemService method getVnasServers.
/**
* Gets all virtual NAS for the registered storage system with the passed
* id.
*
* @param id the URN of a ViPR storage system.
*
* @brief List storage system virtual nas servers
* @return A reference to a StoragePooList specifying the id and self link
* for each storage pool.
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/{id}/vnasservers")
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.SYSTEM_MONITOR })
public VirtualNASList getVnasServers(@PathParam("id") URI id) {
// Make sure storage system is registered.
ArgValidator.checkFieldUriType(id, StorageSystem.class, "id");
StorageSystem system = queryResource(id);
ArgValidator.checkEntity(system, id, isIdEmbeddedInURL(id));
VirtualNASList vNasList = new VirtualNASList();
URIQueryResultList vNasURIs = new URIQueryResultList();
_dbClient.queryByConstraint(ContainmentConstraint.Factory.getStorageDeviceVirtualNasConstraint(id), vNasURIs);
Iterator<URI> vNasIter = vNasURIs.iterator();
while (vNasIter.hasNext()) {
URI vNasURI = vNasIter.next();
VirtualNAS vNas = _dbClient.queryObject(VirtualNAS.class, vNasURI);
if (vNas != null && !vNas.getInactive()) {
vNasList.getVNASServers().add(toNamedRelatedResource(vNas, vNas.getNativeGuid()));
}
}
return vNasList;
}
use of com.emc.storageos.model.vnas.VirtualNASList in project coprhd-controller by CoprHD.
the class VirtualNasService method getVirtualNasServers.
/**
* Gets the ids and self links for all virtual NAS.
*
* @brief List virtual NAS servers
* @return A VirtualNASList reference specifying the ids and self links for
* the virtual NAS servers.
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.SYSTEM_MONITOR })
public VirtualNASList getVirtualNasServers() {
VirtualNASList vNasList = new VirtualNASList();
List<URI> ids = _dbClient.queryByType(VirtualNAS.class, true);
for (URI id : ids) {
VirtualNAS vNas = _dbClient.queryObject(VirtualNAS.class, id);
if ((vNas != null)) {
vNasList.getVNASServers().add(toNamedRelatedResource(vNas, vNas.getNasName()));
}
}
return vNasList;
}
Aggregations