0
votes

Using the Azure Management REST API, I'm trying to update (PATCH) an existing Scheduler job with a retry policy. The request is accepted but the json response object doesn't include the retry policy entries.

In the case of an update, other changes I make are reflected in the response.

Azure Scheduler job entity structure: http://msdn.microsoft.com/library/azure/dn528941.aspx

Azure Scheduler REST API ref: http://msdn.microsoft.com/en-us/library/azure/dn528946.aspx

I've be using Burp Suite to quickly iterate through different requests, but I never see anything to suggest the retry policy has been created.

What am I missing?

The following request will create a new job name SampleJob20 (with no retry policy)

PUT /<subid>/cloudservices/<cloudservicename>/resources/scheduler/~/JobCollections/<jobcollectionname>/jobs/SampleJob20?api-version=2014-04-01 HTTP/1.1
Content-Type: application/json
x-ms-version: 2012-03-01
Host: management.core.windows.net
Content-Length: 583



{
    "startTime": "2013-01-30T12:08:00-08:00",
    "action":
    {
        "type": "http",
        "request":
        {
            "uri": "http://bing.com/",
            "method": "GET",
            "headers": 
            {
                "Content-Type": "text/plain"
            }
        }
    },
    "recurrence":
    {
        "frequency": "minute",
        "interval": 30,
        "count": 1000
    },
    "state": "enabled"
}

The response for this request is:

HTTP/1.1 201 Created
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 364
Content-Type: application/json; charset=utf-8
Expires: -1
Server: 1.0.6198.148 (rd_rdfe_stable.141019-1428) Microsoft-HTTPAPI/2.0
x-ms-servedbyregion: ussouth2
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
x-ms-request-id: xxxxxxxxxxxxxxxxx
Date: Mon, 20 Oct 2014 19:13:40 GMT

{
    "id":"SampleJob20",
    "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":1000,
        "interval":30
    },
    "state":"enabled",
    "status":
    {
        "nextExecutionTime":"2014-10-20T19:38:00Z",
        "executionCount":0,
        "failureCount":0,
        "faultedCount":0
    }
}

When I try and update this job with a retry policy. The response is missing the retry policy detail.

PATCH /<subid>/cloudservices/<cloudservicename>/resources/scheduler/~/JobCollections/<jobcollectionname>/jobs/SampleJob20?api-version=2014-04-01 HTTP/1.1
Content-Type: application/json
x-ms-version: 2012-03-01
Host: management.core.windows.net
Content-Length: 451



{
    "id": "SampleJob20",
    "action":
        {
            "type": "http",
            "request":
            {
                    "uri": "http://bing.com",
                    "method": "GET",
                    "headers": 
                    {
                        "Content-Type": "text/plain"
                    }
            },

            "retryPolicy": 
            {
                "retryType":"fixed",
                "retryInterval": "PT1M",
                "retryCount": 3
            }
        }
}

If I create a new job with a retry policy the response contains the retry detail. However, the jobs retry policy cannot be updated either.

1

1 Answers

0
votes

Can you try putting a new or the same job like this (It includes the retry policy in the Put request)

PUT

{
"startTime": "2013-01-30T12:08:00-08:00",
"action":
{
    "type": "http",
    "request":
    {
        "uri": "http://bing.com/",
        "method": "GET",
        "headers": 
        {
            "Content-Type": "text/plain"
        }
    },
       "retryPolicy": 
        {
            "retryType":"fixed",
            "retryInterval": "PT1M",
            "retryCount": 3
        }
},
"recurrence":
{
    "frequency": "minute",
    "interval": 30,
    "count": 1000
},
"state": "enabled"
}