Revision 70a0afab

b/snf-cyclades-app/synnefo/logic/backend.py
798 798
        return c.GetNodes(bulk=bulk)
799 799

  
800 800

  
801
def get_jobs(backend):
801
def get_jobs(backend, bulk=True):
802 802
    with pooled_rapi_client(backend) as c:
803
        return c.GetJobs()
803
        return c.GetJobs(bulk=bulk)
804 804

  
805 805

  
806 806
def get_physical_resources(backend):
b/snf-cyclades-app/synnefo/logic/rapi.py
1173 1173
                             ("/%s/instances/%s/console" %
1174 1174
                              (GANETI_RAPI_VERSION, instance)), None, None)
1175 1175

  
1176
  def GetJobs(self):
1176
  def GetJobs(self, bulk=False):
1177 1177
    """Gets all jobs for the cluster.
1178 1178

  
1179 1179
    @rtype: list of int
1180 1180
    @return: job ids for the cluster
1181 1181

  
1182 1182
    """
1183
    return [int(j["id"])
1184
            for j in self._SendRequest(HTTP_GET,
1185
                                       "/%s/jobs" % GANETI_RAPI_VERSION,
1186
                                       None, None)]
1183
    query = []
1184
    _AppendIf(query, bulk, ("bulk", 1))
1185

  
1186
    jobs = self._SendRequest(HTTP_GET, "/%s/jobs" % GANETI_RAPI_VERSION,
1187
                             query, None)
1188
    if bulk:
1189
        return jobs
1190
    else:
1191
        return [int(j["id"]) for j in jobs]
1192

  
1187 1193

  
1188 1194
  def GetJobStatus(self, job_id):
1189 1195
    """Gets the status of a job.

Also available in: Unified diff