SALES: 1-800-867-1380

Update Job (Scheduler API)

Updated: April 30, 2014

The Update Job request updates an existing job.

The Update Job 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 nw job itself.

 

Method Request URI

PATCH

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

Jobs can be updated through a simple PATCH operation to a job’s address. The format of the request is the same as that for creating a job, but if a field is unspecified, the current value is carried over.

If the Scheduler job is a currently executing recurring job, then the updated job configuration is used for the next occurrence.

The following values are not allowed in a PATCH request:

  1. "status" : (any value)

  2. "id" : (any value that doesn’t match the URI-specified job ID)

  3. "state" : "completed" or “faulted” (other state values are allowed)

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 format of the request body is as follows:


  { "state": "disabled"}



All elements of the request body are described thoroughly in the topic “Scheduler Entity Hierarchy, Concepts, and Terminology”. Here, we only change the “state” element and disable the job. To suspend a job, the state would be set to “disabled.” To resume a suspended job, another request could be sent, with “state” set to “enabled.”

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

A successful operation returns status code 202 (Accepted).

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 response is formatted as follows:

   
{
  "id": "job1",
  "startTime": "2013-01-30T20:08:00+00:00",
  "action": {
    "request": {
      "uri": "http:\/\/bing.com\/",
      "method": "GET",
      "headers": {
        "content-Type": "text\/plain"
      }
    },
    "type": "http"
  },
  "recurrence": {
    "frequency": "minute",
    "count": 10,
    "interval": 30
  },
  "state": "enabled"
}


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:


PATCH https://management.core.windows.net/mysub/cloudServices/mycs/resources/scheduler/~/jobCollections/myjc/jobs/job1?api-version=2014-04-01


The request is sent with the following headers:


x-ms-version: 2013-03-01
Host: management.core.windows.net
Content-Type: application/json

The request is sent with the following body:


{
  "state": "disabled"
}





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


   
HTTP/1.1 202 Accepted
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 329
Content-Type: application/json; charset=utf-8
Expires: -1
x-ms-request-id: 40c9f7b357ff46cabc4ff03d1cad4f84
Date: Fri, 30 Aug 2013 20:55:16 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": 30
  },
  "state": "disabled",
  "status": {
    "lastExecutionTime": "2013-08-30T20:55:02.4143712Z",
    "executionCount": 1,
     "failureCount": 0,
     "faultedCount": 0
  }
}






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