SALES: 1-800-867-1380

Get Job History (Scheduler API)

Updated: April 30, 2014

The Get Job History operation gets the history details of specified job from the specified job collection.

The Get Job History request is specified as follows. Replace <subscription-id> with your subscription ID, <cloud-service-id> with your cloud service ID, <job-collection-id> with the ID of the job collection, and <job-id> with the ID of the job. When Scheduler jobs execute, they record a log of their results. The response is a JSON array of history objects.

 

Method Request URI

GET

https://management.core.windows.net/<subscription-id>/cloudservices/<cloud-service-id>/resources/scheduler/~/jobCollections/<job-collection-id>/jobs/<job-id>/history?api-version=2014-04-01

 

Parameter Description

state

Optional. To fetch all records of a particular state, you can provide a query parameter defining the state you are interested in (e.g. enabled, disabled, completed, faulted). For example, to retrieve all job records that are completed, you would call GET /history?$filter=state%20eq%20completed

status

Optional. To fetch all records of a particular status, you can provide a query parameter defining the jobs you are interested in (e.g. failed, completed). For example, to retrieve all job records that are failed, you would call GET /history?$filter=status%20eq%20failed

top

Optional. This fetches the top N job records, where N is the argument specified as the value, like so: GET /history?$top=10. This may be combined with the other parameters, like so: GET /history?$top=10&filter=status%20eq%20failed.

skip

Optional. This skips the top N job records and returns the remaining results as specified, where N is the argument specified as the value, like so: GET /history?$skip=10. This may be combined with the other parameters, like so: GET /history?$top=5&$skip=10$filter=status%20eq%20failed.

The following table describes required and optional request headers.

 

Request Header Description

x-ms-version

Required. Specifies the version of the operation to use for this request. This header should be set to 2012-03-01 or a later version.

The response includes an HTTP status code, a set of response headers, and a response body.

A successful operation returns status code 200 (OK).

The response for this operation includes the following headers. The response may also include additional standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.

 

Response Header Description

x-ms-request-id

A value that uniquely identifies a request made against the Management service. For an asynchronous operation, you can call get operation status with the value of the header to determine whether the operation is complete, has failed, or is still in progress. See Tracking Asynchronous Service Management Requests for more information.

The format of the response body is as follows:


[
  {
    "jobId": "job1", 
    "timestamp": "2012-05-01T18:56:46", 
    "startTime": "2013-08-30T20:55:02.4143712Z",
    "endTime": "2013-08-30T20:55:02.5706248Z",
    "state": "enabled",
    "message": "Job Created"
  },
  {
    "jobId": "job1", 
    "timestamp": "2012-06-01T18:56:46", 
    "startTime": "2013-09-30T20:55:02.4143712Z",
    "endTime": "2013-09-30T20:55:02.5706248Z",
    "state": "enabled",
    "message": "Http Action - Response from host 'www.bing.com': 'OK' Body: "
  }
]

Below are key elements of this response body

 

Response Property Description

timestamp

The historical timestamp when the job was executed

Message

Specifies the action that was taken

startTime

Start time of the execution of the job

endTime

End time of the execution of the job

Status

The Status property’s values will be either failed or completed

ActionName

The ActionName property values will be either mainAction or errorAction

State

The state of the job at the end of execution

Any management certificate associated with the subscription specified by <Subscription-Id> can be used to authenticate this operation. For additional details, see Authenticating Service Management Requests

The following sample URI makes a request for fictional subscription named mysub and fictional cloud service mycs:


GET https://management.core.windows.net/{subid}/cloudservices/CS1/resources/scheduler/~/jobcollections/myjc/jobs/job1/history?api-version=2014-04-01


The request is sent with the following headers:


x-ms-version: 2013-03-01
Host: management.core.windows.net

The request is sent with the following XML body:

(Empty)

After the request has been sent, the following response is returned:


// Response
HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 2424
Content-Type: application/json; charset=utf-8
Expires: -1
X-Powered-By: ASP.NET
x-ms-request-id: 58b481e746124941b5148d32b620df7b
Date: Fri, 30 Aug 2013 20:57:02 GMT

[
  {
    "jobId": "job1",
    "timestamp": "2013-08-30T20:55:02.4143712Z",
    "startTime": "2013-08-30T20:55:02.4143712Z",
    "endTime": "2013-08-30T20:55:02.5706248Z",
    "state": "enabled",
    "message": "Response from 'http:\/\/bing.com\/': OK <!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd\"><html lang=\"en\" xml:lang=\"en\" xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><head><meta content=\"text\/html; charset=utf-8\" http-equiv=\"content-type\" \/>\u2026}"
  }
]




Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft