CmdID

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

Opens CmdID with your command. It is read in your browser and sent nowhere.

Examples

from aws-cli, each command read by CmdID

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

3 in the AWS CLI reference
--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.