【发布时间】:2020-12-23 15:41:00
【问题描述】:
我正在更新 AWS API Gateway 中的 API。这是我的 lambda 函数:
response = client.update_method(
restApiId=rest_api_id,
resourceId=resource_id,
httpMethod= "GET", #method
patchOperations=[
{
'op': 'replace',
# 'path': '/apiKeyRequired',
# 'value': 'true',
'path': '/methodIntegration/uri',
'value': 'https://stackoverflow.com',
},
]
)
这可以正常工作并更新“需要 API 密钥”字段,但是当我尝试更新“URI”字段时,它会引发以下错误。
"errorMessage": "An error occurred (BadRequestException) when calling the UpdateMethod operation: Invalid patch path /methodIntegration/uri",
我觉得这条路很好。文档:https://docs.aws.amazon.com/cli/latest/reference/apigateway/update-method.html
【问题讨论】:
标签: python amazon-web-services aws-lambda aws-api-gateway