當使用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