Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

aws apigateway update-integration cli error

I am copying an exact example from aws to upload an integration request base mapping to my api via the cli and I am getting an error.

This is the command: aws apigateway update-integration --rest-api-id a1b2c3d4e5 --resource-id a1b2c3 --http-method POST --patch-operations op='replace',path='/requestTemplates/application~1json',value='{"example": "json"}'

and this is the error:

Error parsing parameter '--patch-operations': Expected: '=', received: '"' for input:
op=add,path=/requestTemplates/application~1json,value={"example": "json"}
                                                       ^

This is where I found the command: https://docs.aws.amazon.com/cli/latest/reference/apigateway/update-integration.html

What is going on?

like image 518
Ludo Avatar asked May 18 '18 18:05

Ludo


1 Answers

Found the solution, wrap the command in quotes:

aws apigateway update-integration --rest-api-id a1b2c3d4e5 --resource-id a1b2c3 --http-method POST --patch-operations "op='replace',path='/requestTemplates/application~1json',value='{"example": "json"}'"

AWS should update their example

like image 138
Ludo Avatar answered Oct 14 '22 05:10

Ludo