当使用AWS Api-Gateway服务时,我想添加一个“父级”资源,而不需要删除和重建资源结构。具体来说,我想更改以下内容:
如果需要使用CLI,一个示例命令看起来会是什么样子?
更新:
感谢Ka Hou Ieong的出色回答。以下是实现它的一些说明:
resource/name
resource/name
同时添加一个“父”资源(v1),而无需删除和重新创建两个“resource/name”资源,像这样:
/v1
/resource/name
/resource/name
如果需要使用CLI,一个示例命令看起来会是什么样子?
更新:
感谢Ka Hou Ieong的出色回答。以下是实现它的一些说明:
rest-api-id : Put the api id here. You can look it up with this command: aws apigateway get-rest-apis
resource-id : Put the id of the resource you'd like to move here. You can look it up with this command: aws apigateway get-resources --rest-api-id API-ID-HERE
replace : Leave this; it's the operation.
/parentId : Leave this. It refers to the "key" of the value that you'll replace.
<new parent resourceId> : Replace this with the ID of the parent you'd like.