2016-05-01 79 views
3

我想移動一個水平之上,如一些資源:移動資源在AWS API網關

\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' 

回答

5

你可以在「重新設置父級」通過發佈replace修補程序操作的/parentId路徑與新的母公司的RESOURCEID資源:

aws apigateway update-resource \ 
    --rest-api-id xvxi2smff9 \ 
    --resource-id 2r0epq \ 
    --patch-operations op=replace,path=/parentId,value=eysorw 

[編輯以取代補丁的操作patchOperations - 評論滿足6個字符的最低編輯]

+0

謝謝,那工作。 – jamborta

+0

誰跟我一樣陷入這個獵物,它是'patch-operations',http://docs.aws.amazon.com/cli/latest/reference/apigateway/update-resource.html –