【问题标题】:when calling the UpdateMethod operation getting invalid path error for /methodIntegration/uri调用 UpdateMethod 操作时出现 /methodIntegration/uri 的无效路径错误
【发布时间】: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


    【解决方案1】:

    apiKeyRequired 有效,因为它是methodvalid property。要更新integration,您应该使用update-integration,其中uri 是它的valid property

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-07-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多