Lists all of the jobs in the specified account.

@param jobListOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList&lt;CloudJob&gt; object
14940
public Observable<Page<CloudJob>> listAsync(final JobListOptions jobListOptions) {
        return listWithServiceResponseAsync(jobListOptions)
            .map(new Func1<ServiceResponseWithHeaders<Page<CloudJob>, JobListHeaders>, Page<CloudJob>>() {
                @Override
                public Page<CloudJob> call(ServiceResponseWithHeaders<Page<CloudJob>, JobListHeaders> response) {
                    return response.body();
                }
            });
    }
158860
public Observable<OperationListResultInner> listAsync() {
        return listWithServiceResponseAsync().map(new Func1<ServiceResponse<OperationListResultInner>, OperationListResultInner>() {
            @Override
            public OperationListResultInner call(ServiceResponse<OperationListResultInner> response) {
                return response.body();
            }
        });
    }
87252
public JsonResponse getJobStatus(String jobId) throws IOException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put(Job.JOB_ID, jobId);
        return apiGet(ApiAction.job, params);
    }
12675
public static void printJob(Optional<JobExecutionInfo> jobExecutionInfoOptional) {
        if (!jobExecutionInfoOptional.isPresent()) {
            System.err.println("Job id not found.");
            return;
        }

        JobExecutionInfo jobExecutionInfo = jobExecutionInfoOptional.get();
        List<List<String>> data = new ArrayList<>();
        List<String> flags = Arrays.asList("", "-");

        data.add(Arrays.asList("Job Name", jobExecutionInfo.getJobName()));
        data.add(Arrays.asList("Job Id", jobExecutionInfo.getJobId()));
        data.add(Arrays.asList("State", jobExecutionInfo.getState().toString()));
        data.add(Arrays.asList("Completed/Launched Tasks",
                String.format("%d/%d", jobExecutionInfo.getCompletedTasks(), jobExecutionInfo.getLaunchedTasks())));
        data.add(Arrays.asList("Start Time", dateTimeFormatter.print(jobExecutionInfo.getStartTime())));
        data.add(Arrays.asList("End Time", dateTimeFormatter.print(jobExecutionInfo.getEndTime())));
        data.add(Arrays.asList("Duration", jobExecutionInfo.getState() == JobStateEnum.COMMITTED ? periodFormatter
                .print(new Period(jobExecutionInfo.getDuration().longValue())) : "-"));
        data.add(Arrays.asList("Tracking URL", jobExecutionInfo.getTrackingUrl()));
        data.add(Arrays.asList("Launcher Type", jobExecutionInfo.getLauncherType().name()));

        new CliTablePrinter.Builder()
                .data(data)
                .flags(flags)
                .delimiterWidth(2)
                .build()
                .printTable();

        JobInfoPrintUtils.printMetrics(jobExecutionInfo.getMetrics());
    }
249068
@GET
  @Path(ServiceConstants.LIST)
  public Response list() {
    return RestUtils.call(new RestUtils.RestCallable<List<Long>>() {
      @Override
      public List<Long> call() throws Exception {
        return mJobMaster.list();
      }
    }, ServerConfiguration.global());
  }
623257
public JobListNextOptions withOcpDate(DateTime ocpDate) {
        if (ocpDate == null) {
            this.ocpDate = null;
        } else {
            this.ocpDate = new DateTimeRfc1123(ocpDate);
        }
        return this;
    }
540808
public Observable<Page<P2SVpnGatewayInner>> listAsync() {
        return listWithServiceResponseAsync()
            .map(new Func1<ServiceResponse<Page<P2SVpnGatewayInner>>, Page<P2SVpnGatewayInner>>() {
                @Override
                public Page<P2SVpnGatewayInner> call(ServiceResponse<Page<P2SVpnGatewayInner>> response) {
                    return response.body();
                }
            });
    }
694689
public List<CloudTask> getTaskStatusForJob(final String jobId) {
    List<CloudTask> tasks = null;
    try {
      tasks = client.taskOperations().listTasks(jobId);
      LOG.log(Level.INFO, "Task status for job: {0} returned {1} tasks", new Object[]{jobId, tasks.size()});
    } catch (IOException | BatchErrorException ex) {
      LOG.log(Level.SEVERE, "Exception when fetching Task status for job: {0}. Exception [{1}]:[2]",
          new Object[]{jobId, ex.getMessage(), ex.getStackTrace()});
    }

    return tasks;
  }
1016949
public Observable<ServiceResponseWithHeaders<Page<CloudPool>, PoolListHeaders>> listWithServiceResponseAsync() {
        return listSinglePageAsync()
            .concatMap(new Func1<ServiceResponseWithHeaders<Page<CloudPool>, PoolListHeaders>, Observable<ServiceResponseWithHeaders<Page<CloudPool>, PoolListHeaders>>>() {
                @Override
                public Observable<ServiceResponseWithHeaders<Page<CloudPool>, PoolListHeaders>> call(ServiceResponseWithHeaders<Page<CloudPool>, PoolListHeaders> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink, null));
                }
            });
    }
827220
List<Job> getRemainingJobs() {
    if (mThread.isAlive()) {
      LOG.warn("Internal error: Polling running monitor for jobs");
    }
    synchronized (mJobs) {
      return new ArrayList<Job>(mJobs);
    }
  }
1104469
public Observable<Page<JobInner>> listByAutomationAccountNextAsync(final String nextPageLink) {
        return listByAutomationAccountNextWithServiceResponseAsync(nextPageLink)
            .map(new Func1<ServiceResponse<Page<JobInner>>, Page<JobInner>>() {
                @Override
                public Page<JobInner> call(ServiceResponse<Page<JobInner>> response) {
                    return response.body();
                }
            });
    }
673969
@Override
  public Map<JobId, Job> getJobs() {
    log.debug("getting jobs");
    final String folder = Paths.configJobs();
    final ZooKeeperClient client = provider.get("getJobs");
    try {
      final List<String> ids;
      try {
        ids = client.getChildren(folder);
      } catch (NoNodeException e) {
        return Maps.newHashMap();
      }
      final Map<JobId, Job> descriptors = Maps.newHashMap();
      for (final String id : ids) {
        final JobId jobId = JobId.fromString(id);
        final String path = Paths.configJob(jobId);
        try {
          final byte[] data = client.getData(path);
          final Job descriptor = parse(data, Job.class);
          descriptors.put(descriptor.getId(), descriptor);
        } catch (NoNodeException e) {
          // Ignore, the job was deleted before we had a chance to read it.
          log.debug("Ignoring deleted job {}", jobId);
        }
      }
      return descriptors;
    } catch (KeeperException | IOException e) {
      throw new HeliosRuntimeException("getting jobs failed", e);
    }
  }
650482
@GET
  @Produces(APPLICATION_JSON)
  @Timed
  @ExceptionMetered
  public Map<JobId, Job> list(
      @QueryParam("q") @DefaultValue("") final String query,
      @QueryParam("hostPattern") @DefaultValue("") final String hostPattern) {

    final Map<JobId, Job> allJobs;
    if (!hostPattern.isEmpty()) {
      // for each host that matches this pattern...
      allJobs = model.listHosts(hostPattern).stream()
          // get the host status
          .map(model::getHostStatus)
          // then flat map over the jobs deployed to this host
          .flatMap(hostStatus -> hostStatus.getJobs().keySet().stream())
          .distinct()
          .collect(Collectors.toMap(Function.identity(), model::getJob));
    } else {
      allJobs = model.getJobs();
    }

    // Return all jobs if the query string is empty
    if (query.isEmpty()) {
      metrics.jobsInJobList(allJobs.size());
      return allJobs;
    }

    // Filter jobs by jobname query
    final Map<JobId, Job> filteredJobs = Maps.newHashMap();
    for (final Map.Entry<JobId, Job> entry : allJobs.entrySet()) {
      if (entry.getKey().toString().contains(query)) {
        filteredJobs.put(entry.getKey(), entry.getValue());
      }
    }

    metrics.jobsInJobList(filteredJobs.size());
    return filteredJobs;
  }
789894
def list(self, allJobs=False):
        

        jobs = self.server.call('get', '/job')

        return [Job(job['id'], self.server) for job in jobs if allJobs or self._job_owned(job)]
912587
@Override
  public JobStatus getJobStatus(final JobId jobId) {
    final ZooKeeperClient client = provider.get("getJobStatus");

    final Job job = getJob(client, jobId);
    if (job == null) {
      return null;
    }

    final List<String> hosts;
    try {
      hosts = listJobHosts(client, jobId);
    } catch (JobDoesNotExistException e) {
      return null;
    }

    final ImmutableMap.Builder<String, Deployment> deployments = ImmutableMap.builder();
    final ImmutableMap.Builder<String, TaskStatus> taskStatuses = ImmutableMap.builder();
    for (final String host : hosts) {
      final TaskStatus taskStatus = getTaskStatus(client, host, jobId);
      if (taskStatus != null) {
        taskStatuses.put(host, taskStatus);
      }
      final Deployment deployment = getDeployment(host, jobId);
      if (deployment != null) {
        deployments.put(host, deployment);
      }
    }

    final Map<String, Deployment> deploymentsMap = deployments.build();
    return JobStatus.newBuilder()
        .setJob(job)
        .setDeployments(deploymentsMap)
        .setTaskStatuses(taskStatuses.build())
        .build();
  }
940802
public static void printJobProperties(Optional<JobExecutionInfo> jobExecutionInfoOptional) {
        if (!jobExecutionInfoOptional.isPresent()) {
            System.err.println("Job not found.");
            return;
        }
        List<List<String>> data = new ArrayList<>();
        List<String> flags = Arrays.asList("", "-");
        List<String> labels = Arrays.asList("Property Key", "Property Value");

        for (Map.Entry<String, String> entry : jobExecutionInfoOptional.get().getJobProperties().entrySet()) {
            data.add(Arrays.asList(entry.getKey(), entry.getValue()));
        }

        new CliTablePrinter.Builder()
                .labels(labels)
                .data(data)
                .flags(flags)
                .delimiterWidth(2)
                .build()
                .printTable();
    }
762321
public List<JobExecutionEntity> getJobExecutionsRunningLocalToServer(PersistenceServiceUnit psu) {

        final EntityManager em = psu.createEntityManager();
        try {
            List<JobExecutionEntity> exec = new TranRequest<List<JobExecutionEntity>>(em) {
                @Override
                public List<JobExecutionEntity> call() throws Exception {
                    TypedQuery<JobExecutionEntity> query = em.createNamedQuery(JobExecutionEntity.GET_JOB_EXECUTIONS_BY_SERVERID_AND_STATUSES_QUERY,
                                                                               JobExecutionEntity.class);
                    query.setParameter("serverid", batchLocationService.getServerId());
                    query.setParameter("status", RUNNING_STATUSES);
                    List<JobExecutionEntity> result = query.getResultList();
                    if (result == null) {
                        return new ArrayList<JobExecutionEntity>();
                    }
                    return result;
                }
            }.runInNewOrExistingGlobalTran();

            return exec;
        } finally {
            em.close();
        }
    }