我想将一些资源移动上一级,例如:
\v1\test1 -> \test1
\v2\test2 -> \test2
文档 here说这是可能的。但是当我运行以下命令时:
aws apigateway update-resource \
--rest-api-id xvxi2smff9 \
--resource-id 2r0epq \
--cli-input-json "{\"patchOperations\" : [
{
\"op\" : \"move\",
\"path\" : \"eysorw\",
\"value\" : \"2r0epq\",
\"from\" : \"xvxi2smff9\"
}
]}"
我收到错误提示,这是一个无效的补丁操作。
A client error (BadRequestException) occurred when calling the UpdateResource operation: Invalid patch operation specified. Must be 'add'|'remove'|'replace'
最佳答案
您可以通过发出 replace
来“重新设置”资源的父级。对 /parentId
的补丁操作具有新父级资源 ID 的路径:
aws apigateway update-resource \
--rest-api-id xvxi2smff9 \
--resource-id 2r0epq \
--patch-operations op=replace,path=/parentId,value=eysorw
[编辑以用补丁操作替换补丁操作 - 评论以满足 6 个字符的最低编辑要求]
关于amazon-web-services - 在 AWS API 网关中移动资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36973234/