Previous Topic: util ObjectNext Topic: obj Object


job Object

Use this object to manage jobs running on the 'WS_API' for one or more VDC.

Method

Description

list

Retrieve list of jobs

info

Retrieve information for a job

list Method (job Object)
Description

Retrieve list of jobs

Syntax
/api/v2/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/v2/job/list?vdc=mygrid 
Sample Output
XML:
<jobs>
  <job>0fee1fe8-795d-4e2b-bdf8-501891d65263</job>
  <job>15f58426-a625-459a-9bbf-042996464d65</job>
  <job>1a7f7c3c-3d90-4946-9257-3a9960c356b6</job>
  .
  .
  .
  <job>f6612181-1fb2-4e12-9b83-6517c28ceb8f</job>
  <job>ff45c672-7fbb-4a79-a237-3d95b41e84d8</job>
</jobs>
JSON:

{
   "jobs" : [
      {
         "job" : "0fee1fe8-795d-4e2b-bdf8-501891d65263"
      },
      .
      .
      .
      {
         "job" : "f6612181-1fb2-4e12-9b83-6517c28ceb8f"
      },
      {
         "job" : "ff45c672-7fbb-4a79-a237-3d95b41e84d8"
      }
   ]
}

info Method (job Object)
Description

Retrieve information for a job

Syntax
/api/v2/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/v2/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.