get_jobs
Lists existing jobs.
Standard Mode
emcli get_jobs [-name="job_name_pattern"] [-owner="job_owner"] [-job_ids="ID1;ID2;..."] [-targets="type1:name1;type2:name2;..."] [-status_ids="status1;status2;..."] [-noheader] [-script | -format= [name:<pretty|script|csv>]; [column_separator:"column_sep_string"]; [row_separator:"row_sep_string"]; ] [ ] indicates that the parameter is optional
Interactive or Script Mode
get_jobs [(name="job_name_pattern"] [,owner="job_owner"] [,job_ids="ID1;ID2;..."] [,targets="type1:name1;type2:name2;..."] [,status_ids="status1;status2;..."] [,noheader=True|False] [,script=True|False | ,format= [name:<pretty|script|csv>]; [column_separator:"column_sep_string"]; [row_separator:"row_sep_string"]; ]) [ ] indicates that the parameter is optional
Options
-
name
Job name pattern to filter on.
-
owner
Owner of the jobs to filter on.
-
job_ids
Lists job IDs to use as the output filters.
-
targets
Lists targets (as name-type pairs) to use as the output filters.
-
status_ids
Lists numeric status IDs to use as the output filters.
The numeric codes for all possible job statuses are as follows:
-
ABORTED(Error)=3
-
ACTION_REQUIRED_STATUS=22
-
COMPLETED(Successful)=5
-
EXECUTING(Running)=2
-
FAILED=4
-
INACTIVE=14
-
MISSING_CREDS_STATUS=21
-
QUEUED=15
-
REASSIGNED_STATUS=20
-
SCHEDULED=1
-
SKIPPED=18
-
STOPPED=8
-
STOP_PENDING=12
-
SUSPENDED_AGENT_DOWN=7
-
SUSPENDED_BLACKOUT=11
-
SUSPENDED_EVENT=10
-
SUSPENDED_LOCK=9
-
SUSPEND_PENDING=13
-
SUSPENDED_USER=6
-
TARGET_NOT_READY_STATUS =26
-
-
noheader
Displays tabular information without column headers.
-
script
This is equivalent to
-format="name:script"
. -
format
Format specification (default is
-format="name:pretty"
).-
format="name:pretty"
prints the output table in a readable format not intended to be parsed by scripts. -
format="name:script"
sets the default column separator to a tab and the default row separator to a newline. The column and row separator strings can be specified to change these defaults. -
format="name:csv"
sets the column separator to a comma and the row separator to a newline. -
format=
column_separator:"column_sep_string" column-separates the verb output by <column_sep_string>. Rows are separated by the newline character. -
row_separator:"row_sep_string" row-separates the verb output by <row_sep_string>. Rows are separated by the tab character.
-
Output Columns
Name, Type, ID, Execution ID, Scheduled, TimeZone, Completed, Status, Status ID, Owner, Target Type, Target Name
Examples
These examples show the jobs with the specified job IDs 12345678901234567890123456789012 and 09876543210987654321098765432100:
Example 1 - Command-Line
emcli get_jobs -job_ids="12345678901234567890123456789012;09876543210987654321098765432100"
Example 2 - Script and Interactive
get_jobs (job_ids="12345678901234567890123456789012; 09876543210987654321098765432100")
These examples show all jobs run against a host target named mainhost.example.com
that are scheduled or have completed.
Example 3 - Command-Line
emcli get_jobs -status_ids="1;5" -targets="mainhost.example.com:host"
Example 4 - Script and Interactive
get_jobs (status_ids="1;5", targets="mainhost.example.com:host")