parameters: (self, request, capture_node=None)
return_statement: return Response(status=200,
                          data={'data': capture_node_info})
docstring: Return the list of capture_nodes.
          :param Request request:
          URL Args:
              capture_node: The id of the status for a specific capture_node. Default (None) is all.
docstring_summary: Return the list of capture_nodes.
          :param Request request:
          URL Args:
              capture_node: The id of the status for a specific capture_node. Default (None) is all.
docstring_tokens: Return the list of capture_nodes . : param Request request : URL Args : capture_node : The id of the status for a specific capture_node . Default ( None ) is all .
function: def get(self, request, capture_node=None):
          """Return the list of capture_nodes.
          :param Request request:
          URL Args:
              capture_node: The id of the status for a specific capture_node. Default (None) is all.
          """
  
          if capture_node is None:
              capture_nodes = CaptureNode.objects.all()
          else:
              try:
                  capture_node = int(capture_node)
              except ValueError:
                  return Response(data={"Invalid capture_node id: {}".format(capture_node)})
  
              try:
                  capture_nodes = [CaptureNode.objects.get(id=capture_node)]
              except CaptureNode.DoesNotExist:
                  return Response(status=404)
  
          capture_node_info = []
          tasks = {}
          for capnode in capture_nodes:
              tasks[capnode.hostname] = status_tasks.get_status.apply_async(queue=capnode.hostname)
  
          for capnode in capture_nodes:
              ser_data = CaptureNodeSerializer(capnode).data
              data = tasks[capnode.hostname].get(timeout=self.timeout).get('data')
              if hasattr(data, 'get'):
                  ser_data['state'] = data.get('state')
              else:
                  ser_data['state'] = None
              ser_data['is_admin'] = request.user.extra.is_admin_for(capnode)
              ephemeral_task_cleanup(tasks[capnode.hostname])
              capture_node_info.append(ser_data)
  
          return Response(status=200,
                          data={'data': capture_node_info})
function_tokens: def get ( self , request , capture_node = None ) : if capture_node is None : capture_nodes = CaptureNode . objects . all ( ) else : try : capture_node = int ( capture_node ) except ValueError : return Response ( data = { "Invalid capture_node id: {}" . format ( capture_node ) } ) try : capture_nodes = [ CaptureNode . objects . get ( id = capture_node ) ] except CaptureNode . DoesNotExist : return Response ( status = 404 ) capture_node_info = [ ] tasks = { } for capnode in capture_nodes : tasks [ capnode . hostname ] = status_tasks . get_status . apply_async ( queue = capnode . hostname ) for capnode in capture_nodes : ser_data = CaptureNodeSerializer ( capnode ) . data data = tasks [ capnode . hostname ] . get ( timeout = self . timeout ) . get ( 'data' ) if hasattr ( data , 'get' ) : ser_data [ 'state' ] = data . get ( 'state' ) else : ser_data [ 'state' ] = None ser_data [ 'is_admin' ] = request . user . extra . is_admin_for ( capnode ) ephemeral_task_cleanup ( tasks [ capnode . hostname ] ) capture_node_info . append ( ser_data ) return Response ( status = 200 , data = { 'data' : capture_node_info } )