使用cli更新apigateway部署

时间:2016-04-28 14:40:05

标签: amazon-web-services aws-api-gateway

如何使用cli更新apigateway部署?我可以找到update-deployment命令,但我不知道在这个骨架中需要输入的值(取自documentation):

{
  "op": "add"|"remove"|"replace"|"move"|"copy"|"test",
  "path": "string",
  "value": "string",
  "from": "string"
}

1 个答案:

答案 0 :(得分:7)

update-deployment用于更新现有部署的元数据。例如,要更新部署的描述:

aws apigateway update-deployment \
               --rest-api-id <value> \
               --deployment-id <value> \ 
               --patch-operations 'op=replace,path=/description,value=<value>'

如果您想重新部署API(这是您在Web控制台中单击“部署API”时发生的情况),您将使用create-deployment命令:

aws apigateway create-deployment \
               --rest-api-id <value> \
               --stage-name <value>