Get All Jobs

 

Updated: May 7, 2015

The Get All Jobs operation gets all the jobs in a job collection. The full list of jobs can be accessed by excluding any job ID in the GET call (i.e. /jobs.)

The Get All Jobs 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.

Method

Request URI

GET

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

Parameter

Description

state

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

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 2013-06-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:



[
  {
    "id": "job1",
    "startTime": "2013-01-30T20:08:00Z",
    "action": {
      "request": {
        "uri": "http:\/\/bing.com\/",
        "method": "GET",
        "headers": {
          "content-Type": "text\/plain"
        }
      },
      "type": "http"
    },
    "recurrence": {
      "frequency": "minute",
      "count": 10,
      "interval": 1
    },
    "state": "completed",
    "status": {
      "lastExecutionTime": "2013-08-30T01:32:04.5843062Z",
      "executionCount": 10,
       "failureCount": 0,
       "faultedCount": 0
    }
  }
]

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

To add authentication information and call an external service that requires authentication, please refer to the details in the topic Scheduler Outbound Authentication

The following sample URI makes a request for fictional subscription named mysub and fictional cloud service mycs and gets completed jobs in the fictional job collection myjc:


GET https://management.core.windows.net /{subid}/cloudservices/CS1/resources/Scheduler/~/jobcollections/myjc/jobs?$filter=state%20eq%20completed&api-version=2014-04-01




The request is sent with the following headers:


x-ms-version: 2013-06-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:



HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 353
Content-Type: application/json; charset=utf-8
Expires: -1
X-Powered-By: ASP.NET
x-ms-request-id: ba6efd5bf29142898e1552d2b4fb20bb
Date: Fri, 30 Aug 2013 19:50:29 GMT

[
  {
    "id": "job1",
    "startTime": "2013-01-30T20:08:00Z",
    "action": {
      "request": {
        "uri": "http:\/\/bing.com\/",
        "method": "GET",
        "headers": {
          "content-Type": "text\/plain"
        }
      },
      "type": "http"
    },
    "recurrence": {
      "frequency": "minute",
      "count": 10,
      "interval": 1
    },
    "state": "completed",
    "status": {
      "lastExecutionTime": "2013-08-30T01:32:04.5843062Z",
      "executionCount": 10
    }
  }
]

Show: