API Gateway¶
Utilities for working with AWS API Gateway.
get_rest_api ¶
get_rest_api(api_name, region=None)
Get a REST API by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
api_name
|
str
|
The name of the REST API to find. |
required |
region
|
Optional[str]
|
AWS region. Defaults to None (uses default region). |
None
|
Raises:
| Type | Description |
|---|---|
ResourceNotFoundError
|
If no REST API with the given name is found. |
Returns:
| Type | Description |
|---|---|
RestApiTypeDef
|
The REST API configuration. |
Source code in src/aibs_informatics_aws_utils/apigateway.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |
get_rest_api_endpoint ¶
get_rest_api_endpoint(rest_api, stage='prod', region=None)
Get the endpoint URL for a REST API.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rest_api
|
RestApiTypeDef
|
The REST API configuration from get_rest_api(). |
required |
stage
|
str
|
The API Gateway stage name. Defaults to "prod". |
'prod'
|
region
|
Optional[str]
|
AWS region. Defaults to None (uses default region). |
None
|
Returns:
| Type | Description |
|---|---|
str
|
The fully qualified endpoint URL for the REST API. |
Source code in src/aibs_informatics_aws_utils/apigateway.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |