Previous Topic: job ObjectNext Topic: obj Object


list Method (job Object)
Description

Retrieve list of jobs

Syntax
/api/v1/job/list?vdc=controller-name 
Arguments
vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Retrieve list of jobs

GET http://192.168.123.200/api/v1/job/list?vdc=mygrid 
Sample Output
XML:
<jobs> 
   <job>03a3b9c0-2009-4408-a6a4-a8a9d57cc225</job> 
</jobs> 
<jobs> 
   <job>2287a615-e63c-4110-bc46-576d17fe9d12</job> 
</jobs> 
. 
. 
. 
JSON:
{ 
   "jobs" : [ 
      { 
         "job" : "03a3b9c0-2009-4408-a6a4-a8a9d57cc225" 
      }, 
      { 
         "job" : "2287a615-e63c-4110-bc46-576d17fe9d12" 
      }, 
      . 
      . 
      . 
   ] 
} 

info Method (job Object)
Description

Retrieve information for a job

Syntax
/api/v1/job/info?job=job-id&console=console&vdc=controller-name 
Arguments
job

Job ID

console

The values specify additional output included in the response:

Console=0 gives no additional information. Default: 0

console=1 gives stdout

console=2 gives stderr

console=3 gives stdout and stderr

noautocomplete

When set to 1, the job is not deleted from the list of completed jobs. By default, when a job/info query is executed against a completed job, it is removed from the job list.

Default: 0

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Retrieve information for job=c4830d52-b523-4a3f-933a-34c9c5a4766a

GET http://192.168.123.200/api/v1/job/info?job=c4830d52-b523-4a3f-933a-34c9c5a4766a&vdc=mygrid 
Sample Output
XML:
<opt> 
   <completed>1</completed> 
   <status>0</status> 
   <time_completed>1271810563</time_completed> 
   <time_started>1271810562</time_started> 
</opt> 
JSON:
{ 
   "status" : "0\n", 
   "time_started" : "1271810371", 
   "time_completed" : "1271810372", 
   "completed" : 1 
} 

HTTP Error Codes
404

Entity job c4830d52-b523-4a3f-933a-34c9c5a4766a not found - ID for the job specified is invalid or job is complete.