docs: def _get_nodes(network_id, template_id=None):
      """
          Get all the nodes in a network
      """
      extras = {'types':[], 'attributes':[]}
  
      node_qry = db.DBSession.query(Node).filter(
                          Node.network_id==network_id,
                          Node.status=='A').options(
                              noload('network')
                          )
      if template_id is not None:
          node_qry = node_qry.filter(ResourceType.node_id==Node.id,
                                     TemplateType.id==ResourceType.type_id,
                                     TemplateType.template_id==template_id)
      node_res = db.DBSession.execute(node_qry.statement).fetchall()
  
      nodes = []
      for n in node_res:
          nodes.append(JSONObject(n, extras=extras))
  
      return nodes