0

我使用boto3 import命令从我现有的api创建了一个api网关。如何使用Boto3修改API网关集成请求

apiClient = boto3.client('apigateway', awsregion) 
api_response=apiClient.import_rest_api 
(
    failOnWarnings=True, 
    body=open('apifileswagger.json', 'rb').read() 
) 

但我不能修改集成请求。我试着用以下Boto3命令。

apiClient = boto3.client('apigateway', awsregion) 
api_response=apiClient.put_integration 
(
    restApiId=apiName, 
    resourceId='/api/v1/hub', 
    httpMethod='GET', 
    integrationHttpMethod='GET', 
    type='AWS', 
    uri='arn:aws:lambda:us-east-1:141697213513:function:test-lambda', 
) 

但我得到的错误是这样

Unexpected error: An error occurred() when calling the PutIntegration operation: 

我需要使用Boto3命令更改拉姆达功能区&名。可能吗? 。

如果可能这个命令的实际问题是什么?

回答

0

与大多数API网关对API定义的更新一样,为了更新集成请求,您必须执行PATCH并使用预期格式传递一个包含补丁文档的正文。见documentation here