CmdID / aws / aws apigateway
aws apigateway update-resource
Changes information about a Resource resource. AWS CLI reference
2 examples 3 options Its page in the AWS CLI reference
Examples
Example 1: To move a resource and place it under a different parent resource in an API
The following update-resource example moves a resource and places it under a different parent resource in an API.
aws apigateway update-resource --rest-api-id 1234123412 --resource-id 1a2b3c --patch-operations op=replace,path=/parentId,value='3c2b1a'Identify--rest-api-idThe string identifier of the associated RestApi.--resource-idThe identifier of the Resource resource.--patch-operationsFor more information about supported patch operations, see Patch Operations.Its output
{
"path": "/resource",
"pathPart": "resource",
"id": "1a2b3c",
"parentId": "3c2b1a"
}Example 2: To rename a resource (pathPart) in an API
The following update-resource example renames a resource (pathPart) in an API.
aws apigateway update-resource --rest-api-id 1234123412 --resource-id 1a2b3c --patch-operations op=replace,path=/pathPart,value=newresourcenameIdentify--rest-api-idThe string identifier of the associated RestApi.--resource-idThe identifier of the Resource resource.--patch-operationsFor more information about supported patch operations, see Patch Operations.Its output
{
"path": "/newresourcename",
"pathPart": "newresourcename",
"id": "1a2b3c",
"parentId": "3c2b1a"
}For more information, see Develop REST APIs in API Gateway in the Amazon API Gateway Developer Guide.
Options
--patch-operationsFor more information about supported patch operations, see Patch Operations.--resource-idThe identifier of the Resource resource.--rest-api-idThe string identifier of the associated RestApi.