azure - 设置Azure调度程序作业重试策略

  显示原文与译文双语对照的内容

使用Azure管理 REST API,我尝试用重试策略更新一个存在的调度程序作业。 请求被接受,但是json响应对象不包含重试策略条目。

在更新时,我所做的其他更改反映在响应中。

Azure调度程序作业实体结构: http://msdn.microsoft.com/library/azure/dn528941.aspx

Azure计划程序 REST API 参考: http://msdn.microsoft.com/en-us/library/azure/dn528946.aspx

我已经使用,来快速迭代不同的请求,但是我从来没有看到任何建议重试策略。

我犯了什么错?

以下请求将创建新的作业 NAME 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
 }
 }
}

如果使用重试策略创建新作业,则响应包含重试详细信息。 但是,作业重试策略不能更新。

时间: 作者:

可以尝试在 Put ( Put请求中包含重试策略) putting新的或者相同的工作

放置


{
"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"
}

...