Skip to content

Commit

Permalink
add example for filtering by array ID
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-jt79 committed Jul 18, 2023
1 parent fd2fb8b commit cd0cd04
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion docs/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ The job client gives access to job related methods.
Listing Jobs
--------------

To list jobs use the list_jobs() method. You can filter by cluster name or by available application version id.
To list jobs use the list_jobs() method. You can filter by Job Array IDs to list all jobs that belong to a given job array.

.. code-block:: python
Expand Down Expand Up @@ -418,6 +418,21 @@ An example output is shown below.
'submitted_by': 'Mike Turner'}
]
To get all the jobs that belong to a specific job array.

.. code-block:: python
from pyepic import EPICClient
client = EPICClient("your_api_token_goes_here")
# List jobs that belong to job array ID 100
jobs = client.job.list(job_array=100)
print("ID | Name | Application | Status | Array ID")
for job in jobs:
print("{} | {} | {} | {} | {}".format(job.id, job.name, job.app, job.status, job.array))
To get the details of a specific job with a known ID using the get_job_details method.

Expand All @@ -431,6 +446,7 @@ To get the details of a specific job with a known ID using the get_job_details m
jobs = client.job.get_details(18)
Checking job logs
-----------------

Expand Down

0 comments on commit cd0cd04

Please sign in to comment.