当使用AWS Api-Gateway服务时,我想添加一个“父”资源而不删除和重建资源结构。具体来说,我想改变这种:如何在AWS API网关中创建父资源?
resource/name
resource/name
而且没有删除和改造两个“资源/名称”资源添加一个“父”资源给它(V1),像这样:
/v1
/resource/name
/resource/name
如果需要使用CLI,示例命令将是什么样子?
更新:
谢谢你的伟大答案卡厚怡。这里是实现它的一些注意事项:
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.
看起来它可以使用CLI是可能的: http://docs.aws.amazon.com/cli/latest/reference/apigateway/create-resource.html – user3303554
原来 - 使用基本参数 - “create-resource”创建一个新的子资源,但不会使新的父母资源CES。 – user3303554