【发布时间】:2014-10-20 19:34:57
【问题描述】:
使用 Azure 管理 REST API,我正在尝试使用重试策略更新 (PATCH) 现有调度程序作业。请求被接受,但 json 响应对象不包含重试策略条目。
在更新的情况下,我所做的其他更改会反映在响应中。
Azure Scheduler 作业实体结构:http://msdn.microsoft.com/library/azure/dn528941.aspx
Azure 调度程序 REST API 参考:http://msdn.microsoft.com/en-us/library/azure/dn528946.aspx
我一直在使用 Burp Suite 快速迭代不同的请求,但我从未看到任何表明已创建重试策略的信息。
我错过了什么?
以下请求将创建一个新的作业名称 SampleJob20(没有重试策略)
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"
}
这个请求的响应是:
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
}
}
当我尝试使用重试策略更新此作业时。响应缺少重试策略详细信息。
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
}
}
}
如果我使用重试策略创建新作业,则响应包含重试详细信息。但是,作业重试策略也无法更新。
【问题讨论】: