Update Job Collection

 

The Update Job Collection request updates an existing job collection. This request is also used to start or stop a job collection. Stopping a job collection has the side effect of disabling all child jobs. When a job collection that was stopped is restarted, all jobs that were previously enabled (before the job collection was stopped) are re-enabled.

Request

The Update Job Collection request is specified as follows. Replace <subscription-id> with your subscription ID, <cloud-service-id> with your cloud service ID, and <job-collection-id> with the ID of the job collection you’d like to update.

Method

Request URI

PUT

https://management.core.windows.net/<subscription-id>/cloudServices/<cloud-service-id>/resources/scheduler/jobCollections/<job-collection-id>

PATCH

Use for starting or stopping all jobs in a job collection: https://management.core.windows.net/<subscription-id>/cloudServices/<cloud-service-id>/resources/scheduler/jobCollections/<job-collection-id>/jobs

URI Parameters

None.

Request Headers

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.

Content-type

Required. The content type of the request body.

If-Match

Required. An ETag value. Specify this header to perform the operation only if the resource's ETag matches the value specified. If an Etag value is passed for this header for the update operation, Azure matches the value with the Etag for the resource

Request Body

The format of the request body is as follows. The InstrincSettings element is optional, but allows you to specify quotas and settings at the job collection level, as shown below. Plan may be Free or Standard. MaxJobCount and MaxRecurrence control the maximum job count in the collection and the maximum recurrence of the collection respectively.

<Resource xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/windowsazure">
<IntrinsicSettings>
    <Plan>Standard</Plan>
    <Quota>
        <MaxJobCount>10</MaxJobCount>
        <MaxRecurrence>
            <Frequency>Second</Frequency>
            <Interval>1</Interval>
        </MaxRecurrence>
    </Quota>
</IntrinsicSettings>
</Resource>

It is possible to use a similar operation to start or stop a job collection indirectly -- you do this by sending a PATCH request to all jobs in a job collection, to set them to disabled or enabled. To indirectly start a job collection, set the ‘state’ of every job in the job collection to enabled. To indirectly stop a job collection, set the ‘state’ to disabled. An example request with request headers and request body:

PATCH https://management.core.windows.net/<subscription-id>/cloudservices/mycs/resources/scheduler/~/jobcollections/myjc/jobs?api-version=2014-04-01

x-ms-version: 2013-06-01
Host: management.core.windows.net
Accept: application/json
Content-Type: application/json
Content-Length: 31

{
    "state": "disabled"
}

Response

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

Status Code

A successful operation returns status code 202 (Accepted).

Response Headers

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.

Response Body

None.

Authorization

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

Sample Request and Response

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

PUT https://management.core.windows.net/mysub /cloudServices/mycs/resources/scheduler/jobCollections/JC1 

The request is sent with the following headers:

x-ms-version: 2013-03-01
Accept: application/xml
Content-Type: application/xml; charset=utf-8
Host: management.core.windows.net
If-Match: e527f958-ae51-4ad0-9615-65c3b7a60e0f
Content-Length: 331

The request is sent with the following XML body:

<?xml version="1.0"?>
<Resource xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/windowsazure">
<IntrinsicSettings>
    <Quota>
        <MaxJobCount>10</MaxJobCount>
    </Quota>
</IntrinsicSettings>
<State>Started</State>
</Resource>

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

HTTP/1.1 202 Accepted
Cache-Control: no-cache
Content-Length: 0
ETag: 6d795b45-a87b-466a-a942-c21d35fd4069
x-ms-servedbyregion: ussouth
x-ms-request-id: 3cc88205c13d2eedb7bbb1e7c21b49a9
Date: Mon, 28 Oct 2013 23:21:09 GMT

See Also

What is Scheduler?
Get Started Using Scheduler in the Management Portal
Scheduler Concepts, Terminology, and Entity Hierarchy
How to Build Complex Schedules and Advanced Recurrence with Azure Scheduler
Scheduler PowerShell Cmdlets Reference
Scheduler High-Availability and Reliability
Scheduler Outbound Authentication
Scheduler Limits, Defaults, and Error Codes
Plans and Billing in Azure Scheduler
Azure Scheduler Pricing
Azure Scheduler Videos
Register Subscription
Get Resource Provider Properties
Create Cloud Service2
Get Cloud Service1
Get Cloud Services2
Delete Cloud Service2
Create Job1
Update Job1
Get Job1
Delete Job2
Check Name Availability1
Create Job Collection
Update Job Collection (Scheduler API)
Get Job Collection
Delete Job Collection
Get All Jobs
Get Job History1