amazon-web-services - 使用 aws cli 向 aws api 网关添加标签
问题描述
我正在尝试使用 aws cli 将标签添加到现有的 restApi。
试过
aws apigateway update-rest-api --rest-api-id ${rest_api_id} --patch-operations op=add,path=/tags/keytest,value='testvalue'
并得到
An error occurred (BadRequestException) when calling the UpdateRestApi operation: Invalid patch path /tags/keytest
提前致谢
解决方案
您需要使用tag-resource
方法而不是update-rest-api
aws apigateway tag-resource --resource-arn your-api-gateway-arn --tags tag-name=tag-value
api网关的arn格式可以在这里找到
编辑:这将更新阶段标签。
推荐阅读
- css - 在 div 中定位 inline-flex 元素
- python-3.x - OSError: libespeak.so.1: cannot open shared object file: No such file or directory notsolved after install espeak and libespeak1
- javascript - 如何在地图功能中只打印一次按钮仍然能够访问迭代值?
- laravel - 处理laravel中的malfromed数组错误
- python - 如何在 Python 中计算指数移动平均线
- javascript - 在 createElement 方法中插入脚本
- python - 字符计数函数为每个连续字符提供输出
- ruby-on-rails - Ruby on Rails 无法使用简单按钮更新用户“点数”
- python - Pymongo:以日期为字符串的聚合日期范围查询
- ffmpeg - 在 MP4 上覆盖透明 webm 有时会在开始时冻结