list_jobs RESTful API - Teradata Data Mover

Teradata Data Mover User Guide

Product
Teradata Data Mover
Release Number
16.00
Published
December 2016
Language
English (United States)
Last Update
2018-03-29
dita:mapPath
rdo1467305237457.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-4101
lifecycle
previous
Product Category
Analytical Ecosystem

Purpose

Data Mover provides the following three variations of the list_jobs RESTful API:
  • Jobs that meet specified conditions, including start time, end time, and status
  • Jobs that executed and meet specified conditions, including start time, end time, status, and priority
  • Jobs currently executing and that meet specified conditions, including start time, status, and priority
The list_jobs RESTful API uses the following URLs and method:
Item Description
URL

/datamover/jobs

/datamover/executedJobs

/datamover/executingJobs

Method GET

Request Parameters (/datamover/jobs>)

This variation of the list_jobs RESTful API returns a list of job names that meet the specified conditions, including start time, end time, and status.

startTimeAfter
Description: Jobs started later than specified time
Restriction: Cannot be used with endTimeAfter
URL: /datamover/jobs?startTimeAfter=<value>
JSON Data Type: String (with ISO 8601 UTC date format, for example: 2015-07-01T17:38:12Z
Required: No
endTimeBefore
Description: Jobs finished earlier than specified time.
Restriction: Cannot be used with endTimeAfter
URL: /datamover/jobs?endTimeBefore=<value>
JSON Data Type: String (with ISO 8601 UTC date format, for example: 2015-07-01T17:38:12Z
Required: No
endTimeAfter
Description: Jobs finished earlier than specified time.
Restriction: Cannot be used with endTimeBefore or startTimeAfter.
URL: /datamover/jobs?endTimeAfter=<value>
JSON Data Type: String (with ISO 8601 UTC date format, for example: 2015-07-01T17:38:12Z
Required: No
status
Description: Jobs with last execution status that matches one of the following:
  • NEW: All new jobs
  • INITIALIZING: All initializing jobs
  • RUNNING: All running jobs
  • BLOCKED: All blocked jobs
  • COMPLETED: All successfully completed jobs
  • FAILED: All failed jobs
  • RESTARTING: All restarting jobs
  • CANCELLED: All user-cancelled jobs
  • QUEUED: All queued jobs
URL: /datamover/jobs?status=<value>
JSON Data Type: String
Required: No

Response Parameters (/datamover/jobs>)

jobExecutionName
Description: Job execution name
JSON Data Type: String
jobName
Description: Job name (maximum characters: 237)
JSON Data Type: String
startTime
Description: Start time if job has executed or null if job has not executed
JSON Data Type: String (with ISO 8601 UTC date format), for example: 2015-07-01T17:38:12Z
endTime
Description: End time if job has executed or null if not has not executed
JSON Data Type: String (with ISO 8601 UTC date format), for example: 2015-07-01T17:38:12Z
status
Description: Status of the job (maximum characters: 12), where possible values are specified in Request Parameters section
JSON Data Type: String
Priority
Description: Priority of the job if executed (maximum characters: 11), where the value is one of the following:
  • UNSPECIFIED
  • LOW
  • MEDIUM
  • HIGH
JSON Data Type: String

Status Codes

If the command executes without error, the API returns status code 200 in the response header and nothing in the response body.

If an error occurs during execution, the API returns a non-200 status code in the response header and an error message in JSON format in the response body.

The status codes apply to all variations of the RESTful API.

Response Example (/datamover/jobs>)

This example shows an array of job executions with a start time later than the specified time, no jobs found, and return an empty array.
[
     {
         "jobName" :  "runningJob" ,
         "startTime" : "2015-07-16T17:14:13Z",
         "endTime" :  null ,
         "status" :  "RUNNING" ,
         "priority" :  "MEDIUM" ,
         "links" : 
          [
             {
                 "rel" :  "status" ,
                 "href" :  "http://server/datamover/executingJobs/runningJob-1417744247669"
                              
             },
             {
                 "rel" :  "past_executions" ,
                 "href" :  "http://server/datamover/executedJobs?jobName=runningJob&startTimeAfter=<value>"
                              
             }
            {
                 "rel" :  "job_steps" ,
                 "href" :  "http://server/datamover/jobs/runningJob/steps"
                              
             }
         ]
     },
     {
         "jobName" :  "successfulJob" ,
         "startTime" : "2015-07-16T17:14:13Z",
         "endTime" : "2015-07-16T19:14:13Z",
         "status" :  "COMPLETED" ,
         "priority" :  "MEDIUM" ,
         "links" : 
         [
             {
                 "rel" :  "status" ,
                 "href" :  "http://server/datamover/executedJobs/successfulJob-20141204175020"
                              
             },
             {
                 "rel" :  "past_executions" ,
                 "href" :  "http://server/datamover/executedJobs?jobName=successfulJob
                                &startTimeAfter=<value>
                                "
                              
             }
            {
                 "rel" :  "job_steps" ,
                 "href" :  "http://server/datamover/jobs/successfulJob/steps"
                              
             }
         ]
     },
     {
         "jobName" :  "failedJob" ,
         "startTime" : 1417744247669,
         "endTime" : 1417744323437,
         "status" :  "FAILED" ,
         "priority" :  "MEDIUM" ,
         "links" : 
         [
             {
                 "rel" :  "status" ,
                 "href" :  "http://server/datamover/executedJobs/failedJob-20141204175020"
                              
             },
             {
                 "rel" :  "past_executions" ,
                 "href" :  "http://server/datamover/executedJobs?jobName=failedJob
                                &startTimeAfter=<value>
                                "
                              
             }
            {
                 "rel" :  "job_steps" ,
                 "href" :  "http://server/datamover/jobs/failedJob/steps"
                              
             }
         ]
     }
]             

Request Parameters (/datamover/executedJobs)

This variation of list_jobs RESTful API returns a list of job names that meet the specified conditions, including jobs that are new or in the executing state.

startTimeAfter
Description: Jobs started later than specified time
Restriction: Cannot be used with endTimeAfter
URL: /datamover/executedJobs
JSON Data Type: String (with ISO 8601 UTC date format, for example: 2015-07-01T17:38:12Z
Required: No
endTimeBefore
Description: Jobs finished later than specified time
Restriction: Cannot be used with endTimeAfter
URL: /datamover/executedJobs?endTimeBefore=<value>
JSON Data Type: String (with ISO 8601 UTC date format, for example: 2015-07-01T17:38:12Z
Required: No
endTimeAfter
Description: Jobs finished later than specified time
Restriction: Cannot be used with startTimeAfter or endTimeBefore
URL: /datamover/executedJobs?endTimeAfter=<value>
JSON Data Type: String (with ISO 8601 UTC date format, for example: 2015-07-01T17:38:12Z
Required: No
status
Description: Jobs with last execution status that matches one of the following:
  • COMPLETED: All successfully completed jobs
  • FAILED: All failed jobs
  • CANCELLED: All user-cancelled jobs
URL: /datamover/executedJobs?status=<value>
JSON Data Type: String
Required: No
jobName
Description: Executed jobs mapped to the specified name
URL: /datamover/executedJobs?jobName=<value>
JSON Data Type: String
Required: No

Response Parameters (/datamover/executedJobs)

jobExecutionName
Description: Executed job name
JSON Data Type: String
jobName
Description: Job name (maximum characters: 237)
JSON Data Type: String
startTime
Description: Start time if job has executed or null if not executed
JSON Data Type: String (with ISO 8601 UTC date format), for example: 2015-07-01T17:38:12Z
endTime
Description: End time if job has executed or null if not executed
JSON Data Type: String (with ISO 8601 UTC date format), for example: 2015-07-01T17:38:12Z
status
Description: Job status (maximum characters: 11), where possible values are listed in the Request Parameters section
JSON Data Type: String (with ISO 8601 UTC date format), for example: 2015-07-01T17:38:12Z
Priority
Description: Priority of the job if and when executed (maximum characters: 11), where the value is one of the following:
  • UNSPECIFIED
  • LOW
  • MEDIUM
  • HIGH
JSON Data Type: String

list_jobs RESTful API Example (/datamover/executedJobs)

This example shows an executed job, no jobs found, and an empty array.
[
     {
         "jobExecutionName" :  "successfulJob-20141204175020" ,
         "jobName" :  "successfulJob" ,
         "startTime" :"2015-07-01T17:38:12Z",
         "endTime" : "2015-07-01T19:38:12Z",
         "status" :  "COMPLETED" ,
         "priority" :  "MEDIUM" ,
         "links" : 
         [
             {
                 "rel" :  "status" ,
                 "href" :  "http://server/datamover/executedJobs/successfulJob-20141204175020"
                          
             }
            {
                 "rel" :  "job_steps" ,
                 "href" :  "http://server/datamover/jobs/successfulJob/steps"
                              
             }
         ]
     },
     {
         "jobExecutionName" :  "successfulJob-20141204175111" ,
         "jobName" :  "successfulJob" ,
         "startTime" : "2015-07-02T17:38:12Z",
         "endTime" : "2015-07-02T19:38:12Z",
         "status" :  "COMPLETED" ,
         "priority" :  "MEDIUM" ,
         "links" : 
         [
             {
                 "rel" :  "status" ,
                 "href" :  "http://server/datamover/executedJobs/successfulJob-20141204175111"
                          
             }
            {
                 "rel" :  "job_steps" ,
                 "href" :  "http://server/datamover/jobs/successfulJob/steps"
                              
             }
         ]
     },
     {
         "jobExecutionName" :  "failedJob-20141204175020" ,
         "jobName" :  "failedJob" ,
         "startTime" : "2015-07-03T17:38:12Z",
         "endTime" : "2015-07-03T19:38:12Z",
         "status" :  "FAILED" ,
         "priority" :  "MEDIUM" ,
         "links" : 
         [
             {
                 "rel" :  "status" ,
                 "href" :  "http://server/datamover/executedJobs/failedJob-20141204175020"
                          
             }
            {
                 "rel" :  "job_steps" ,
                 "href" :  "http://server/datamover/jobs/failedJob/steps"
                              
             }
         ]
     }
]     

Request Parameters (/datamover/executingJobs)

This variation of list_jobs RESTful API returns all jobs currently executing on the Data Mover daemon and started later than the specified time, where the value is one of the following:
  • INITIALIZING
  • RUNNING
  • BLOCKED
  • RESTARTING
  • QUEUED
You can provide the following optional parameters:
startTimeAfter
Description: Jobs started later than specified time
Restriction: Cannot be used with endTimeAfter
URL: /datamover/executingJobs
JSON Data Type: String (with ISO 8601 UTC date format, for example: 2015-07-01T17:38:12Z
Required: No
status
Description: Jobs with last execution status that matches one of the following:
  • COMPLETED: All successfully completed jobs
  • FAILED: All failed jobs
  • CANCELLED: All user-cancelled jobs
URL: /datamover/executingJobs?status=<value>
JSON Data Type: String
Required: No

Response Parameters (/datamover/executingJobs)

jobExecutionName
Description: Executed job name
JSON Data Type: String
jobName
Description: Job name (maximum characters: 237)
JSON Data Type: String
startTime
Description: Start time if job has been executed or null if not executed
JSON Data Type: String (with ISO 8601 UTC date format), for example: 2015-07-01T17:38:12Z
status
Description: Status of the job (maximum characters: 11), where possible values are specified in Request Parameters list
JSON Data Type: String
Priority
Description: Priority of the job if and when executed (maximum characters: 11), where the value is one of the following:
  • UNSPECIFIED
  • LOW
  • MEDIUM
  • HIGH
JSON Data Type: String

list_jobs RESTful API Example (/datamover/executingJobs)

This example shows an executed job, no jobs found, and an empty array.
[
         {
         "jobExecutionName" :  "runningJob-1417744247669" ,
         "jobName" :  "runningJob" ,
         "startTime" :"2015-07-16T17:14:13Z",
         "status" :  "RUNNING" ,
         "priority" :  "MEDIUM" ,
         "links" : 
          [
             {
                 "rel" :  "status" ,
                 "href" :  "http://server/datamover/runningJobs/runningJob-1417744247669"
                          
             },
             {
                 "rel" :  "history" ,
                 "href" :  "http://server/datamover/executedJobs?jobName=runningJob&startTimeAfter=<value>"
                          
             }
            {
                 "rel" :  "job_steps" ,
                 "href" :  "http://server/datamover/jobs/runningJob/steps"
                              
             }
         ]
     }
]