test_invoke_method
async
¶
test_invoke_method(
rest_api_id: String,
resource_id: String,
http_method: String,
*,
config_overrides: Optional[AsyncAPIGatewayClientConfig] = 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/async_api_gateway.py
6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 | |