test_invoke_method
¶
test_invoke_method(
rest_api_id: String,
resource_id: String,
http_method: String,
*,
config_overrides: Optional[APIGatewayClientConfig] = None,
path_with_query_string: Optional[String] = None,
body: Optional[String] = None,
headers: Optional[MapOfStringToString] = None,
multi_value_headers: Optional[MapOfStringToList] = None,
client_certificate_id: Optional[String] = None,
stage_variables: Optional[MapOfStringToString] = None,
) -> TestInvokeMethodResponse
Simulate the invocation of a Method in your RestApi with headers, parameters, and an incoming request body.
Parameters:
-
rest_api_id(String) –The string identifier of the associated RestApi.
-
resource_id(String) –Specifies a test invoke method request's resource ID.
-
http_method(String) –Specifies a test invoke method request's HTTP method.
-
path_with_query_string(Optional[String], default:None) –The URI path, including query string, of the simulated invocation request. Use this to specify path parameters and query string parameters.
-
body(Optional[String], default:None) –The simulated request body of an incoming invocation request.
-
headers(Optional[MapOfStringToString], default:None) –A key-value map of headers to simulate an incoming invocation request.
-
multi_value_headers(Optional[MapOfStringToList], default:None) –The headers as a map from string to list of values to simulate an incoming invocation request.
-
client_certificate_id(Optional[String], default:None) –A ClientCertificate identifier to use in the test invocation. API Gateway will use the certificate when making the HTTPS request to the defined back-end endpoint.
-
stage_variables(Optional[MapOfStringToString], default:None) –A key-value map of stage variables to simulate an invocation on a deployed Stage.
Raises:
-
BadRequestException–The submitted request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details.
-
NotFoundException–The requested resource is not found. Make sure that the request URI is correct.
-
TooManyRequestsException–The request has reached its throttling limit. Retry after the specified time period.
-
UnauthorizedException–The request is denied because the caller has insufficient permissions.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_api_gateway/_services/api_gateway.py
6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 | |