Loading...
 

Get Task Status


HTTP VerbGET
URI Template/task/{taskID}
MIME Typeapplication/vnd.pncp.v.1.0+json onwards
Normal HTTP Response Code200 OK
Invoked ByResellers and end-clients can only invoke this for tasks created by themselves.
Response ModeSynchronous.

Sample Request

GET /pncp-external-api-rest/task/8ab670f8-36fd-496d-b214-17943e742c9f HTTP/1.1
Accept: application/vnd.pncp.v.5.0+json
Authorization: PNCP WhX4vxJ6hV3BMdR/Vg+MMPaGxrGDzfQkr/LQ9zJsLCs=
Content-Length: 0
User-Agent: Jakarta Commons-HttpClient/3.1
Host: YOUR_API_URL

Sample Response (When Task Still In Progress)

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Pragma: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: no-cache
Cache-Control: no-store
Content-Type: application/vnd.pncp.v.5.0+json
Transfer-Encoding: chunked
Date: Thu, 26 Jan 2012 11:40:19 GMT

{
   "percentageComplete":15,
   "requestStateEnum":"OPEN",
   "processDescription":"Creating VM ExternalVMTest646bca17",
   "latestTaskDescription":"Creating VM image",
   "result":null,
   "errorCode":null,
   "errorMessage":null,
   "lastUpdatedTimestamp":"2012/01/26 11:25:22",
   "createdTimestamp":"2012/01/26 11:20:06"
}

Sample Response (When Task Completed)

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Pragma: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: no-cache
Cache-Control: no-store
Content-Type: application/vnd.pncp.v.5.0+json
Transfer-Encoding: chunked
Date: Thu, 26 Jan 2012 11:21:02 GMT

{
   "percentageComplete":100,
   "requestStateEnum":"CLOSED_SUCCESSFUL",
   "processDescription":"Creating VM ExternalVMTestc4de7e9b",
   "latestTaskDescription":"Done",
   "result":{
      "resourceURL":"/virtualmachine/540"
   },
   "errorCode":null,
   "errorMessage":null,
   "lastUpdatedTimestamp":"2012/01/26 11:21:02",
   "createdTimestamp":"2012/01/26 11:20:06"
}

Notes

  • requestStateEnum can be of value OPEN, CLOSED_SUCCESSFUL or CLOSED_FAILED.
  • The fields lastUpdatedTimestamp and createdTimestamp are of type date of format yyyy/MM/dd HH:mm:ss.