I would like to move a few resources one level above such as:
\v1\test1 -> \test1
\v2\test2 -> \test2
The documentation here say that it is possible. But when I run the following command:
aws apigateway update-resource \
--rest-api-id xvxi2smff9 \
--resource-id 2r0epq \
--cli-input-json "{\"patchOperations\" : [
{
\"op\" : \"move\",
\"path\" : \"eysorw\",
\"value\" : \"2r0epq\",
\"from\" : \"xvxi2smff9\"
}
]}"
I get the error that it is an invalid patch operation.
A client error (BadRequestException) occurred when calling the UpdateResource operation: Invalid patch operation specified. Must be 'add'|'remove'|'replace'
A collection of HTTP resources and methods that are integrated with backend HTTP endpoints, Lambda functions, or other AWS services. You can deploy this collection in one or more stages. Typically, API resources are organized in a resource tree according to the application logic.
To set up a proxy integration in an API Gateway API with a proxy resource, you perform the following tasks: Create a proxy resource with a greedy path variable of { proxy +} . Set the ANY method on the proxy resource. Integrate the resource and method with a backend using the HTTP or Lambda integration type.
You can "reparent" a resource by issuing a replace
patch operation to the /parentId
path with the resourceId of the new parent:
aws apigateway update-resource \
--rest-api-id xvxi2smff9 \
--resource-id 2r0epq \
--patch-operations op=replace,path=/parentId,value=eysorw
[edited to replace patchOperations with patch-operations - comment to meet 6 character minimum edit]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With