Add Support for 201 return code. Deploy Template

This commit is contained in:
alanwe 2016-09-27 08:48:22 +01:00
Родитель 8812104d14
Коммит 05e7e37087
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -57,7 +57,7 @@ AzureDeployTemplate <- function(AzureActiveContext,DeplName,TemplateURL,ParamURL
r <- PUT(URL,add_headers(.headers = c("Host" = "management.azure.com" ,"Authorization" = AT, "Content-Type" = "application/json")),body=bodyI,verbosity) r <- PUT(URL,add_headers(.headers = c("Host" = "management.azure.com" ,"Authorization" = AT, "Content-Type" = "application/json")),body=bodyI,verbosity)
# print(paste(DeplName,"Submitted")) # print(paste(DeplName,"Submitted"))
if (status_code(r) != 200 && status_code(r) != 202 ) {stop(paste("Error: Return code",status_code(r) ))} if (status_code(r) != 200 && status_code(r) != 201 && status_code(r) != 202 ) {stop(paste("Error: Return code",status_code(r) ))}
rl <- content(r,"text",encoding="UTF-8") rl <- content(r,"text",encoding="UTF-8")
# print (rl) # print (rl)
df <- fromJSON(rl) df <- fromJSON(rl)