Table of Contents
APIGateway.
Client
¶A low-level client representing Amazon API Gateway
Amazon API Gateway helps developers deliver robust, secure, and scalable mobile and web application back ends. API Gateway allows developers to securely connect mobile and web applications to APIs that run on AWS Lambda, Amazon EC2, or other publicly addressable web services that are hosted outside of AWS.
import boto3
client = boto3.client('apigateway')
These are the available methods:
can_paginate()
close()
create_api_key()
create_authorizer()
create_base_path_mapping()
create_deployment()
create_documentation_part()
create_documentation_version()
create_domain_name()
create_model()
create_request_validator()
create_resource()
create_rest_api()
create_stage()
create_usage_plan()
create_usage_plan_key()
create_vpc_link()
delete_api_key()
delete_authorizer()
delete_base_path_mapping()
delete_client_certificate()
delete_deployment()
delete_documentation_part()
delete_documentation_version()
delete_domain_name()
delete_gateway_response()
delete_integration()
delete_integration_response()
delete_method()
delete_method_response()
delete_model()
delete_request_validator()
delete_resource()
delete_rest_api()
delete_stage()
delete_usage_plan()
delete_usage_plan_key()
delete_vpc_link()
flush_stage_authorizers_cache()
flush_stage_cache()
generate_client_certificate()
get_account()
get_api_key()
get_api_keys()
get_authorizer()
get_authorizers()
get_base_path_mapping()
get_base_path_mappings()
get_client_certificate()
get_client_certificates()
get_deployment()
get_deployments()
get_documentation_part()
get_documentation_parts()
get_documentation_version()
get_documentation_versions()
get_domain_name()
get_domain_names()
get_export()
get_gateway_response()
get_gateway_responses()
get_integration()
get_integration_response()
get_method()
get_method_response()
get_model()
get_model_template()
get_models()
get_paginator()
get_request_validator()
get_request_validators()
get_resource()
get_resources()
get_rest_api()
get_rest_apis()
get_sdk()
get_sdk_type()
get_sdk_types()
get_stage()
get_stages()
get_tags()
get_usage()
get_usage_plan()
get_usage_plan_key()
get_usage_plan_keys()
get_usage_plans()
get_vpc_link()
get_vpc_links()
get_waiter()
import_api_keys()
import_documentation_parts()
import_rest_api()
put_gateway_response()
put_integration()
put_integration_response()
put_method()
put_method_response()
put_rest_api()
tag_resource()
test_invoke_authorizer()
test_invoke_method()
untag_resource()
update_account()
update_api_key()
update_authorizer()
update_base_path_mapping()
update_client_certificate()
update_deployment()
update_documentation_part()
update_documentation_version()
update_domain_name()
update_gateway_response()
update_integration()
update_integration_response()
update_method()
update_method_response()
update_model()
update_request_validator()
update_resource()
update_rest_api()
update_stage()
update_usage()
update_usage_plan()
update_vpc_link()
can_paginate
(operation_name)¶Check if an operation can be paginated.
create_foo
, and you'd normally invoke the
operation as client.create_foo(**kwargs)
, if the
create_foo
operation can be paginated, you can use the
call client.get_paginator("create_foo")
.True
if the operation can be paginated,
False
otherwise.close
()¶Closes underlying endpoint connections.
create_api_key
(**kwargs)¶Create an ApiKey resource.
See also: AWS API Documentation
Request Syntax
response = client.create_api_key(
name='string',
description='string',
enabled=True|False,
generateDistinctId=True|False,
value='string',
stageKeys=[
{
'restApiId': 'string',
'stageName': 'string'
},
],
customerId='string',
tags={
'string': 'string'
}
)
true
) or not ( false
) the key identifier is distinct from the created API key value. This parameter is deprecated and should not be used.DEPRECATED FOR USAGE PLANS - Specifies stages associated with the API key.
A reference to a unique stage identified in the format {restApiId}/{stage}
.
The string identifier of the associated RestApi.
The stage name associated with the stage key.
The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with aws:
. The tag value can be up to 256 characters.
dict
Response Syntax
{
'id': 'string',
'value': 'string',
'name': 'string',
'customerId': 'string',
'description': 'string',
'enabled': True|False,
'createdDate': datetime(2015, 1, 1),
'lastUpdatedDate': datetime(2015, 1, 1),
'stageKeys': [
'string',
],
'tags': {
'string': 'string'
}
}
Response Structure
(dict) --
A resource that can be distributed to callers for executing Method resources that require an API key. API keys can be mapped to any Stage on any RestApi, which indicates that the callers with the API key can make requests to that stage.
id (string) --
The identifier of the API Key.
value (string) --
The value of the API Key.
name (string) --
The name of the API Key.
customerId (string) --
An AWS Marketplace customer identifier , when integrating with the AWS SaaS Marketplace.
description (string) --
The description of the API Key.
enabled (boolean) --
Specifies whether the API Key can be used by callers.
createdDate (datetime) --
The timestamp when the API Key was created.
lastUpdatedDate (datetime) --
The timestamp when the API Key was last updated.
stageKeys (list) --
A list of Stage resources that are associated with the ApiKey resource.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
Adds a new Authorizer resource to an existing RestApi resource.
See also: AWS API Documentation
Request Syntax
response = client.create_authorizer(
restApiId='string',
name='string',
type='TOKEN'|'REQUEST'|'COGNITO_USER_POOLS',
providerARNs=[
'string',
],
authType='string',
authorizerUri='string',
authorizerCredentials='string',
identitySource='string',
identityValidationExpression='string',
authorizerResultTtlInSeconds=123
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The name of the authorizer.
[REQUIRED]
The authorizer type. Valid values are TOKEN
for a Lambda function using a single authorization token submitted in a custom header, REQUEST
for a Lambda function using incoming request parameters, and COGNITO_USER_POOLS
for using an Amazon Cognito user pool.
A list of the Amazon Cognito user pool ARNs for the COGNITO_USER_POOLS
authorizer. Each element is of this format: arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}
. For a TOKEN
or REQUEST
authorizer, this is not defined.
TOKEN
or REQUEST
authorizers, this must be a well-formed Lambda function URI, for example, arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations
. In general, the URI has this form arn:aws:apigateway:{region}:lambda:path/{service_api}
, where {region}
is the same as the region hosting the Lambda function, path
indicates that the remaining substring in the URI should be treated as the path to the resource, including the initial /
. For Lambda functions, this is usually of the form /2015-03-31/functions/[FunctionARN]/invocations
.TOKEN
or COGNITO_USER_POOLS
authorizer, this is required and specifies the request header mapping expression for the custom header holding the authorization token submitted by the client. For example, if the token header name is Auth
, the header mapping expression is method.request.header.Auth
. For the REQUEST
authorizer, this is required when authorization caching is enabled. The value is a comma-separated string of one or more mapping expressions of the specified request parameters. For example, if an Auth
header, a Name
query string parameter are defined as identity sources, this value is method.request.header.Auth, method.request.querystring.Name
. These parameters will be used to derive the authorization caching key and to perform runtime validation of the REQUEST
authorizer by verifying all of the identity-related request parameters are present, not null and non-empty. Only when this is true does the authorizer invoke the authorizer Lambda function, otherwise, it returns a 401 Unauthorized response without calling the Lambda function. The valid value is a string of comma-separated mapping expressions of the specified request parameters. When the authorization caching is not enabled, this property is optional.TOKEN
authorizers, this value is a regular expression. For COGNITO_USER_POOLS
authorizers, API Gateway will match the aud
field of the incoming token from the client against the specified regular expression. It will invoke the authorizer's Lambda function when there is a match. Otherwise, it will return a 401 Unauthorized response without calling the Lambda function. The validation expression does not apply to the REQUEST
authorizer.dict
Response Syntax
{
'id': 'string',
'name': 'string',
'type': 'TOKEN'|'REQUEST'|'COGNITO_USER_POOLS',
'providerARNs': [
'string',
],
'authType': 'string',
'authorizerUri': 'string',
'authorizerCredentials': 'string',
'identitySource': 'string',
'identityValidationExpression': 'string',
'authorizerResultTtlInSeconds': 123
}
Response Structure
(dict) --
Represents an authorization layer for methods. If enabled on a method, API Gateway will activate the authorizer when a client calls the method.
id (string) --
The identifier for the authorizer resource.
name (string) --
The name of the authorizer.
type (string) --
The authorizer type. Valid values are TOKEN
for a Lambda function using a single authorization token submitted in a custom header, REQUEST
for a Lambda function using incoming request parameters, and COGNITO_USER_POOLS
for using an Amazon Cognito user pool.
providerARNs (list) --
A list of the Amazon Cognito user pool ARNs for the COGNITO_USER_POOLS
authorizer. Each element is of this format: arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}
. For a TOKEN
or REQUEST
authorizer, this is not defined.
authType (string) --
Optional customer-defined field, used in OpenAPI imports and exports without functional impact.
authorizerUri (string) --
Specifies the authorizer's Uniform Resource Identifier (URI). For TOKEN
or REQUEST
authorizers, this must be a well-formed Lambda function URI, for example, arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations
. In general, the URI has this form arn:aws:apigateway:{region}:lambda:path/{service_api}
, where {region}
is the same as the region hosting the Lambda function, path
indicates that the remaining substring in the URI should be treated as the path to the resource, including the initial /
. For Lambda functions, this is usually of the form /2015-03-31/functions/[FunctionARN]/invocations
.
authorizerCredentials (string) --
Specifies the required credentials as an IAM role for API Gateway to invoke the authorizer. To specify an IAM role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, specify null.
identitySource (string) --
The identity source for which authorization is requested. For a TOKEN
or COGNITO_USER_POOLS
authorizer, this is required and specifies the request header mapping expression for the custom header holding the authorization token submitted by the client. For example, if the token header name is Auth
, the header mapping expression is method.request.header.Auth
. For the REQUEST
authorizer, this is required when authorization caching is enabled. The value is a comma-separated string of one or more mapping expressions of the specified request parameters. For example, if an Auth
header, a Name
query string parameter are defined as identity sources, this value is method.request.header.Auth
, method.request.querystring.Name
. These parameters will be used to derive the authorization caching key and to perform runtime validation of the REQUEST
authorizer by verifying all of the identity-related request parameters are present, not null and non-empty. Only when this is true does the authorizer invoke the authorizer Lambda function, otherwise, it returns a 401 Unauthorized response without calling the Lambda function. The valid value is a string of comma-separated mapping expressions of the specified request parameters. When the authorization caching is not enabled, this property is optional.
identityValidationExpression (string) --
A validation expression for the incoming identity token. For TOKEN
authorizers, this value is a regular expression. For COGNITO_USER_POOLS
authorizers, API Gateway will match the aud
field of the incoming token from the client against the specified regular expression. It will invoke the authorizer's Lambda function when there is a match. Otherwise, it will return a 401 Unauthorized response without calling the Lambda function. The validation expression does not apply to the REQUEST
authorizer.
authorizerResultTtlInSeconds (integer) --
The TTL in seconds of cached authorizer results. If it equals 0, authorization caching is disabled. If it is greater than 0, API Gateway will cache authorizer responses. If this field is not set, the default value is 300. The maximum value is 3600, or 1 hour.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
create_base_path_mapping
(**kwargs)¶Creates a new BasePathMapping resource.
See also: AWS API Documentation
Request Syntax
response = client.create_base_path_mapping(
domainName='string',
basePath='string',
restApiId='string',
stage='string'
)
[REQUIRED]
The domain name of the BasePathMapping resource to create.
[REQUIRED]
The string identifier of the associated RestApi.
dict
Response Syntax
{
'basePath': 'string',
'restApiId': 'string',
'stage': 'string'
}
Response Structure
(dict) --
Represents the base path that callers of the API must provide as part of the URL after the domain name.
basePath (string) --
The base path name that callers of the API must provide as part of the URL after the domain name.
restApiId (string) --
The string identifier of the associated RestApi.
stage (string) --
The name of the associated stage.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
create_deployment
(**kwargs)¶Creates a Deployment resource, which makes a specified RestApi callable over the internet.
See also: AWS API Documentation
Request Syntax
response = client.create_deployment(
restApiId='string',
stageName='string',
stageDescription='string',
description='string',
cacheClusterEnabled=True|False,
cacheClusterSize='0.5'|'1.6'|'6.1'|'13.5'|'28.4'|'58.2'|'118'|'237',
variables={
'string': 'string'
},
canarySettings={
'percentTraffic': 123.0,
'stageVariableOverrides': {
'string': 'string'
},
'useStageCache': True|False
},
tracingEnabled=True|False
)
[REQUIRED]
The string identifier of the associated RestApi.
A map that defines the stage variables for the Stage resource that is associated with the new deployment. Variable names can have alphanumeric and underscore characters, and the values must match [A-Za-z0-9-._~:/?#&=,]+
.
The input configuration for the canary deployment when the deployment is a canary release deployment.
The percentage (0.0-100.0) of traffic routed to the canary deployment.
A stage variable overrides used for the canary release deployment. They can override existing stage variables or add new stage variables for the canary release deployment. These stage variables are represented as a string-to-string map between stage variable names and their values.
A Boolean flag to indicate whether the canary release deployment uses the stage cache or not.
dict
Response Syntax
{
'id': 'string',
'description': 'string',
'createdDate': datetime(2015, 1, 1),
'apiSummary': {
'string': {
'string': {
'authorizationType': 'string',
'apiKeyRequired': True|False
}
}
}
}
Response Structure
(dict) --
An immutable representation of a RestApi resource that can be called by users using Stages. A deployment must be associated with a Stage for it to be callable over the Internet.
id (string) --
The identifier for the deployment resource.
description (string) --
The description for the deployment resource.
createdDate (datetime) --
The date and time that the deployment resource was created.
apiSummary (dict) --
A summary of the RestApi at the date and time that the deployment resource was created.
(string) --
(dict) --
(string) --
(dict) --
Represents a summary of a Method resource, given a particular date and time.
authorizationType (string) --
The method's authorization type. Valid values are NONE
for open access, AWS_IAM
for using AWS IAM permissions, CUSTOM
for using a custom authorizer, or COGNITO_USER_POOLS
for using a Cognito user pool.
apiKeyRequired (boolean) --
Specifies whether the method requires a valid ApiKey.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
APIGateway.Client.exceptions.ServiceUnavailableException
create_documentation_part
(**kwargs)¶Creates a documentation part.
See also: AWS API Documentation
Request Syntax
response = client.create_documentation_part(
restApiId='string',
location={
'type': 'API'|'AUTHORIZER'|'MODEL'|'RESOURCE'|'METHOD'|'PATH_PARAMETER'|'QUERY_PARAMETER'|'REQUEST_HEADER'|'REQUEST_BODY'|'RESPONSE'|'RESPONSE_HEADER'|'RESPONSE_BODY',
'path': 'string',
'method': 'string',
'statusCode': 'string',
'name': 'string'
},
properties='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The location of the targeted API entity of the to-be-created documentation part.
The type of API entity to which the documentation content applies. Valid values are API
, AUTHORIZER
, MODEL
, RESOURCE
, METHOD
, PATH_PARAMETER
, QUERY_PARAMETER
, REQUEST_HEADER
, REQUEST_BODY
, RESPONSE
, RESPONSE_HEADER
, and RESPONSE_BODY
. Content inheritance does not apply to any entity of the API
, AUTHORIZER
, METHOD
, MODEL
, REQUEST_BODY
, or RESOURCE
type.
The URL path of the target. It is a valid field for the API entity types of RESOURCE
, METHOD
, PATH_PARAMETER
, QUERY_PARAMETER
, REQUEST_HEADER
, REQUEST_BODY
, RESPONSE
, RESPONSE_HEADER
, and RESPONSE_BODY
. The default value is /
for the root resource. When an applicable child entity inherits the content of another entity of the same type with more general specifications of the other location
attributes, the child entity's path
attribute must match that of the parent entity as a prefix.
The HTTP verb of a method. It is a valid field for the API entity types of METHOD
, PATH_PARAMETER
, QUERY_PARAMETER
, REQUEST_HEADER
, REQUEST_BODY
, RESPONSE
, RESPONSE_HEADER
, and RESPONSE_BODY
. The default value is *
for any method. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the other location
attributes, the child entity's method
attribute must match that of the parent entity exactly.
The HTTP status code of a response. It is a valid field for the API entity types of RESPONSE
, RESPONSE_HEADER
, and RESPONSE_BODY
. The default value is *
for any status code. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the other location
attributes, the child entity's statusCode
attribute must match that of the parent entity exactly.
The name of the targeted API entity. It is a valid and required field for the API entity types of AUTHORIZER
, MODEL
, PATH_PARAMETER
, QUERY_PARAMETER
, REQUEST_HEADER
, REQUEST_BODY
and RESPONSE_HEADER
. It is an invalid field for any other entity type.
[REQUIRED]
The new documentation content map of the targeted API entity. Enclosed key-value pairs are API-specific, but only OpenAPI-compliant key-value pairs can be exported and, hence, published.
dict
Response Syntax
{
'id': 'string',
'location': {
'type': 'API'|'AUTHORIZER'|'MODEL'|'RESOURCE'|'METHOD'|'PATH_PARAMETER'|'QUERY_PARAMETER'|'REQUEST_HEADER'|'REQUEST_BODY'|'RESPONSE'|'RESPONSE_HEADER'|'RESPONSE_BODY',
'path': 'string',
'method': 'string',
'statusCode': 'string',
'name': 'string'
},
'properties': 'string'
}
Response Structure
(dict) --
A documentation part for a targeted API entity.
id (string) --
The DocumentationPart identifier, generated by API Gateway when the DocumentationPart
is created.
location (dict) --
The location of the API entity to which the documentation applies. Valid fields depend on the targeted API entity type. All the valid location fields are not required. If not explicitly specified, a valid location field is treated as a wildcard and associated documentation content may be inherited by matching entities, unless overridden.
type (string) --
The type of API entity to which the documentation content applies. Valid values are API
, AUTHORIZER
, MODEL
, RESOURCE
, METHOD
, PATH_PARAMETER
, QUERY_PARAMETER
, REQUEST_HEADER
, REQUEST_BODY
, RESPONSE
, RESPONSE_HEADER
, and RESPONSE_BODY
. Content inheritance does not apply to any entity of the API
, AUTHORIZER
, METHOD
, MODEL
, REQUEST_BODY
, or RESOURCE
type.
path (string) --
The URL path of the target. It is a valid field for the API entity types of RESOURCE
, METHOD
, PATH_PARAMETER
, QUERY_PARAMETER
, REQUEST_HEADER
, REQUEST_BODY
, RESPONSE
, RESPONSE_HEADER
, and RESPONSE_BODY
. The default value is /
for the root resource. When an applicable child entity inherits the content of another entity of the same type with more general specifications of the other location
attributes, the child entity's path
attribute must match that of the parent entity as a prefix.
method (string) --
The HTTP verb of a method. It is a valid field for the API entity types of METHOD
, PATH_PARAMETER
, QUERY_PARAMETER
, REQUEST_HEADER
, REQUEST_BODY
, RESPONSE
, RESPONSE_HEADER
, and RESPONSE_BODY
. The default value is *
for any method. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the other location
attributes, the child entity's method
attribute must match that of the parent entity exactly.
statusCode (string) --
The HTTP status code of a response. It is a valid field for the API entity types of RESPONSE
, RESPONSE_HEADER
, and RESPONSE_BODY
. The default value is *
for any status code. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the other location
attributes, the child entity's statusCode
attribute must match that of the parent entity exactly.
name (string) --
The name of the targeted API entity. It is a valid and required field for the API entity types of AUTHORIZER
, MODEL
, PATH_PARAMETER
, QUERY_PARAMETER
, REQUEST_HEADER
, REQUEST_BODY
and RESPONSE_HEADER
. It is an invalid field for any other entity type.
properties (string) --
A content map of API-specific key-value pairs describing the targeted API entity. The map must be encoded as a JSON string, e.g., "{ \"description\": \"The API does ...\" }"
. Only OpenAPI-compliant documentation-related fields from the properties map are exported and, hence, published as part of the API entity definitions, while the original documentation parts are exported in a OpenAPI extension of x-amazon-apigateway-documentation
.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
create_documentation_version
(**kwargs)¶Creates a documentation version
See also: AWS API Documentation
Request Syntax
response = client.create_documentation_version(
restApiId='string',
documentationVersion='string',
stageName='string',
description='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The version identifier of the new snapshot.
dict
Response Syntax
{
'version': 'string',
'createdDate': datetime(2015, 1, 1),
'description': 'string'
}
Response Structure
(dict) --
A snapshot of the documentation of an API.
version (string) --
The version identifier of the API documentation snapshot.
createdDate (datetime) --
The date when the API documentation snapshot is created.
description (string) --
The description of the API documentation snapshot.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
create_domain_name
(**kwargs)¶Creates a new domain name.
See also: AWS API Documentation
Request Syntax
response = client.create_domain_name(
domainName='string',
certificateName='string',
certificateBody='string',
certificatePrivateKey='string',
certificateChain='string',
certificateArn='string',
regionalCertificateName='string',
regionalCertificateArn='string',
endpointConfiguration={
'types': [
'REGIONAL'|'EDGE'|'PRIVATE',
],
'vpcEndpointIds': [
'string',
]
},
tags={
'string': 'string'
},
securityPolicy='TLS_1_0'|'TLS_1_2',
mutualTlsAuthentication={
'truststoreUri': 'string',
'truststoreVersion': 'string'
},
ownershipVerificationCertificateArn='string'
)
[REQUIRED]
The name of the DomainName resource.
The endpoint configuration of this DomainName showing the endpoint types of the domain name.
A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is "EDGE"
. For a regional API and its custom domain name, the endpoint type is REGIONAL
. For a private API, the endpoint type is PRIVATE
.
The endpoint type. The valid values are EDGE
for edge-optimized API setup, most suitable for mobile applications; REGIONAL
for regional API endpoint setup, most suitable for calling from AWS Region; and PRIVATE
for private APIs.
A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for PRIVATE
endpoint type.
The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with aws:
. The tag value can be up to 256 characters.
TLS_1_0
and TLS_1_2
.The mutual TLS authentication configuration for a custom domain name. If specified, API Gateway performs two-way authentication between the client and the server. Clients must present a trusted certificate to access your API.
An Amazon S3 URL that specifies the truststore for mutual TLS authentication, for example s3://bucket-name/key-name
. The truststore can contain certificates from public or private certificate authorities. To update the truststore, upload a new version to S3, and then update your custom domain name to use the new version. To update the truststore, you must have permissions to access the S3 object.
The version of the S3 object that contains your truststore. To specify a version, you must have versioning enabled for the S3 bucket
dict
Response Syntax
{
'domainName': 'string',
'certificateName': 'string',
'certificateArn': 'string',
'certificateUploadDate': datetime(2015, 1, 1),
'regionalDomainName': 'string',
'regionalHostedZoneId': 'string',
'regionalCertificateName': 'string',
'regionalCertificateArn': 'string',
'distributionDomainName': 'string',
'distributionHostedZoneId': 'string',
'endpointConfiguration': {
'types': [
'REGIONAL'|'EDGE'|'PRIVATE',
],
'vpcEndpointIds': [
'string',
]
},
'domainNameStatus': 'AVAILABLE'|'UPDATING'|'PENDING'|'PENDING_CERTIFICATE_REIMPORT'|'PENDING_OWNERSHIP_VERIFICATION',
'domainNameStatusMessage': 'string',
'securityPolicy': 'TLS_1_0'|'TLS_1_2',
'tags': {
'string': 'string'
},
'mutualTlsAuthentication': {
'truststoreUri': 'string',
'truststoreVersion': 'string',
'truststoreWarnings': [
'string',
]
},
'ownershipVerificationCertificateArn': 'string'
}
Response Structure
(dict) --
Represents a custom domain name as a user-friendly host name of an API (RestApi).
domainName (string) --
The custom domain name as an API host name, for example, my-api.example.com
.
certificateName (string) --
The name of the certificate that will be used by edge-optimized endpoint for this domain name.
certificateArn (string) --
The reference to an AWS-managed certificate that will be used by edge-optimized endpoint for this domain name. AWS Certificate Manager is the only supported source.
certificateUploadDate (datetime) --
The timestamp when the certificate that was used by edge-optimized endpoint for this domain name was uploaded.
regionalDomainName (string) --
The domain name associated with the regional endpoint for this custom domain name. You set up this association by adding a DNS record that points the custom domain name to this regional domain name. The regional domain name is returned by API Gateway when you create a regional endpoint.
regionalHostedZoneId (string) --
The region-specific Amazon Route 53 Hosted Zone ID of the regional endpoint. For more information, see Set up a Regional Custom Domain Name and AWS Regions and Endpoints for API Gateway.
regionalCertificateName (string) --
The name of the certificate that will be used for validating the regional domain name.
regionalCertificateArn (string) --
The reference to an AWS-managed certificate that will be used for validating the regional domain name. AWS Certificate Manager is the only supported source.
distributionDomainName (string) --
The domain name of the Amazon CloudFront distribution associated with this custom domain name for an edge-optimized endpoint. You set up this association when adding a DNS record pointing the custom domain name to this distribution name. For more information about CloudFront distributions, see the Amazon CloudFront documentation.
distributionHostedZoneId (string) --
The region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized endpoint. The valid value is Z2FDTNDATAQYW2
for all the regions. For more information, see Set up a Regional Custom Domain Name and AWS Regions and Endpoints for API Gateway.
endpointConfiguration (dict) --
The endpoint configuration of this DomainName showing the endpoint types of the domain name.
types (list) --
A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is "EDGE"
. For a regional API and its custom domain name, the endpoint type is REGIONAL
. For a private API, the endpoint type is PRIVATE
.
(string) --
The endpoint type. The valid values are EDGE
for edge-optimized API setup, most suitable for mobile applications; REGIONAL
for regional API endpoint setup, most suitable for calling from AWS Region; and PRIVATE
for private APIs.
vpcEndpointIds (list) --
A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for PRIVATE
endpoint type.
domainNameStatus (string) --
The status of the DomainName migration. The valid values are AVAILABLE
and UPDATING
. If the status is UPDATING
, the domain cannot be modified further until the existing operation is complete. If it is AVAILABLE
, the domain can be updated.
domainNameStatusMessage (string) --
An optional text message containing detailed information about status of the DomainName migration.
securityPolicy (string) --
The Transport Layer Security (TLS) version + cipher suite for this DomainName. The valid values are TLS_1_0
and TLS_1_2
.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
mutualTlsAuthentication (dict) --
The mutual TLS authentication configuration for a custom domain name. If specified, API Gateway performs two-way authentication between the client and the server. Clients must present a trusted certificate to access your API.
truststoreUri (string) --
An Amazon S3 URL that specifies the truststore for mutual TLS authentication, for example s3://bucket-name/key-name
. The truststore can contain certificates from public or private certificate authorities. To update the truststore, upload a new version to S3, and then update your custom domain name to use the new version. To update the truststore, you must have permissions to access the S3 object.
truststoreVersion (string) --
The version of the S3 object that contains your truststore. To specify a version, you must have versioning enabled for the S3 bucket.
truststoreWarnings (list) --
A list of warnings that API Gateway returns while processing your truststore. Invalid certificates produce warnings. Mutual TLS is still enabled, but some clients might not be able to access your API. To resolve warnings, upload a new truststore to S3, and then update you domain name to use the new version.
ownershipVerificationCertificateArn (string) --
The ARN of the public certificate issued by ACM to validate ownership of your custom domain. Only required when configuring mutual TLS and using an ACM imported or private CA certificate ARN as the regionalCertificateArn.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
create_model
(**kwargs)¶Adds a new Model resource to an existing RestApi resource.
See also: AWS API Documentation
Request Syntax
response = client.create_model(
restApiId='string',
name='string',
description='string',
schema='string',
contentType='string'
)
[REQUIRED]
The RestApi identifier under which the Model will be created.
[REQUIRED]
The name of the model. Must be alphanumeric.
application/json
models, this should be JSON schema draft 4 model.[REQUIRED]
The content-type for the model.
dict
Response Syntax
{
'id': 'string',
'name': 'string',
'description': 'string',
'schema': 'string',
'contentType': 'string'
}
Response Structure
(dict) --
Represents the data structure of a method's request or response payload.
id (string) --
The identifier for the model resource.
name (string) --
The name of the model. Must be an alphanumeric string.
description (string) --
The description of the model.
schema (string) --
The schema for the model. For application/json
models, this should be JSON schema draft 4 model. Do not include "*/" characters in the description of any properties because such "*/" characters may be interpreted as the closing marker for comments in some languages, such as Java or JavaScript, causing the installation of your API's SDK generated by API Gateway to fail.
contentType (string) --
The content-type for the model.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
create_request_validator
(**kwargs)¶Creates a RequestValidator of a given RestApi.
See also: AWS API Documentation
Request Syntax
response = client.create_request_validator(
restApiId='string',
name='string',
validateRequestBody=True|False,
validateRequestParameters=True|False
)
[REQUIRED]
The string identifier of the associated RestApi.
true
) or not ( false
).true
, or not false
.dict
Response Syntax
{
'id': 'string',
'name': 'string',
'validateRequestBody': True|False,
'validateRequestParameters': True|False
}
Response Structure
(dict) --
A set of validation rules for incoming Method requests.
id (string) --
The identifier of this RequestValidator.
name (string) --
The name of this RequestValidator
validateRequestBody (boolean) --
A Boolean flag to indicate whether to validate a request body according to the configured Model schema.
validateRequestParameters (boolean) --
A Boolean flag to indicate whether to validate request parameters ( true
) or not ( false
).
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
create_resource
(**kwargs)¶Creates a Resource resource.
See also: AWS API Documentation
Request Syntax
response = client.create_resource(
restApiId='string',
parentId='string',
pathPart='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The parent resource's identifier.
[REQUIRED]
The last path segment for this resource.
dict
Response Syntax
{
'id': 'string',
'parentId': 'string',
'pathPart': 'string',
'path': 'string',
'resourceMethods': {
'string': {
'httpMethod': 'string',
'authorizationType': 'string',
'authorizerId': 'string',
'apiKeyRequired': True|False,
'requestValidatorId': 'string',
'operationName': 'string',
'requestParameters': {
'string': True|False
},
'requestModels': {
'string': 'string'
},
'methodResponses': {
'string': {
'statusCode': 'string',
'responseParameters': {
'string': True|False
},
'responseModels': {
'string': 'string'
}
}
},
'methodIntegration': {
'type': 'HTTP'|'AWS'|'MOCK'|'HTTP_PROXY'|'AWS_PROXY',
'httpMethod': 'string',
'uri': 'string',
'connectionType': 'INTERNET'|'VPC_LINK',
'connectionId': 'string',
'credentials': 'string',
'requestParameters': {
'string': 'string'
},
'requestTemplates': {
'string': 'string'
},
'passthroughBehavior': 'string',
'contentHandling': 'CONVERT_TO_BINARY'|'CONVERT_TO_TEXT',
'timeoutInMillis': 123,
'cacheNamespace': 'string',
'cacheKeyParameters': [
'string',
],
'integrationResponses': {
'string': {
'statusCode': 'string',
'selectionPattern': 'string',
'responseParameters': {
'string': 'string'
},
'responseTemplates': {
'string': 'string'
},
'contentHandling': 'CONVERT_TO_BINARY'|'CONVERT_TO_TEXT'
}
},
'tlsConfig': {
'insecureSkipVerification': True|False
}
},
'authorizationScopes': [
'string',
]
}
}
}
Response Structure
(dict) --
Represents an API resource.
id (string) --
The resource's identifier.
parentId (string) --
The parent resource's identifier.
pathPart (string) --
The last path segment for this resource.
path (string) --
The full path for this resource.
resourceMethods (dict) --
Gets an API resource's method of a given HTTP verb.
(string) --
(dict) --
Represents a client-facing interface by which the client calls the API to access back-end resources. A Method resource is integrated with an Integration resource. Both consist of a request and one or more responses. The method request takes the client input that is passed to the back end through the integration request. A method response returns the output from the back end to the client through an integration response. A method request is embodied in a Method resource, whereas an integration request is embodied in an Integration resource. On the other hand, a method response is represented by a MethodResponse resource, whereas an integration response is represented by an IntegrationResponse resource.
httpMethod (string) --
The method's HTTP verb.
authorizationType (string) --
The method's authorization type. Valid values are NONE
for open access, AWS_IAM
for using AWS IAM permissions, CUSTOM
for using a custom authorizer, or COGNITO_USER_POOLS
for using a Cognito user pool.
authorizerId (string) --
The identifier of an Authorizer to use on this method. The authorizationType
must be CUSTOM
.
apiKeyRequired (boolean) --
A boolean flag specifying whether a valid ApiKey is required to invoke this method.
requestValidatorId (string) --
The identifier of a RequestValidator for request validation.
operationName (string) --
A human-friendly operation identifier for the method. For example, you can assign the operationName
of ListPets
for the GET /pets
method in the PetStore
example.
requestParameters (dict) --
A key-value map defining required or optional method request parameters that can be accepted by API Gateway. A key is a method request parameter name matching the pattern of method.request.{location}.{name}
, where location
is querystring
, path
, or header
and name
is a valid and unique parameter name. The value associated with the key is a Boolean flag indicating whether the parameter is required ( true
) or optional ( false
). The method request parameter names defined here are available in Integration to be mapped to integration request parameters or templates.
requestModels (dict) --
A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key).
methodResponses (dict) --
Gets a method response associated with a given HTTP status code.
(string) --
(dict) --
Represents a method response of a given HTTP status code returned to the client. The method response is passed from the back end through the associated integration response that can be transformed using a mapping template.
statusCode (string) --
The method response's status code.
responseParameters (dict) --
A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header and the value specifies whether the associated method response header is required or not. The expression of the key must match the pattern method.response.header.{name}
, where name
is a valid and unique header name. API Gateway passes certain integration response data to the method response headers specified here according to the mapping you prescribe in the API's IntegrationResponse. The integration response data that can be mapped include an integration response header expressed in integration.response.header.{name}
, a static value enclosed within a pair of single quotes (e.g., 'application/json'
), or a JSON expression from the back-end response payload in the form of integration.response.body.{JSON-expression}
, where JSON-expression
is a valid JSON expression without the $
prefix.)
responseModels (dict) --
Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.
methodIntegration (dict) --
Gets the method's integration responsible for passing the client-submitted request to the back end and performing necessary transformations to make the request compliant with the back end.
type (string) --
Specifies an API method integration type. The valid value is one of the following:
For the HTTP and HTTP proxy integrations, each integration can specify a protocol ( http/https
), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with a connectionType
of VPC_LINK
is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC.
httpMethod (string) --
Specifies the integration's HTTP method type.
uri (string) --
Specifies Uniform Resource Identifier (URI) of the integration endpoint.
For HTTP
or HTTP_PROXY
integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, where connectionType
is not VPC_LINK
, or private integration, where connectionType
is VPC_LINK
. For a private HTTP integration, the URI is not used for routing. For AWS
or AWS_PROXY
integrations, the URI is of the form arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}
. Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is the name of the integrated Amazon Web Services service (e.g., s3); and {subdomain} is a designated subdomain supported by certain Amazon Web Services service for fast host-name lookup. action can be used for an Amazon Web Services service action-based API, using an Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing {service_api} refers to a supported action {name} plus any required input parameters. Alternatively, path can be used for an AWS service path-based API. The ensuing service_api refers to the path to an Amazon Web Services service resource, including the region of the integrated Amazon Web Services service, if applicable. For example, for integration with the S3 API of GetObject, the uri can be either arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}
or arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}
connectionType (string) --
The type of the network connection to the integration endpoint. The valid value is INTERNET
for connections through the public routable internet or VPC_LINK
for private connections between API Gateway and a network load balancer in a VPC. The default value is INTERNET
.
connectionId (string) --
The ID of the VpcLink used for the integration when connectionType=VPC_LINK
and undefined, otherwise.
credentials (string) --
Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string arn:aws:iam::\*:user/\*
. To use resource-based permissions on supported AWS services, specify null.
requestParameters (dict) --
A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of method.request.{location}.{name}
, where location
is querystring
, path
, or header
and name
must be a valid and unique method request parameter name.
requestTemplates (dict) --
Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.
passthroughBehavior (string) --
Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in requestTemplates
. The valid value is one of the following: WHEN_NO_MATCH
: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. WHEN_NO_TEMPLATES
: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP 415 Unsupported Media Type response. NEVER
: rejects the method request with an HTTP 415 Unsupported Media Type response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.
contentHandling (string) --
Specifies how to handle request payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the passthroughBehavior
is configured to support payload pass-through.
timeoutInMillis (integer) --
Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
cacheNamespace (string) --
Specifies a group of related cached parameters. By default, API Gateway uses the resource ID as the cacheNamespace
. You can specify the same cacheNamespace
across resources to return the same cached data for requests to different resources.
cacheKeyParameters (list) --
A list of request parameters whose values API Gateway caches. To be valid values for cacheKeyParameters
, these parameters must also be specified for Method requestParameters
.
integrationResponses (dict) --
Specifies the integration's responses.
(string) --
(dict) --
Represents an integration response. The status code must map to an existing MethodResponse, and parameters and templates can be used to transform the back-end response.
statusCode (string) --
Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern (string) --
Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the .+
regex to match error response. However, make sure that the error response does not contain any newline ( \n
) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.
responseParameters (dict) --
A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of method.response.header.{name}
, where name
is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header.{name}
or integration.response.body.{JSON-expression}
, where name
is a valid and unique response header name and JSON-expression
is a valid JSON expression without the $
prefix.
responseTemplates (dict) --
Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
contentHandling (string) --
Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
tlsConfig (dict) --
Specifies the TLS configuration for an integration.
insecureSkipVerification (boolean) --
Specifies whether or not API Gateway skips verification that the certificate for an integration endpoint is issued by a supported certificate authority. This isn’t recommended, but it enables you to use certificates that are signed by private certificate authorities, or certificates that are self-signed. If enabled, API Gateway still performs basic certificate validation, which includes checking the certificate's expiration date, hostname, and presence of a root certificate authority. Supported only for HTTP
and HTTP_PROXY
integrations.
Warning
Enabling insecureSkipVerification
isn't recommended, especially for integrations with public HTTPS endpoints. If you enable insecureSkipVerification
, you increase the risk of man-in-the-middle attacks.
authorizationScopes (list) --
A list of authorization scopes configured on the method. The scopes are used with a COGNITO_USER_POOLS
authorizer to authorize the method invocation. The authorization works by matching the method scopes against the scopes parsed from the access token in the incoming request. The method invocation is authorized if any method scopes matches a claimed scope in the access token. Otherwise, the invocation is not authorized. When the method scope is configured, the client must provide an access token instead of an identity token for authorization purposes.
Exceptions
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.TooManyRequestsException
create_rest_api
(**kwargs)¶Creates a new RestApi resource.
See also: AWS API Documentation
Request Syntax
response = client.create_rest_api(
name='string',
description='string',
version='string',
cloneFrom='string',
binaryMediaTypes=[
'string',
],
minimumCompressionSize=123,
apiKeySource='HEADER'|'AUTHORIZER',
endpointConfiguration={
'types': [
'REGIONAL'|'EDGE'|'PRIVATE',
],
'vpcEndpointIds': [
'string',
]
},
policy='string',
tags={
'string': 'string'
},
disableExecuteApiEndpoint=True|False
)
[REQUIRED]
The name of the RestApi.
The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
HEADER
to read the API key from the X-API-Key
header of a request. AUTHORIZER
to read the API key from the UsageIdentifierKey
from a custom authorizer.The endpoint configuration of this RestApi showing the endpoint types of the API.
A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is "EDGE"
. For a regional API and its custom domain name, the endpoint type is REGIONAL
. For a private API, the endpoint type is PRIVATE
.
The endpoint type. The valid values are EDGE
for edge-optimized API setup, most suitable for mobile applications; REGIONAL
for regional API endpoint setup, most suitable for calling from AWS Region; and PRIVATE
for private APIs.
A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for PRIVATE
endpoint type.
The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with aws:
. The tag value can be up to 256 characters.
execute-api
endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com
endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpointdict
Response Syntax
{
'id': 'string',
'name': 'string',
'description': 'string',
'createdDate': datetime(2015, 1, 1),
'version': 'string',
'warnings': [
'string',
],
'binaryMediaTypes': [
'string',
],
'minimumCompressionSize': 123,
'apiKeySource': 'HEADER'|'AUTHORIZER',
'endpointConfiguration': {
'types': [
'REGIONAL'|'EDGE'|'PRIVATE',
],
'vpcEndpointIds': [
'string',
]
},
'policy': 'string',
'tags': {
'string': 'string'
},
'disableExecuteApiEndpoint': True|False
}
Response Structure
(dict) --
Represents a REST API.
id (string) --
The API's identifier. This identifier is unique across all of your APIs in API Gateway.
name (string) --
The API's name.
description (string) --
The API's description.
createdDate (datetime) --
The timestamp when the API was created.
version (string) --
A version identifier for the API.
warnings (list) --
The warning messages reported when failonwarnings
is turned on during API import.
binaryMediaTypes (list) --
The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
minimumCompressionSize (integer) --
A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
apiKeySource (string) --
The source of the API key for metering requests according to a usage plan. Valid values are: > HEADER
to read the API key from the X-API-Key
header of a request. AUTHORIZER
to read the API key from the UsageIdentifierKey
from a custom authorizer.
endpointConfiguration (dict) --
The endpoint configuration of this RestApi showing the endpoint types of the API.
types (list) --
A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is "EDGE"
. For a regional API and its custom domain name, the endpoint type is REGIONAL
. For a private API, the endpoint type is PRIVATE
.
(string) --
The endpoint type. The valid values are EDGE
for edge-optimized API setup, most suitable for mobile applications; REGIONAL
for regional API endpoint setup, most suitable for calling from AWS Region; and PRIVATE
for private APIs.
vpcEndpointIds (list) --
A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for PRIVATE
endpoint type.
policy (string) --
A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
disableExecuteApiEndpoint (boolean) --
Specifies whether clients can invoke your API by using the default execute-api
endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com
endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
create_stage
(**kwargs)¶Creates a new Stage resource that references a pre-existing Deployment for the API.
See also: AWS API Documentation
Request Syntax
response = client.create_stage(
restApiId='string',
stageName='string',
deploymentId='string',
description='string',
cacheClusterEnabled=True|False,
cacheClusterSize='0.5'|'1.6'|'6.1'|'13.5'|'28.4'|'58.2'|'118'|'237',
variables={
'string': 'string'
},
documentationVersion='string',
canarySettings={
'percentTraffic': 123.0,
'deploymentId': 'string',
'stageVariableOverrides': {
'string': 'string'
},
'useStageCache': True|False
},
tracingEnabled=True|False,
tags={
'string': 'string'
}
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The name for the Stage resource. Stage names can only contain alphanumeric characters, hyphens, and underscores. Maximum length is 128 characters.
[REQUIRED]
The identifier of the Deployment resource for the Stage resource.
A map that defines the stage variables for the new Stage resource. Variable names can have alphanumeric and underscore characters, and the values must match [A-Za-z0-9-._~:/?#&=,]+
.
The canary deployment settings of this stage.
The percent (0-100) of traffic diverted to a canary deployment.
The ID of the canary deployment.
Stage variables overridden for a canary release deployment, including new stage variables introduced in the canary. These stage variables are represented as a string-to-string map between stage variable names and their values.
A Boolean flag to indicate whether the canary deployment uses the stage cache or not.
The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with aws:
. The tag value can be up to 256 characters.
dict
Response Syntax
{
'deploymentId': 'string',
'clientCertificateId': 'string',
'stageName': 'string',
'description': 'string',
'cacheClusterEnabled': True|False,
'cacheClusterSize': '0.5'|'1.6'|'6.1'|'13.5'|'28.4'|'58.2'|'118'|'237',
'cacheClusterStatus': 'CREATE_IN_PROGRESS'|'AVAILABLE'|'DELETE_IN_PROGRESS'|'NOT_AVAILABLE'|'FLUSH_IN_PROGRESS',
'methodSettings': {
'string': {
'metricsEnabled': True|False,
'loggingLevel': 'string',
'dataTraceEnabled': True|False,
'throttlingBurstLimit': 123,
'throttlingRateLimit': 123.0,
'cachingEnabled': True|False,
'cacheTtlInSeconds': 123,
'cacheDataEncrypted': True|False,
'requireAuthorizationForCacheControl': True|False,
'unauthorizedCacheControlHeaderStrategy': 'FAIL_WITH_403'|'SUCCEED_WITH_RESPONSE_HEADER'|'SUCCEED_WITHOUT_RESPONSE_HEADER'
}
},
'variables': {
'string': 'string'
},
'documentationVersion': 'string',
'accessLogSettings': {
'format': 'string',
'destinationArn': 'string'
},
'canarySettings': {
'percentTraffic': 123.0,
'deploymentId': 'string',
'stageVariableOverrides': {
'string': 'string'
},
'useStageCache': True|False
},
'tracingEnabled': True|False,
'webAclArn': 'string',
'tags': {
'string': 'string'
},
'createdDate': datetime(2015, 1, 1),
'lastUpdatedDate': datetime(2015, 1, 1)
}
Response Structure
(dict) --
Represents a unique identifier for a version of a deployed RestApi that is callable by users.
deploymentId (string) --
The identifier of the Deployment that the stage points to.
clientCertificateId (string) --
The identifier of a client certificate for an API stage.
stageName (string) --
The name of the stage is the first path segment in the Uniform Resource Identifier (URI) of a call to API Gateway. Stage names can only contain alphanumeric characters, hyphens, and underscores. Maximum length is 128 characters.
description (string) --
The stage's description.
cacheClusterEnabled (boolean) --
Specifies whether a cache cluster is enabled for the stage.
cacheClusterSize (string) --
The size of the cache cluster for the stage, if enabled.
cacheClusterStatus (string) --
The status of the cache cluster for the stage, if enabled.
methodSettings (dict) --
A map that defines the method settings for a Stage resource. Keys (designated as /{method_setting_key
below) are method paths defined as {resource_path}/{http_method}
for an individual method override, or /\*/\*
for overriding all methods in the stage.
(string) --
(dict) --
Specifies the method setting properties.
metricsEnabled (boolean) --
Specifies whether Amazon CloudWatch metrics are enabled for this method. The PATCH path for this setting is /{method_setting_key}/metrics/enabled
, and the value is a Boolean.
loggingLevel (string) --
Specifies the logging level for this method, which affects the log entries pushed to Amazon CloudWatch Logs. The PATCH path for this setting is /{method_setting_key}/logging/loglevel
, and the available levels are OFF
, ERROR
, and INFO
. Choose ERROR
to write only error-level entries to CloudWatch Logs, or choose INFO
to include all ERROR
events as well as extra informational events.
dataTraceEnabled (boolean) --
Specifies whether data trace logging is enabled for this method, which affects the log entries pushed to Amazon CloudWatch Logs. The PATCH path for this setting is /{method_setting_key}/logging/dataTrace
, and the value is a Boolean.
throttlingBurstLimit (integer) --
Specifies the throttling burst limit. The PATCH path for this setting is /{method_setting_key}/throttling/burstLimit
, and the value is an integer.
throttlingRateLimit (float) --
Specifies the throttling rate limit. The PATCH path for this setting is /{method_setting_key}/throttling/rateLimit
, and the value is a double.
cachingEnabled (boolean) --
Specifies whether responses should be cached and returned for requests. A cache cluster must be enabled on the stage for responses to be cached. The PATCH path for this setting is /{method_setting_key}/caching/enabled
, and the value is a Boolean.
cacheTtlInSeconds (integer) --
Specifies the time to live (TTL), in seconds, for cached responses. The higher the TTL, the longer the response will be cached. The PATCH path for this setting is /{method_setting_key}/caching/ttlInSeconds
, and the value is an integer.
cacheDataEncrypted (boolean) --
Specifies whether the cached responses are encrypted. The PATCH path for this setting is /{method_setting_key}/caching/dataEncrypted
, and the value is a Boolean.
requireAuthorizationForCacheControl (boolean) --
Specifies whether authorization is required for a cache invalidation request. The PATCH path for this setting is /{method_setting_key}/caching/requireAuthorizationForCacheControl
, and the value is a Boolean.
unauthorizedCacheControlHeaderStrategy (string) --
Specifies how to handle unauthorized requests for cache invalidation. The PATCH path for this setting is /{method_setting_key}/caching/unauthorizedCacheControlHeaderStrategy
, and the available values are FAIL_WITH_403
, SUCCEED_WITH_RESPONSE_HEADER
, SUCCEED_WITHOUT_RESPONSE_HEADER
.
variables (dict) --
A map that defines the stage variables for a Stage resource. Variable names can have alphanumeric and underscore characters, and the values must match [A-Za-z0-9-._~:/?#&=,]+
.
documentationVersion (string) --
The version of the associated API documentation.
accessLogSettings (dict) --
Settings for logging access in this stage.
format (string) --
A single line format of the access logs of data, as specified by selected $context variables. The format must include at least $context.requestId
.
destinationArn (string) --
The Amazon Resource Name (ARN) of the CloudWatch Logs log group or Kinesis Data Firehose delivery stream to receive access logs. If you specify a Kinesis Data Firehose delivery stream, the stream name must begin with amazon-apigateway-
.
canarySettings (dict) --
Settings for the canary deployment in this stage.
percentTraffic (float) --
The percent (0-100) of traffic diverted to a canary deployment.
deploymentId (string) --
The ID of the canary deployment.
stageVariableOverrides (dict) --
Stage variables overridden for a canary release deployment, including new stage variables introduced in the canary. These stage variables are represented as a string-to-string map between stage variable names and their values.
useStageCache (boolean) --
A Boolean flag to indicate whether the canary deployment uses the stage cache or not.
tracingEnabled (boolean) --
Specifies whether active tracing with X-ray is enabled for the Stage.
webAclArn (string) --
The ARN of the WebAcl associated with the Stage.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
createdDate (datetime) --
The timestamp when the stage was created.
lastUpdatedDate (datetime) --
The timestamp when the stage last updated.
Exceptions
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.TooManyRequestsException
create_usage_plan
(**kwargs)¶Creates a usage plan with the throttle and quota limits, as well as the associated API stages, specified in the payload.
See also: AWS API Documentation
Request Syntax
response = client.create_usage_plan(
name='string',
description='string',
apiStages=[
{
'apiId': 'string',
'stage': 'string',
'throttle': {
'string': {
'burstLimit': 123,
'rateLimit': 123.0
}
}
},
],
throttle={
'burstLimit': 123,
'rateLimit': 123.0
},
quota={
'limit': 123,
'offset': 123,
'period': 'DAY'|'WEEK'|'MONTH'
},
tags={
'string': 'string'
}
)
[REQUIRED]
The name of the usage plan.
The associated API stages of the usage plan.
API stage name of the associated API stage in a usage plan.
API Id of the associated API stage in a usage plan.
API stage name of the associated API stage in a usage plan.
Map containing method level throttling information for API stage in a usage plan.
The API request rate limits.
The API target request burst rate limit. This allows more requests through for a period of time than the target rate limit.
The API target request rate limit.
The throttling limits of the usage plan.
The API target request burst rate limit. This allows more requests through for a period of time than the target rate limit.
The API target request rate limit.
The quota of the usage plan.
The target maximum number of requests that can be made in a given time period.
The number of requests subtracted from the given limit in the initial time period.
The time period in which the limit applies. Valid values are "DAY", "WEEK" or "MONTH".
The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with aws:
. The tag value can be up to 256 characters.
dict
Response Syntax
{
'id': 'string',
'name': 'string',
'description': 'string',
'apiStages': [
{
'apiId': 'string',
'stage': 'string',
'throttle': {
'string': {
'burstLimit': 123,
'rateLimit': 123.0
}
}
},
],
'throttle': {
'burstLimit': 123,
'rateLimit': 123.0
},
'quota': {
'limit': 123,
'offset': 123,
'period': 'DAY'|'WEEK'|'MONTH'
},
'productCode': 'string',
'tags': {
'string': 'string'
}
}
Response Structure
(dict) --
Represents a usage plan used to specify who can assess associated API stages. Optionally, target request rate and quota limits can be set. In some cases clients can exceed the targets that you set. Don’t rely on usage plans to control costs. Consider using Amazon Web Services Budgets to monitor costs and WAF to manage API requests.
id (string) --
The identifier of a UsagePlan resource.
name (string) --
The name of a usage plan.
description (string) --
The description of a usage plan.
apiStages (list) --
The associated API stages of a usage plan.
(dict) --
API stage name of the associated API stage in a usage plan.
apiId (string) --
API Id of the associated API stage in a usage plan.
stage (string) --
API stage name of the associated API stage in a usage plan.
throttle (dict) --
Map containing method level throttling information for API stage in a usage plan.
(string) --
(dict) --
The API request rate limits.
burstLimit (integer) --
The API target request burst rate limit. This allows more requests through for a period of time than the target rate limit.
rateLimit (float) --
The API target request rate limit.
throttle (dict) --
A map containing method level throttling information for API stage in a usage plan.
burstLimit (integer) --
The API target request burst rate limit. This allows more requests through for a period of time than the target rate limit.
rateLimit (float) --
The API target request rate limit.
quota (dict) --
The target maximum number of permitted requests per a given unit time interval.
limit (integer) --
The target maximum number of requests that can be made in a given time period.
offset (integer) --
The number of requests subtracted from the given limit in the initial time period.
period (string) --
The time period in which the limit applies. Valid values are "DAY", "WEEK" or "MONTH".
productCode (string) --
The AWS Markeplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
create_usage_plan_key
(**kwargs)¶Creates a usage plan key for adding an existing API key to a usage plan.
See also: AWS API Documentation
Request Syntax
response = client.create_usage_plan_key(
usagePlanId='string',
keyId='string',
keyType='string'
)
[REQUIRED]
The Id of the UsagePlan resource representing the usage plan containing the to-be-created UsagePlanKey resource representing a plan customer.
[REQUIRED]
The identifier of a UsagePlanKey resource for a plan customer.
[REQUIRED]
The type of a UsagePlanKey resource for a plan customer.
dict
Response Syntax
{
'id': 'string',
'type': 'string',
'value': 'string',
'name': 'string'
}
Response Structure
(dict) --
Represents a usage plan key to identify a plan customer.
id (string) --
The Id of a usage plan key.
type (string) --
The type of a usage plan key. Currently, the valid key type is API_KEY
.
value (string) --
The value of a usage plan key.
name (string) --
The name of a usage plan key.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
create_vpc_link
(**kwargs)¶Creates a VPC link, under the caller's account in a selected region, in an asynchronous operation that typically takes 2-4 minutes to complete and become operational. The caller must have permissions to create and update VPC Endpoint services.
See also: AWS API Documentation
Request Syntax
response = client.create_vpc_link(
name='string',
description='string',
targetArns=[
'string',
],
tags={
'string': 'string'
}
)
[REQUIRED]
The name used to label and identify the VPC link.
[REQUIRED]
The ARN of the network load balancer of the VPC targeted by the VPC link. The network load balancer must be owned by the same AWS account of the API owner.
The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with aws:
. The tag value can be up to 256 characters.
dict
Response Syntax
{
'id': 'string',
'name': 'string',
'description': 'string',
'targetArns': [
'string',
],
'status': 'AVAILABLE'|'PENDING'|'DELETING'|'FAILED',
'statusMessage': 'string',
'tags': {
'string': 'string'
}
}
Response Structure
(dict) --
An API Gateway VPC link for a RestApi to access resources in an Amazon Virtual Private Cloud (VPC).
id (string) --
The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.
name (string) --
The name used to label and identify the VPC link.
description (string) --
The description of the VPC link.
targetArns (list) --
The ARN of the network load balancer of the VPC targeted by the VPC link. The network load balancer must be owned by the same AWS account of the API owner.
status (string) --
The status of the VPC link. The valid values are AVAILABLE
, PENDING
, DELETING
, or FAILED
. Deploying an API will wait if the status is PENDING
and will fail if the status is DELETING
.
statusMessage (string) --
A description about the VPC link status.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
delete_api_key
(**kwargs)¶Deletes the ApiKey resource.
See also: AWS API Documentation
Request Syntax
response = client.delete_api_key(
apiKey='string'
)
[REQUIRED]
The identifier of the ApiKey resource to be deleted.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
Deletes an existing Authorizer resource.
See also: AWS API Documentation
Request Syntax
response = client.delete_authorizer(
restApiId='string',
authorizerId='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The identifier of the Authorizer resource.
None
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
delete_base_path_mapping
(**kwargs)¶Deletes the BasePathMapping resource.
See also: AWS API Documentation
Request Syntax
response = client.delete_base_path_mapping(
domainName='string',
basePath='string'
)
[REQUIRED]
The domain name of the BasePathMapping resource to delete.
[REQUIRED]
The base path name of the BasePathMapping resource to delete.
To specify an empty base path, set this parameter to '(none)'
.
None
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
delete_client_certificate
(**kwargs)¶Deletes the ClientCertificate resource.
See also: AWS API Documentation
Request Syntax
response = client.delete_client_certificate(
clientCertificateId='string'
)
[REQUIRED]
The identifier of the ClientCertificate resource to be deleted.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
delete_deployment
(**kwargs)¶Deletes a Deployment resource. Deleting a deployment will only succeed if there are no Stage resources associated with it.
See also: AWS API Documentation
Request Syntax
response = client.delete_deployment(
restApiId='string',
deploymentId='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The identifier of the Deployment resource to delete.
None
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
delete_documentation_part
(**kwargs)¶Deletes a documentation part
See also: AWS API Documentation
Request Syntax
response = client.delete_documentation_part(
restApiId='string',
documentationPartId='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The identifier of the to-be-deleted documentation part.
None
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
delete_documentation_version
(**kwargs)¶Deletes a documentation version.
See also: AWS API Documentation
Request Syntax
response = client.delete_documentation_version(
restApiId='string',
documentationVersion='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The version identifier of a to-be-deleted documentation snapshot.
None
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
delete_domain_name
(**kwargs)¶Deletes the DomainName resource.
See also: AWS API Documentation
Request Syntax
response = client.delete_domain_name(
domainName='string'
)
[REQUIRED]
The name of the DomainName resource to be deleted.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
delete_gateway_response
(**kwargs)¶Clears any customization of a GatewayResponse of a specified response type on the given RestApi and resets it with the default settings.
See also: AWS API Documentation
Request Syntax
response = client.delete_gateway_response(
restApiId='string',
responseType='DEFAULT_4XX'|'DEFAULT_5XX'|'RESOURCE_NOT_FOUND'|'UNAUTHORIZED'|'INVALID_API_KEY'|'ACCESS_DENIED'|'AUTHORIZER_FAILURE'|'AUTHORIZER_CONFIGURATION_ERROR'|'INVALID_SIGNATURE'|'EXPIRED_TOKEN'|'MISSING_AUTHENTICATION_TOKEN'|'INTEGRATION_FAILURE'|'INTEGRATION_TIMEOUT'|'API_CONFIGURATION_ERROR'|'UNSUPPORTED_MEDIA_TYPE'|'BAD_REQUEST_PARAMETERS'|'BAD_REQUEST_BODY'|'REQUEST_TOO_LARGE'|'THROTTLED'|'QUOTA_EXCEEDED'|'WAF_FILTERED'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The response type of the associated GatewayResponse.
None
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
delete_integration
(**kwargs)¶Represents a delete integration.
See also: AWS API Documentation
Request Syntax
response = client.delete_integration(
restApiId='string',
resourceId='string',
httpMethod='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
Specifies a delete integration request's resource identifier.
[REQUIRED]
Specifies a delete integration request's HTTP method.
None
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
delete_integration_response
(**kwargs)¶Represents a delete integration response.
See also: AWS API Documentation
Request Syntax
response = client.delete_integration_response(
restApiId='string',
resourceId='string',
httpMethod='string',
statusCode='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
Specifies a delete integration response request's resource identifier.
[REQUIRED]
Specifies a delete integration response request's HTTP method.
[REQUIRED]
Specifies a delete integration response request's status code.
None
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
delete_method
(**kwargs)¶Deletes an existing Method resource.
See also: AWS API Documentation
Request Syntax
response = client.delete_method(
restApiId='string',
resourceId='string',
httpMethod='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The Resource identifier for the Method resource.
[REQUIRED]
The HTTP verb of the Method resource.
None
Exceptions
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.TooManyRequestsException
APIGateway.Client.exceptions.ConflictException
delete_method_response
(**kwargs)¶Deletes an existing MethodResponse resource.
See also: AWS API Documentation
Request Syntax
response = client.delete_method_response(
restApiId='string',
resourceId='string',
httpMethod='string',
statusCode='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The Resource identifier for the MethodResponse resource.
[REQUIRED]
The HTTP verb of the Method resource.
[REQUIRED]
The status code identifier for the MethodResponse resource.
None
Exceptions
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.TooManyRequestsException
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
delete_model
(**kwargs)¶Deletes a model.
See also: AWS API Documentation
Request Syntax
response = client.delete_model(
restApiId='string',
modelName='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The name of the model to delete.
None
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
delete_request_validator
(**kwargs)¶Deletes a RequestValidator of a given RestApi.
See also: AWS API Documentation
Request Syntax
response = client.delete_request_validator(
restApiId='string',
requestValidatorId='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The identifier of the RequestValidator to be deleted.
None
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
delete_resource
(**kwargs)¶Deletes a Resource resource.
See also: AWS API Documentation
Request Syntax
response = client.delete_resource(
restApiId='string',
resourceId='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The identifier of the Resource resource.
None
Exceptions
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.TooManyRequestsException
delete_rest_api
(**kwargs)¶Deletes the specified API.
See also: AWS API Documentation
Request Syntax
response = client.delete_rest_api(
restApiId='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
delete_stage
(**kwargs)¶Deletes a Stage resource.
See also: AWS API Documentation
Request Syntax
response = client.delete_stage(
restApiId='string',
stageName='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The name of the Stage resource to delete.
None
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
delete_usage_plan
(**kwargs)¶Deletes a usage plan of a given plan Id.
See also: AWS API Documentation
Request Syntax
response = client.delete_usage_plan(
usagePlanId='string'
)
[REQUIRED]
The Id of the to-be-deleted usage plan.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
delete_usage_plan_key
(**kwargs)¶Deletes a usage plan key and remove the underlying API key from the associated usage plan.
See also: AWS API Documentation
Request Syntax
response = client.delete_usage_plan_key(
usagePlanId='string',
keyId='string'
)
[REQUIRED]
The Id of the UsagePlan resource representing the usage plan containing the to-be-deleted UsagePlanKey resource representing a plan customer.
[REQUIRED]
The Id of the UsagePlanKey resource to be deleted.
None
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
delete_vpc_link
(**kwargs)¶Deletes an existing VpcLink of a specified identifier.
See also: AWS API Documentation
Request Syntax
response = client.delete_vpc_link(
vpcLinkId='string'
)
[REQUIRED]
The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
Flushes all authorizer cache entries on a stage.
See also: AWS API Documentation
Request Syntax
response = client.flush_stage_authorizers_cache(
restApiId='string',
stageName='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The name of the stage to flush.
None
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
flush_stage_cache
(**kwargs)¶Flushes a stage's cache.
See also: AWS API Documentation
Request Syntax
response = client.flush_stage_cache(
restApiId='string',
stageName='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The name of the stage to flush its cache.
None
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
generate_client_certificate
(**kwargs)¶Generates a ClientCertificate resource.
See also: AWS API Documentation
Request Syntax
response = client.generate_client_certificate(
description='string',
tags={
'string': 'string'
}
)
The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with aws:
. The tag value can be up to 256 characters.
dict
Response Syntax
{
'clientCertificateId': 'string',
'description': 'string',
'pemEncodedCertificate': 'string',
'createdDate': datetime(2015, 1, 1),
'expirationDate': datetime(2015, 1, 1),
'tags': {
'string': 'string'
}
}
Response Structure
(dict) --
Represents a client certificate used to configure client-side SSL authentication while sending requests to the integration endpoint.
clientCertificateId (string) --
The identifier of the client certificate.
description (string) --
The description of the client certificate.
pemEncodedCertificate (string) --
The PEM-encoded public key of the client certificate, which can be used to configure certificate authentication in the integration endpoint .
createdDate (datetime) --
The timestamp when the client certificate was created.
expirationDate (datetime) --
The timestamp when the client certificate will expire.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_account
()¶Gets information about the current Account resource.
See also: AWS API Documentation
Request Syntax
response = client.get_account()
{
'cloudwatchRoleArn': 'string',
'throttleSettings': {
'burstLimit': 123,
'rateLimit': 123.0
},
'features': [
'string',
],
'apiKeyVersion': 'string'
}
Response Structure
Represents an AWS account that is associated with API Gateway.
The ARN of an Amazon CloudWatch role for the current Account.
Specifies the API request limits configured for the current Account.
The API target request burst rate limit. This allows more requests through for a period of time than the target rate limit.
The API target request rate limit.
A list of features supported for the account. When usage plans are enabled, the features list will include an entry of "UsagePlans"
.
The version of the API keys used for the account.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_api_key
(**kwargs)¶Gets information about the current ApiKey resource.
See also: AWS API Documentation
Request Syntax
response = client.get_api_key(
apiKey='string',
includeValue=True|False
)
[REQUIRED]
The identifier of the ApiKey resource.
true
) or not ( false
) the result contains the key value.dict
Response Syntax
{
'id': 'string',
'value': 'string',
'name': 'string',
'customerId': 'string',
'description': 'string',
'enabled': True|False,
'createdDate': datetime(2015, 1, 1),
'lastUpdatedDate': datetime(2015, 1, 1),
'stageKeys': [
'string',
],
'tags': {
'string': 'string'
}
}
Response Structure
(dict) --
A resource that can be distributed to callers for executing Method resources that require an API key. API keys can be mapped to any Stage on any RestApi, which indicates that the callers with the API key can make requests to that stage.
id (string) --
The identifier of the API Key.
value (string) --
The value of the API Key.
name (string) --
The name of the API Key.
customerId (string) --
An AWS Marketplace customer identifier , when integrating with the AWS SaaS Marketplace.
description (string) --
The description of the API Key.
enabled (boolean) --
Specifies whether the API Key can be used by callers.
createdDate (datetime) --
The timestamp when the API Key was created.
lastUpdatedDate (datetime) --
The timestamp when the API Key was last updated.
stageKeys (list) --
A list of Stage resources that are associated with the ApiKey resource.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_api_keys
(**kwargs)¶Gets information about the current ApiKeys resource.
See also: AWS API Documentation
Request Syntax
response = client.get_api_keys(
position='string',
limit=123,
nameQuery='string',
customerId='string',
includeValues=True|False
)
true
) or not ( false
) the result contains key values.dict
Response Syntax
{
'warnings': [
'string',
],
'position': 'string',
'items': [
{
'id': 'string',
'value': 'string',
'name': 'string',
'customerId': 'string',
'description': 'string',
'enabled': True|False,
'createdDate': datetime(2015, 1, 1),
'lastUpdatedDate': datetime(2015, 1, 1),
'stageKeys': [
'string',
],
'tags': {
'string': 'string'
}
},
]
}
Response Structure
(dict) --
Represents a collection of API keys as represented by an ApiKeys resource.
warnings (list) --
A list of warning messages logged during the import of API keys when the failOnWarnings
option is set to true.
position (string) --
items (list) --
The current page of elements from this collection.
(dict) --
A resource that can be distributed to callers for executing Method resources that require an API key. API keys can be mapped to any Stage on any RestApi, which indicates that the callers with the API key can make requests to that stage.
id (string) --
The identifier of the API Key.
value (string) --
The value of the API Key.
name (string) --
The name of the API Key.
customerId (string) --
An AWS Marketplace customer identifier , when integrating with the AWS SaaS Marketplace.
description (string) --
The description of the API Key.
enabled (boolean) --
Specifies whether the API Key can be used by callers.
createdDate (datetime) --
The timestamp when the API Key was created.
lastUpdatedDate (datetime) --
The timestamp when the API Key was last updated.
stageKeys (list) --
A list of Stage resources that are associated with the ApiKey resource.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
Describe an existing Authorizer resource.
See also: AWS API Documentation
Request Syntax
response = client.get_authorizer(
restApiId='string',
authorizerId='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The identifier of the Authorizer resource.
dict
Response Syntax
{
'id': 'string',
'name': 'string',
'type': 'TOKEN'|'REQUEST'|'COGNITO_USER_POOLS',
'providerARNs': [
'string',
],
'authType': 'string',
'authorizerUri': 'string',
'authorizerCredentials': 'string',
'identitySource': 'string',
'identityValidationExpression': 'string',
'authorizerResultTtlInSeconds': 123
}
Response Structure
(dict) --
Represents an authorization layer for methods. If enabled on a method, API Gateway will activate the authorizer when a client calls the method.
id (string) --
The identifier for the authorizer resource.
name (string) --
The name of the authorizer.
type (string) --
The authorizer type. Valid values are TOKEN
for a Lambda function using a single authorization token submitted in a custom header, REQUEST
for a Lambda function using incoming request parameters, and COGNITO_USER_POOLS
for using an Amazon Cognito user pool.
providerARNs (list) --
A list of the Amazon Cognito user pool ARNs for the COGNITO_USER_POOLS
authorizer. Each element is of this format: arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}
. For a TOKEN
or REQUEST
authorizer, this is not defined.
authType (string) --
Optional customer-defined field, used in OpenAPI imports and exports without functional impact.
authorizerUri (string) --
Specifies the authorizer's Uniform Resource Identifier (URI). For TOKEN
or REQUEST
authorizers, this must be a well-formed Lambda function URI, for example, arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations
. In general, the URI has this form arn:aws:apigateway:{region}:lambda:path/{service_api}
, where {region}
is the same as the region hosting the Lambda function, path
indicates that the remaining substring in the URI should be treated as the path to the resource, including the initial /
. For Lambda functions, this is usually of the form /2015-03-31/functions/[FunctionARN]/invocations
.
authorizerCredentials (string) --
Specifies the required credentials as an IAM role for API Gateway to invoke the authorizer. To specify an IAM role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, specify null.
identitySource (string) --
The identity source for which authorization is requested. For a TOKEN
or COGNITO_USER_POOLS
authorizer, this is required and specifies the request header mapping expression for the custom header holding the authorization token submitted by the client. For example, if the token header name is Auth
, the header mapping expression is method.request.header.Auth
. For the REQUEST
authorizer, this is required when authorization caching is enabled. The value is a comma-separated string of one or more mapping expressions of the specified request parameters. For example, if an Auth
header, a Name
query string parameter are defined as identity sources, this value is method.request.header.Auth
, method.request.querystring.Name
. These parameters will be used to derive the authorization caching key and to perform runtime validation of the REQUEST
authorizer by verifying all of the identity-related request parameters are present, not null and non-empty. Only when this is true does the authorizer invoke the authorizer Lambda function, otherwise, it returns a 401 Unauthorized response without calling the Lambda function. The valid value is a string of comma-separated mapping expressions of the specified request parameters. When the authorization caching is not enabled, this property is optional.
identityValidationExpression (string) --
A validation expression for the incoming identity token. For TOKEN
authorizers, this value is a regular expression. For COGNITO_USER_POOLS
authorizers, API Gateway will match the aud
field of the incoming token from the client against the specified regular expression. It will invoke the authorizer's Lambda function when there is a match. Otherwise, it will return a 401 Unauthorized response without calling the Lambda function. The validation expression does not apply to the REQUEST
authorizer.
authorizerResultTtlInSeconds (integer) --
The TTL in seconds of cached authorizer results. If it equals 0, authorization caching is disabled. If it is greater than 0, API Gateway will cache authorizer responses. If this field is not set, the default value is 300. The maximum value is 3600, or 1 hour.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
Describe an existing Authorizers resource.
See also: AWS API Documentation
Request Syntax
response = client.get_authorizers(
restApiId='string',
position='string',
limit=123
)
[REQUIRED]
The string identifier of the associated RestApi.
dict
Response Syntax
{
'position': 'string',
'items': [
{
'id': 'string',
'name': 'string',
'type': 'TOKEN'|'REQUEST'|'COGNITO_USER_POOLS',
'providerARNs': [
'string',
],
'authType': 'string',
'authorizerUri': 'string',
'authorizerCredentials': 'string',
'identitySource': 'string',
'identityValidationExpression': 'string',
'authorizerResultTtlInSeconds': 123
},
]
}
Response Structure
(dict) --
Represents a collection of Authorizer resources.
position (string) --
items (list) --
The current page of elements from this collection.
(dict) --
Represents an authorization layer for methods. If enabled on a method, API Gateway will activate the authorizer when a client calls the method.
id (string) --
The identifier for the authorizer resource.
name (string) --
The name of the authorizer.
type (string) --
The authorizer type. Valid values are TOKEN
for a Lambda function using a single authorization token submitted in a custom header, REQUEST
for a Lambda function using incoming request parameters, and COGNITO_USER_POOLS
for using an Amazon Cognito user pool.
providerARNs (list) --
A list of the Amazon Cognito user pool ARNs for the COGNITO_USER_POOLS
authorizer. Each element is of this format: arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}
. For a TOKEN
or REQUEST
authorizer, this is not defined.
authType (string) --
Optional customer-defined field, used in OpenAPI imports and exports without functional impact.
authorizerUri (string) --
Specifies the authorizer's Uniform Resource Identifier (URI). For TOKEN
or REQUEST
authorizers, this must be a well-formed Lambda function URI, for example, arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations
. In general, the URI has this form arn:aws:apigateway:{region}:lambda:path/{service_api}
, where {region}
is the same as the region hosting the Lambda function, path
indicates that the remaining substring in the URI should be treated as the path to the resource, including the initial /
. For Lambda functions, this is usually of the form /2015-03-31/functions/[FunctionARN]/invocations
.
authorizerCredentials (string) --
Specifies the required credentials as an IAM role for API Gateway to invoke the authorizer. To specify an IAM role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, specify null.
identitySource (string) --
The identity source for which authorization is requested. For a TOKEN
or COGNITO_USER_POOLS
authorizer, this is required and specifies the request header mapping expression for the custom header holding the authorization token submitted by the client. For example, if the token header name is Auth
, the header mapping expression is method.request.header.Auth
. For the REQUEST
authorizer, this is required when authorization caching is enabled. The value is a comma-separated string of one or more mapping expressions of the specified request parameters. For example, if an Auth
header, a Name
query string parameter are defined as identity sources, this value is method.request.header.Auth
, method.request.querystring.Name
. These parameters will be used to derive the authorization caching key and to perform runtime validation of the REQUEST
authorizer by verifying all of the identity-related request parameters are present, not null and non-empty. Only when this is true does the authorizer invoke the authorizer Lambda function, otherwise, it returns a 401 Unauthorized response without calling the Lambda function. The valid value is a string of comma-separated mapping expressions of the specified request parameters. When the authorization caching is not enabled, this property is optional.
identityValidationExpression (string) --
A validation expression for the incoming identity token. For TOKEN
authorizers, this value is a regular expression. For COGNITO_USER_POOLS
authorizers, API Gateway will match the aud
field of the incoming token from the client against the specified regular expression. It will invoke the authorizer's Lambda function when there is a match. Otherwise, it will return a 401 Unauthorized response without calling the Lambda function. The validation expression does not apply to the REQUEST
authorizer.
authorizerResultTtlInSeconds (integer) --
The TTL in seconds of cached authorizer results. If it equals 0, authorization caching is disabled. If it is greater than 0, API Gateway will cache authorizer responses. If this field is not set, the default value is 300. The maximum value is 3600, or 1 hour.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_base_path_mapping
(**kwargs)¶Describe a BasePathMapping resource.
See also: AWS API Documentation
Request Syntax
response = client.get_base_path_mapping(
domainName='string',
basePath='string'
)
[REQUIRED]
The domain name of the BasePathMapping resource to be described.
[REQUIRED]
The base path name that callers of the API must provide as part of the URL after the domain name. This value must be unique for all of the mappings across a single API. Specify '(none)' if you do not want callers to specify any base path name after the domain name.
dict
Response Syntax
{
'basePath': 'string',
'restApiId': 'string',
'stage': 'string'
}
Response Structure
(dict) --
Represents the base path that callers of the API must provide as part of the URL after the domain name.
basePath (string) --
The base path name that callers of the API must provide as part of the URL after the domain name.
restApiId (string) --
The string identifier of the associated RestApi.
stage (string) --
The name of the associated stage.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_base_path_mappings
(**kwargs)¶Represents a collection of BasePathMapping resources.
See also: AWS API Documentation
Request Syntax
response = client.get_base_path_mappings(
domainName='string',
position='string',
limit=123
)
[REQUIRED]
The domain name of a BasePathMapping resource.
dict
Response Syntax
{
'position': 'string',
'items': [
{
'basePath': 'string',
'restApiId': 'string',
'stage': 'string'
},
]
}
Response Structure
(dict) --
Represents a collection of BasePathMapping resources.
position (string) --
items (list) --
The current page of elements from this collection.
(dict) --
Represents the base path that callers of the API must provide as part of the URL after the domain name.
basePath (string) --
The base path name that callers of the API must provide as part of the URL after the domain name.
restApiId (string) --
The string identifier of the associated RestApi.
stage (string) --
The name of the associated stage.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_client_certificate
(**kwargs)¶Gets information about the current ClientCertificate resource.
See also: AWS API Documentation
Request Syntax
response = client.get_client_certificate(
clientCertificateId='string'
)
[REQUIRED]
The identifier of the ClientCertificate resource to be described.
{
'clientCertificateId': 'string',
'description': 'string',
'pemEncodedCertificate': 'string',
'createdDate': datetime(2015, 1, 1),
'expirationDate': datetime(2015, 1, 1),
'tags': {
'string': 'string'
}
}
Response Structure
Represents a client certificate used to configure client-side SSL authentication while sending requests to the integration endpoint.
The identifier of the client certificate.
The description of the client certificate.
The PEM-encoded public key of the client certificate, which can be used to configure certificate authentication in the integration endpoint .
The timestamp when the client certificate was created.
The timestamp when the client certificate will expire.
The collection of tags. Each tag element is associated with a given resource.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_client_certificates
(**kwargs)¶Gets a collection of ClientCertificate resources.
See also: AWS API Documentation
Request Syntax
response = client.get_client_certificates(
position='string',
limit=123
)
dict
Response Syntax
{
'position': 'string',
'items': [
{
'clientCertificateId': 'string',
'description': 'string',
'pemEncodedCertificate': 'string',
'createdDate': datetime(2015, 1, 1),
'expirationDate': datetime(2015, 1, 1),
'tags': {
'string': 'string'
}
},
]
}
Response Structure
(dict) --
Represents a collection of ClientCertificate resources.
position (string) --
items (list) --
The current page of elements from this collection.
(dict) --
Represents a client certificate used to configure client-side SSL authentication while sending requests to the integration endpoint.
clientCertificateId (string) --
The identifier of the client certificate.
description (string) --
The description of the client certificate.
pemEncodedCertificate (string) --
The PEM-encoded public key of the client certificate, which can be used to configure certificate authentication in the integration endpoint .
createdDate (datetime) --
The timestamp when the client certificate was created.
expirationDate (datetime) --
The timestamp when the client certificate will expire.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_deployment
(**kwargs)¶Gets information about a Deployment resource.
See also: AWS API Documentation
Request Syntax
response = client.get_deployment(
restApiId='string',
deploymentId='string',
embed=[
'string',
]
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The identifier of the Deployment resource to get information about.
A query parameter to retrieve the specified embedded resources of the returned Deployment resource in the response. In a REST API call, this embed
parameter value is a list of comma-separated strings, as in GET /restapis/{restapi_id}/deployments/{deployment_id}?embed=var1,var2
. The SDK and other platform-dependent libraries might use a different format for the list. Currently, this request supports only retrieval of the embedded API summary this way. Hence, the parameter value must be a single-valued list containing only the "apisummary"
string. For example, GET /restapis/{restapi_id}/deployments/{deployment_id}?embed=apisummary
.
dict
Response Syntax
{
'id': 'string',
'description': 'string',
'createdDate': datetime(2015, 1, 1),
'apiSummary': {
'string': {
'string': {
'authorizationType': 'string',
'apiKeyRequired': True|False
}
}
}
}
Response Structure
(dict) --
An immutable representation of a RestApi resource that can be called by users using Stages. A deployment must be associated with a Stage for it to be callable over the Internet.
id (string) --
The identifier for the deployment resource.
description (string) --
The description for the deployment resource.
createdDate (datetime) --
The date and time that the deployment resource was created.
apiSummary (dict) --
A summary of the RestApi at the date and time that the deployment resource was created.
(string) --
(dict) --
(string) --
(dict) --
Represents a summary of a Method resource, given a particular date and time.
authorizationType (string) --
The method's authorization type. Valid values are NONE
for open access, AWS_IAM
for using AWS IAM permissions, CUSTOM
for using a custom authorizer, or COGNITO_USER_POOLS
for using a Cognito user pool.
apiKeyRequired (boolean) --
Specifies whether the method requires a valid ApiKey.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
APIGateway.Client.exceptions.ServiceUnavailableException
get_deployments
(**kwargs)¶Gets information about a Deployments collection.
See also: AWS API Documentation
Request Syntax
response = client.get_deployments(
restApiId='string',
position='string',
limit=123
)
[REQUIRED]
The string identifier of the associated RestApi.
dict
Response Syntax
{
'position': 'string',
'items': [
{
'id': 'string',
'description': 'string',
'createdDate': datetime(2015, 1, 1),
'apiSummary': {
'string': {
'string': {
'authorizationType': 'string',
'apiKeyRequired': True|False
}
}
}
},
]
}
Response Structure
(dict) --
Represents a collection resource that contains zero or more references to your existing deployments, and links that guide you on how to interact with your collection. The collection offers a paginated view of the contained deployments.
position (string) --
items (list) --
The current page of elements from this collection.
(dict) --
An immutable representation of a RestApi resource that can be called by users using Stages. A deployment must be associated with a Stage for it to be callable over the Internet.
id (string) --
The identifier for the deployment resource.
description (string) --
The description for the deployment resource.
createdDate (datetime) --
The date and time that the deployment resource was created.
apiSummary (dict) --
A summary of the RestApi at the date and time that the deployment resource was created.
(string) --
(dict) --
(string) --
(dict) --
Represents a summary of a Method resource, given a particular date and time.
authorizationType (string) --
The method's authorization type. Valid values are NONE
for open access, AWS_IAM
for using AWS IAM permissions, CUSTOM
for using a custom authorizer, or COGNITO_USER_POOLS
for using a Cognito user pool.
apiKeyRequired (boolean) --
Specifies whether the method requires a valid ApiKey.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
APIGateway.Client.exceptions.ServiceUnavailableException
get_documentation_part
(**kwargs)¶Gets a documentation part.
See also: AWS API Documentation
Request Syntax
response = client.get_documentation_part(
restApiId='string',
documentationPartId='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The string identifier of the associated RestApi.
dict
Response Syntax
{
'id': 'string',
'location': {
'type': 'API'|'AUTHORIZER'|'MODEL'|'RESOURCE'|'METHOD'|'PATH_PARAMETER'|'QUERY_PARAMETER'|'REQUEST_HEADER'|'REQUEST_BODY'|'RESPONSE'|'RESPONSE_HEADER'|'RESPONSE_BODY',
'path': 'string',
'method': 'string',
'statusCode': 'string',
'name': 'string'
},
'properties': 'string'
}
Response Structure
(dict) --
A documentation part for a targeted API entity.
id (string) --
The DocumentationPart identifier, generated by API Gateway when the DocumentationPart
is created.
location (dict) --
The location of the API entity to which the documentation applies. Valid fields depend on the targeted API entity type. All the valid location fields are not required. If not explicitly specified, a valid location field is treated as a wildcard and associated documentation content may be inherited by matching entities, unless overridden.
type (string) --
The type of API entity to which the documentation content applies. Valid values are API
, AUTHORIZER
, MODEL
, RESOURCE
, METHOD
, PATH_PARAMETER
, QUERY_PARAMETER
, REQUEST_HEADER
, REQUEST_BODY
, RESPONSE
, RESPONSE_HEADER
, and RESPONSE_BODY
. Content inheritance does not apply to any entity of the API
, AUTHORIZER
, METHOD
, MODEL
, REQUEST_BODY
, or RESOURCE
type.
path (string) --
The URL path of the target. It is a valid field for the API entity types of RESOURCE
, METHOD
, PATH_PARAMETER
, QUERY_PARAMETER
, REQUEST_HEADER
, REQUEST_BODY
, RESPONSE
, RESPONSE_HEADER
, and RESPONSE_BODY
. The default value is /
for the root resource. When an applicable child entity inherits the content of another entity of the same type with more general specifications of the other location
attributes, the child entity's path
attribute must match that of the parent entity as a prefix.
method (string) --
The HTTP verb of a method. It is a valid field for the API entity types of METHOD
, PATH_PARAMETER
, QUERY_PARAMETER
, REQUEST_HEADER
, REQUEST_BODY
, RESPONSE
, RESPONSE_HEADER
, and RESPONSE_BODY
. The default value is *
for any method. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the other location
attributes, the child entity's method
attribute must match that of the parent entity exactly.
statusCode (string) --
The HTTP status code of a response. It is a valid field for the API entity types of RESPONSE
, RESPONSE_HEADER
, and RESPONSE_BODY
. The default value is *
for any status code. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the other location
attributes, the child entity's statusCode
attribute must match that of the parent entity exactly.
name (string) --
The name of the targeted API entity. It is a valid and required field for the API entity types of AUTHORIZER
, MODEL
, PATH_PARAMETER
, QUERY_PARAMETER
, REQUEST_HEADER
, REQUEST_BODY
and RESPONSE_HEADER
. It is an invalid field for any other entity type.
properties (string) --
A content map of API-specific key-value pairs describing the targeted API entity. The map must be encoded as a JSON string, e.g., "{ \"description\": \"The API does ...\" }"
. Only OpenAPI-compliant documentation-related fields from the properties map are exported and, hence, published as part of the API entity definitions, while the original documentation parts are exported in a OpenAPI extension of x-amazon-apigateway-documentation
.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_documentation_parts
(**kwargs)¶Gets documentation parts.
See also: AWS API Documentation
Request Syntax
response = client.get_documentation_parts(
restApiId='string',
type='API'|'AUTHORIZER'|'MODEL'|'RESOURCE'|'METHOD'|'PATH_PARAMETER'|'QUERY_PARAMETER'|'REQUEST_HEADER'|'REQUEST_BODY'|'RESPONSE'|'RESPONSE_HEADER'|'RESPONSE_BODY',
nameQuery='string',
path='string',
position='string',
limit=123,
locationStatus='DOCUMENTED'|'UNDOCUMENTED'
)
[REQUIRED]
The string identifier of the associated RestApi.
DOCUMENTED
for retrieving DocumentationPart resources with content and UNDOCUMENTED
for DocumentationPart resources without content.dict
Response Syntax
{
'position': 'string',
'items': [
{
'id': 'string',
'location': {
'type': 'API'|'AUTHORIZER'|'MODEL'|'RESOURCE'|'METHOD'|'PATH_PARAMETER'|'QUERY_PARAMETER'|'REQUEST_HEADER'|'REQUEST_BODY'|'RESPONSE'|'RESPONSE_HEADER'|'RESPONSE_BODY',
'path': 'string',
'method': 'string',
'statusCode': 'string',
'name': 'string'
},
'properties': 'string'
},
]
}
Response Structure
(dict) --
The collection of documentation parts of an API.
position (string) --
items (list) --
The current page of elements from this collection.
(dict) --
A documentation part for a targeted API entity.
id (string) --
The DocumentationPart identifier, generated by API Gateway when the DocumentationPart
is created.
location (dict) --
The location of the API entity to which the documentation applies. Valid fields depend on the targeted API entity type. All the valid location fields are not required. If not explicitly specified, a valid location field is treated as a wildcard and associated documentation content may be inherited by matching entities, unless overridden.
type (string) --
The type of API entity to which the documentation content applies. Valid values are API
, AUTHORIZER
, MODEL
, RESOURCE
, METHOD
, PATH_PARAMETER
, QUERY_PARAMETER
, REQUEST_HEADER
, REQUEST_BODY
, RESPONSE
, RESPONSE_HEADER
, and RESPONSE_BODY
. Content inheritance does not apply to any entity of the API
, AUTHORIZER
, METHOD
, MODEL
, REQUEST_BODY
, or RESOURCE
type.
path (string) --
The URL path of the target. It is a valid field for the API entity types of RESOURCE
, METHOD
, PATH_PARAMETER
, QUERY_PARAMETER
, REQUEST_HEADER
, REQUEST_BODY
, RESPONSE
, RESPONSE_HEADER
, and RESPONSE_BODY
. The default value is /
for the root resource. When an applicable child entity inherits the content of another entity of the same type with more general specifications of the other location
attributes, the child entity's path
attribute must match that of the parent entity as a prefix.
method (string) --
The HTTP verb of a method. It is a valid field for the API entity types of METHOD
, PATH_PARAMETER
, QUERY_PARAMETER
, REQUEST_HEADER
, REQUEST_BODY
, RESPONSE
, RESPONSE_HEADER
, and RESPONSE_BODY
. The default value is *
for any method. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the other location
attributes, the child entity's method
attribute must match that of the parent entity exactly.
statusCode (string) --
The HTTP status code of a response. It is a valid field for the API entity types of RESPONSE
, RESPONSE_HEADER
, and RESPONSE_BODY
. The default value is *
for any status code. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the other location
attributes, the child entity's statusCode
attribute must match that of the parent entity exactly.
name (string) --
The name of the targeted API entity. It is a valid and required field for the API entity types of AUTHORIZER
, MODEL
, PATH_PARAMETER
, QUERY_PARAMETER
, REQUEST_HEADER
, REQUEST_BODY
and RESPONSE_HEADER
. It is an invalid field for any other entity type.
properties (string) --
A content map of API-specific key-value pairs describing the targeted API entity. The map must be encoded as a JSON string, e.g., "{ \"description\": \"The API does ...\" }"
. Only OpenAPI-compliant documentation-related fields from the properties map are exported and, hence, published as part of the API entity definitions, while the original documentation parts are exported in a OpenAPI extension of x-amazon-apigateway-documentation
.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_documentation_version
(**kwargs)¶Gets a documentation version.
See also: AWS API Documentation
Request Syntax
response = client.get_documentation_version(
restApiId='string',
documentationVersion='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The version identifier of the to-be-retrieved documentation snapshot.
dict
Response Syntax
{
'version': 'string',
'createdDate': datetime(2015, 1, 1),
'description': 'string'
}
Response Structure
(dict) --
A snapshot of the documentation of an API.
version (string) --
The version identifier of the API documentation snapshot.
createdDate (datetime) --
The date when the API documentation snapshot is created.
description (string) --
The description of the API documentation snapshot.
Exceptions
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.TooManyRequestsException
get_documentation_versions
(**kwargs)¶Gets documentation versions.
See also: AWS API Documentation
Request Syntax
response = client.get_documentation_versions(
restApiId='string',
position='string',
limit=123
)
[REQUIRED]
The string identifier of the associated RestApi.
dict
Response Syntax
{
'position': 'string',
'items': [
{
'version': 'string',
'createdDate': datetime(2015, 1, 1),
'description': 'string'
},
]
}
Response Structure
(dict) --
The collection of documentation snapshots of an API.
position (string) --
items (list) --
The current page of elements from this collection.
(dict) --
A snapshot of the documentation of an API.
version (string) --
The version identifier of the API documentation snapshot.
createdDate (datetime) --
The date when the API documentation snapshot is created.
description (string) --
The description of the API documentation snapshot.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.TooManyRequestsException
get_domain_name
(**kwargs)¶Represents a domain name that is contained in a simpler, more intuitive URL that can be called.
See also: AWS API Documentation
Request Syntax
response = client.get_domain_name(
domainName='string'
)
[REQUIRED]
The name of the DomainName resource.
{
'domainName': 'string',
'certificateName': 'string',
'certificateArn': 'string',
'certificateUploadDate': datetime(2015, 1, 1),
'regionalDomainName': 'string',
'regionalHostedZoneId': 'string',
'regionalCertificateName': 'string',
'regionalCertificateArn': 'string',
'distributionDomainName': 'string',
'distributionHostedZoneId': 'string',
'endpointConfiguration': {
'types': [
'REGIONAL'|'EDGE'|'PRIVATE',
],
'vpcEndpointIds': [
'string',
]
},
'domainNameStatus': 'AVAILABLE'|'UPDATING'|'PENDING'|'PENDING_CERTIFICATE_REIMPORT'|'PENDING_OWNERSHIP_VERIFICATION',
'domainNameStatusMessage': 'string',
'securityPolicy': 'TLS_1_0'|'TLS_1_2',
'tags': {
'string': 'string'
},
'mutualTlsAuthentication': {
'truststoreUri': 'string',
'truststoreVersion': 'string',
'truststoreWarnings': [
'string',
]
},
'ownershipVerificationCertificateArn': 'string'
}
Response Structure
Represents a custom domain name as a user-friendly host name of an API (RestApi).
The custom domain name as an API host name, for example, my-api.example.com
.
The name of the certificate that will be used by edge-optimized endpoint for this domain name.
The reference to an AWS-managed certificate that will be used by edge-optimized endpoint for this domain name. AWS Certificate Manager is the only supported source.
The timestamp when the certificate that was used by edge-optimized endpoint for this domain name was uploaded.
The domain name associated with the regional endpoint for this custom domain name. You set up this association by adding a DNS record that points the custom domain name to this regional domain name. The regional domain name is returned by API Gateway when you create a regional endpoint.
The region-specific Amazon Route 53 Hosted Zone ID of the regional endpoint. For more information, see Set up a Regional Custom Domain Name and AWS Regions and Endpoints for API Gateway.
The name of the certificate that will be used for validating the regional domain name.
The reference to an AWS-managed certificate that will be used for validating the regional domain name. AWS Certificate Manager is the only supported source.
The domain name of the Amazon CloudFront distribution associated with this custom domain name for an edge-optimized endpoint. You set up this association when adding a DNS record pointing the custom domain name to this distribution name. For more information about CloudFront distributions, see the Amazon CloudFront documentation.
The region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized endpoint. The valid value is Z2FDTNDATAQYW2
for all the regions. For more information, see Set up a Regional Custom Domain Name and AWS Regions and Endpoints for API Gateway.
The endpoint configuration of this DomainName showing the endpoint types of the domain name.
A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is "EDGE"
. For a regional API and its custom domain name, the endpoint type is REGIONAL
. For a private API, the endpoint type is PRIVATE
.
The endpoint type. The valid values are EDGE
for edge-optimized API setup, most suitable for mobile applications; REGIONAL
for regional API endpoint setup, most suitable for calling from AWS Region; and PRIVATE
for private APIs.
A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for PRIVATE
endpoint type.
The status of the DomainName migration. The valid values are AVAILABLE
and UPDATING
. If the status is UPDATING
, the domain cannot be modified further until the existing operation is complete. If it is AVAILABLE
, the domain can be updated.
An optional text message containing detailed information about status of the DomainName migration.
The Transport Layer Security (TLS) version + cipher suite for this DomainName. The valid values are TLS_1_0
and TLS_1_2
.
The collection of tags. Each tag element is associated with a given resource.
The mutual TLS authentication configuration for a custom domain name. If specified, API Gateway performs two-way authentication between the client and the server. Clients must present a trusted certificate to access your API.
An Amazon S3 URL that specifies the truststore for mutual TLS authentication, for example s3://bucket-name/key-name
. The truststore can contain certificates from public or private certificate authorities. To update the truststore, upload a new version to S3, and then update your custom domain name to use the new version. To update the truststore, you must have permissions to access the S3 object.
The version of the S3 object that contains your truststore. To specify a version, you must have versioning enabled for the S3 bucket.
A list of warnings that API Gateway returns while processing your truststore. Invalid certificates produce warnings. Mutual TLS is still enabled, but some clients might not be able to access your API. To resolve warnings, upload a new truststore to S3, and then update you domain name to use the new version.
The ARN of the public certificate issued by ACM to validate ownership of your custom domain. Only required when configuring mutual TLS and using an ACM imported or private CA certificate ARN as the regionalCertificateArn.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_domain_names
(**kwargs)¶Represents a collection of DomainName resources.
See also: AWS API Documentation
Request Syntax
response = client.get_domain_names(
position='string',
limit=123
)
dict
Response Syntax
{
'position': 'string',
'items': [
{
'domainName': 'string',
'certificateName': 'string',
'certificateArn': 'string',
'certificateUploadDate': datetime(2015, 1, 1),
'regionalDomainName': 'string',
'regionalHostedZoneId': 'string',
'regionalCertificateName': 'string',
'regionalCertificateArn': 'string',
'distributionDomainName': 'string',
'distributionHostedZoneId': 'string',
'endpointConfiguration': {
'types': [
'REGIONAL'|'EDGE'|'PRIVATE',
],
'vpcEndpointIds': [
'string',
]
},
'domainNameStatus': 'AVAILABLE'|'UPDATING'|'PENDING'|'PENDING_CERTIFICATE_REIMPORT'|'PENDING_OWNERSHIP_VERIFICATION',
'domainNameStatusMessage': 'string',
'securityPolicy': 'TLS_1_0'|'TLS_1_2',
'tags': {
'string': 'string'
},
'mutualTlsAuthentication': {
'truststoreUri': 'string',
'truststoreVersion': 'string',
'truststoreWarnings': [
'string',
]
},
'ownershipVerificationCertificateArn': 'string'
},
]
}
Response Structure
(dict) --
Represents a collection of DomainName resources.
position (string) --
items (list) --
The current page of elements from this collection.
(dict) --
Represents a custom domain name as a user-friendly host name of an API (RestApi).
domainName (string) --
The custom domain name as an API host name, for example, my-api.example.com
.
certificateName (string) --
The name of the certificate that will be used by edge-optimized endpoint for this domain name.
certificateArn (string) --
The reference to an AWS-managed certificate that will be used by edge-optimized endpoint for this domain name. AWS Certificate Manager is the only supported source.
certificateUploadDate (datetime) --
The timestamp when the certificate that was used by edge-optimized endpoint for this domain name was uploaded.
regionalDomainName (string) --
The domain name associated with the regional endpoint for this custom domain name. You set up this association by adding a DNS record that points the custom domain name to this regional domain name. The regional domain name is returned by API Gateway when you create a regional endpoint.
regionalHostedZoneId (string) --
The region-specific Amazon Route 53 Hosted Zone ID of the regional endpoint. For more information, see Set up a Regional Custom Domain Name and AWS Regions and Endpoints for API Gateway.
regionalCertificateName (string) --
The name of the certificate that will be used for validating the regional domain name.
regionalCertificateArn (string) --
The reference to an AWS-managed certificate that will be used for validating the regional domain name. AWS Certificate Manager is the only supported source.
distributionDomainName (string) --
The domain name of the Amazon CloudFront distribution associated with this custom domain name for an edge-optimized endpoint. You set up this association when adding a DNS record pointing the custom domain name to this distribution name. For more information about CloudFront distributions, see the Amazon CloudFront documentation.
distributionHostedZoneId (string) --
The region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized endpoint. The valid value is Z2FDTNDATAQYW2
for all the regions. For more information, see Set up a Regional Custom Domain Name and AWS Regions and Endpoints for API Gateway.
endpointConfiguration (dict) --
The endpoint configuration of this DomainName showing the endpoint types of the domain name.
types (list) --
A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is "EDGE"
. For a regional API and its custom domain name, the endpoint type is REGIONAL
. For a private API, the endpoint type is PRIVATE
.
(string) --
The endpoint type. The valid values are EDGE
for edge-optimized API setup, most suitable for mobile applications; REGIONAL
for regional API endpoint setup, most suitable for calling from AWS Region; and PRIVATE
for private APIs.
vpcEndpointIds (list) --
A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for PRIVATE
endpoint type.
domainNameStatus (string) --
The status of the DomainName migration. The valid values are AVAILABLE
and UPDATING
. If the status is UPDATING
, the domain cannot be modified further until the existing operation is complete. If it is AVAILABLE
, the domain can be updated.
domainNameStatusMessage (string) --
An optional text message containing detailed information about status of the DomainName migration.
securityPolicy (string) --
The Transport Layer Security (TLS) version + cipher suite for this DomainName. The valid values are TLS_1_0
and TLS_1_2
.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
mutualTlsAuthentication (dict) --
The mutual TLS authentication configuration for a custom domain name. If specified, API Gateway performs two-way authentication between the client and the server. Clients must present a trusted certificate to access your API.
truststoreUri (string) --
An Amazon S3 URL that specifies the truststore for mutual TLS authentication, for example s3://bucket-name/key-name
. The truststore can contain certificates from public or private certificate authorities. To update the truststore, upload a new version to S3, and then update your custom domain name to use the new version. To update the truststore, you must have permissions to access the S3 object.
truststoreVersion (string) --
The version of the S3 object that contains your truststore. To specify a version, you must have versioning enabled for the S3 bucket.
truststoreWarnings (list) --
A list of warnings that API Gateway returns while processing your truststore. Invalid certificates produce warnings. Mutual TLS is still enabled, but some clients might not be able to access your API. To resolve warnings, upload a new truststore to S3, and then update you domain name to use the new version.
ownershipVerificationCertificateArn (string) --
The ARN of the public certificate issued by ACM to validate ownership of your custom domain. Only required when configuring mutual TLS and using an ACM imported or private CA certificate ARN as the regionalCertificateArn.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_export
(**kwargs)¶Exports a deployed version of a RestApi in a specified format.
See also: AWS API Documentation
Request Syntax
response = client.get_export(
restApiId='string',
stageName='string',
exportType='string',
parameters={
'string': 'string'
},
accepts='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The name of the Stage that will be exported.
[REQUIRED]
The type of export. Acceptable values are 'oas30' for OpenAPI 3.0.x and 'swagger' for Swagger/OpenAPI 2.0.
A key-value map of query string parameters that specify properties of the export, depending on the requested exportType
. For exportType
oas30
and swagger
, any combination of the following parameters are supported: extensions='integrations'
or extensions='apigateway'
will export the API with x-amazon-apigateway-integration extensions. extensions='authorizers'
will export the API with x-amazon-apigateway-authorizer extensions. postman
will export the API with Postman extensions, allowing for import to the Postman tool
application/json
. Currently application/json
and application/yaml
are supported for exportType
of oas30
and swagger
. This should be specified in the Accept
header for direct API requests.dict
Response Syntax
{
'contentType': 'string',
'contentDisposition': 'string',
'body': StreamingBody()
}
Response Structure
(dict) --
The binary blob response to GetExport, which contains the generated SDK.
contentType (string) --
The content-type header value in the HTTP response. This will correspond to a valid 'accept' type in the request.
contentDisposition (string) --
The content-disposition header value in the HTTP response.
body (StreamingBody
) --
The binary blob response to GetExport, which contains the export.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_gateway_response
(**kwargs)¶Gets a GatewayResponse of a specified response type on the given RestApi.
See also: AWS API Documentation
Request Syntax
response = client.get_gateway_response(
restApiId='string',
responseType='DEFAULT_4XX'|'DEFAULT_5XX'|'RESOURCE_NOT_FOUND'|'UNAUTHORIZED'|'INVALID_API_KEY'|'ACCESS_DENIED'|'AUTHORIZER_FAILURE'|'AUTHORIZER_CONFIGURATION_ERROR'|'INVALID_SIGNATURE'|'EXPIRED_TOKEN'|'MISSING_AUTHENTICATION_TOKEN'|'INTEGRATION_FAILURE'|'INTEGRATION_TIMEOUT'|'API_CONFIGURATION_ERROR'|'UNSUPPORTED_MEDIA_TYPE'|'BAD_REQUEST_PARAMETERS'|'BAD_REQUEST_BODY'|'REQUEST_TOO_LARGE'|'THROTTLED'|'QUOTA_EXCEEDED'|'WAF_FILTERED'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The response type of the associated GatewayResponse.
dict
Response Syntax
{
'responseType': 'DEFAULT_4XX'|'DEFAULT_5XX'|'RESOURCE_NOT_FOUND'|'UNAUTHORIZED'|'INVALID_API_KEY'|'ACCESS_DENIED'|'AUTHORIZER_FAILURE'|'AUTHORIZER_CONFIGURATION_ERROR'|'INVALID_SIGNATURE'|'EXPIRED_TOKEN'|'MISSING_AUTHENTICATION_TOKEN'|'INTEGRATION_FAILURE'|'INTEGRATION_TIMEOUT'|'API_CONFIGURATION_ERROR'|'UNSUPPORTED_MEDIA_TYPE'|'BAD_REQUEST_PARAMETERS'|'BAD_REQUEST_BODY'|'REQUEST_TOO_LARGE'|'THROTTLED'|'QUOTA_EXCEEDED'|'WAF_FILTERED',
'statusCode': 'string',
'responseParameters': {
'string': 'string'
},
'responseTemplates': {
'string': 'string'
},
'defaultResponse': True|False
}
Response Structure
(dict) --
A gateway response of a given response type and status code, with optional response parameters and mapping templates.
responseType (string) --
The response type of the associated GatewayResponse.
statusCode (string) --
The HTTP status code for this GatewayResponse.
responseParameters (dict) --
Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of key-value pairs.
responseTemplates (dict) --
Response templates of the GatewayResponse as a string-to-string map of key-value pairs.
defaultResponse (boolean) --
A Boolean flag to indicate whether this GatewayResponse is the default gateway response ( true
) or not ( false
). A default gateway response is one generated by API Gateway without any customization by an API developer.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_gateway_responses
(**kwargs)¶Gets the GatewayResponses collection on the given RestApi. If an API developer has not added any definitions for gateway responses, the result will be the API Gateway-generated default GatewayResponses collection for the supported response types.
See also: AWS API Documentation
Request Syntax
response = client.get_gateway_responses(
restApiId='string',
position='string',
limit=123
)
[REQUIRED]
The string identifier of the associated RestApi.
dict
Response Syntax
{
'position': 'string',
'items': [
{
'responseType': 'DEFAULT_4XX'|'DEFAULT_5XX'|'RESOURCE_NOT_FOUND'|'UNAUTHORIZED'|'INVALID_API_KEY'|'ACCESS_DENIED'|'AUTHORIZER_FAILURE'|'AUTHORIZER_CONFIGURATION_ERROR'|'INVALID_SIGNATURE'|'EXPIRED_TOKEN'|'MISSING_AUTHENTICATION_TOKEN'|'INTEGRATION_FAILURE'|'INTEGRATION_TIMEOUT'|'API_CONFIGURATION_ERROR'|'UNSUPPORTED_MEDIA_TYPE'|'BAD_REQUEST_PARAMETERS'|'BAD_REQUEST_BODY'|'REQUEST_TOO_LARGE'|'THROTTLED'|'QUOTA_EXCEEDED'|'WAF_FILTERED',
'statusCode': 'string',
'responseParameters': {
'string': 'string'
},
'responseTemplates': {
'string': 'string'
},
'defaultResponse': True|False
},
]
}
Response Structure
(dict) --
The collection of the GatewayResponse instances of a RestApi as a responseType
-to-GatewayResponse object map of key-value pairs. As such, pagination is not supported for querying this collection.
position (string) --
items (list) --
Returns the entire collection, because of no pagination support.
(dict) --
A gateway response of a given response type and status code, with optional response parameters and mapping templates.
responseType (string) --
The response type of the associated GatewayResponse.
statusCode (string) --
The HTTP status code for this GatewayResponse.
responseParameters (dict) --
Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of key-value pairs.
responseTemplates (dict) --
Response templates of the GatewayResponse as a string-to-string map of key-value pairs.
defaultResponse (boolean) --
A Boolean flag to indicate whether this GatewayResponse is the default gateway response ( true
) or not ( false
). A default gateway response is one generated by API Gateway without any customization by an API developer.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_integration
(**kwargs)¶Get the integration settings.
See also: AWS API Documentation
Request Syntax
response = client.get_integration(
restApiId='string',
resourceId='string',
httpMethod='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
Specifies a get integration request's resource identifier
[REQUIRED]
Specifies a get integration request's HTTP method.
dict
Response Syntax
{
'type': 'HTTP'|'AWS'|'MOCK'|'HTTP_PROXY'|'AWS_PROXY',
'httpMethod': 'string',
'uri': 'string',
'connectionType': 'INTERNET'|'VPC_LINK',
'connectionId': 'string',
'credentials': 'string',
'requestParameters': {
'string': 'string'
},
'requestTemplates': {
'string': 'string'
},
'passthroughBehavior': 'string',
'contentHandling': 'CONVERT_TO_BINARY'|'CONVERT_TO_TEXT',
'timeoutInMillis': 123,
'cacheNamespace': 'string',
'cacheKeyParameters': [
'string',
],
'integrationResponses': {
'string': {
'statusCode': 'string',
'selectionPattern': 'string',
'responseParameters': {
'string': 'string'
},
'responseTemplates': {
'string': 'string'
},
'contentHandling': 'CONVERT_TO_BINARY'|'CONVERT_TO_TEXT'
}
},
'tlsConfig': {
'insecureSkipVerification': True|False
}
}
Response Structure
(dict) --
Represents an HTTP, HTTP_PROXY, AWS, AWS_PROXY, or Mock integration.
type (string) --
Specifies an API method integration type. The valid value is one of the following:
For the HTTP and HTTP proxy integrations, each integration can specify a protocol ( http/https
), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with a connectionType
of VPC_LINK
is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC.
httpMethod (string) --
Specifies the integration's HTTP method type.
uri (string) --
Specifies Uniform Resource Identifier (URI) of the integration endpoint.
For HTTP
or HTTP_PROXY
integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, where connectionType
is not VPC_LINK
, or private integration, where connectionType
is VPC_LINK
. For a private HTTP integration, the URI is not used for routing. For AWS
or AWS_PROXY
integrations, the URI is of the form arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}
. Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is the name of the integrated Amazon Web Services service (e.g., s3); and {subdomain} is a designated subdomain supported by certain Amazon Web Services service for fast host-name lookup. action can be used for an Amazon Web Services service action-based API, using an Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing {service_api} refers to a supported action {name} plus any required input parameters. Alternatively, path can be used for an AWS service path-based API. The ensuing service_api refers to the path to an Amazon Web Services service resource, including the region of the integrated Amazon Web Services service, if applicable. For example, for integration with the S3 API of GetObject, the uri can be either arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}
or arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}
connectionType (string) --
The type of the network connection to the integration endpoint. The valid value is INTERNET
for connections through the public routable internet or VPC_LINK
for private connections between API Gateway and a network load balancer in a VPC. The default value is INTERNET
.
connectionId (string) --
The ID of the VpcLink used for the integration when connectionType=VPC_LINK
and undefined, otherwise.
credentials (string) --
Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string arn:aws:iam::\*:user/\*
. To use resource-based permissions on supported AWS services, specify null.
requestParameters (dict) --
A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of method.request.{location}.{name}
, where location
is querystring
, path
, or header
and name
must be a valid and unique method request parameter name.
requestTemplates (dict) --
Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.
passthroughBehavior (string) --
Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in requestTemplates
. The valid value is one of the following: WHEN_NO_MATCH
: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. WHEN_NO_TEMPLATES
: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP 415 Unsupported Media Type response. NEVER
: rejects the method request with an HTTP 415 Unsupported Media Type response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.
contentHandling (string) --
Specifies how to handle request payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the passthroughBehavior
is configured to support payload pass-through.
timeoutInMillis (integer) --
Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
cacheNamespace (string) --
Specifies a group of related cached parameters. By default, API Gateway uses the resource ID as the cacheNamespace
. You can specify the same cacheNamespace
across resources to return the same cached data for requests to different resources.
cacheKeyParameters (list) --
A list of request parameters whose values API Gateway caches. To be valid values for cacheKeyParameters
, these parameters must also be specified for Method requestParameters
.
integrationResponses (dict) --
Specifies the integration's responses.
(string) --
(dict) --
Represents an integration response. The status code must map to an existing MethodResponse, and parameters and templates can be used to transform the back-end response.
statusCode (string) --
Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern (string) --
Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the .+
regex to match error response. However, make sure that the error response does not contain any newline ( \n
) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.
responseParameters (dict) --
A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of method.response.header.{name}
, where name
is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header.{name}
or integration.response.body.{JSON-expression}
, where name
is a valid and unique response header name and JSON-expression
is a valid JSON expression without the $
prefix.
responseTemplates (dict) --
Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
contentHandling (string) --
Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
tlsConfig (dict) --
Specifies the TLS configuration for an integration.
insecureSkipVerification (boolean) --
Specifies whether or not API Gateway skips verification that the certificate for an integration endpoint is issued by a supported certificate authority. This isn’t recommended, but it enables you to use certificates that are signed by private certificate authorities, or certificates that are self-signed. If enabled, API Gateway still performs basic certificate validation, which includes checking the certificate's expiration date, hostname, and presence of a root certificate authority. Supported only for HTTP
and HTTP_PROXY
integrations.
Warning
Enabling insecureSkipVerification
isn't recommended, especially for integrations with public HTTPS endpoints. If you enable insecureSkipVerification
, you increase the risk of man-in-the-middle attacks.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_integration_response
(**kwargs)¶Represents a get integration response.
See also: AWS API Documentation
Request Syntax
response = client.get_integration_response(
restApiId='string',
resourceId='string',
httpMethod='string',
statusCode='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
Specifies a get integration response request's resource identifier.
[REQUIRED]
Specifies a get integration response request's HTTP method.
[REQUIRED]
Specifies a get integration response request's status code.
dict
Response Syntax
{
'statusCode': 'string',
'selectionPattern': 'string',
'responseParameters': {
'string': 'string'
},
'responseTemplates': {
'string': 'string'
},
'contentHandling': 'CONVERT_TO_BINARY'|'CONVERT_TO_TEXT'
}
Response Structure
(dict) --
Represents an integration response. The status code must map to an existing MethodResponse, and parameters and templates can be used to transform the back-end response.
statusCode (string) --
Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern (string) --
Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the .+
regex to match error response. However, make sure that the error response does not contain any newline ( \n
) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.
responseParameters (dict) --
A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of method.response.header.{name}
, where name
is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header.{name}
or integration.response.body.{JSON-expression}
, where name
is a valid and unique response header name and JSON-expression
is a valid JSON expression without the $
prefix.
responseTemplates (dict) --
Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
contentHandling (string) --
Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_method
(**kwargs)¶Describe an existing Method resource.
See also: AWS API Documentation
Request Syntax
response = client.get_method(
restApiId='string',
resourceId='string',
httpMethod='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The Resource identifier for the Method resource.
[REQUIRED]
Specifies the method request's HTTP method type.
dict
Response Syntax
{
'httpMethod': 'string',
'authorizationType': 'string',
'authorizerId': 'string',
'apiKeyRequired': True|False,
'requestValidatorId': 'string',
'operationName': 'string',
'requestParameters': {
'string': True|False
},
'requestModels': {
'string': 'string'
},
'methodResponses': {
'string': {
'statusCode': 'string',
'responseParameters': {
'string': True|False
},
'responseModels': {
'string': 'string'
}
}
},
'methodIntegration': {
'type': 'HTTP'|'AWS'|'MOCK'|'HTTP_PROXY'|'AWS_PROXY',
'httpMethod': 'string',
'uri': 'string',
'connectionType': 'INTERNET'|'VPC_LINK',
'connectionId': 'string',
'credentials': 'string',
'requestParameters': {
'string': 'string'
},
'requestTemplates': {
'string': 'string'
},
'passthroughBehavior': 'string',
'contentHandling': 'CONVERT_TO_BINARY'|'CONVERT_TO_TEXT',
'timeoutInMillis': 123,
'cacheNamespace': 'string',
'cacheKeyParameters': [
'string',
],
'integrationResponses': {
'string': {
'statusCode': 'string',
'selectionPattern': 'string',
'responseParameters': {
'string': 'string'
},
'responseTemplates': {
'string': 'string'
},
'contentHandling': 'CONVERT_TO_BINARY'|'CONVERT_TO_TEXT'
}
},
'tlsConfig': {
'insecureSkipVerification': True|False
}
},
'authorizationScopes': [
'string',
]
}
Response Structure
(dict) --
Represents a client-facing interface by which the client calls the API to access back-end resources. A Method resource is integrated with an Integration resource. Both consist of a request and one or more responses. The method request takes the client input that is passed to the back end through the integration request. A method response returns the output from the back end to the client through an integration response. A method request is embodied in a Method resource, whereas an integration request is embodied in an Integration resource. On the other hand, a method response is represented by a MethodResponse resource, whereas an integration response is represented by an IntegrationResponse resource.
httpMethod (string) --
The method's HTTP verb.
authorizationType (string) --
The method's authorization type. Valid values are NONE
for open access, AWS_IAM
for using AWS IAM permissions, CUSTOM
for using a custom authorizer, or COGNITO_USER_POOLS
for using a Cognito user pool.
authorizerId (string) --
The identifier of an Authorizer to use on this method. The authorizationType
must be CUSTOM
.
apiKeyRequired (boolean) --
A boolean flag specifying whether a valid ApiKey is required to invoke this method.
requestValidatorId (string) --
The identifier of a RequestValidator for request validation.
operationName (string) --
A human-friendly operation identifier for the method. For example, you can assign the operationName
of ListPets
for the GET /pets
method in the PetStore
example.
requestParameters (dict) --
A key-value map defining required or optional method request parameters that can be accepted by API Gateway. A key is a method request parameter name matching the pattern of method.request.{location}.{name}
, where location
is querystring
, path
, or header
and name
is a valid and unique parameter name. The value associated with the key is a Boolean flag indicating whether the parameter is required ( true
) or optional ( false
). The method request parameter names defined here are available in Integration to be mapped to integration request parameters or templates.
requestModels (dict) --
A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key).
methodResponses (dict) --
Gets a method response associated with a given HTTP status code.
(string) --
(dict) --
Represents a method response of a given HTTP status code returned to the client. The method response is passed from the back end through the associated integration response that can be transformed using a mapping template.
statusCode (string) --
The method response's status code.
responseParameters (dict) --
A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header and the value specifies whether the associated method response header is required or not. The expression of the key must match the pattern method.response.header.{name}
, where name
is a valid and unique header name. API Gateway passes certain integration response data to the method response headers specified here according to the mapping you prescribe in the API's IntegrationResponse. The integration response data that can be mapped include an integration response header expressed in integration.response.header.{name}
, a static value enclosed within a pair of single quotes (e.g., 'application/json'
), or a JSON expression from the back-end response payload in the form of integration.response.body.{JSON-expression}
, where JSON-expression
is a valid JSON expression without the $
prefix.)
responseModels (dict) --
Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.
methodIntegration (dict) --
Gets the method's integration responsible for passing the client-submitted request to the back end and performing necessary transformations to make the request compliant with the back end.
type (string) --
Specifies an API method integration type. The valid value is one of the following:
For the HTTP and HTTP proxy integrations, each integration can specify a protocol ( http/https
), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with a connectionType
of VPC_LINK
is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC.
httpMethod (string) --
Specifies the integration's HTTP method type.
uri (string) --
Specifies Uniform Resource Identifier (URI) of the integration endpoint.
For HTTP
or HTTP_PROXY
integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, where connectionType
is not VPC_LINK
, or private integration, where connectionType
is VPC_LINK
. For a private HTTP integration, the URI is not used for routing. For AWS
or AWS_PROXY
integrations, the URI is of the form arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}
. Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is the name of the integrated Amazon Web Services service (e.g., s3); and {subdomain} is a designated subdomain supported by certain Amazon Web Services service for fast host-name lookup. action can be used for an Amazon Web Services service action-based API, using an Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing {service_api} refers to a supported action {name} plus any required input parameters. Alternatively, path can be used for an AWS service path-based API. The ensuing service_api refers to the path to an Amazon Web Services service resource, including the region of the integrated Amazon Web Services service, if applicable. For example, for integration with the S3 API of GetObject, the uri can be either arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}
or arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}
connectionType (string) --
The type of the network connection to the integration endpoint. The valid value is INTERNET
for connections through the public routable internet or VPC_LINK
for private connections between API Gateway and a network load balancer in a VPC. The default value is INTERNET
.
connectionId (string) --
The ID of the VpcLink used for the integration when connectionType=VPC_LINK
and undefined, otherwise.
credentials (string) --
Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string arn:aws:iam::\*:user/\*
. To use resource-based permissions on supported AWS services, specify null.
requestParameters (dict) --
A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of method.request.{location}.{name}
, where location
is querystring
, path
, or header
and name
must be a valid and unique method request parameter name.
requestTemplates (dict) --
Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.
passthroughBehavior (string) --
Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in requestTemplates
. The valid value is one of the following: WHEN_NO_MATCH
: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. WHEN_NO_TEMPLATES
: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP 415 Unsupported Media Type response. NEVER
: rejects the method request with an HTTP 415 Unsupported Media Type response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.
contentHandling (string) --
Specifies how to handle request payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the passthroughBehavior
is configured to support payload pass-through.
timeoutInMillis (integer) --
Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
cacheNamespace (string) --
Specifies a group of related cached parameters. By default, API Gateway uses the resource ID as the cacheNamespace
. You can specify the same cacheNamespace
across resources to return the same cached data for requests to different resources.
cacheKeyParameters (list) --
A list of request parameters whose values API Gateway caches. To be valid values for cacheKeyParameters
, these parameters must also be specified for Method requestParameters
.
integrationResponses (dict) --
Specifies the integration's responses.
(string) --
(dict) --
Represents an integration response. The status code must map to an existing MethodResponse, and parameters and templates can be used to transform the back-end response.
statusCode (string) --
Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern (string) --
Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the .+
regex to match error response. However, make sure that the error response does not contain any newline ( \n
) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.
responseParameters (dict) --
A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of method.response.header.{name}
, where name
is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header.{name}
or integration.response.body.{JSON-expression}
, where name
is a valid and unique response header name and JSON-expression
is a valid JSON expression without the $
prefix.
responseTemplates (dict) --
Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
contentHandling (string) --
Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
tlsConfig (dict) --
Specifies the TLS configuration for an integration.
insecureSkipVerification (boolean) --
Specifies whether or not API Gateway skips verification that the certificate for an integration endpoint is issued by a supported certificate authority. This isn’t recommended, but it enables you to use certificates that are signed by private certificate authorities, or certificates that are self-signed. If enabled, API Gateway still performs basic certificate validation, which includes checking the certificate's expiration date, hostname, and presence of a root certificate authority. Supported only for HTTP
and HTTP_PROXY
integrations.
Warning
Enabling insecureSkipVerification
isn't recommended, especially for integrations with public HTTPS endpoints. If you enable insecureSkipVerification
, you increase the risk of man-in-the-middle attacks.
authorizationScopes (list) --
A list of authorization scopes configured on the method. The scopes are used with a COGNITO_USER_POOLS
authorizer to authorize the method invocation. The authorization works by matching the method scopes against the scopes parsed from the access token in the incoming request. The method invocation is authorized if any method scopes matches a claimed scope in the access token. Otherwise, the invocation is not authorized. When the method scope is configured, the client must provide an access token instead of an identity token for authorization purposes.
Exceptions
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.TooManyRequestsException
get_method_response
(**kwargs)¶Describes a MethodResponse resource.
See also: AWS API Documentation
Request Syntax
response = client.get_method_response(
restApiId='string',
resourceId='string',
httpMethod='string',
statusCode='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The Resource identifier for the MethodResponse resource.
[REQUIRED]
The HTTP verb of the Method resource.
[REQUIRED]
The status code for the MethodResponse resource.
dict
Response Syntax
{
'statusCode': 'string',
'responseParameters': {
'string': True|False
},
'responseModels': {
'string': 'string'
}
}
Response Structure
(dict) --
Represents a method response of a given HTTP status code returned to the client. The method response is passed from the back end through the associated integration response that can be transformed using a mapping template.
statusCode (string) --
The method response's status code.
responseParameters (dict) --
A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header and the value specifies whether the associated method response header is required or not. The expression of the key must match the pattern method.response.header.{name}
, where name
is a valid and unique header name. API Gateway passes certain integration response data to the method response headers specified here according to the mapping you prescribe in the API's IntegrationResponse. The integration response data that can be mapped include an integration response header expressed in integration.response.header.{name}
, a static value enclosed within a pair of single quotes (e.g., 'application/json'
), or a JSON expression from the back-end response payload in the form of integration.response.body.{JSON-expression}
, where JSON-expression
is a valid JSON expression without the $
prefix.)
responseModels (dict) --
Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.
Exceptions
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.TooManyRequestsException
get_model
(**kwargs)¶Describes an existing model defined for a RestApi resource.
See also: AWS API Documentation
Request Syntax
response = client.get_model(
restApiId='string',
modelName='string',
flatten=True|False
)
[REQUIRED]
The RestApi identifier under which the Model exists.
[REQUIRED]
The name of the model as an identifier.
true
) all external model references and returns a flattened model schema or not ( false
) The default is false
.dict
Response Syntax
{
'id': 'string',
'name': 'string',
'description': 'string',
'schema': 'string',
'contentType': 'string'
}
Response Structure
(dict) --
Represents the data structure of a method's request or response payload.
id (string) --
The identifier for the model resource.
name (string) --
The name of the model. Must be an alphanumeric string.
description (string) --
The description of the model.
schema (string) --
The schema for the model. For application/json
models, this should be JSON schema draft 4 model. Do not include "*/" characters in the description of any properties because such "*/" characters may be interpreted as the closing marker for comments in some languages, such as Java or JavaScript, causing the installation of your API's SDK generated by API Gateway to fail.
contentType (string) --
The content-type for the model.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_model_template
(**kwargs)¶Generates a sample mapping template that can be used to transform a payload into the structure of a model.
See also: AWS API Documentation
Request Syntax
response = client.get_model_template(
restApiId='string',
modelName='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The name of the model for which to generate a template.
dict
Response Syntax
{
'value': 'string'
}
Response Structure
(dict) --
Represents a mapping template used to transform a payload.
value (string) --
The Apache Velocity Template Language (VTL) template content used for the template resource.
Exceptions
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.TooManyRequestsException
get_models
(**kwargs)¶Describes existing Models defined for a RestApi resource.
See also: AWS API Documentation
Request Syntax
response = client.get_models(
restApiId='string',
position='string',
limit=123
)
[REQUIRED]
The string identifier of the associated RestApi.
dict
Response Syntax
{
'position': 'string',
'items': [
{
'id': 'string',
'name': 'string',
'description': 'string',
'schema': 'string',
'contentType': 'string'
},
]
}
Response Structure
(dict) --
Represents a collection of Model resources.
position (string) --
items (list) --
The current page of elements from this collection.
(dict) --
Represents the data structure of a method's request or response payload.
id (string) --
The identifier for the model resource.
name (string) --
The name of the model. Must be an alphanumeric string.
description (string) --
The description of the model.
schema (string) --
The schema for the model. For application/json
models, this should be JSON schema draft 4 model. Do not include "*/" characters in the description of any properties because such "*/" characters may be interpreted as the closing marker for comments in some languages, such as Java or JavaScript, causing the installation of your API's SDK generated by API Gateway to fail.
contentType (string) --
The content-type for the model.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.TooManyRequestsException
get_paginator
(operation_name)¶Create a paginator for an operation.
create_foo
, and you'd normally invoke the
operation as client.create_foo(**kwargs)
, if the
create_foo
operation can be paginated, you can use the
call client.get_paginator("create_foo")
.client.can_paginate
method to
check if an operation is pageable.get_request_validator
(**kwargs)¶Gets a RequestValidator of a given RestApi.
See also: AWS API Documentation
Request Syntax
response = client.get_request_validator(
restApiId='string',
requestValidatorId='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The identifier of the RequestValidator to be retrieved.
dict
Response Syntax
{
'id': 'string',
'name': 'string',
'validateRequestBody': True|False,
'validateRequestParameters': True|False
}
Response Structure
(dict) --
A set of validation rules for incoming Method requests.
id (string) --
The identifier of this RequestValidator.
name (string) --
The name of this RequestValidator
validateRequestBody (boolean) --
A Boolean flag to indicate whether to validate a request body according to the configured Model schema.
validateRequestParameters (boolean) --
A Boolean flag to indicate whether to validate request parameters ( true
) or not ( false
).
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_request_validators
(**kwargs)¶Gets the RequestValidators collection of a given RestApi.
See also: AWS API Documentation
Request Syntax
response = client.get_request_validators(
restApiId='string',
position='string',
limit=123
)
[REQUIRED]
The string identifier of the associated RestApi.
dict
Response Syntax
{
'position': 'string',
'items': [
{
'id': 'string',
'name': 'string',
'validateRequestBody': True|False,
'validateRequestParameters': True|False
},
]
}
Response Structure
(dict) --
A collection of RequestValidator resources of a given RestApi.
position (string) --
items (list) --
The current page of elements from this collection.
(dict) --
A set of validation rules for incoming Method requests.
id (string) --
The identifier of this RequestValidator.
name (string) --
The name of this RequestValidator
validateRequestBody (boolean) --
A Boolean flag to indicate whether to validate a request body according to the configured Model schema.
validateRequestParameters (boolean) --
A Boolean flag to indicate whether to validate request parameters ( true
) or not ( false
).
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_resource
(**kwargs)¶Lists information about a resource.
See also: AWS API Documentation
Request Syntax
response = client.get_resource(
restApiId='string',
resourceId='string',
embed=[
'string',
]
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The identifier for the Resource resource.
A query parameter to retrieve the specified resources embedded in the returned Resource representation in the response. This embed
parameter value is a list of comma-separated strings. Currently, the request supports only retrieval of the embedded Method resources this way. The query parameter value must be a single-valued list and contain the "methods"
string. For example, GET /restapis/{restapi_id}/resources/{resource_id}?embed=methods
.
dict
Response Syntax
{
'id': 'string',
'parentId': 'string',
'pathPart': 'string',
'path': 'string',
'resourceMethods': {
'string': {
'httpMethod': 'string',
'authorizationType': 'string',
'authorizerId': 'string',
'apiKeyRequired': True|False,
'requestValidatorId': 'string',
'operationName': 'string',
'requestParameters': {
'string': True|False
},
'requestModels': {
'string': 'string'
},
'methodResponses': {
'string': {
'statusCode': 'string',
'responseParameters': {
'string': True|False
},
'responseModels': {
'string': 'string'
}
}
},
'methodIntegration': {
'type': 'HTTP'|'AWS'|'MOCK'|'HTTP_PROXY'|'AWS_PROXY',
'httpMethod': 'string',
'uri': 'string',
'connectionType': 'INTERNET'|'VPC_LINK',
'connectionId': 'string',
'credentials': 'string',
'requestParameters': {
'string': 'string'
},
'requestTemplates': {
'string': 'string'
},
'passthroughBehavior': 'string',
'contentHandling': 'CONVERT_TO_BINARY'|'CONVERT_TO_TEXT',
'timeoutInMillis': 123,
'cacheNamespace': 'string',
'cacheKeyParameters': [
'string',
],
'integrationResponses': {
'string': {
'statusCode': 'string',
'selectionPattern': 'string',
'responseParameters': {
'string': 'string'
},
'responseTemplates': {
'string': 'string'
},
'contentHandling': 'CONVERT_TO_BINARY'|'CONVERT_TO_TEXT'
}
},
'tlsConfig': {
'insecureSkipVerification': True|False
}
},
'authorizationScopes': [
'string',
]
}
}
}
Response Structure
(dict) --
Represents an API resource.
id (string) --
The resource's identifier.
parentId (string) --
The parent resource's identifier.
pathPart (string) --
The last path segment for this resource.
path (string) --
The full path for this resource.
resourceMethods (dict) --
Gets an API resource's method of a given HTTP verb.
(string) --
(dict) --
Represents a client-facing interface by which the client calls the API to access back-end resources. A Method resource is integrated with an Integration resource. Both consist of a request and one or more responses. The method request takes the client input that is passed to the back end through the integration request. A method response returns the output from the back end to the client through an integration response. A method request is embodied in a Method resource, whereas an integration request is embodied in an Integration resource. On the other hand, a method response is represented by a MethodResponse resource, whereas an integration response is represented by an IntegrationResponse resource.
httpMethod (string) --
The method's HTTP verb.
authorizationType (string) --
The method's authorization type. Valid values are NONE
for open access, AWS_IAM
for using AWS IAM permissions, CUSTOM
for using a custom authorizer, or COGNITO_USER_POOLS
for using a Cognito user pool.
authorizerId (string) --
The identifier of an Authorizer to use on this method. The authorizationType
must be CUSTOM
.
apiKeyRequired (boolean) --
A boolean flag specifying whether a valid ApiKey is required to invoke this method.
requestValidatorId (string) --
The identifier of a RequestValidator for request validation.
operationName (string) --
A human-friendly operation identifier for the method. For example, you can assign the operationName
of ListPets
for the GET /pets
method in the PetStore
example.
requestParameters (dict) --
A key-value map defining required or optional method request parameters that can be accepted by API Gateway. A key is a method request parameter name matching the pattern of method.request.{location}.{name}
, where location
is querystring
, path
, or header
and name
is a valid and unique parameter name. The value associated with the key is a Boolean flag indicating whether the parameter is required ( true
) or optional ( false
). The method request parameter names defined here are available in Integration to be mapped to integration request parameters or templates.
requestModels (dict) --
A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key).
methodResponses (dict) --
Gets a method response associated with a given HTTP status code.
(string) --
(dict) --
Represents a method response of a given HTTP status code returned to the client. The method response is passed from the back end through the associated integration response that can be transformed using a mapping template.
statusCode (string) --
The method response's status code.
responseParameters (dict) --
A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header and the value specifies whether the associated method response header is required or not. The expression of the key must match the pattern method.response.header.{name}
, where name
is a valid and unique header name. API Gateway passes certain integration response data to the method response headers specified here according to the mapping you prescribe in the API's IntegrationResponse. The integration response data that can be mapped include an integration response header expressed in integration.response.header.{name}
, a static value enclosed within a pair of single quotes (e.g., 'application/json'
), or a JSON expression from the back-end response payload in the form of integration.response.body.{JSON-expression}
, where JSON-expression
is a valid JSON expression without the $
prefix.)
responseModels (dict) --
Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.
methodIntegration (dict) --
Gets the method's integration responsible for passing the client-submitted request to the back end and performing necessary transformations to make the request compliant with the back end.
type (string) --
Specifies an API method integration type. The valid value is one of the following:
For the HTTP and HTTP proxy integrations, each integration can specify a protocol ( http/https
), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with a connectionType
of VPC_LINK
is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC.
httpMethod (string) --
Specifies the integration's HTTP method type.
uri (string) --
Specifies Uniform Resource Identifier (URI) of the integration endpoint.
For HTTP
or HTTP_PROXY
integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, where connectionType
is not VPC_LINK
, or private integration, where connectionType
is VPC_LINK
. For a private HTTP integration, the URI is not used for routing. For AWS
or AWS_PROXY
integrations, the URI is of the form arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}
. Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is the name of the integrated Amazon Web Services service (e.g., s3); and {subdomain} is a designated subdomain supported by certain Amazon Web Services service for fast host-name lookup. action can be used for an Amazon Web Services service action-based API, using an Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing {service_api} refers to a supported action {name} plus any required input parameters. Alternatively, path can be used for an AWS service path-based API. The ensuing service_api refers to the path to an Amazon Web Services service resource, including the region of the integrated Amazon Web Services service, if applicable. For example, for integration with the S3 API of GetObject, the uri can be either arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}
or arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}
connectionType (string) --
The type of the network connection to the integration endpoint. The valid value is INTERNET
for connections through the public routable internet or VPC_LINK
for private connections between API Gateway and a network load balancer in a VPC. The default value is INTERNET
.
connectionId (string) --
The ID of the VpcLink used for the integration when connectionType=VPC_LINK
and undefined, otherwise.
credentials (string) --
Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string arn:aws:iam::\*:user/\*
. To use resource-based permissions on supported AWS services, specify null.
requestParameters (dict) --
A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of method.request.{location}.{name}
, where location
is querystring
, path
, or header
and name
must be a valid and unique method request parameter name.
requestTemplates (dict) --
Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.
passthroughBehavior (string) --
Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in requestTemplates
. The valid value is one of the following: WHEN_NO_MATCH
: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. WHEN_NO_TEMPLATES
: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP 415 Unsupported Media Type response. NEVER
: rejects the method request with an HTTP 415 Unsupported Media Type response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.
contentHandling (string) --
Specifies how to handle request payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the passthroughBehavior
is configured to support payload pass-through.
timeoutInMillis (integer) --
Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
cacheNamespace (string) --
Specifies a group of related cached parameters. By default, API Gateway uses the resource ID as the cacheNamespace
. You can specify the same cacheNamespace
across resources to return the same cached data for requests to different resources.
cacheKeyParameters (list) --
A list of request parameters whose values API Gateway caches. To be valid values for cacheKeyParameters
, these parameters must also be specified for Method requestParameters
.
integrationResponses (dict) --
Specifies the integration's responses.
(string) --
(dict) --
Represents an integration response. The status code must map to an existing MethodResponse, and parameters and templates can be used to transform the back-end response.
statusCode (string) --
Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern (string) --
Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the .+
regex to match error response. However, make sure that the error response does not contain any newline ( \n
) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.
responseParameters (dict) --
A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of method.response.header.{name}
, where name
is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header.{name}
or integration.response.body.{JSON-expression}
, where name
is a valid and unique response header name and JSON-expression
is a valid JSON expression without the $
prefix.
responseTemplates (dict) --
Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
contentHandling (string) --
Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
tlsConfig (dict) --
Specifies the TLS configuration for an integration.
insecureSkipVerification (boolean) --
Specifies whether or not API Gateway skips verification that the certificate for an integration endpoint is issued by a supported certificate authority. This isn’t recommended, but it enables you to use certificates that are signed by private certificate authorities, or certificates that are self-signed. If enabled, API Gateway still performs basic certificate validation, which includes checking the certificate's expiration date, hostname, and presence of a root certificate authority. Supported only for HTTP
and HTTP_PROXY
integrations.
Warning
Enabling insecureSkipVerification
isn't recommended, especially for integrations with public HTTPS endpoints. If you enable insecureSkipVerification
, you increase the risk of man-in-the-middle attacks.
authorizationScopes (list) --
A list of authorization scopes configured on the method. The scopes are used with a COGNITO_USER_POOLS
authorizer to authorize the method invocation. The authorization works by matching the method scopes against the scopes parsed from the access token in the incoming request. The method invocation is authorized if any method scopes matches a claimed scope in the access token. Otherwise, the invocation is not authorized. When the method scope is configured, the client must provide an access token instead of an identity token for authorization purposes.
Exceptions
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.TooManyRequestsException
get_resources
(**kwargs)¶Lists information about a collection of Resource resources.
See also: AWS API Documentation
Request Syntax
response = client.get_resources(
restApiId='string',
position='string',
limit=123,
embed=[
'string',
]
)
[REQUIRED]
The string identifier of the associated RestApi.
A query parameter used to retrieve the specified resources embedded in the returned Resources resource in the response. This embed
parameter value is a list of comma-separated strings. Currently, the request supports only retrieval of the embedded Method resources this way. The query parameter value must be a single-valued list and contain the "methods"
string. For example, GET /restapis/{restapi_id}/resources?embed=methods
.
dict
Response Syntax
{
'position': 'string',
'items': [
{
'id': 'string',
'parentId': 'string',
'pathPart': 'string',
'path': 'string',
'resourceMethods': {
'string': {
'httpMethod': 'string',
'authorizationType': 'string',
'authorizerId': 'string',
'apiKeyRequired': True|False,
'requestValidatorId': 'string',
'operationName': 'string',
'requestParameters': {
'string': True|False
},
'requestModels': {
'string': 'string'
},
'methodResponses': {
'string': {
'statusCode': 'string',
'responseParameters': {
'string': True|False
},
'responseModels': {
'string': 'string'
}
}
},
'methodIntegration': {
'type': 'HTTP'|'AWS'|'MOCK'|'HTTP_PROXY'|'AWS_PROXY',
'httpMethod': 'string',
'uri': 'string',
'connectionType': 'INTERNET'|'VPC_LINK',
'connectionId': 'string',
'credentials': 'string',
'requestParameters': {
'string': 'string'
},
'requestTemplates': {
'string': 'string'
},
'passthroughBehavior': 'string',
'contentHandling': 'CONVERT_TO_BINARY'|'CONVERT_TO_TEXT',
'timeoutInMillis': 123,
'cacheNamespace': 'string',
'cacheKeyParameters': [
'string',
],
'integrationResponses': {
'string': {
'statusCode': 'string',
'selectionPattern': 'string',
'responseParameters': {
'string': 'string'
},
'responseTemplates': {
'string': 'string'
},
'contentHandling': 'CONVERT_TO_BINARY'|'CONVERT_TO_TEXT'
}
},
'tlsConfig': {
'insecureSkipVerification': True|False
}
},
'authorizationScopes': [
'string',
]
}
}
},
]
}
Response Structure
(dict) --
Represents a collection of Resource resources.
position (string) --
items (list) --
The current page of elements from this collection.
(dict) --
Represents an API resource.
id (string) --
The resource's identifier.
parentId (string) --
The parent resource's identifier.
pathPart (string) --
The last path segment for this resource.
path (string) --
The full path for this resource.
resourceMethods (dict) --
Gets an API resource's method of a given HTTP verb.
(string) --
(dict) --
Represents a client-facing interface by which the client calls the API to access back-end resources. A Method resource is integrated with an Integration resource. Both consist of a request and one or more responses. The method request takes the client input that is passed to the back end through the integration request. A method response returns the output from the back end to the client through an integration response. A method request is embodied in a Method resource, whereas an integration request is embodied in an Integration resource. On the other hand, a method response is represented by a MethodResponse resource, whereas an integration response is represented by an IntegrationResponse resource.
httpMethod (string) --
The method's HTTP verb.
authorizationType (string) --
The method's authorization type. Valid values are NONE
for open access, AWS_IAM
for using AWS IAM permissions, CUSTOM
for using a custom authorizer, or COGNITO_USER_POOLS
for using a Cognito user pool.
authorizerId (string) --
The identifier of an Authorizer to use on this method. The authorizationType
must be CUSTOM
.
apiKeyRequired (boolean) --
A boolean flag specifying whether a valid ApiKey is required to invoke this method.
requestValidatorId (string) --
The identifier of a RequestValidator for request validation.
operationName (string) --
A human-friendly operation identifier for the method. For example, you can assign the operationName
of ListPets
for the GET /pets
method in the PetStore
example.
requestParameters (dict) --
A key-value map defining required or optional method request parameters that can be accepted by API Gateway. A key is a method request parameter name matching the pattern of method.request.{location}.{name}
, where location
is querystring
, path
, or header
and name
is a valid and unique parameter name. The value associated with the key is a Boolean flag indicating whether the parameter is required ( true
) or optional ( false
). The method request parameter names defined here are available in Integration to be mapped to integration request parameters or templates.
requestModels (dict) --
A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key).
methodResponses (dict) --
Gets a method response associated with a given HTTP status code.
(string) --
(dict) --
Represents a method response of a given HTTP status code returned to the client. The method response is passed from the back end through the associated integration response that can be transformed using a mapping template.
statusCode (string) --
The method response's status code.
responseParameters (dict) --
A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header and the value specifies whether the associated method response header is required or not. The expression of the key must match the pattern method.response.header.{name}
, where name
is a valid and unique header name. API Gateway passes certain integration response data to the method response headers specified here according to the mapping you prescribe in the API's IntegrationResponse. The integration response data that can be mapped include an integration response header expressed in integration.response.header.{name}
, a static value enclosed within a pair of single quotes (e.g., 'application/json'
), or a JSON expression from the back-end response payload in the form of integration.response.body.{JSON-expression}
, where JSON-expression
is a valid JSON expression without the $
prefix.)
responseModels (dict) --
Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.
methodIntegration (dict) --
Gets the method's integration responsible for passing the client-submitted request to the back end and performing necessary transformations to make the request compliant with the back end.
type (string) --
Specifies an API method integration type. The valid value is one of the following:
For the HTTP and HTTP proxy integrations, each integration can specify a protocol ( http/https
), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with a connectionType
of VPC_LINK
is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC.
httpMethod (string) --
Specifies the integration's HTTP method type.
uri (string) --
Specifies Uniform Resource Identifier (URI) of the integration endpoint.
For HTTP
or HTTP_PROXY
integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, where connectionType
is not VPC_LINK
, or private integration, where connectionType
is VPC_LINK
. For a private HTTP integration, the URI is not used for routing. For AWS
or AWS_PROXY
integrations, the URI is of the form arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}
. Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is the name of the integrated Amazon Web Services service (e.g., s3); and {subdomain} is a designated subdomain supported by certain Amazon Web Services service for fast host-name lookup. action can be used for an Amazon Web Services service action-based API, using an Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing {service_api} refers to a supported action {name} plus any required input parameters. Alternatively, path can be used for an AWS service path-based API. The ensuing service_api refers to the path to an Amazon Web Services service resource, including the region of the integrated Amazon Web Services service, if applicable. For example, for integration with the S3 API of GetObject, the uri can be either arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}
or arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}
connectionType (string) --
The type of the network connection to the integration endpoint. The valid value is INTERNET
for connections through the public routable internet or VPC_LINK
for private connections between API Gateway and a network load balancer in a VPC. The default value is INTERNET
.
connectionId (string) --
The ID of the VpcLink used for the integration when connectionType=VPC_LINK
and undefined, otherwise.
credentials (string) --
Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string arn:aws:iam::\*:user/\*
. To use resource-based permissions on supported AWS services, specify null.
requestParameters (dict) --
A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of method.request.{location}.{name}
, where location
is querystring
, path
, or header
and name
must be a valid and unique method request parameter name.
requestTemplates (dict) --
Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.
passthroughBehavior (string) --
Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in requestTemplates
. The valid value is one of the following: WHEN_NO_MATCH
: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. WHEN_NO_TEMPLATES
: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP 415 Unsupported Media Type response. NEVER
: rejects the method request with an HTTP 415 Unsupported Media Type response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.
contentHandling (string) --
Specifies how to handle request payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the passthroughBehavior
is configured to support payload pass-through.
timeoutInMillis (integer) --
Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
cacheNamespace (string) --
Specifies a group of related cached parameters. By default, API Gateway uses the resource ID as the cacheNamespace
. You can specify the same cacheNamespace
across resources to return the same cached data for requests to different resources.
cacheKeyParameters (list) --
A list of request parameters whose values API Gateway caches. To be valid values for cacheKeyParameters
, these parameters must also be specified for Method requestParameters
.
integrationResponses (dict) --
Specifies the integration's responses.
(string) --
(dict) --
Represents an integration response. The status code must map to an existing MethodResponse, and parameters and templates can be used to transform the back-end response.
statusCode (string) --
Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern (string) --
Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the .+
regex to match error response. However, make sure that the error response does not contain any newline ( \n
) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.
responseParameters (dict) --
A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of method.response.header.{name}
, where name
is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header.{name}
or integration.response.body.{JSON-expression}
, where name
is a valid and unique response header name and JSON-expression
is a valid JSON expression without the $
prefix.
responseTemplates (dict) --
Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
contentHandling (string) --
Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
tlsConfig (dict) --
Specifies the TLS configuration for an integration.
insecureSkipVerification (boolean) --
Specifies whether or not API Gateway skips verification that the certificate for an integration endpoint is issued by a supported certificate authority. This isn’t recommended, but it enables you to use certificates that are signed by private certificate authorities, or certificates that are self-signed. If enabled, API Gateway still performs basic certificate validation, which includes checking the certificate's expiration date, hostname, and presence of a root certificate authority. Supported only for HTTP
and HTTP_PROXY
integrations.
Warning
Enabling insecureSkipVerification
isn't recommended, especially for integrations with public HTTPS endpoints. If you enable insecureSkipVerification
, you increase the risk of man-in-the-middle attacks.
authorizationScopes (list) --
A list of authorization scopes configured on the method. The scopes are used with a COGNITO_USER_POOLS
authorizer to authorize the method invocation. The authorization works by matching the method scopes against the scopes parsed from the access token in the incoming request. The method invocation is authorized if any method scopes matches a claimed scope in the access token. Otherwise, the invocation is not authorized. When the method scope is configured, the client must provide an access token instead of an identity token for authorization purposes.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.TooManyRequestsException
get_rest_api
(**kwargs)¶Lists the RestApi resource in the collection.
See also: AWS API Documentation
Request Syntax
response = client.get_rest_api(
restApiId='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
{
'id': 'string',
'name': 'string',
'description': 'string',
'createdDate': datetime(2015, 1, 1),
'version': 'string',
'warnings': [
'string',
],
'binaryMediaTypes': [
'string',
],
'minimumCompressionSize': 123,
'apiKeySource': 'HEADER'|'AUTHORIZER',
'endpointConfiguration': {
'types': [
'REGIONAL'|'EDGE'|'PRIVATE',
],
'vpcEndpointIds': [
'string',
]
},
'policy': 'string',
'tags': {
'string': 'string'
},
'disableExecuteApiEndpoint': True|False
}
Response Structure
Represents a REST API.
The API's identifier. This identifier is unique across all of your APIs in API Gateway.
The API's name.
The API's description.
The timestamp when the API was created.
A version identifier for the API.
The warning messages reported when failonwarnings
is turned on during API import.
The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
The source of the API key for metering requests according to a usage plan. Valid values are: > HEADER
to read the API key from the X-API-Key
header of a request. AUTHORIZER
to read the API key from the UsageIdentifierKey
from a custom authorizer.
The endpoint configuration of this RestApi showing the endpoint types of the API.
A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is "EDGE"
. For a regional API and its custom domain name, the endpoint type is REGIONAL
. For a private API, the endpoint type is PRIVATE
.
The endpoint type. The valid values are EDGE
for edge-optimized API setup, most suitable for mobile applications; REGIONAL
for regional API endpoint setup, most suitable for calling from AWS Region; and PRIVATE
for private APIs.
A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for PRIVATE
endpoint type.
A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.
The collection of tags. Each tag element is associated with a given resource.
Specifies whether clients can invoke your API by using the default execute-api
endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com
endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_rest_apis
(**kwargs)¶Lists the RestApis resources for your collection.
See also: AWS API Documentation
Request Syntax
response = client.get_rest_apis(
position='string',
limit=123
)
dict
Response Syntax
{
'position': 'string',
'items': [
{
'id': 'string',
'name': 'string',
'description': 'string',
'createdDate': datetime(2015, 1, 1),
'version': 'string',
'warnings': [
'string',
],
'binaryMediaTypes': [
'string',
],
'minimumCompressionSize': 123,
'apiKeySource': 'HEADER'|'AUTHORIZER',
'endpointConfiguration': {
'types': [
'REGIONAL'|'EDGE'|'PRIVATE',
],
'vpcEndpointIds': [
'string',
]
},
'policy': 'string',
'tags': {
'string': 'string'
},
'disableExecuteApiEndpoint': True|False
},
]
}
Response Structure
(dict) --
Contains references to your APIs and links that guide you in how to interact with your collection. A collection offers a paginated view of your APIs.
position (string) --
items (list) --
The current page of elements from this collection.
(dict) --
Represents a REST API.
id (string) --
The API's identifier. This identifier is unique across all of your APIs in API Gateway.
name (string) --
The API's name.
description (string) --
The API's description.
createdDate (datetime) --
The timestamp when the API was created.
version (string) --
A version identifier for the API.
warnings (list) --
The warning messages reported when failonwarnings
is turned on during API import.
binaryMediaTypes (list) --
The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
minimumCompressionSize (integer) --
A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
apiKeySource (string) --
The source of the API key for metering requests according to a usage plan. Valid values are: > HEADER
to read the API key from the X-API-Key
header of a request. AUTHORIZER
to read the API key from the UsageIdentifierKey
from a custom authorizer.
endpointConfiguration (dict) --
The endpoint configuration of this RestApi showing the endpoint types of the API.
types (list) --
A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is "EDGE"
. For a regional API and its custom domain name, the endpoint type is REGIONAL
. For a private API, the endpoint type is PRIVATE
.
(string) --
The endpoint type. The valid values are EDGE
for edge-optimized API setup, most suitable for mobile applications; REGIONAL
for regional API endpoint setup, most suitable for calling from AWS Region; and PRIVATE
for private APIs.
vpcEndpointIds (list) --
A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for PRIVATE
endpoint type.
policy (string) --
A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
disableExecuteApiEndpoint (boolean) --
Specifies whether clients can invoke your API by using the default execute-api
endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com
endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_sdk
(**kwargs)¶Generates a client SDK for a RestApi and Stage.
See also: AWS API Documentation
Request Syntax
response = client.get_sdk(
restApiId='string',
stageName='string',
sdkType='string',
parameters={
'string': 'string'
}
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The name of the Stage that the SDK will use.
[REQUIRED]
The language for the generated SDK. Currently java
, javascript
, android
, objectivec
(for iOS), swift
(for iOS), and ruby
are supported.
A string-to-string key-value map of query parameters sdkType
-dependent properties of the SDK. For sdkType
of objectivec
or swift
, a parameter named classPrefix
is required. For sdkType
of android
, parameters named groupId
, artifactId
, artifactVersion
, and invokerPackage
are required. For sdkType
of java
, parameters named serviceName
and javaPackageName
are required.
dict
Response Syntax
{
'contentType': 'string',
'contentDisposition': 'string',
'body': StreamingBody()
}
Response Structure
(dict) --
The binary blob response to GetSdk, which contains the generated SDK.
contentType (string) --
The content-type header value in the HTTP response.
contentDisposition (string) --
The content-disposition header value in the HTTP response.
body (StreamingBody
) --
The binary blob response to GetSdk, which contains the generated SDK.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_sdk_type
(**kwargs)¶Gets an SDK type.
See also: AWS API Documentation
Request Syntax
response = client.get_sdk_type(
id='string'
)
[REQUIRED]
The identifier of the queried SdkType instance.
{
'id': 'string',
'friendlyName': 'string',
'description': 'string',
'configurationProperties': [
{
'name': 'string',
'friendlyName': 'string',
'description': 'string',
'required': True|False,
'defaultValue': 'string'
},
]
}
Response Structure
A type of SDK that API Gateway can generate.
The identifier of an SdkType instance.
The user-friendly name of an SdkType instance.
The description of an SdkType.
A list of configuration properties of an SdkType.
A configuration property of an SDK type.
The name of a an SdkType configuration property.
The user-friendly name of an SdkType configuration property.
The description of an SdkType configuration property.
A boolean flag of an SdkType configuration property to indicate if the associated SDK configuration property is required ( true
) or not ( false
).
The default value of an SdkType configuration property.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_sdk_types
(**kwargs)¶Gets SDK types
See also: AWS API Documentation
Request Syntax
response = client.get_sdk_types(
position='string',
limit=123
)
dict
Response Syntax
{
'position': 'string',
'items': [
{
'id': 'string',
'friendlyName': 'string',
'description': 'string',
'configurationProperties': [
{
'name': 'string',
'friendlyName': 'string',
'description': 'string',
'required': True|False,
'defaultValue': 'string'
},
]
},
]
}
Response Structure
(dict) --
The collection of SdkType instances.
position (string) --
items (list) --
The current page of elements from this collection.
(dict) --
A type of SDK that API Gateway can generate.
id (string) --
The identifier of an SdkType instance.
friendlyName (string) --
The user-friendly name of an SdkType instance.
description (string) --
The description of an SdkType.
configurationProperties (list) --
A list of configuration properties of an SdkType.
(dict) --
A configuration property of an SDK type.
name (string) --
The name of a an SdkType configuration property.
friendlyName (string) --
The user-friendly name of an SdkType configuration property.
description (string) --
The description of an SdkType configuration property.
required (boolean) --
A boolean flag of an SdkType configuration property to indicate if the associated SDK configuration property is required ( true
) or not ( false
).
defaultValue (string) --
The default value of an SdkType configuration property.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_stage
(**kwargs)¶Gets information about a Stage resource.
See also: AWS API Documentation
Request Syntax
response = client.get_stage(
restApiId='string',
stageName='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The name of the Stage resource to get information about.
dict
Response Syntax
{
'deploymentId': 'string',
'clientCertificateId': 'string',
'stageName': 'string',
'description': 'string',
'cacheClusterEnabled': True|False,
'cacheClusterSize': '0.5'|'1.6'|'6.1'|'13.5'|'28.4'|'58.2'|'118'|'237',
'cacheClusterStatus': 'CREATE_IN_PROGRESS'|'AVAILABLE'|'DELETE_IN_PROGRESS'|'NOT_AVAILABLE'|'FLUSH_IN_PROGRESS',
'methodSettings': {
'string': {
'metricsEnabled': True|False,
'loggingLevel': 'string',
'dataTraceEnabled': True|False,
'throttlingBurstLimit': 123,
'throttlingRateLimit': 123.0,
'cachingEnabled': True|False,
'cacheTtlInSeconds': 123,
'cacheDataEncrypted': True|False,
'requireAuthorizationForCacheControl': True|False,
'unauthorizedCacheControlHeaderStrategy': 'FAIL_WITH_403'|'SUCCEED_WITH_RESPONSE_HEADER'|'SUCCEED_WITHOUT_RESPONSE_HEADER'
}
},
'variables': {
'string': 'string'
},
'documentationVersion': 'string',
'accessLogSettings': {
'format': 'string',
'destinationArn': 'string'
},
'canarySettings': {
'percentTraffic': 123.0,
'deploymentId': 'string',
'stageVariableOverrides': {
'string': 'string'
},
'useStageCache': True|False
},
'tracingEnabled': True|False,
'webAclArn': 'string',
'tags': {
'string': 'string'
},
'createdDate': datetime(2015, 1, 1),
'lastUpdatedDate': datetime(2015, 1, 1)
}
Response Structure
(dict) --
Represents a unique identifier for a version of a deployed RestApi that is callable by users.
deploymentId (string) --
The identifier of the Deployment that the stage points to.
clientCertificateId (string) --
The identifier of a client certificate for an API stage.
stageName (string) --
The name of the stage is the first path segment in the Uniform Resource Identifier (URI) of a call to API Gateway. Stage names can only contain alphanumeric characters, hyphens, and underscores. Maximum length is 128 characters.
description (string) --
The stage's description.
cacheClusterEnabled (boolean) --
Specifies whether a cache cluster is enabled for the stage.
cacheClusterSize (string) --
The size of the cache cluster for the stage, if enabled.
cacheClusterStatus (string) --
The status of the cache cluster for the stage, if enabled.
methodSettings (dict) --
A map that defines the method settings for a Stage resource. Keys (designated as /{method_setting_key
below) are method paths defined as {resource_path}/{http_method}
for an individual method override, or /\*/\*
for overriding all methods in the stage.
(string) --
(dict) --
Specifies the method setting properties.
metricsEnabled (boolean) --
Specifies whether Amazon CloudWatch metrics are enabled for this method. The PATCH path for this setting is /{method_setting_key}/metrics/enabled
, and the value is a Boolean.
loggingLevel (string) --
Specifies the logging level for this method, which affects the log entries pushed to Amazon CloudWatch Logs. The PATCH path for this setting is /{method_setting_key}/logging/loglevel
, and the available levels are OFF
, ERROR
, and INFO
. Choose ERROR
to write only error-level entries to CloudWatch Logs, or choose INFO
to include all ERROR
events as well as extra informational events.
dataTraceEnabled (boolean) --
Specifies whether data trace logging is enabled for this method, which affects the log entries pushed to Amazon CloudWatch Logs. The PATCH path for this setting is /{method_setting_key}/logging/dataTrace
, and the value is a Boolean.
throttlingBurstLimit (integer) --
Specifies the throttling burst limit. The PATCH path for this setting is /{method_setting_key}/throttling/burstLimit
, and the value is an integer.
throttlingRateLimit (float) --
Specifies the throttling rate limit. The PATCH path for this setting is /{method_setting_key}/throttling/rateLimit
, and the value is a double.
cachingEnabled (boolean) --
Specifies whether responses should be cached and returned for requests. A cache cluster must be enabled on the stage for responses to be cached. The PATCH path for this setting is /{method_setting_key}/caching/enabled
, and the value is a Boolean.
cacheTtlInSeconds (integer) --
Specifies the time to live (TTL), in seconds, for cached responses. The higher the TTL, the longer the response will be cached. The PATCH path for this setting is /{method_setting_key}/caching/ttlInSeconds
, and the value is an integer.
cacheDataEncrypted (boolean) --
Specifies whether the cached responses are encrypted. The PATCH path for this setting is /{method_setting_key}/caching/dataEncrypted
, and the value is a Boolean.
requireAuthorizationForCacheControl (boolean) --
Specifies whether authorization is required for a cache invalidation request. The PATCH path for this setting is /{method_setting_key}/caching/requireAuthorizationForCacheControl
, and the value is a Boolean.
unauthorizedCacheControlHeaderStrategy (string) --
Specifies how to handle unauthorized requests for cache invalidation. The PATCH path for this setting is /{method_setting_key}/caching/unauthorizedCacheControlHeaderStrategy
, and the available values are FAIL_WITH_403
, SUCCEED_WITH_RESPONSE_HEADER
, SUCCEED_WITHOUT_RESPONSE_HEADER
.
variables (dict) --
A map that defines the stage variables for a Stage resource. Variable names can have alphanumeric and underscore characters, and the values must match [A-Za-z0-9-._~:/?#&=,]+
.
documentationVersion (string) --
The version of the associated API documentation.
accessLogSettings (dict) --
Settings for logging access in this stage.
format (string) --
A single line format of the access logs of data, as specified by selected $context variables. The format must include at least $context.requestId
.
destinationArn (string) --
The Amazon Resource Name (ARN) of the CloudWatch Logs log group or Kinesis Data Firehose delivery stream to receive access logs. If you specify a Kinesis Data Firehose delivery stream, the stream name must begin with amazon-apigateway-
.
canarySettings (dict) --
Settings for the canary deployment in this stage.
percentTraffic (float) --
The percent (0-100) of traffic diverted to a canary deployment.
deploymentId (string) --
The ID of the canary deployment.
stageVariableOverrides (dict) --
Stage variables overridden for a canary release deployment, including new stage variables introduced in the canary. These stage variables are represented as a string-to-string map between stage variable names and their values.
useStageCache (boolean) --
A Boolean flag to indicate whether the canary deployment uses the stage cache or not.
tracingEnabled (boolean) --
Specifies whether active tracing with X-ray is enabled for the Stage.
webAclArn (string) --
The ARN of the WebAcl associated with the Stage.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
createdDate (datetime) --
The timestamp when the stage was created.
lastUpdatedDate (datetime) --
The timestamp when the stage last updated.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_stages
(**kwargs)¶Gets information about one or more Stage resources.
See also: AWS API Documentation
Request Syntax
response = client.get_stages(
restApiId='string',
deploymentId='string'
)
[REQUIRED]
The string identifier of the associated RestApi.
dict
Response Syntax
{
'item': [
{
'deploymentId': 'string',
'clientCertificateId': 'string',
'stageName': 'string',
'description': 'string',
'cacheClusterEnabled': True|False,
'cacheClusterSize': '0.5'|'1.6'|'6.1'|'13.5'|'28.4'|'58.2'|'118'|'237',
'cacheClusterStatus': 'CREATE_IN_PROGRESS'|'AVAILABLE'|'DELETE_IN_PROGRESS'|'NOT_AVAILABLE'|'FLUSH_IN_PROGRESS',
'methodSettings': {
'string': {
'metricsEnabled': True|False,
'loggingLevel': 'string',
'dataTraceEnabled': True|False,
'throttlingBurstLimit': 123,
'throttlingRateLimit': 123.0,
'cachingEnabled': True|False,
'cacheTtlInSeconds': 123,
'cacheDataEncrypted': True|False,
'requireAuthorizationForCacheControl': True|False,
'unauthorizedCacheControlHeaderStrategy': 'FAIL_WITH_403'|'SUCCEED_WITH_RESPONSE_HEADER'|'SUCCEED_WITHOUT_RESPONSE_HEADER'
}
},
'variables': {
'string': 'string'
},
'documentationVersion': 'string',
'accessLogSettings': {
'format': 'string',
'destinationArn': 'string'
},
'canarySettings': {
'percentTraffic': 123.0,
'deploymentId': 'string',
'stageVariableOverrides': {
'string': 'string'
},
'useStageCache': True|False
},
'tracingEnabled': True|False,
'webAclArn': 'string',
'tags': {
'string': 'string'
},
'createdDate': datetime(2015, 1, 1),
'lastUpdatedDate': datetime(2015, 1, 1)
},
]
}
Response Structure
(dict) --
A list of Stage resources that are associated with the ApiKey resource.
item (list) --
The current page of elements from this collection.
(dict) --
Represents a unique identifier for a version of a deployed RestApi that is callable by users.
deploymentId (string) --
The identifier of the Deployment that the stage points to.
clientCertificateId (string) --
The identifier of a client certificate for an API stage.
stageName (string) --
The name of the stage is the first path segment in the Uniform Resource Identifier (URI) of a call to API Gateway. Stage names can only contain alphanumeric characters, hyphens, and underscores. Maximum length is 128 characters.
description (string) --
The stage's description.
cacheClusterEnabled (boolean) --
Specifies whether a cache cluster is enabled for the stage.
cacheClusterSize (string) --
The size of the cache cluster for the stage, if enabled.
cacheClusterStatus (string) --
The status of the cache cluster for the stage, if enabled.
methodSettings (dict) --
A map that defines the method settings for a Stage resource. Keys (designated as /{method_setting_key
below) are method paths defined as {resource_path}/{http_method}
for an individual method override, or /\*/\*
for overriding all methods in the stage.
(string) --
(dict) --
Specifies the method setting properties.
metricsEnabled (boolean) --
Specifies whether Amazon CloudWatch metrics are enabled for this method. The PATCH path for this setting is /{method_setting_key}/metrics/enabled
, and the value is a Boolean.
loggingLevel (string) --
Specifies the logging level for this method, which affects the log entries pushed to Amazon CloudWatch Logs. The PATCH path for this setting is /{method_setting_key}/logging/loglevel
, and the available levels are OFF
, ERROR
, and INFO
. Choose ERROR
to write only error-level entries to CloudWatch Logs, or choose INFO
to include all ERROR
events as well as extra informational events.
dataTraceEnabled (boolean) --
Specifies whether data trace logging is enabled for this method, which affects the log entries pushed to Amazon CloudWatch Logs. The PATCH path for this setting is /{method_setting_key}/logging/dataTrace
, and the value is a Boolean.
throttlingBurstLimit (integer) --
Specifies the throttling burst limit. The PATCH path for this setting is /{method_setting_key}/throttling/burstLimit
, and the value is an integer.
throttlingRateLimit (float) --
Specifies the throttling rate limit. The PATCH path for this setting is /{method_setting_key}/throttling/rateLimit
, and the value is a double.
cachingEnabled (boolean) --
Specifies whether responses should be cached and returned for requests. A cache cluster must be enabled on the stage for responses to be cached. The PATCH path for this setting is /{method_setting_key}/caching/enabled
, and the value is a Boolean.
cacheTtlInSeconds (integer) --
Specifies the time to live (TTL), in seconds, for cached responses. The higher the TTL, the longer the response will be cached. The PATCH path for this setting is /{method_setting_key}/caching/ttlInSeconds
, and the value is an integer.
cacheDataEncrypted (boolean) --
Specifies whether the cached responses are encrypted. The PATCH path for this setting is /{method_setting_key}/caching/dataEncrypted
, and the value is a Boolean.
requireAuthorizationForCacheControl (boolean) --
Specifies whether authorization is required for a cache invalidation request. The PATCH path for this setting is /{method_setting_key}/caching/requireAuthorizationForCacheControl
, and the value is a Boolean.
unauthorizedCacheControlHeaderStrategy (string) --
Specifies how to handle unauthorized requests for cache invalidation. The PATCH path for this setting is /{method_setting_key}/caching/unauthorizedCacheControlHeaderStrategy
, and the available values are FAIL_WITH_403
, SUCCEED_WITH_RESPONSE_HEADER
, SUCCEED_WITHOUT_RESPONSE_HEADER
.
variables (dict) --
A map that defines the stage variables for a Stage resource. Variable names can have alphanumeric and underscore characters, and the values must match [A-Za-z0-9-._~:/?#&=,]+
.
documentationVersion (string) --
The version of the associated API documentation.
accessLogSettings (dict) --
Settings for logging access in this stage.
format (string) --
A single line format of the access logs of data, as specified by selected $context variables. The format must include at least $context.requestId
.
destinationArn (string) --
The Amazon Resource Name (ARN) of the CloudWatch Logs log group or Kinesis Data Firehose delivery stream to receive access logs. If you specify a Kinesis Data Firehose delivery stream, the stream name must begin with amazon-apigateway-
.
canarySettings (dict) --
Settings for the canary deployment in this stage.
percentTraffic (float) --
The percent (0-100) of traffic diverted to a canary deployment.
deploymentId (string) --
The ID of the canary deployment.
stageVariableOverrides (dict) --
Stage variables overridden for a canary release deployment, including new stage variables introduced in the canary. These stage variables are represented as a string-to-string map between stage variable names and their values.
useStageCache (boolean) --
A Boolean flag to indicate whether the canary deployment uses the stage cache or not.
tracingEnabled (boolean) --
Specifies whether active tracing with X-ray is enabled for the Stage.
webAclArn (string) --
The ARN of the WebAcl associated with the Stage.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
createdDate (datetime) --
The timestamp when the stage was created.
lastUpdatedDate (datetime) --
The timestamp when the stage last updated.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
Gets the Tags collection for a given resource.
See also: AWS API Documentation
Request Syntax
response = client.get_tags(
resourceArn='string',
position='string',
limit=123
)
[REQUIRED]
The ARN of a resource that can be tagged.
dict
Response Syntax
{
'tags': {
'string': 'string'
}
}
Response Structure
(dict) --
The collection of tags. Each tag element is associated with a given resource.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_usage
(**kwargs)¶Gets the usage data of a usage plan in a specified time interval.
See also: AWS API Documentation
Request Syntax
response = client.get_usage(
usagePlanId='string',
keyId='string',
startDate='string',
endDate='string',
position='string',
limit=123
)
[REQUIRED]
The Id of the usage plan associated with the usage data.
[REQUIRED]
The starting date (e.g., 2016-01-01) of the usage data.
[REQUIRED]
The ending date (e.g., 2016-12-31) of the usage data.
dict
Response Syntax
{
'usagePlanId': 'string',
'startDate': 'string',
'endDate': 'string',
'position': 'string',
'items': {
'string': [
[
123,
],
]
}
}
Response Structure
(dict) --
Represents the usage data of a usage plan.
usagePlanId (string) --
The plan Id associated with this usage data.
startDate (string) --
The starting date of the usage data.
endDate (string) --
The ending date of the usage data.
position (string) --
items (dict) --
The usage data, as daily logs of used and remaining quotas, over the specified time interval indexed over the API keys in a usage plan. For example, {..., "values" : { "{api_key}" : [ [0, 100], [10, 90], [100, 10]]}
, where {api_key}
stands for an API key value and the daily log entry is of the format [used quota, remaining quota]
.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.TooManyRequestsException
get_usage_plan
(**kwargs)¶Gets a usage plan of a given plan identifier.
See also: AWS API Documentation
Request Syntax
response = client.get_usage_plan(
usagePlanId='string'
)
[REQUIRED]
The identifier of the UsagePlan resource to be retrieved.
{
'id': 'string',
'name': 'string',
'description': 'string',
'apiStages': [
{
'apiId': 'string',
'stage': 'string',
'throttle': {
'string': {
'burstLimit': 123,
'rateLimit': 123.0
}
}
},
],
'throttle': {
'burstLimit': 123,
'rateLimit': 123.0
},
'quota': {
'limit': 123,
'offset': 123,
'period': 'DAY'|'WEEK'|'MONTH'
},
'productCode': 'string',
'tags': {
'string': 'string'
}
}
Response Structure
Represents a usage plan used to specify who can assess associated API stages. Optionally, target request rate and quota limits can be set. In some cases clients can exceed the targets that you set. Don’t rely on usage plans to control costs. Consider using Amazon Web Services Budgets to monitor costs and WAF to manage API requests.
The identifier of a UsagePlan resource.
The name of a usage plan.
The description of a usage plan.
The associated API stages of a usage plan.
API stage name of the associated API stage in a usage plan.
API Id of the associated API stage in a usage plan.
API stage name of the associated API stage in a usage plan.
Map containing method level throttling information for API stage in a usage plan.
The API request rate limits.
The API target request burst rate limit. This allows more requests through for a period of time than the target rate limit.
The API target request rate limit.
A map containing method level throttling information for API stage in a usage plan.
The API target request burst rate limit. This allows more requests through for a period of time than the target rate limit.
The API target request rate limit.
The target maximum number of permitted requests per a given unit time interval.
The target maximum number of requests that can be made in a given time period.
The number of requests subtracted from the given limit in the initial time period.
The time period in which the limit applies. Valid values are "DAY", "WEEK" or "MONTH".
The AWS Markeplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
The collection of tags. Each tag element is associated with a given resource.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_usage_plan_key
(**kwargs)¶Gets a usage plan key of a given key identifier.
See also: AWS API Documentation
Request Syntax
response = client.get_usage_plan_key(
usagePlanId='string',
keyId='string'
)
[REQUIRED]
The Id of the UsagePlan resource representing the usage plan containing the to-be-retrieved UsagePlanKey resource representing a plan customer.
[REQUIRED]
The key Id of the to-be-retrieved UsagePlanKey resource representing a plan customer.
dict
Response Syntax
{
'id': 'string',
'type': 'string',
'value': 'string',
'name': 'string'
}
Response Structure
(dict) --
Represents a usage plan key to identify a plan customer.
id (string) --
The Id of a usage plan key.
type (string) --
The type of a usage plan key. Currently, the valid key type is API_KEY
.
value (string) --
The value of a usage plan key.
name (string) --
The name of a usage plan key.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_usage_plan_keys
(**kwargs)¶Gets all the usage plan keys representing the API keys added to a specified usage plan.
See also: AWS API Documentation
Request Syntax
response = client.get_usage_plan_keys(
usagePlanId='string',
position='string',
limit=123,
nameQuery='string'
)
[REQUIRED]
The Id of the UsagePlan resource representing the usage plan containing the to-be-retrieved UsagePlanKey resource representing a plan customer.
dict
Response Syntax
{
'position': 'string',
'items': [
{
'id': 'string',
'type': 'string',
'value': 'string',
'name': 'string'
},
]
}
Response Structure
(dict) --
Represents the collection of usage plan keys added to usage plans for the associated API keys and, possibly, other types of keys.
position (string) --
items (list) --
The current page of elements from this collection.
(dict) --
Represents a usage plan key to identify a plan customer.
id (string) --
The Id of a usage plan key.
type (string) --
The type of a usage plan key. Currently, the valid key type is API_KEY
.
value (string) --
The value of a usage plan key.
name (string) --
The name of a usage plan key.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_usage_plans
(**kwargs)¶Gets all the usage plans of the caller's account.
See also: AWS API Documentation
Request Syntax
response = client.get_usage_plans(
position='string',
keyId='string',
limit=123
)
dict
Response Syntax
{
'position': 'string',
'items': [
{
'id': 'string',
'name': 'string',
'description': 'string',
'apiStages': [
{
'apiId': 'string',
'stage': 'string',
'throttle': {
'string': {
'burstLimit': 123,
'rateLimit': 123.0
}
}
},
],
'throttle': {
'burstLimit': 123,
'rateLimit': 123.0
},
'quota': {
'limit': 123,
'offset': 123,
'period': 'DAY'|'WEEK'|'MONTH'
},
'productCode': 'string',
'tags': {
'string': 'string'
}
},
]
}
Response Structure
(dict) --
Represents a collection of usage plans for an AWS account.
position (string) --
items (list) --
The current page of elements from this collection.
(dict) --
Represents a usage plan used to specify who can assess associated API stages. Optionally, target request rate and quota limits can be set. In some cases clients can exceed the targets that you set. Don’t rely on usage plans to control costs. Consider using Amazon Web Services Budgets to monitor costs and WAF to manage API requests.
id (string) --
The identifier of a UsagePlan resource.
name (string) --
The name of a usage plan.
description (string) --
The description of a usage plan.
apiStages (list) --
The associated API stages of a usage plan.
(dict) --
API stage name of the associated API stage in a usage plan.
apiId (string) --
API Id of the associated API stage in a usage plan.
stage (string) --
API stage name of the associated API stage in a usage plan.
throttle (dict) --
Map containing method level throttling information for API stage in a usage plan.
(string) --
(dict) --
The API request rate limits.
burstLimit (integer) --
The API target request burst rate limit. This allows more requests through for a period of time than the target rate limit.
rateLimit (float) --
The API target request rate limit.
throttle (dict) --
A map containing method level throttling information for API stage in a usage plan.
burstLimit (integer) --
The API target request burst rate limit. This allows more requests through for a period of time than the target rate limit.
rateLimit (float) --
The API target request rate limit.
quota (dict) --
The target maximum number of permitted requests per a given unit time interval.
limit (integer) --
The target maximum number of requests that can be made in a given time period.
offset (integer) --
The number of requests subtracted from the given limit in the initial time period.
period (string) --
The time period in which the limit applies. Valid values are "DAY", "WEEK" or "MONTH".
productCode (string) --
The AWS Markeplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_vpc_link
(**kwargs)¶Gets a specified VPC link under the caller's account in a region.
See also: AWS API Documentation
Request Syntax
response = client.get_vpc_link(
vpcLinkId='string'
)
[REQUIRED]
The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.
{
'id': 'string',
'name': 'string',
'description': 'string',
'targetArns': [
'string',
],
'status': 'AVAILABLE'|'PENDING'|'DELETING'|'FAILED',
'statusMessage': 'string',
'tags': {
'string': 'string'
}
}
Response Structure
An API Gateway VPC link for a RestApi to access resources in an Amazon Virtual Private Cloud (VPC).
The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.
The name used to label and identify the VPC link.
The description of the VPC link.
The ARN of the network load balancer of the VPC targeted by the VPC link. The network load balancer must be owned by the same AWS account of the API owner.
The status of the VPC link. The valid values are AVAILABLE
, PENDING
, DELETING
, or FAILED
. Deploying an API will wait if the status is PENDING
and will fail if the status is DELETING
.
A description about the VPC link status.
The collection of tags. Each tag element is associated with a given resource.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_vpc_links
(**kwargs)¶Gets the VpcLinks collection under the caller's account in a selected region.
See also: AWS API Documentation
Request Syntax
response = client.get_vpc_links(
position='string',
limit=123
)
dict
Response Syntax
{
'position': 'string',
'items': [
{
'id': 'string',
'name': 'string',
'description': 'string',
'targetArns': [
'string',
],
'status': 'AVAILABLE'|'PENDING'|'DELETING'|'FAILED',
'statusMessage': 'string',
'tags': {
'string': 'string'
}
},
]
}
Response Structure
(dict) --
The collection of VPC links under the caller's account in a region.
position (string) --
items (list) --
The current page of elements from this collection.
(dict) --
An API Gateway VPC link for a RestApi to access resources in an Amazon Virtual Private Cloud (VPC).
id (string) --
The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.
name (string) --
The name used to label and identify the VPC link.
description (string) --
The description of the VPC link.
targetArns (list) --
The ARN of the network load balancer of the VPC targeted by the VPC link. The network load balancer must be owned by the same AWS account of the API owner.
status (string) --
The status of the VPC link. The valid values are AVAILABLE
, PENDING
, DELETING
, or FAILED
. Deploying an API will wait if the status is PENDING
and will fail if the status is DELETING
.
statusMessage (string) --
A description about the VPC link status.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
get_waiter
(waiter_name)¶Returns an object that can wait for some condition.
import_api_keys
(**kwargs)¶Import API keys from an external source, such as a CSV-formatted file.
See also: AWS API Documentation
Request Syntax
response = client.import_api_keys(
body=b'bytes'|file,
format='csv',
failOnWarnings=True|False
)
[REQUIRED]
The payload of the POST request to import API keys. For the payload format, see API Key File Format.
[REQUIRED]
A query parameter to specify the input format to imported API keys. Currently, only the csv
format is supported.
true
) or not ( false
) when error is encountered.dict
Response Syntax
{
'ids': [
'string',
],
'warnings': [
'string',
]
}
Response Structure
(dict) --
The identifier of an ApiKey used in a UsagePlan.
ids (list) --
A list of all the ApiKey identifiers.
warnings (list) --
A list of warning messages.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
import_documentation_parts
(**kwargs)¶Imports documentation parts
See also: AWS API Documentation
Request Syntax
response = client.import_documentation_parts(
restApiId='string',
mode='merge'|'overwrite',
failOnWarnings=True|False,
body=b'bytes'|file
)
[REQUIRED]
The string identifier of the associated RestApi.
OVERWRITE
) any existing DocumentationParts definition or to merge ( MERGE
) the new definition into the existing one. The default value is MERGE
.true
) or not ( false
) when a warning is encountered. The default value is false
.[REQUIRED]
Raw byte array representing the to-be-imported documentation parts. To import from an OpenAPI file, this is a JSON object.
dict
Response Syntax
{
'ids': [
'string',
],
'warnings': [
'string',
]
}
Response Structure
(dict) --
A collection of the imported DocumentationPart identifiers.
ids (list) --
A list of the returned documentation part identifiers.
warnings (list) --
A list of warning messages reported during import of documentation parts.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
import_rest_api
(**kwargs)¶A feature of the API Gateway control service for creating a new API from an external API definition file.
See also: AWS API Documentation
Request Syntax
response = client.import_rest_api(
failOnWarnings=True|False,
parameters={
'string': 'string'
},
body=b'bytes'|file
)
true
) or not ( false
) when a warning is encountered. The default value is false
.A key-value map of context-specific query string parameters specifying the behavior of different API importing operations. The following shows operation-specific parameters and their supported values.
To exclude DocumentationParts from the import, set parameters
as ignore=documentation
.
To configure the endpoint type, set parameters
as endpointConfigurationTypes=EDGE
, endpointConfigurationTypes=REGIONAL
, or endpointConfigurationTypes=PRIVATE
. The default endpoint type is EDGE
.
To handle imported basepath
, set parameters
as basepath=ignore
, basepath=prepend
or basepath=split
.
For example, the AWS CLI command to exclude documentation from the imported API is:
The AWS CLI command to set the regional endpoint on the imported API is:
[REQUIRED]
The POST request body containing external API definitions. Currently, only OpenAPI definition JSON/YAML files are supported. The maximum size of the API definition file is 6MB.
dict
Response Syntax
{
'id': 'string',
'name': 'string',
'description': 'string',
'createdDate': datetime(2015, 1, 1),
'version': 'string',
'warnings': [
'string',
],
'binaryMediaTypes': [
'string',
],
'minimumCompressionSize': 123,
'apiKeySource': 'HEADER'|'AUTHORIZER',
'endpointConfiguration': {
'types': [
'REGIONAL'|'EDGE'|'PRIVATE',
],
'vpcEndpointIds': [
'string',
]
},
'policy': 'string',
'tags': {
'string': 'string'
},
'disableExecuteApiEndpoint': True|False
}
Response Structure
(dict) --
Represents a REST API.
id (string) --
The API's identifier. This identifier is unique across all of your APIs in API Gateway.
name (string) --
The API's name.
description (string) --
The API's description.
createdDate (datetime) --
The timestamp when the API was created.
version (string) --
A version identifier for the API.
warnings (list) --
The warning messages reported when failonwarnings
is turned on during API import.
binaryMediaTypes (list) --
The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
minimumCompressionSize (integer) --
A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
apiKeySource (string) --
The source of the API key for metering requests according to a usage plan. Valid values are: > HEADER
to read the API key from the X-API-Key
header of a request. AUTHORIZER
to read the API key from the UsageIdentifierKey
from a custom authorizer.
endpointConfiguration (dict) --
The endpoint configuration of this RestApi showing the endpoint types of the API.
types (list) --
A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is "EDGE"
. For a regional API and its custom domain name, the endpoint type is REGIONAL
. For a private API, the endpoint type is PRIVATE
.
(string) --
The endpoint type. The valid values are EDGE
for edge-optimized API setup, most suitable for mobile applications; REGIONAL
for regional API endpoint setup, most suitable for calling from AWS Region; and PRIVATE
for private APIs.
vpcEndpointIds (list) --
A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for PRIVATE
endpoint type.
policy (string) --
A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
disableExecuteApiEndpoint (boolean) --
Specifies whether clients can invoke your API by using the default execute-api
endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com
endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
put_gateway_response
(**kwargs)¶Creates a customization of a GatewayResponse of a specified response type and status code on the given RestApi.
See also: AWS API Documentation
Request Syntax
response = client.put_gateway_response(
restApiId='string',
responseType='DEFAULT_4XX'|'DEFAULT_5XX'|'RESOURCE_NOT_FOUND'|'UNAUTHORIZED'|'INVALID_API_KEY'|'ACCESS_DENIED'|'AUTHORIZER_FAILURE'|'AUTHORIZER_CONFIGURATION_ERROR'|'INVALID_SIGNATURE'|'EXPIRED_TOKEN'|'MISSING_AUTHENTICATION_TOKEN'|'INTEGRATION_FAILURE'|'INTEGRATION_TIMEOUT'|'API_CONFIGURATION_ERROR'|'UNSUPPORTED_MEDIA_TYPE'|'BAD_REQUEST_PARAMETERS'|'BAD_REQUEST_BODY'|'REQUEST_TOO_LARGE'|'THROTTLED'|'QUOTA_EXCEEDED'|'WAF_FILTERED',
statusCode='string',
responseParameters={
'string': 'string'
},
responseTemplates={
'string': 'string'
}
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The response type of the associated GatewayResponse
Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of key-value pairs.
Response templates of the GatewayResponse as a string-to-string map of key-value pairs.
dict
Response Syntax
{
'responseType': 'DEFAULT_4XX'|'DEFAULT_5XX'|'RESOURCE_NOT_FOUND'|'UNAUTHORIZED'|'INVALID_API_KEY'|'ACCESS_DENIED'|'AUTHORIZER_FAILURE'|'AUTHORIZER_CONFIGURATION_ERROR'|'INVALID_SIGNATURE'|'EXPIRED_TOKEN'|'MISSING_AUTHENTICATION_TOKEN'|'INTEGRATION_FAILURE'|'INTEGRATION_TIMEOUT'|'API_CONFIGURATION_ERROR'|'UNSUPPORTED_MEDIA_TYPE'|'BAD_REQUEST_PARAMETERS'|'BAD_REQUEST_BODY'|'REQUEST_TOO_LARGE'|'THROTTLED'|'QUOTA_EXCEEDED'|'WAF_FILTERED',
'statusCode': 'string',
'responseParameters': {
'string': 'string'
},
'responseTemplates': {
'string': 'string'
},
'defaultResponse': True|False
}
Response Structure
(dict) --
A gateway response of a given response type and status code, with optional response parameters and mapping templates.
responseType (string) --
The response type of the associated GatewayResponse.
statusCode (string) --
The HTTP status code for this GatewayResponse.
responseParameters (dict) --
Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of key-value pairs.
responseTemplates (dict) --
Response templates of the GatewayResponse as a string-to-string map of key-value pairs.
defaultResponse (boolean) --
A Boolean flag to indicate whether this GatewayResponse is the default gateway response ( true
) or not ( false
). A default gateway response is one generated by API Gateway without any customization by an API developer.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
put_integration
(**kwargs)¶Sets up a method's integration.
See also: AWS API Documentation
Request Syntax
response = client.put_integration(
restApiId='string',
resourceId='string',
httpMethod='string',
type='HTTP'|'AWS'|'MOCK'|'HTTP_PROXY'|'AWS_PROXY',
integrationHttpMethod='string',
uri='string',
connectionType='INTERNET'|'VPC_LINK',
connectionId='string',
credentials='string',
requestParameters={
'string': 'string'
},
requestTemplates={
'string': 'string'
},
passthroughBehavior='string',
cacheNamespace='string',
cacheKeyParameters=[
'string',
],
contentHandling='CONVERT_TO_BINARY'|'CONVERT_TO_TEXT',
timeoutInMillis=123,
tlsConfig={
'insecureSkipVerification': True|False
}
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
Specifies a put integration request's resource ID.
[REQUIRED]
Specifies the HTTP method for the integration.
[REQUIRED]
Specifies a put integration input's type.
HTTP_PROXY
integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, where connectionType
is not VPC_LINK
, or private integration, where connectionType
is VPC_LINK
. For a private HTTP integration, the URI is not used for routing. For AWS
or AWS_PROXY
integrations, the URI is of the form arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api
}. Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is the name of the integrated Amazon Web Services service (e.g., s3); and {subdomain} is a designated subdomain supported by certain Amazon Web Services service for fast host-name lookup. action can be used for an Amazon Web Services service action-based API, using an Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing {service_api} refers to a supported action {name} plus any required input parameters. Alternatively, path can be used for an Amazon Web Services service path-based API. The ensuing service_api refers to the path to an Amazon Web Services service resource, including the region of the integrated Amazon Web Services service, if applicable. For example, for integration with the S3 API of GetObject
, the uri
can be either arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}
or arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}
.INTERNET
for connections through the public routable internet or VPC_LINK
for private connections between API Gateway and a network load balancer in a VPC. The default value is INTERNET
.VPC_LINK
as the connection type.A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of method.request.{location}.{name}
, where location
is querystring
, path
, or header
and name
must be a valid and unique method request parameter name.
Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.
requestTemplates
property on the Integration resource. There are three valid values: WHEN_NO_MATCH
, WHEN_NO_TEMPLATES
, and NEVER
.cacheNamespace
. You can specify the same cacheNamespace
across resources to return the same cached data for requests to different resources.A list of request parameters whose values API Gateway caches. To be valid values for cacheKeyParameters
, these parameters must also be specified for Method requestParameters
.
Specifies how to handle request payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the passthroughBehavior
is configured to support payload pass-through.
Specifies the TLS configuration for an integration.
Specifies whether or not API Gateway skips verification that the certificate for an integration endpoint is issued by a supported certificate authority. This isn’t recommended, but it enables you to use certificates that are signed by private certificate authorities, or certificates that are self-signed. If enabled, API Gateway still performs basic certificate validation, which includes checking the certificate's expiration date, hostname, and presence of a root certificate authority. Supported only for HTTP
and HTTP_PROXY
integrations.
Warning
Enabling insecureSkipVerification
isn't recommended, especially for integrations with public HTTPS endpoints. If you enable insecureSkipVerification
, you increase the risk of man-in-the-middle attacks.
dict
Response Syntax
{
'type': 'HTTP'|'AWS'|'MOCK'|'HTTP_PROXY'|'AWS_PROXY',
'httpMethod': 'string',
'uri': 'string',
'connectionType': 'INTERNET'|'VPC_LINK',
'connectionId': 'string',
'credentials': 'string',
'requestParameters': {
'string': 'string'
},
'requestTemplates': {
'string': 'string'
},
'passthroughBehavior': 'string',
'contentHandling': 'CONVERT_TO_BINARY'|'CONVERT_TO_TEXT',
'timeoutInMillis': 123,
'cacheNamespace': 'string',
'cacheKeyParameters': [
'string',
],
'integrationResponses': {
'string': {
'statusCode': 'string',
'selectionPattern': 'string',
'responseParameters': {
'string': 'string'
},
'responseTemplates': {
'string': 'string'
},
'contentHandling': 'CONVERT_TO_BINARY'|'CONVERT_TO_TEXT'
}
},
'tlsConfig': {
'insecureSkipVerification': True|False
}
}
Response Structure
(dict) --
Represents an HTTP, HTTP_PROXY, AWS, AWS_PROXY, or Mock integration.
type (string) --
Specifies an API method integration type. The valid value is one of the following:
For the HTTP and HTTP proxy integrations, each integration can specify a protocol ( http/https
), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with a connectionType
of VPC_LINK
is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC.
httpMethod (string) --
Specifies the integration's HTTP method type.
uri (string) --
Specifies Uniform Resource Identifier (URI) of the integration endpoint.
For HTTP
or HTTP_PROXY
integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, where connectionType
is not VPC_LINK
, or private integration, where connectionType
is VPC_LINK
. For a private HTTP integration, the URI is not used for routing. For AWS
or AWS_PROXY
integrations, the URI is of the form arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}
. Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is the name of the integrated Amazon Web Services service (e.g., s3); and {subdomain} is a designated subdomain supported by certain Amazon Web Services service for fast host-name lookup. action can be used for an Amazon Web Services service action-based API, using an Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing {service_api} refers to a supported action {name} plus any required input parameters. Alternatively, path can be used for an AWS service path-based API. The ensuing service_api refers to the path to an Amazon Web Services service resource, including the region of the integrated Amazon Web Services service, if applicable. For example, for integration with the S3 API of GetObject, the uri can be either arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}
or arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}
connectionType (string) --
The type of the network connection to the integration endpoint. The valid value is INTERNET
for connections through the public routable internet or VPC_LINK
for private connections between API Gateway and a network load balancer in a VPC. The default value is INTERNET
.
connectionId (string) --
The ID of the VpcLink used for the integration when connectionType=VPC_LINK
and undefined, otherwise.
credentials (string) --
Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string arn:aws:iam::\*:user/\*
. To use resource-based permissions on supported AWS services, specify null.
requestParameters (dict) --
A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of method.request.{location}.{name}
, where location
is querystring
, path
, or header
and name
must be a valid and unique method request parameter name.
requestTemplates (dict) --
Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.
passthroughBehavior (string) --
Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in requestTemplates
. The valid value is one of the following: WHEN_NO_MATCH
: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. WHEN_NO_TEMPLATES
: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP 415 Unsupported Media Type response. NEVER
: rejects the method request with an HTTP 415 Unsupported Media Type response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.
contentHandling (string) --
Specifies how to handle request payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the passthroughBehavior
is configured to support payload pass-through.
timeoutInMillis (integer) --
Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
cacheNamespace (string) --
Specifies a group of related cached parameters. By default, API Gateway uses the resource ID as the cacheNamespace
. You can specify the same cacheNamespace
across resources to return the same cached data for requests to different resources.
cacheKeyParameters (list) --
A list of request parameters whose values API Gateway caches. To be valid values for cacheKeyParameters
, these parameters must also be specified for Method requestParameters
.
integrationResponses (dict) --
Specifies the integration's responses.
(string) --
(dict) --
Represents an integration response. The status code must map to an existing MethodResponse, and parameters and templates can be used to transform the back-end response.
statusCode (string) --
Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern (string) --
Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the .+
regex to match error response. However, make sure that the error response does not contain any newline ( \n
) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.
responseParameters (dict) --
A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of method.response.header.{name}
, where name
is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header.{name}
or integration.response.body.{JSON-expression}
, where name
is a valid and unique response header name and JSON-expression
is a valid JSON expression without the $
prefix.
responseTemplates (dict) --
Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
contentHandling (string) --
Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
tlsConfig (dict) --
Specifies the TLS configuration for an integration.
insecureSkipVerification (boolean) --
Specifies whether or not API Gateway skips verification that the certificate for an integration endpoint is issued by a supported certificate authority. This isn’t recommended, but it enables you to use certificates that are signed by private certificate authorities, or certificates that are self-signed. If enabled, API Gateway still performs basic certificate validation, which includes checking the certificate's expiration date, hostname, and presence of a root certificate authority. Supported only for HTTP
and HTTP_PROXY
integrations.
Warning
Enabling insecureSkipVerification
isn't recommended, especially for integrations with public HTTPS endpoints. If you enable insecureSkipVerification
, you increase the risk of man-in-the-middle attacks.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
put_integration_response
(**kwargs)¶Represents a put integration.
See also: AWS API Documentation
Request Syntax
response = client.put_integration_response(
restApiId='string',
resourceId='string',
httpMethod='string',
statusCode='string',
selectionPattern='string',
responseParameters={
'string': 'string'
},
responseTemplates={
'string': 'string'
},
contentHandling='CONVERT_TO_BINARY'|'CONVERT_TO_TEXT'
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
Specifies a put integration response request's resource identifier.
[REQUIRED]
Specifies a put integration response request's HTTP method.
[REQUIRED]
Specifies the status code that is used to map the integration response to an existing MethodResponse.
A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of method.response.header.{name}
, where name
is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header.{name}
or integration.response.body.{JSON-expression}
, where name
must be a valid and unique response header name and JSON-expression
a valid JSON expression without the $
prefix.
Specifies a put integration response's templates.
Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
dict
Response Syntax
{
'statusCode': 'string',
'selectionPattern': 'string',
'responseParameters': {
'string': 'string'
},
'responseTemplates': {
'string': 'string'
},
'contentHandling': 'CONVERT_TO_BINARY'|'CONVERT_TO_TEXT'
}
Response Structure
(dict) --
Represents an integration response. The status code must map to an existing MethodResponse, and parameters and templates can be used to transform the back-end response.
statusCode (string) --
Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern (string) --
Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the .+
regex to match error response. However, make sure that the error response does not contain any newline ( \n
) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.
responseParameters (dict) --
A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of method.response.header.{name}
, where name
is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header.{name}
or integration.response.body.{JSON-expression}
, where name
is a valid and unique response header name and JSON-expression
is a valid JSON expression without the $
prefix.
responseTemplates (dict) --
Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
contentHandling (string) --
Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
put_method
(**kwargs)¶Add a method to an existing Resource resource.
See also: AWS API Documentation
Request Syntax
response = client.put_method(
restApiId='string',
resourceId='string',
httpMethod='string',
authorizationType='string',
authorizerId='string',
apiKeyRequired=True|False,
operationName='string',
requestParameters={
'string': True|False
},
requestModels={
'string': 'string'
},
requestValidatorId='string',
authorizationScopes=[
'string',
]
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The Resource identifier for the new Method resource.
[REQUIRED]
Specifies the method request's HTTP method type.
[REQUIRED]
The method's authorization type. Valid values are NONE
for open access, AWS_IAM
for using AWS IAM permissions, CUSTOM
for using a custom authorizer, or COGNITO_USER_POOLS
for using a Cognito user pool.
operationName
of ListPets
for the GET /pets
method in the PetStore
example.A key-value map defining required or optional method request parameters that can be accepted by API Gateway. A key defines a method request parameter name matching the pattern of method.request.{location}.{name}
, where location
is querystring
, path
, or header
and name
is a valid and unique parameter name. The value associated with the key is a Boolean flag indicating whether the parameter is required ( true
) or optional ( false
). The method request parameter names defined here are available in Integration to be mapped to integration request parameters or body-mapping templates.
Specifies the Model resources used for the request's content type. Request models are represented as a key/value map, with a content type as the key and a Model name as the value.
A list of authorization scopes configured on the method. The scopes are used with a COGNITO_USER_POOLS
authorizer to authorize the method invocation. The authorization works by matching the method scopes against the scopes parsed from the access token in the incoming request. The method invocation is authorized if any method scopes matches a claimed scope in the access token. Otherwise, the invocation is not authorized. When the method scope is configured, the client must provide an access token instead of an identity token for authorization purposes.
dict
Response Syntax
{
'httpMethod': 'string',
'authorizationType': 'string',
'authorizerId': 'string',
'apiKeyRequired': True|False,
'requestValidatorId': 'string',
'operationName': 'string',
'requestParameters': {
'string': True|False
},
'requestModels': {
'string': 'string'
},
'methodResponses': {
'string': {
'statusCode': 'string',
'responseParameters': {
'string': True|False
},
'responseModels': {
'string': 'string'
}
}
},
'methodIntegration': {
'type': 'HTTP'|'AWS'|'MOCK'|'HTTP_PROXY'|'AWS_PROXY',
'httpMethod': 'string',
'uri': 'string',
'connectionType': 'INTERNET'|'VPC_LINK',
'connectionId': 'string',
'credentials': 'string',
'requestParameters': {
'string': 'string'
},
'requestTemplates': {
'string': 'string'
},
'passthroughBehavior': 'string',
'contentHandling': 'CONVERT_TO_BINARY'|'CONVERT_TO_TEXT',
'timeoutInMillis': 123,
'cacheNamespace': 'string',
'cacheKeyParameters': [
'string',
],
'integrationResponses': {
'string': {
'statusCode': 'string',
'selectionPattern': 'string',
'responseParameters': {
'string': 'string'
},
'responseTemplates': {
'string': 'string'
},
'contentHandling': 'CONVERT_TO_BINARY'|'CONVERT_TO_TEXT'
}
},
'tlsConfig': {
'insecureSkipVerification': True|False
}
},
'authorizationScopes': [
'string',
]
}
Response Structure
(dict) --
Represents a client-facing interface by which the client calls the API to access back-end resources. A Method resource is integrated with an Integration resource. Both consist of a request and one or more responses. The method request takes the client input that is passed to the back end through the integration request. A method response returns the output from the back end to the client through an integration response. A method request is embodied in a Method resource, whereas an integration request is embodied in an Integration resource. On the other hand, a method response is represented by a MethodResponse resource, whereas an integration response is represented by an IntegrationResponse resource.
httpMethod (string) --
The method's HTTP verb.
authorizationType (string) --
The method's authorization type. Valid values are NONE
for open access, AWS_IAM
for using AWS IAM permissions, CUSTOM
for using a custom authorizer, or COGNITO_USER_POOLS
for using a Cognito user pool.
authorizerId (string) --
The identifier of an Authorizer to use on this method. The authorizationType
must be CUSTOM
.
apiKeyRequired (boolean) --
A boolean flag specifying whether a valid ApiKey is required to invoke this method.
requestValidatorId (string) --
The identifier of a RequestValidator for request validation.
operationName (string) --
A human-friendly operation identifier for the method. For example, you can assign the operationName
of ListPets
for the GET /pets
method in the PetStore
example.
requestParameters (dict) --
A key-value map defining required or optional method request parameters that can be accepted by API Gateway. A key is a method request parameter name matching the pattern of method.request.{location}.{name}
, where location
is querystring
, path
, or header
and name
is a valid and unique parameter name. The value associated with the key is a Boolean flag indicating whether the parameter is required ( true
) or optional ( false
). The method request parameter names defined here are available in Integration to be mapped to integration request parameters or templates.
requestModels (dict) --
A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key).
methodResponses (dict) --
Gets a method response associated with a given HTTP status code.
(string) --
(dict) --
Represents a method response of a given HTTP status code returned to the client. The method response is passed from the back end through the associated integration response that can be transformed using a mapping template.
statusCode (string) --
The method response's status code.
responseParameters (dict) --
A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header and the value specifies whether the associated method response header is required or not. The expression of the key must match the pattern method.response.header.{name}
, where name
is a valid and unique header name. API Gateway passes certain integration response data to the method response headers specified here according to the mapping you prescribe in the API's IntegrationResponse. The integration response data that can be mapped include an integration response header expressed in integration.response.header.{name}
, a static value enclosed within a pair of single quotes (e.g., 'application/json'
), or a JSON expression from the back-end response payload in the form of integration.response.body.{JSON-expression}
, where JSON-expression
is a valid JSON expression without the $
prefix.)
responseModels (dict) --
Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.
methodIntegration (dict) --
Gets the method's integration responsible for passing the client-submitted request to the back end and performing necessary transformations to make the request compliant with the back end.
type (string) --
Specifies an API method integration type. The valid value is one of the following:
For the HTTP and HTTP proxy integrations, each integration can specify a protocol ( http/https
), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with a connectionType
of VPC_LINK
is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC.
httpMethod (string) --
Specifies the integration's HTTP method type.
uri (string) --
Specifies Uniform Resource Identifier (URI) of the integration endpoint.
For HTTP
or HTTP_PROXY
integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, where connectionType
is not VPC_LINK
, or private integration, where connectionType
is VPC_LINK
. For a private HTTP integration, the URI is not used for routing. For AWS
or AWS_PROXY
integrations, the URI is of the form arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}
. Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is the name of the integrated Amazon Web Services service (e.g., s3); and {subdomain} is a designated subdomain supported by certain Amazon Web Services service for fast host-name lookup. action can be used for an Amazon Web Services service action-based API, using an Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing {service_api} refers to a supported action {name} plus any required input parameters. Alternatively, path can be used for an AWS service path-based API. The ensuing service_api refers to the path to an Amazon Web Services service resource, including the region of the integrated Amazon Web Services service, if applicable. For example, for integration with the S3 API of GetObject, the uri can be either arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}
or arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}
connectionType (string) --
The type of the network connection to the integration endpoint. The valid value is INTERNET
for connections through the public routable internet or VPC_LINK
for private connections between API Gateway and a network load balancer in a VPC. The default value is INTERNET
.
connectionId (string) --
The ID of the VpcLink used for the integration when connectionType=VPC_LINK
and undefined, otherwise.
credentials (string) --
Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string arn:aws:iam::\*:user/\*
. To use resource-based permissions on supported AWS services, specify null.
requestParameters (dict) --
A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of method.request.{location}.{name}
, where location
is querystring
, path
, or header
and name
must be a valid and unique method request parameter name.
requestTemplates (dict) --
Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.
passthroughBehavior (string) --
Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in requestTemplates
. The valid value is one of the following: WHEN_NO_MATCH
: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. WHEN_NO_TEMPLATES
: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP 415 Unsupported Media Type response. NEVER
: rejects the method request with an HTTP 415 Unsupported Media Type response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.
contentHandling (string) --
Specifies how to handle request payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the passthroughBehavior
is configured to support payload pass-through.
timeoutInMillis (integer) --
Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
cacheNamespace (string) --
Specifies a group of related cached parameters. By default, API Gateway uses the resource ID as the cacheNamespace
. You can specify the same cacheNamespace
across resources to return the same cached data for requests to different resources.
cacheKeyParameters (list) --
A list of request parameters whose values API Gateway caches. To be valid values for cacheKeyParameters
, these parameters must also be specified for Method requestParameters
.
integrationResponses (dict) --
Specifies the integration's responses.
(string) --
(dict) --
Represents an integration response. The status code must map to an existing MethodResponse, and parameters and templates can be used to transform the back-end response.
statusCode (string) --
Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern (string) --
Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the .+
regex to match error response. However, make sure that the error response does not contain any newline ( \n
) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.
responseParameters (dict) --
A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of method.response.header.{name}
, where name
is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header.{name}
or integration.response.body.{JSON-expression}
, where name
is a valid and unique response header name and JSON-expression
is a valid JSON expression without the $
prefix.
responseTemplates (dict) --
Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
contentHandling (string) --
Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
tlsConfig (dict) --
Specifies the TLS configuration for an integration.
insecureSkipVerification (boolean) --
Specifies whether or not API Gateway skips verification that the certificate for an integration endpoint is issued by a supported certificate authority. This isn’t recommended, but it enables you to use certificates that are signed by private certificate authorities, or certificates that are self-signed. If enabled, API Gateway still performs basic certificate validation, which includes checking the certificate's expiration date, hostname, and presence of a root certificate authority. Supported only for HTTP
and HTTP_PROXY
integrations.
Warning
Enabling insecureSkipVerification
isn't recommended, especially for integrations with public HTTPS endpoints. If you enable insecureSkipVerification
, you increase the risk of man-in-the-middle attacks.
authorizationScopes (list) --
A list of authorization scopes configured on the method. The scopes are used with a COGNITO_USER_POOLS
authorizer to authorize the method invocation. The authorization works by matching the method scopes against the scopes parsed from the access token in the incoming request. The method invocation is authorized if any method scopes matches a claimed scope in the access token. Otherwise, the invocation is not authorized. When the method scope is configured, the client must provide an access token instead of an identity token for authorization purposes.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.TooManyRequestsException
put_method_response
(**kwargs)¶Adds a MethodResponse to an existing Method resource.
See also: AWS API Documentation
Request Syntax
response = client.put_method_response(
restApiId='string',
resourceId='string',
httpMethod='string',
statusCode='string',
responseParameters={
'string': True|False
},
responseModels={
'string': 'string'
}
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The Resource identifier for the Method resource.
[REQUIRED]
The HTTP verb of the Method resource.
[REQUIRED]
The method response's status code.
A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header name and the associated value is a Boolean flag indicating whether the method response parameter is required or not. The method response header names must match the pattern of method.response.header.{name}
, where name
is a valid and unique header name. The response parameter names defined here are available in the integration response to be mapped from an integration response header expressed in integration.response.header.{name}
, a static value enclosed within a pair of single quotes (e.g., 'application/json'
), or a JSON expression from the back-end response payload in the form of integration.response.body.{JSON-expression}
, where JSON-expression
is a valid JSON expression without the $
prefix.)
Specifies the Model resources used for the response's content type. Response models are represented as a key/value map, with a content type as the key and a Model name as the value.
dict
Response Syntax
{
'statusCode': 'string',
'responseParameters': {
'string': True|False
},
'responseModels': {
'string': 'string'
}
}
Response Structure
(dict) --
Represents a method response of a given HTTP status code returned to the client. The method response is passed from the back end through the associated integration response that can be transformed using a mapping template.
statusCode (string) --
The method response's status code.
responseParameters (dict) --
A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header and the value specifies whether the associated method response header is required or not. The expression of the key must match the pattern method.response.header.{name}
, where name
is a valid and unique header name. API Gateway passes certain integration response data to the method response headers specified here according to the mapping you prescribe in the API's IntegrationResponse. The integration response data that can be mapped include an integration response header expressed in integration.response.header.{name}
, a static value enclosed within a pair of single quotes (e.g., 'application/json'
), or a JSON expression from the back-end response payload in the form of integration.response.body.{JSON-expression}
, where JSON-expression
is a valid JSON expression without the $
prefix.)
responseModels (dict) --
Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.
Exceptions
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.TooManyRequestsException
put_rest_api
(**kwargs)¶A feature of the API Gateway control service for updating an existing API with an input of external API definitions. The update can take the form of merging the supplied definition into the existing API or overwriting the existing API.
See also: AWS API Documentation
Request Syntax
response = client.put_rest_api(
restApiId='string',
mode='merge'|'overwrite',
failOnWarnings=True|False,
parameters={
'string': 'string'
},
body=b'bytes'|file
)
[REQUIRED]
The string identifier of the associated RestApi.
mode
query parameter to specify the update mode. Valid values are "merge" and "overwrite". By default, the update mode is "merge".true
) or not ( false
) when a warning is encountered. The default value is false
.Custom header parameters as part of the request. For example, to exclude DocumentationParts from an imported API, set ignore=documentation
as a parameters
value, as in the AWS CLI command of aws apigateway import-rest-api --parameters ignore=documentation --body 'file:///path/to/imported-api-body.json'
.
[REQUIRED]
The PUT request body containing external API definitions. Currently, only OpenAPI definition JSON/YAML files are supported. The maximum size of the API definition file is 6MB.
dict
Response Syntax
{
'id': 'string',
'name': 'string',
'description': 'string',
'createdDate': datetime(2015, 1, 1),
'version': 'string',
'warnings': [
'string',
],
'binaryMediaTypes': [
'string',
],
'minimumCompressionSize': 123,
'apiKeySource': 'HEADER'|'AUTHORIZER',
'endpointConfiguration': {
'types': [
'REGIONAL'|'EDGE'|'PRIVATE',
],
'vpcEndpointIds': [
'string',
]
},
'policy': 'string',
'tags': {
'string': 'string'
},
'disableExecuteApiEndpoint': True|False
}
Response Structure
(dict) --
Represents a REST API.
id (string) --
The API's identifier. This identifier is unique across all of your APIs in API Gateway.
name (string) --
The API's name.
description (string) --
The API's description.
createdDate (datetime) --
The timestamp when the API was created.
version (string) --
A version identifier for the API.
warnings (list) --
The warning messages reported when failonwarnings
is turned on during API import.
binaryMediaTypes (list) --
The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
minimumCompressionSize (integer) --
A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
apiKeySource (string) --
The source of the API key for metering requests according to a usage plan. Valid values are: > HEADER
to read the API key from the X-API-Key
header of a request. AUTHORIZER
to read the API key from the UsageIdentifierKey
from a custom authorizer.
endpointConfiguration (dict) --
The endpoint configuration of this RestApi showing the endpoint types of the API.
types (list) --
A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is "EDGE"
. For a regional API and its custom domain name, the endpoint type is REGIONAL
. For a private API, the endpoint type is PRIVATE
.
(string) --
The endpoint type. The valid values are EDGE
for edge-optimized API setup, most suitable for mobile applications; REGIONAL
for regional API endpoint setup, most suitable for calling from AWS Region; and PRIVATE
for private APIs.
vpcEndpointIds (list) --
A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for PRIVATE
endpoint type.
policy (string) --
A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
disableExecuteApiEndpoint (boolean) --
Specifies whether clients can invoke your API by using the default execute-api
endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com
endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
tag_resource
(**kwargs)¶Adds or updates a tag on a given resource.
See also: AWS API Documentation
Request Syntax
response = client.tag_resource(
resourceArn='string',
tags={
'string': 'string'
}
)
[REQUIRED]
The ARN of a resource that can be tagged.
[REQUIRED]
The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with aws:
. The tag value can be up to 256 characters.
None
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
Simulate the execution of an Authorizer in your RestApi with headers, parameters, and an incoming request body.
See also: AWS API Documentation
Request Syntax
response = client.test_invoke_authorizer(
restApiId='string',
authorizerId='string',
headers={
'string': 'string'
},
multiValueHeaders={
'string': [
'string',
]
},
pathWithQueryString='string',
body='string',
stageVariables={
'string': 'string'
},
additionalContext={
'string': 'string'
}
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
Specifies a test invoke authorizer request's Authorizer ID.
A key-value map of headers to simulate an incoming invocation request. This is where the incoming authorization token, or identity source, should be specified.
The headers as a map from string to list of values to simulate an incoming invocation request. This is where the incoming authorization token, or identity source, may be specified.
A key-value map of stage variables to simulate an invocation on a deployed Stage.
A key-value map of additional context variables.
dict
Response Syntax
{
'clientStatus': 123,
'log': 'string',
'latency': 123,
'principalId': 'string',
'policy': 'string',
'authorization': {
'string': [
'string',
]
},
'claims': {
'string': 'string'
}
}
Response Structure
(dict) --
Represents the response of the test invoke request for a custom Authorizer
clientStatus (integer) --
The HTTP status code that the client would have received. Value is 0 if the authorizer succeeded.
log (string) --
The API Gateway execution log for the test authorizer request.
latency (integer) --
The execution latency of the test authorizer request.
principalId (string) --
The principal identity returned by the Authorizer
policy (string) --
The JSON policy document returned by the Authorizer
authorization (dict) --
The authorization response.
claims (dict) --
The open identity claims, with any supported custom attributes, returned from the Cognito Your User Pool configured for the API.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.TooManyRequestsException
test_invoke_method
(**kwargs)¶Simulate the invocation of a Method in your RestApi with headers, parameters, and an incoming request body.
See also: AWS API Documentation
Request Syntax
response = client.test_invoke_method(
restApiId='string',
resourceId='string',
httpMethod='string',
pathWithQueryString='string',
body='string',
headers={
'string': 'string'
},
multiValueHeaders={
'string': [
'string',
]
},
clientCertificateId='string',
stageVariables={
'string': 'string'
}
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
Specifies a test invoke method request's resource ID.
[REQUIRED]
Specifies a test invoke method request's HTTP method.
A key-value map of headers to simulate an incoming invocation request.
The headers as a map from string to list of values to simulate an incoming invocation request.
A key-value map of stage variables to simulate an invocation on a deployed Stage.
dict
Response Syntax
{
'status': 123,
'body': 'string',
'headers': {
'string': 'string'
},
'multiValueHeaders': {
'string': [
'string',
]
},
'log': 'string',
'latency': 123
}
Response Structure
(dict) --
Represents the response of the test invoke request in the HTTP method.
status (integer) --
The HTTP status code.
body (string) --
The body of the HTTP response.
headers (dict) --
The headers of the HTTP response.
multiValueHeaders (dict) --
The headers of the HTTP response as a map from string to list of values.
log (string) --
The API Gateway execution log for the test invoke request.
latency (integer) --
The execution latency of the test invoke request.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.TooManyRequestsException
untag_resource
(**kwargs)¶Removes a tag from a given resource.
See also: AWS API Documentation
Request Syntax
response = client.untag_resource(
resourceArn='string',
tagKeys=[
'string',
]
)
[REQUIRED]
The ARN of a resource that can be tagged.
[REQUIRED]
The Tag keys to delete.
None
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
update_account
(**kwargs)¶Changes information about the current Account resource.
See also: AWS API Documentation
Request Syntax
response = client.update_account(
patchOperations=[
{
'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
'path': 'string',
'value': 'string',
'from': 'string'
},
]
)
For more information about supported patch operations, see Patch Operations.
For more information about supported patch operations, see Patch Operations.
An update operation to be performed with this PATCH request. The valid value can be add, remove, replace or copy. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message..
The op operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of {"name":"value"}, the path for this property is /name. If the name property value is a JSON object (e.g., {"name": {"child/name": "child-value"}}), the path for the child/name property will be /name/child~1name. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Each op operation can have only one path associated with it.
The new target value of the update operation. It is applicable for the add or replace operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '{"a": ...}'.
The copy update operation's source as identified by a JSON-Pointer value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with "op":"copy", "from":"/canarySettings/deploymentId" and "path":"/deploymentId".
{
'cloudwatchRoleArn': 'string',
'throttleSettings': {
'burstLimit': 123,
'rateLimit': 123.0
},
'features': [
'string',
],
'apiKeyVersion': 'string'
}
Response Structure
Represents an AWS account that is associated with API Gateway.
The ARN of an Amazon CloudWatch role for the current Account.
Specifies the API request limits configured for the current Account.
The API target request burst rate limit. This allows more requests through for a period of time than the target rate limit.
The API target request rate limit.
A list of features supported for the account. When usage plans are enabled, the features list will include an entry of "UsagePlans"
.
The version of the API keys used for the account.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
update_api_key
(**kwargs)¶Changes information about an ApiKey resource.
See also: AWS API Documentation
Request Syntax
response = client.update_api_key(
apiKey='string',
patchOperations=[
{
'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
'path': 'string',
'value': 'string',
'from': 'string'
},
]
)
[REQUIRED]
The identifier of the ApiKey resource to be updated.
For more information about supported patch operations, see Patch Operations.
For more information about supported patch operations, see Patch Operations.
An update operation to be performed with this PATCH request. The valid value can be add, remove, replace or copy. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message..
The op operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of {"name":"value"}, the path for this property is /name. If the name property value is a JSON object (e.g., {"name": {"child/name": "child-value"}}), the path for the child/name property will be /name/child~1name. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Each op operation can have only one path associated with it.
The new target value of the update operation. It is applicable for the add or replace operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '{"a": ...}'.
The copy update operation's source as identified by a JSON-Pointer value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with "op":"copy", "from":"/canarySettings/deploymentId" and "path":"/deploymentId".
dict
Response Syntax
{
'id': 'string',
'value': 'string',
'name': 'string',
'customerId': 'string',
'description': 'string',
'enabled': True|False,
'createdDate': datetime(2015, 1, 1),
'lastUpdatedDate': datetime(2015, 1, 1),
'stageKeys': [
'string',
],
'tags': {
'string': 'string'
}
}
Response Structure
(dict) --
A resource that can be distributed to callers for executing Method resources that require an API key. API keys can be mapped to any Stage on any RestApi, which indicates that the callers with the API key can make requests to that stage.
id (string) --
The identifier of the API Key.
value (string) --
The value of the API Key.
name (string) --
The name of the API Key.
customerId (string) --
An AWS Marketplace customer identifier , when integrating with the AWS SaaS Marketplace.
description (string) --
The description of the API Key.
enabled (boolean) --
Specifies whether the API Key can be used by callers.
createdDate (datetime) --
The timestamp when the API Key was created.
lastUpdatedDate (datetime) --
The timestamp when the API Key was last updated.
stageKeys (list) --
A list of Stage resources that are associated with the ApiKey resource.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
Updates an existing Authorizer resource.
See also: AWS API Documentation
Request Syntax
response = client.update_authorizer(
restApiId='string',
authorizerId='string',
patchOperations=[
{
'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
'path': 'string',
'value': 'string',
'from': 'string'
},
]
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The identifier of the Authorizer resource.
For more information about supported patch operations, see Patch Operations.
For more information about supported patch operations, see Patch Operations.
An update operation to be performed with this PATCH request. The valid value can be add, remove, replace or copy. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message..
The op operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of {"name":"value"}, the path for this property is /name. If the name property value is a JSON object (e.g., {"name": {"child/name": "child-value"}}), the path for the child/name property will be /name/child~1name. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Each op operation can have only one path associated with it.
The new target value of the update operation. It is applicable for the add or replace operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '{"a": ...}'.
The copy update operation's source as identified by a JSON-Pointer value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with "op":"copy", "from":"/canarySettings/deploymentId" and "path":"/deploymentId".
dict
Response Syntax
{
'id': 'string',
'name': 'string',
'type': 'TOKEN'|'REQUEST'|'COGNITO_USER_POOLS',
'providerARNs': [
'string',
],
'authType': 'string',
'authorizerUri': 'string',
'authorizerCredentials': 'string',
'identitySource': 'string',
'identityValidationExpression': 'string',
'authorizerResultTtlInSeconds': 123
}
Response Structure
(dict) --
Represents an authorization layer for methods. If enabled on a method, API Gateway will activate the authorizer when a client calls the method.
id (string) --
The identifier for the authorizer resource.
name (string) --
The name of the authorizer.
type (string) --
The authorizer type. Valid values are TOKEN
for a Lambda function using a single authorization token submitted in a custom header, REQUEST
for a Lambda function using incoming request parameters, and COGNITO_USER_POOLS
for using an Amazon Cognito user pool.
providerARNs (list) --
A list of the Amazon Cognito user pool ARNs for the COGNITO_USER_POOLS
authorizer. Each element is of this format: arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}
. For a TOKEN
or REQUEST
authorizer, this is not defined.
authType (string) --
Optional customer-defined field, used in OpenAPI imports and exports without functional impact.
authorizerUri (string) --
Specifies the authorizer's Uniform Resource Identifier (URI). For TOKEN
or REQUEST
authorizers, this must be a well-formed Lambda function URI, for example, arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations
. In general, the URI has this form arn:aws:apigateway:{region}:lambda:path/{service_api}
, where {region}
is the same as the region hosting the Lambda function, path
indicates that the remaining substring in the URI should be treated as the path to the resource, including the initial /
. For Lambda functions, this is usually of the form /2015-03-31/functions/[FunctionARN]/invocations
.
authorizerCredentials (string) --
Specifies the required credentials as an IAM role for API Gateway to invoke the authorizer. To specify an IAM role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, specify null.
identitySource (string) --
The identity source for which authorization is requested. For a TOKEN
or COGNITO_USER_POOLS
authorizer, this is required and specifies the request header mapping expression for the custom header holding the authorization token submitted by the client. For example, if the token header name is Auth
, the header mapping expression is method.request.header.Auth
. For the REQUEST
authorizer, this is required when authorization caching is enabled. The value is a comma-separated string of one or more mapping expressions of the specified request parameters. For example, if an Auth
header, a Name
query string parameter are defined as identity sources, this value is method.request.header.Auth
, method.request.querystring.Name
. These parameters will be used to derive the authorization caching key and to perform runtime validation of the REQUEST
authorizer by verifying all of the identity-related request parameters are present, not null and non-empty. Only when this is true does the authorizer invoke the authorizer Lambda function, otherwise, it returns a 401 Unauthorized response without calling the Lambda function. The valid value is a string of comma-separated mapping expressions of the specified request parameters. When the authorization caching is not enabled, this property is optional.
identityValidationExpression (string) --
A validation expression for the incoming identity token. For TOKEN
authorizers, this value is a regular expression. For COGNITO_USER_POOLS
authorizers, API Gateway will match the aud
field of the incoming token from the client against the specified regular expression. It will invoke the authorizer's Lambda function when there is a match. Otherwise, it will return a 401 Unauthorized response without calling the Lambda function. The validation expression does not apply to the REQUEST
authorizer.
authorizerResultTtlInSeconds (integer) --
The TTL in seconds of cached authorizer results. If it equals 0, authorization caching is disabled. If it is greater than 0, API Gateway will cache authorizer responses. If this field is not set, the default value is 300. The maximum value is 3600, or 1 hour.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
update_base_path_mapping
(**kwargs)¶Changes information about the BasePathMapping resource.
See also: AWS API Documentation
Request Syntax
response = client.update_base_path_mapping(
domainName='string',
basePath='string',
patchOperations=[
{
'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
'path': 'string',
'value': 'string',
'from': 'string'
},
]
)
[REQUIRED]
The domain name of the BasePathMapping resource to change.
[REQUIRED]
The base path of the BasePathMapping resource to change.
To specify an empty base path, set this parameter to '(none)'
.
For more information about supported patch operations, see Patch Operations.
For more information about supported patch operations, see Patch Operations.
An update operation to be performed with this PATCH request. The valid value can be add, remove, replace or copy. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message..
The op operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of {"name":"value"}, the path for this property is /name. If the name property value is a JSON object (e.g., {"name": {"child/name": "child-value"}}), the path for the child/name property will be /name/child~1name. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Each op operation can have only one path associated with it.
The new target value of the update operation. It is applicable for the add or replace operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '{"a": ...}'.
The copy update operation's source as identified by a JSON-Pointer value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with "op":"copy", "from":"/canarySettings/deploymentId" and "path":"/deploymentId".
dict
Response Syntax
{
'basePath': 'string',
'restApiId': 'string',
'stage': 'string'
}
Response Structure
(dict) --
Represents the base path that callers of the API must provide as part of the URL after the domain name.
basePath (string) --
The base path name that callers of the API must provide as part of the URL after the domain name.
restApiId (string) --
The string identifier of the associated RestApi.
stage (string) --
The name of the associated stage.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
update_client_certificate
(**kwargs)¶Changes information about an ClientCertificate resource.
See also: AWS API Documentation
Request Syntax
response = client.update_client_certificate(
clientCertificateId='string',
patchOperations=[
{
'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
'path': 'string',
'value': 'string',
'from': 'string'
},
]
)
[REQUIRED]
The identifier of the ClientCertificate resource to be updated.
For more information about supported patch operations, see Patch Operations.
For more information about supported patch operations, see Patch Operations.
An update operation to be performed with this PATCH request. The valid value can be add, remove, replace or copy. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message..
The op operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of {"name":"value"}, the path for this property is /name. If the name property value is a JSON object (e.g., {"name": {"child/name": "child-value"}}), the path for the child/name property will be /name/child~1name. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Each op operation can have only one path associated with it.
The new target value of the update operation. It is applicable for the add or replace operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '{"a": ...}'.
The copy update operation's source as identified by a JSON-Pointer value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with "op":"copy", "from":"/canarySettings/deploymentId" and "path":"/deploymentId".
dict
Response Syntax
{
'clientCertificateId': 'string',
'description': 'string',
'pemEncodedCertificate': 'string',
'createdDate': datetime(2015, 1, 1),
'expirationDate': datetime(2015, 1, 1),
'tags': {
'string': 'string'
}
}
Response Structure
(dict) --
Represents a client certificate used to configure client-side SSL authentication while sending requests to the integration endpoint.
clientCertificateId (string) --
The identifier of the client certificate.
description (string) --
The description of the client certificate.
pemEncodedCertificate (string) --
The PEM-encoded public key of the client certificate, which can be used to configure certificate authentication in the integration endpoint .
createdDate (datetime) --
The timestamp when the client certificate was created.
expirationDate (datetime) --
The timestamp when the client certificate will expire.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
update_deployment
(**kwargs)¶Changes information about a Deployment resource.
See also: AWS API Documentation
Request Syntax
response = client.update_deployment(
restApiId='string',
deploymentId='string',
patchOperations=[
{
'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
'path': 'string',
'value': 'string',
'from': 'string'
},
]
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The replacement identifier for the Deployment resource to change information about.
For more information about supported patch operations, see Patch Operations.
For more information about supported patch operations, see Patch Operations.
An update operation to be performed with this PATCH request. The valid value can be add, remove, replace or copy. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message..
The op operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of {"name":"value"}, the path for this property is /name. If the name property value is a JSON object (e.g., {"name": {"child/name": "child-value"}}), the path for the child/name property will be /name/child~1name. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Each op operation can have only one path associated with it.
The new target value of the update operation. It is applicable for the add or replace operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '{"a": ...}'.
The copy update operation's source as identified by a JSON-Pointer value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with "op":"copy", "from":"/canarySettings/deploymentId" and "path":"/deploymentId".
dict
Response Syntax
{
'id': 'string',
'description': 'string',
'createdDate': datetime(2015, 1, 1),
'apiSummary': {
'string': {
'string': {
'authorizationType': 'string',
'apiKeyRequired': True|False
}
}
}
}
Response Structure
(dict) --
An immutable representation of a RestApi resource that can be called by users using Stages. A deployment must be associated with a Stage for it to be callable over the Internet.
id (string) --
The identifier for the deployment resource.
description (string) --
The description for the deployment resource.
createdDate (datetime) --
The date and time that the deployment resource was created.
apiSummary (dict) --
A summary of the RestApi at the date and time that the deployment resource was created.
(string) --
(dict) --
(string) --
(dict) --
Represents a summary of a Method resource, given a particular date and time.
authorizationType (string) --
The method's authorization type. Valid values are NONE
for open access, AWS_IAM
for using AWS IAM permissions, CUSTOM
for using a custom authorizer, or COGNITO_USER_POOLS
for using a Cognito user pool.
apiKeyRequired (boolean) --
Specifies whether the method requires a valid ApiKey.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
APIGateway.Client.exceptions.ServiceUnavailableException
update_documentation_part
(**kwargs)¶Updates a documentation part.
See also: AWS API Documentation
Request Syntax
response = client.update_documentation_part(
restApiId='string',
documentationPartId='string',
patchOperations=[
{
'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
'path': 'string',
'value': 'string',
'from': 'string'
},
]
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The identifier of the to-be-updated documentation part.
For more information about supported patch operations, see Patch Operations.
For more information about supported patch operations, see Patch Operations.
An update operation to be performed with this PATCH request. The valid value can be add, remove, replace or copy. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message..
The op operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of {"name":"value"}, the path for this property is /name. If the name property value is a JSON object (e.g., {"name": {"child/name": "child-value"}}), the path for the child/name property will be /name/child~1name. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Each op operation can have only one path associated with it.
The new target value of the update operation. It is applicable for the add or replace operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '{"a": ...}'.
The copy update operation's source as identified by a JSON-Pointer value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with "op":"copy", "from":"/canarySettings/deploymentId" and "path":"/deploymentId".
dict
Response Syntax
{
'id': 'string',
'location': {
'type': 'API'|'AUTHORIZER'|'MODEL'|'RESOURCE'|'METHOD'|'PATH_PARAMETER'|'QUERY_PARAMETER'|'REQUEST_HEADER'|'REQUEST_BODY'|'RESPONSE'|'RESPONSE_HEADER'|'RESPONSE_BODY',
'path': 'string',
'method': 'string',
'statusCode': 'string',
'name': 'string'
},
'properties': 'string'
}
Response Structure
(dict) --
A documentation part for a targeted API entity.
id (string) --
The DocumentationPart identifier, generated by API Gateway when the DocumentationPart
is created.
location (dict) --
The location of the API entity to which the documentation applies. Valid fields depend on the targeted API entity type. All the valid location fields are not required. If not explicitly specified, a valid location field is treated as a wildcard and associated documentation content may be inherited by matching entities, unless overridden.
type (string) --
The type of API entity to which the documentation content applies. Valid values are API
, AUTHORIZER
, MODEL
, RESOURCE
, METHOD
, PATH_PARAMETER
, QUERY_PARAMETER
, REQUEST_HEADER
, REQUEST_BODY
, RESPONSE
, RESPONSE_HEADER
, and RESPONSE_BODY
. Content inheritance does not apply to any entity of the API
, AUTHORIZER
, METHOD
, MODEL
, REQUEST_BODY
, or RESOURCE
type.
path (string) --
The URL path of the target. It is a valid field for the API entity types of RESOURCE
, METHOD
, PATH_PARAMETER
, QUERY_PARAMETER
, REQUEST_HEADER
, REQUEST_BODY
, RESPONSE
, RESPONSE_HEADER
, and RESPONSE_BODY
. The default value is /
for the root resource. When an applicable child entity inherits the content of another entity of the same type with more general specifications of the other location
attributes, the child entity's path
attribute must match that of the parent entity as a prefix.
method (string) --
The HTTP verb of a method. It is a valid field for the API entity types of METHOD
, PATH_PARAMETER
, QUERY_PARAMETER
, REQUEST_HEADER
, REQUEST_BODY
, RESPONSE
, RESPONSE_HEADER
, and RESPONSE_BODY
. The default value is *
for any method. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the other location
attributes, the child entity's method
attribute must match that of the parent entity exactly.
statusCode (string) --
The HTTP status code of a response. It is a valid field for the API entity types of RESPONSE
, RESPONSE_HEADER
, and RESPONSE_BODY
. The default value is *
for any status code. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the other location
attributes, the child entity's statusCode
attribute must match that of the parent entity exactly.
name (string) --
The name of the targeted API entity. It is a valid and required field for the API entity types of AUTHORIZER
, MODEL
, PATH_PARAMETER
, QUERY_PARAMETER
, REQUEST_HEADER
, REQUEST_BODY
and RESPONSE_HEADER
. It is an invalid field for any other entity type.
properties (string) --
A content map of API-specific key-value pairs describing the targeted API entity. The map must be encoded as a JSON string, e.g., "{ \"description\": \"The API does ...\" }"
. Only OpenAPI-compliant documentation-related fields from the properties map are exported and, hence, published as part of the API entity definitions, while the original documentation parts are exported in a OpenAPI extension of x-amazon-apigateway-documentation
.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
update_documentation_version
(**kwargs)¶Updates a documentation version.
See also: AWS API Documentation
Request Syntax
response = client.update_documentation_version(
restApiId='string',
documentationVersion='string',
patchOperations=[
{
'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
'path': 'string',
'value': 'string',
'from': 'string'
},
]
)
[REQUIRED]
The string identifier of the associated RestApi..
[REQUIRED]
The version identifier of the to-be-updated documentation version.
For more information about supported patch operations, see Patch Operations.
For more information about supported patch operations, see Patch Operations.
An update operation to be performed with this PATCH request. The valid value can be add, remove, replace or copy. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message..
The op operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of {"name":"value"}, the path for this property is /name. If the name property value is a JSON object (e.g., {"name": {"child/name": "child-value"}}), the path for the child/name property will be /name/child~1name. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Each op operation can have only one path associated with it.
The new target value of the update operation. It is applicable for the add or replace operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '{"a": ...}'.
The copy update operation's source as identified by a JSON-Pointer value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with "op":"copy", "from":"/canarySettings/deploymentId" and "path":"/deploymentId".
dict
Response Syntax
{
'version': 'string',
'createdDate': datetime(2015, 1, 1),
'description': 'string'
}
Response Structure
(dict) --
A snapshot of the documentation of an API.
version (string) --
The version identifier of the API documentation snapshot.
createdDate (datetime) --
The date when the API documentation snapshot is created.
description (string) --
The description of the API documentation snapshot.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
update_domain_name
(**kwargs)¶Changes information about the DomainName resource.
See also: AWS API Documentation
Request Syntax
response = client.update_domain_name(
domainName='string',
patchOperations=[
{
'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
'path': 'string',
'value': 'string',
'from': 'string'
},
]
)
[REQUIRED]
The name of the DomainName resource to be changed.
For more information about supported patch operations, see Patch Operations.
For more information about supported patch operations, see Patch Operations.
An update operation to be performed with this PATCH request. The valid value can be add, remove, replace or copy. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message..
The op operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of {"name":"value"}, the path for this property is /name. If the name property value is a JSON object (e.g., {"name": {"child/name": "child-value"}}), the path for the child/name property will be /name/child~1name. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Each op operation can have only one path associated with it.
The new target value of the update operation. It is applicable for the add or replace operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '{"a": ...}'.
The copy update operation's source as identified by a JSON-Pointer value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with "op":"copy", "from":"/canarySettings/deploymentId" and "path":"/deploymentId".
dict
Response Syntax
{
'domainName': 'string',
'certificateName': 'string',
'certificateArn': 'string',
'certificateUploadDate': datetime(2015, 1, 1),
'regionalDomainName': 'string',
'regionalHostedZoneId': 'string',
'regionalCertificateName': 'string',
'regionalCertificateArn': 'string',
'distributionDomainName': 'string',
'distributionHostedZoneId': 'string',
'endpointConfiguration': {
'types': [
'REGIONAL'|'EDGE'|'PRIVATE',
],
'vpcEndpointIds': [
'string',
]
},
'domainNameStatus': 'AVAILABLE'|'UPDATING'|'PENDING'|'PENDING_CERTIFICATE_REIMPORT'|'PENDING_OWNERSHIP_VERIFICATION',
'domainNameStatusMessage': 'string',
'securityPolicy': 'TLS_1_0'|'TLS_1_2',
'tags': {
'string': 'string'
},
'mutualTlsAuthentication': {
'truststoreUri': 'string',
'truststoreVersion': 'string',
'truststoreWarnings': [
'string',
]
},
'ownershipVerificationCertificateArn': 'string'
}
Response Structure
(dict) --
Represents a custom domain name as a user-friendly host name of an API (RestApi).
domainName (string) --
The custom domain name as an API host name, for example, my-api.example.com
.
certificateName (string) --
The name of the certificate that will be used by edge-optimized endpoint for this domain name.
certificateArn (string) --
The reference to an AWS-managed certificate that will be used by edge-optimized endpoint for this domain name. AWS Certificate Manager is the only supported source.
certificateUploadDate (datetime) --
The timestamp when the certificate that was used by edge-optimized endpoint for this domain name was uploaded.
regionalDomainName (string) --
The domain name associated with the regional endpoint for this custom domain name. You set up this association by adding a DNS record that points the custom domain name to this regional domain name. The regional domain name is returned by API Gateway when you create a regional endpoint.
regionalHostedZoneId (string) --
The region-specific Amazon Route 53 Hosted Zone ID of the regional endpoint. For more information, see Set up a Regional Custom Domain Name and AWS Regions and Endpoints for API Gateway.
regionalCertificateName (string) --
The name of the certificate that will be used for validating the regional domain name.
regionalCertificateArn (string) --
The reference to an AWS-managed certificate that will be used for validating the regional domain name. AWS Certificate Manager is the only supported source.
distributionDomainName (string) --
The domain name of the Amazon CloudFront distribution associated with this custom domain name for an edge-optimized endpoint. You set up this association when adding a DNS record pointing the custom domain name to this distribution name. For more information about CloudFront distributions, see the Amazon CloudFront documentation.
distributionHostedZoneId (string) --
The region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized endpoint. The valid value is Z2FDTNDATAQYW2
for all the regions. For more information, see Set up a Regional Custom Domain Name and AWS Regions and Endpoints for API Gateway.
endpointConfiguration (dict) --
The endpoint configuration of this DomainName showing the endpoint types of the domain name.
types (list) --
A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is "EDGE"
. For a regional API and its custom domain name, the endpoint type is REGIONAL
. For a private API, the endpoint type is PRIVATE
.
(string) --
The endpoint type. The valid values are EDGE
for edge-optimized API setup, most suitable for mobile applications; REGIONAL
for regional API endpoint setup, most suitable for calling from AWS Region; and PRIVATE
for private APIs.
vpcEndpointIds (list) --
A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for PRIVATE
endpoint type.
domainNameStatus (string) --
The status of the DomainName migration. The valid values are AVAILABLE
and UPDATING
. If the status is UPDATING
, the domain cannot be modified further until the existing operation is complete. If it is AVAILABLE
, the domain can be updated.
domainNameStatusMessage (string) --
An optional text message containing detailed information about status of the DomainName migration.
securityPolicy (string) --
The Transport Layer Security (TLS) version + cipher suite for this DomainName. The valid values are TLS_1_0
and TLS_1_2
.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
mutualTlsAuthentication (dict) --
The mutual TLS authentication configuration for a custom domain name. If specified, API Gateway performs two-way authentication between the client and the server. Clients must present a trusted certificate to access your API.
truststoreUri (string) --
An Amazon S3 URL that specifies the truststore for mutual TLS authentication, for example s3://bucket-name/key-name
. The truststore can contain certificates from public or private certificate authorities. To update the truststore, upload a new version to S3, and then update your custom domain name to use the new version. To update the truststore, you must have permissions to access the S3 object.
truststoreVersion (string) --
The version of the S3 object that contains your truststore. To specify a version, you must have versioning enabled for the S3 bucket.
truststoreWarnings (list) --
A list of warnings that API Gateway returns while processing your truststore. Invalid certificates produce warnings. Mutual TLS is still enabled, but some clients might not be able to access your API. To resolve warnings, upload a new truststore to S3, and then update you domain name to use the new version.
ownershipVerificationCertificateArn (string) --
The ARN of the public certificate issued by ACM to validate ownership of your custom domain. Only required when configuring mutual TLS and using an ACM imported or private CA certificate ARN as the regionalCertificateArn.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
update_gateway_response
(**kwargs)¶Updates a GatewayResponse of a specified response type on the given RestApi.
See also: AWS API Documentation
Request Syntax
response = client.update_gateway_response(
restApiId='string',
responseType='DEFAULT_4XX'|'DEFAULT_5XX'|'RESOURCE_NOT_FOUND'|'UNAUTHORIZED'|'INVALID_API_KEY'|'ACCESS_DENIED'|'AUTHORIZER_FAILURE'|'AUTHORIZER_CONFIGURATION_ERROR'|'INVALID_SIGNATURE'|'EXPIRED_TOKEN'|'MISSING_AUTHENTICATION_TOKEN'|'INTEGRATION_FAILURE'|'INTEGRATION_TIMEOUT'|'API_CONFIGURATION_ERROR'|'UNSUPPORTED_MEDIA_TYPE'|'BAD_REQUEST_PARAMETERS'|'BAD_REQUEST_BODY'|'REQUEST_TOO_LARGE'|'THROTTLED'|'QUOTA_EXCEEDED'|'WAF_FILTERED',
patchOperations=[
{
'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
'path': 'string',
'value': 'string',
'from': 'string'
},
]
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The response type of the associated GatewayResponse.
For more information about supported patch operations, see Patch Operations.
For more information about supported patch operations, see Patch Operations.
An update operation to be performed with this PATCH request. The valid value can be add, remove, replace or copy. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message..
The op operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of {"name":"value"}, the path for this property is /name. If the name property value is a JSON object (e.g., {"name": {"child/name": "child-value"}}), the path for the child/name property will be /name/child~1name. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Each op operation can have only one path associated with it.
The new target value of the update operation. It is applicable for the add or replace operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '{"a": ...}'.
The copy update operation's source as identified by a JSON-Pointer value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with "op":"copy", "from":"/canarySettings/deploymentId" and "path":"/deploymentId".
dict
Response Syntax
{
'responseType': 'DEFAULT_4XX'|'DEFAULT_5XX'|'RESOURCE_NOT_FOUND'|'UNAUTHORIZED'|'INVALID_API_KEY'|'ACCESS_DENIED'|'AUTHORIZER_FAILURE'|'AUTHORIZER_CONFIGURATION_ERROR'|'INVALID_SIGNATURE'|'EXPIRED_TOKEN'|'MISSING_AUTHENTICATION_TOKEN'|'INTEGRATION_FAILURE'|'INTEGRATION_TIMEOUT'|'API_CONFIGURATION_ERROR'|'UNSUPPORTED_MEDIA_TYPE'|'BAD_REQUEST_PARAMETERS'|'BAD_REQUEST_BODY'|'REQUEST_TOO_LARGE'|'THROTTLED'|'QUOTA_EXCEEDED'|'WAF_FILTERED',
'statusCode': 'string',
'responseParameters': {
'string': 'string'
},
'responseTemplates': {
'string': 'string'
},
'defaultResponse': True|False
}
Response Structure
(dict) --
A gateway response of a given response type and status code, with optional response parameters and mapping templates.
responseType (string) --
The response type of the associated GatewayResponse.
statusCode (string) --
The HTTP status code for this GatewayResponse.
responseParameters (dict) --
Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of key-value pairs.
responseTemplates (dict) --
Response templates of the GatewayResponse as a string-to-string map of key-value pairs.
defaultResponse (boolean) --
A Boolean flag to indicate whether this GatewayResponse is the default gateway response ( true
) or not ( false
). A default gateway response is one generated by API Gateway without any customization by an API developer.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
update_integration
(**kwargs)¶Represents an update integration.
See also: AWS API Documentation
Request Syntax
response = client.update_integration(
restApiId='string',
resourceId='string',
httpMethod='string',
patchOperations=[
{
'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
'path': 'string',
'value': 'string',
'from': 'string'
},
]
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
Represents an update integration request's resource identifier.
[REQUIRED]
Represents an update integration request's HTTP method.
For more information about supported patch operations, see Patch Operations.
For more information about supported patch operations, see Patch Operations.
An update operation to be performed with this PATCH request. The valid value can be add, remove, replace or copy. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message..
The op operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of {"name":"value"}, the path for this property is /name. If the name property value is a JSON object (e.g., {"name": {"child/name": "child-value"}}), the path for the child/name property will be /name/child~1name. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Each op operation can have only one path associated with it.
The new target value of the update operation. It is applicable for the add or replace operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '{"a": ...}'.
The copy update operation's source as identified by a JSON-Pointer value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with "op":"copy", "from":"/canarySettings/deploymentId" and "path":"/deploymentId".
dict
Response Syntax
{
'type': 'HTTP'|'AWS'|'MOCK'|'HTTP_PROXY'|'AWS_PROXY',
'httpMethod': 'string',
'uri': 'string',
'connectionType': 'INTERNET'|'VPC_LINK',
'connectionId': 'string',
'credentials': 'string',
'requestParameters': {
'string': 'string'
},
'requestTemplates': {
'string': 'string'
},
'passthroughBehavior': 'string',
'contentHandling': 'CONVERT_TO_BINARY'|'CONVERT_TO_TEXT',
'timeoutInMillis': 123,
'cacheNamespace': 'string',
'cacheKeyParameters': [
'string',
],
'integrationResponses': {
'string': {
'statusCode': 'string',
'selectionPattern': 'string',
'responseParameters': {
'string': 'string'
},
'responseTemplates': {
'string': 'string'
},
'contentHandling': 'CONVERT_TO_BINARY'|'CONVERT_TO_TEXT'
}
},
'tlsConfig': {
'insecureSkipVerification': True|False
}
}
Response Structure
(dict) --
Represents an HTTP, HTTP_PROXY, AWS, AWS_PROXY, or Mock integration.
type (string) --
Specifies an API method integration type. The valid value is one of the following:
For the HTTP and HTTP proxy integrations, each integration can specify a protocol ( http/https
), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with a connectionType
of VPC_LINK
is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC.
httpMethod (string) --
Specifies the integration's HTTP method type.
uri (string) --
Specifies Uniform Resource Identifier (URI) of the integration endpoint.
For HTTP
or HTTP_PROXY
integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, where connectionType
is not VPC_LINK
, or private integration, where connectionType
is VPC_LINK
. For a private HTTP integration, the URI is not used for routing. For AWS
or AWS_PROXY
integrations, the URI is of the form arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}
. Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is the name of the integrated Amazon Web Services service (e.g., s3); and {subdomain} is a designated subdomain supported by certain Amazon Web Services service for fast host-name lookup. action can be used for an Amazon Web Services service action-based API, using an Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing {service_api} refers to a supported action {name} plus any required input parameters. Alternatively, path can be used for an AWS service path-based API. The ensuing service_api refers to the path to an Amazon Web Services service resource, including the region of the integrated Amazon Web Services service, if applicable. For example, for integration with the S3 API of GetObject, the uri can be either arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}
or arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}
connectionType (string) --
The type of the network connection to the integration endpoint. The valid value is INTERNET
for connections through the public routable internet or VPC_LINK
for private connections between API Gateway and a network load balancer in a VPC. The default value is INTERNET
.
connectionId (string) --
The ID of the VpcLink used for the integration when connectionType=VPC_LINK
and undefined, otherwise.
credentials (string) --
Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string arn:aws:iam::\*:user/\*
. To use resource-based permissions on supported AWS services, specify null.
requestParameters (dict) --
A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of method.request.{location}.{name}
, where location
is querystring
, path
, or header
and name
must be a valid and unique method request parameter name.
requestTemplates (dict) --
Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.
passthroughBehavior (string) --
Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in requestTemplates
. The valid value is one of the following: WHEN_NO_MATCH
: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. WHEN_NO_TEMPLATES
: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP 415 Unsupported Media Type response. NEVER
: rejects the method request with an HTTP 415 Unsupported Media Type response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.
contentHandling (string) --
Specifies how to handle request payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the passthroughBehavior
is configured to support payload pass-through.
timeoutInMillis (integer) --
Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
cacheNamespace (string) --
Specifies a group of related cached parameters. By default, API Gateway uses the resource ID as the cacheNamespace
. You can specify the same cacheNamespace
across resources to return the same cached data for requests to different resources.
cacheKeyParameters (list) --
A list of request parameters whose values API Gateway caches. To be valid values for cacheKeyParameters
, these parameters must also be specified for Method requestParameters
.
integrationResponses (dict) --
Specifies the integration's responses.
(string) --
(dict) --
Represents an integration response. The status code must map to an existing MethodResponse, and parameters and templates can be used to transform the back-end response.
statusCode (string) --
Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern (string) --
Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the .+
regex to match error response. However, make sure that the error response does not contain any newline ( \n
) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.
responseParameters (dict) --
A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of method.response.header.{name}
, where name
is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header.{name}
or integration.response.body.{JSON-expression}
, where name
is a valid and unique response header name and JSON-expression
is a valid JSON expression without the $
prefix.
responseTemplates (dict) --
Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
contentHandling (string) --
Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
tlsConfig (dict) --
Specifies the TLS configuration for an integration.
insecureSkipVerification (boolean) --
Specifies whether or not API Gateway skips verification that the certificate for an integration endpoint is issued by a supported certificate authority. This isn’t recommended, but it enables you to use certificates that are signed by private certificate authorities, or certificates that are self-signed. If enabled, API Gateway still performs basic certificate validation, which includes checking the certificate's expiration date, hostname, and presence of a root certificate authority. Supported only for HTTP
and HTTP_PROXY
integrations.
Warning
Enabling insecureSkipVerification
isn't recommended, especially for integrations with public HTTPS endpoints. If you enable insecureSkipVerification
, you increase the risk of man-in-the-middle attacks.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
update_integration_response
(**kwargs)¶Represents an update integration response.
See also: AWS API Documentation
Request Syntax
response = client.update_integration_response(
restApiId='string',
resourceId='string',
httpMethod='string',
statusCode='string',
patchOperations=[
{
'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
'path': 'string',
'value': 'string',
'from': 'string'
},
]
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
Specifies an update integration response request's resource identifier.
[REQUIRED]
Specifies an update integration response request's HTTP method.
[REQUIRED]
Specifies an update integration response request's status code.
For more information about supported patch operations, see Patch Operations.
For more information about supported patch operations, see Patch Operations.
An update operation to be performed with this PATCH request. The valid value can be add, remove, replace or copy. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message..
The op operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of {"name":"value"}, the path for this property is /name. If the name property value is a JSON object (e.g., {"name": {"child/name": "child-value"}}), the path for the child/name property will be /name/child~1name. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Each op operation can have only one path associated with it.
The new target value of the update operation. It is applicable for the add or replace operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '{"a": ...}'.
The copy update operation's source as identified by a JSON-Pointer value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with "op":"copy", "from":"/canarySettings/deploymentId" and "path":"/deploymentId".
dict
Response Syntax
{
'statusCode': 'string',
'selectionPattern': 'string',
'responseParameters': {
'string': 'string'
},
'responseTemplates': {
'string': 'string'
},
'contentHandling': 'CONVERT_TO_BINARY'|'CONVERT_TO_TEXT'
}
Response Structure
(dict) --
Represents an integration response. The status code must map to an existing MethodResponse, and parameters and templates can be used to transform the back-end response.
statusCode (string) --
Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern (string) --
Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the .+
regex to match error response. However, make sure that the error response does not contain any newline ( \n
) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.
responseParameters (dict) --
A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of method.response.header.{name}
, where name
is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header.{name}
or integration.response.body.{JSON-expression}
, where name
is a valid and unique response header name and JSON-expression
is a valid JSON expression without the $
prefix.
responseTemplates (dict) --
Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
contentHandling (string) --
Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
update_method
(**kwargs)¶Updates an existing Method resource.
See also: AWS API Documentation
Request Syntax
response = client.update_method(
restApiId='string',
resourceId='string',
httpMethod='string',
patchOperations=[
{
'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
'path': 'string',
'value': 'string',
'from': 'string'
},
]
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The Resource identifier for the Method resource.
[REQUIRED]
The HTTP verb of the Method resource.
For more information about supported patch operations, see Patch Operations.
For more information about supported patch operations, see Patch Operations.
An update operation to be performed with this PATCH request. The valid value can be add, remove, replace or copy. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message..
The op operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of {"name":"value"}, the path for this property is /name. If the name property value is a JSON object (e.g., {"name": {"child/name": "child-value"}}), the path for the child/name property will be /name/child~1name. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Each op operation can have only one path associated with it.
The new target value of the update operation. It is applicable for the add or replace operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '{"a": ...}'.
The copy update operation's source as identified by a JSON-Pointer value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with "op":"copy", "from":"/canarySettings/deploymentId" and "path":"/deploymentId".
dict
Response Syntax
{
'httpMethod': 'string',
'authorizationType': 'string',
'authorizerId': 'string',
'apiKeyRequired': True|False,
'requestValidatorId': 'string',
'operationName': 'string',
'requestParameters': {
'string': True|False
},
'requestModels': {
'string': 'string'
},
'methodResponses': {
'string': {
'statusCode': 'string',
'responseParameters': {
'string': True|False
},
'responseModels': {
'string': 'string'
}
}
},
'methodIntegration': {
'type': 'HTTP'|'AWS'|'MOCK'|'HTTP_PROXY'|'AWS_PROXY',
'httpMethod': 'string',
'uri': 'string',
'connectionType': 'INTERNET'|'VPC_LINK',
'connectionId': 'string',
'credentials': 'string',
'requestParameters': {
'string': 'string'
},
'requestTemplates': {
'string': 'string'
},
'passthroughBehavior': 'string',
'contentHandling': 'CONVERT_TO_BINARY'|'CONVERT_TO_TEXT',
'timeoutInMillis': 123,
'cacheNamespace': 'string',
'cacheKeyParameters': [
'string',
],
'integrationResponses': {
'string': {
'statusCode': 'string',
'selectionPattern': 'string',
'responseParameters': {
'string': 'string'
},
'responseTemplates': {
'string': 'string'
},
'contentHandling': 'CONVERT_TO_BINARY'|'CONVERT_TO_TEXT'
}
},
'tlsConfig': {
'insecureSkipVerification': True|False
}
},
'authorizationScopes': [
'string',
]
}
Response Structure
(dict) --
Represents a client-facing interface by which the client calls the API to access back-end resources. A Method resource is integrated with an Integration resource. Both consist of a request and one or more responses. The method request takes the client input that is passed to the back end through the integration request. A method response returns the output from the back end to the client through an integration response. A method request is embodied in a Method resource, whereas an integration request is embodied in an Integration resource. On the other hand, a method response is represented by a MethodResponse resource, whereas an integration response is represented by an IntegrationResponse resource.
httpMethod (string) --
The method's HTTP verb.
authorizationType (string) --
The method's authorization type. Valid values are NONE
for open access, AWS_IAM
for using AWS IAM permissions, CUSTOM
for using a custom authorizer, or COGNITO_USER_POOLS
for using a Cognito user pool.
authorizerId (string) --
The identifier of an Authorizer to use on this method. The authorizationType
must be CUSTOM
.
apiKeyRequired (boolean) --
A boolean flag specifying whether a valid ApiKey is required to invoke this method.
requestValidatorId (string) --
The identifier of a RequestValidator for request validation.
operationName (string) --
A human-friendly operation identifier for the method. For example, you can assign the operationName
of ListPets
for the GET /pets
method in the PetStore
example.
requestParameters (dict) --
A key-value map defining required or optional method request parameters that can be accepted by API Gateway. A key is a method request parameter name matching the pattern of method.request.{location}.{name}
, where location
is querystring
, path
, or header
and name
is a valid and unique parameter name. The value associated with the key is a Boolean flag indicating whether the parameter is required ( true
) or optional ( false
). The method request parameter names defined here are available in Integration to be mapped to integration request parameters or templates.
requestModels (dict) --
A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key).
methodResponses (dict) --
Gets a method response associated with a given HTTP status code.
(string) --
(dict) --
Represents a method response of a given HTTP status code returned to the client. The method response is passed from the back end through the associated integration response that can be transformed using a mapping template.
statusCode (string) --
The method response's status code.
responseParameters (dict) --
A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header and the value specifies whether the associated method response header is required or not. The expression of the key must match the pattern method.response.header.{name}
, where name
is a valid and unique header name. API Gateway passes certain integration response data to the method response headers specified here according to the mapping you prescribe in the API's IntegrationResponse. The integration response data that can be mapped include an integration response header expressed in integration.response.header.{name}
, a static value enclosed within a pair of single quotes (e.g., 'application/json'
), or a JSON expression from the back-end response payload in the form of integration.response.body.{JSON-expression}
, where JSON-expression
is a valid JSON expression without the $
prefix.)
responseModels (dict) --
Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.
methodIntegration (dict) --
Gets the method's integration responsible for passing the client-submitted request to the back end and performing necessary transformations to make the request compliant with the back end.
type (string) --
Specifies an API method integration type. The valid value is one of the following:
For the HTTP and HTTP proxy integrations, each integration can specify a protocol ( http/https
), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with a connectionType
of VPC_LINK
is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC.
httpMethod (string) --
Specifies the integration's HTTP method type.
uri (string) --
Specifies Uniform Resource Identifier (URI) of the integration endpoint.
For HTTP
or HTTP_PROXY
integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, where connectionType
is not VPC_LINK
, or private integration, where connectionType
is VPC_LINK
. For a private HTTP integration, the URI is not used for routing. For AWS
or AWS_PROXY
integrations, the URI is of the form arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}
. Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is the name of the integrated Amazon Web Services service (e.g., s3); and {subdomain} is a designated subdomain supported by certain Amazon Web Services service for fast host-name lookup. action can be used for an Amazon Web Services service action-based API, using an Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing {service_api} refers to a supported action {name} plus any required input parameters. Alternatively, path can be used for an AWS service path-based API. The ensuing service_api refers to the path to an Amazon Web Services service resource, including the region of the integrated Amazon Web Services service, if applicable. For example, for integration with the S3 API of GetObject, the uri can be either arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}
or arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}
connectionType (string) --
The type of the network connection to the integration endpoint. The valid value is INTERNET
for connections through the public routable internet or VPC_LINK
for private connections between API Gateway and a network load balancer in a VPC. The default value is INTERNET
.
connectionId (string) --
The ID of the VpcLink used for the integration when connectionType=VPC_LINK
and undefined, otherwise.
credentials (string) --
Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string arn:aws:iam::\*:user/\*
. To use resource-based permissions on supported AWS services, specify null.
requestParameters (dict) --
A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of method.request.{location}.{name}
, where location
is querystring
, path
, or header
and name
must be a valid and unique method request parameter name.
requestTemplates (dict) --
Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.
passthroughBehavior (string) --
Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in requestTemplates
. The valid value is one of the following: WHEN_NO_MATCH
: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. WHEN_NO_TEMPLATES
: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP 415 Unsupported Media Type response. NEVER
: rejects the method request with an HTTP 415 Unsupported Media Type response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.
contentHandling (string) --
Specifies how to handle request payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the passthroughBehavior
is configured to support payload pass-through.
timeoutInMillis (integer) --
Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
cacheNamespace (string) --
Specifies a group of related cached parameters. By default, API Gateway uses the resource ID as the cacheNamespace
. You can specify the same cacheNamespace
across resources to return the same cached data for requests to different resources.
cacheKeyParameters (list) --
A list of request parameters whose values API Gateway caches. To be valid values for cacheKeyParameters
, these parameters must also be specified for Method requestParameters
.
integrationResponses (dict) --
Specifies the integration's responses.
(string) --
(dict) --
Represents an integration response. The status code must map to an existing MethodResponse, and parameters and templates can be used to transform the back-end response.
statusCode (string) --
Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern (string) --
Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the .+
regex to match error response. However, make sure that the error response does not contain any newline ( \n
) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.
responseParameters (dict) --
A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of method.response.header.{name}
, where name
is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header.{name}
or integration.response.body.{JSON-expression}
, where name
is a valid and unique response header name and JSON-expression
is a valid JSON expression without the $
prefix.
responseTemplates (dict) --
Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
contentHandling (string) --
Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
tlsConfig (dict) --
Specifies the TLS configuration for an integration.
insecureSkipVerification (boolean) --
Specifies whether or not API Gateway skips verification that the certificate for an integration endpoint is issued by a supported certificate authority. This isn’t recommended, but it enables you to use certificates that are signed by private certificate authorities, or certificates that are self-signed. If enabled, API Gateway still performs basic certificate validation, which includes checking the certificate's expiration date, hostname, and presence of a root certificate authority. Supported only for HTTP
and HTTP_PROXY
integrations.
Warning
Enabling insecureSkipVerification
isn't recommended, especially for integrations with public HTTPS endpoints. If you enable insecureSkipVerification
, you increase the risk of man-in-the-middle attacks.
authorizationScopes (list) --
A list of authorization scopes configured on the method. The scopes are used with a COGNITO_USER_POOLS
authorizer to authorize the method invocation. The authorization works by matching the method scopes against the scopes parsed from the access token in the incoming request. The method invocation is authorized if any method scopes matches a claimed scope in the access token. Otherwise, the invocation is not authorized. When the method scope is configured, the client must provide an access token instead of an identity token for authorization purposes.
Exceptions
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.TooManyRequestsException
update_method_response
(**kwargs)¶Updates an existing MethodResponse resource.
See also: AWS API Documentation
Request Syntax
response = client.update_method_response(
restApiId='string',
resourceId='string',
httpMethod='string',
statusCode='string',
patchOperations=[
{
'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
'path': 'string',
'value': 'string',
'from': 'string'
},
]
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The Resource identifier for the MethodResponse resource.
[REQUIRED]
The HTTP verb of the Method resource.
[REQUIRED]
The status code for the MethodResponse resource.
For more information about supported patch operations, see Patch Operations.
For more information about supported patch operations, see Patch Operations.
An update operation to be performed with this PATCH request. The valid value can be add, remove, replace or copy. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message..
The op operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of {"name":"value"}, the path for this property is /name. If the name property value is a JSON object (e.g., {"name": {"child/name": "child-value"}}), the path for the child/name property will be /name/child~1name. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Each op operation can have only one path associated with it.
The new target value of the update operation. It is applicable for the add or replace operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '{"a": ...}'.
The copy update operation's source as identified by a JSON-Pointer value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with "op":"copy", "from":"/canarySettings/deploymentId" and "path":"/deploymentId".
dict
Response Syntax
{
'statusCode': 'string',
'responseParameters': {
'string': True|False
},
'responseModels': {
'string': 'string'
}
}
Response Structure
(dict) --
Represents a method response of a given HTTP status code returned to the client. The method response is passed from the back end through the associated integration response that can be transformed using a mapping template.
statusCode (string) --
The method response's status code.
responseParameters (dict) --
A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header and the value specifies whether the associated method response header is required or not. The expression of the key must match the pattern method.response.header.{name}
, where name
is a valid and unique header name. API Gateway passes certain integration response data to the method response headers specified here according to the mapping you prescribe in the API's IntegrationResponse. The integration response data that can be mapped include an integration response header expressed in integration.response.header.{name}
, a static value enclosed within a pair of single quotes (e.g., 'application/json'
), or a JSON expression from the back-end response payload in the form of integration.response.body.{JSON-expression}
, where JSON-expression
is a valid JSON expression without the $
prefix.)
responseModels (dict) --
Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.
Exceptions
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.TooManyRequestsException
update_model
(**kwargs)¶Changes information about a model.
See also: AWS API Documentation
Request Syntax
response = client.update_model(
restApiId='string',
modelName='string',
patchOperations=[
{
'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
'path': 'string',
'value': 'string',
'from': 'string'
},
]
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The name of the model to update.
For more information about supported patch operations, see Patch Operations.
For more information about supported patch operations, see Patch Operations.
An update operation to be performed with this PATCH request. The valid value can be add, remove, replace or copy. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message..
The op operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of {"name":"value"}, the path for this property is /name. If the name property value is a JSON object (e.g., {"name": {"child/name": "child-value"}}), the path for the child/name property will be /name/child~1name. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Each op operation can have only one path associated with it.
The new target value of the update operation. It is applicable for the add or replace operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '{"a": ...}'.
The copy update operation's source as identified by a JSON-Pointer value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with "op":"copy", "from":"/canarySettings/deploymentId" and "path":"/deploymentId".
dict
Response Syntax
{
'id': 'string',
'name': 'string',
'description': 'string',
'schema': 'string',
'contentType': 'string'
}
Response Structure
(dict) --
Represents the data structure of a method's request or response payload.
id (string) --
The identifier for the model resource.
name (string) --
The name of the model. Must be an alphanumeric string.
description (string) --
The description of the model.
schema (string) --
The schema for the model. For application/json
models, this should be JSON schema draft 4 model. Do not include "*/" characters in the description of any properties because such "*/" characters may be interpreted as the closing marker for comments in some languages, such as Java or JavaScript, causing the installation of your API's SDK generated by API Gateway to fail.
contentType (string) --
The content-type for the model.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
update_request_validator
(**kwargs)¶Updates a RequestValidator of a given RestApi.
See also: AWS API Documentation
Request Syntax
response = client.update_request_validator(
restApiId='string',
requestValidatorId='string',
patchOperations=[
{
'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
'path': 'string',
'value': 'string',
'from': 'string'
},
]
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The identifier of RequestValidator to be updated.
For more information about supported patch operations, see Patch Operations.
For more information about supported patch operations, see Patch Operations.
An update operation to be performed with this PATCH request. The valid value can be add, remove, replace or copy. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message..
The op operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of {"name":"value"}, the path for this property is /name. If the name property value is a JSON object (e.g., {"name": {"child/name": "child-value"}}), the path for the child/name property will be /name/child~1name. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Each op operation can have only one path associated with it.
The new target value of the update operation. It is applicable for the add or replace operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '{"a": ...}'.
The copy update operation's source as identified by a JSON-Pointer value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with "op":"copy", "from":"/canarySettings/deploymentId" and "path":"/deploymentId".
dict
Response Syntax
{
'id': 'string',
'name': 'string',
'validateRequestBody': True|False,
'validateRequestParameters': True|False
}
Response Structure
(dict) --
A set of validation rules for incoming Method requests.
id (string) --
The identifier of this RequestValidator.
name (string) --
The name of this RequestValidator
validateRequestBody (boolean) --
A Boolean flag to indicate whether to validate a request body according to the configured Model schema.
validateRequestParameters (boolean) --
A Boolean flag to indicate whether to validate request parameters ( true
) or not ( false
).
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
update_resource
(**kwargs)¶Changes information about a Resource resource.
See also: AWS API Documentation
Request Syntax
response = client.update_resource(
restApiId='string',
resourceId='string',
patchOperations=[
{
'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
'path': 'string',
'value': 'string',
'from': 'string'
},
]
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The identifier of the Resource resource.
For more information about supported patch operations, see Patch Operations.
For more information about supported patch operations, see Patch Operations.
An update operation to be performed with this PATCH request. The valid value can be add, remove, replace or copy. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message..
The op operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of {"name":"value"}, the path for this property is /name. If the name property value is a JSON object (e.g., {"name": {"child/name": "child-value"}}), the path for the child/name property will be /name/child~1name. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Each op operation can have only one path associated with it.
The new target value of the update operation. It is applicable for the add or replace operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '{"a": ...}'.
The copy update operation's source as identified by a JSON-Pointer value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with "op":"copy", "from":"/canarySettings/deploymentId" and "path":"/deploymentId".
dict
Response Syntax
{
'id': 'string',
'parentId': 'string',
'pathPart': 'string',
'path': 'string',
'resourceMethods': {
'string': {
'httpMethod': 'string',
'authorizationType': 'string',
'authorizerId': 'string',
'apiKeyRequired': True|False,
'requestValidatorId': 'string',
'operationName': 'string',
'requestParameters': {
'string': True|False
},
'requestModels': {
'string': 'string'
},
'methodResponses': {
'string': {
'statusCode': 'string',
'responseParameters': {
'string': True|False
},
'responseModels': {
'string': 'string'
}
}
},
'methodIntegration': {
'type': 'HTTP'|'AWS'|'MOCK'|'HTTP_PROXY'|'AWS_PROXY',
'httpMethod': 'string',
'uri': 'string',
'connectionType': 'INTERNET'|'VPC_LINK',
'connectionId': 'string',
'credentials': 'string',
'requestParameters': {
'string': 'string'
},
'requestTemplates': {
'string': 'string'
},
'passthroughBehavior': 'string',
'contentHandling': 'CONVERT_TO_BINARY'|'CONVERT_TO_TEXT',
'timeoutInMillis': 123,
'cacheNamespace': 'string',
'cacheKeyParameters': [
'string',
],
'integrationResponses': {
'string': {
'statusCode': 'string',
'selectionPattern': 'string',
'responseParameters': {
'string': 'string'
},
'responseTemplates': {
'string': 'string'
},
'contentHandling': 'CONVERT_TO_BINARY'|'CONVERT_TO_TEXT'
}
},
'tlsConfig': {
'insecureSkipVerification': True|False
}
},
'authorizationScopes': [
'string',
]
}
}
}
Response Structure
(dict) --
Represents an API resource.
id (string) --
The resource's identifier.
parentId (string) --
The parent resource's identifier.
pathPart (string) --
The last path segment for this resource.
path (string) --
The full path for this resource.
resourceMethods (dict) --
Gets an API resource's method of a given HTTP verb.
(string) --
(dict) --
Represents a client-facing interface by which the client calls the API to access back-end resources. A Method resource is integrated with an Integration resource. Both consist of a request and one or more responses. The method request takes the client input that is passed to the back end through the integration request. A method response returns the output from the back end to the client through an integration response. A method request is embodied in a Method resource, whereas an integration request is embodied in an Integration resource. On the other hand, a method response is represented by a MethodResponse resource, whereas an integration response is represented by an IntegrationResponse resource.
httpMethod (string) --
The method's HTTP verb.
authorizationType (string) --
The method's authorization type. Valid values are NONE
for open access, AWS_IAM
for using AWS IAM permissions, CUSTOM
for using a custom authorizer, or COGNITO_USER_POOLS
for using a Cognito user pool.
authorizerId (string) --
The identifier of an Authorizer to use on this method. The authorizationType
must be CUSTOM
.
apiKeyRequired (boolean) --
A boolean flag specifying whether a valid ApiKey is required to invoke this method.
requestValidatorId (string) --
The identifier of a RequestValidator for request validation.
operationName (string) --
A human-friendly operation identifier for the method. For example, you can assign the operationName
of ListPets
for the GET /pets
method in the PetStore
example.
requestParameters (dict) --
A key-value map defining required or optional method request parameters that can be accepted by API Gateway. A key is a method request parameter name matching the pattern of method.request.{location}.{name}
, where location
is querystring
, path
, or header
and name
is a valid and unique parameter name. The value associated with the key is a Boolean flag indicating whether the parameter is required ( true
) or optional ( false
). The method request parameter names defined here are available in Integration to be mapped to integration request parameters or templates.
requestModels (dict) --
A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key).
methodResponses (dict) --
Gets a method response associated with a given HTTP status code.
(string) --
(dict) --
Represents a method response of a given HTTP status code returned to the client. The method response is passed from the back end through the associated integration response that can be transformed using a mapping template.
statusCode (string) --
The method response's status code.
responseParameters (dict) --
A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header and the value specifies whether the associated method response header is required or not. The expression of the key must match the pattern method.response.header.{name}
, where name
is a valid and unique header name. API Gateway passes certain integration response data to the method response headers specified here according to the mapping you prescribe in the API's IntegrationResponse. The integration response data that can be mapped include an integration response header expressed in integration.response.header.{name}
, a static value enclosed within a pair of single quotes (e.g., 'application/json'
), or a JSON expression from the back-end response payload in the form of integration.response.body.{JSON-expression}
, where JSON-expression
is a valid JSON expression without the $
prefix.)
responseModels (dict) --
Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.
methodIntegration (dict) --
Gets the method's integration responsible for passing the client-submitted request to the back end and performing necessary transformations to make the request compliant with the back end.
type (string) --
Specifies an API method integration type. The valid value is one of the following:
For the HTTP and HTTP proxy integrations, each integration can specify a protocol ( http/https
), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with a connectionType
of VPC_LINK
is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC.
httpMethod (string) --
Specifies the integration's HTTP method type.
uri (string) --
Specifies Uniform Resource Identifier (URI) of the integration endpoint.
For HTTP
or HTTP_PROXY
integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, where connectionType
is not VPC_LINK
, or private integration, where connectionType
is VPC_LINK
. For a private HTTP integration, the URI is not used for routing. For AWS
or AWS_PROXY
integrations, the URI is of the form arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}
. Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is the name of the integrated Amazon Web Services service (e.g., s3); and {subdomain} is a designated subdomain supported by certain Amazon Web Services service for fast host-name lookup. action can be used for an Amazon Web Services service action-based API, using an Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing {service_api} refers to a supported action {name} plus any required input parameters. Alternatively, path can be used for an AWS service path-based API. The ensuing service_api refers to the path to an Amazon Web Services service resource, including the region of the integrated Amazon Web Services service, if applicable. For example, for integration with the S3 API of GetObject, the uri can be either arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}
or arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}
connectionType (string) --
The type of the network connection to the integration endpoint. The valid value is INTERNET
for connections through the public routable internet or VPC_LINK
for private connections between API Gateway and a network load balancer in a VPC. The default value is INTERNET
.
connectionId (string) --
The ID of the VpcLink used for the integration when connectionType=VPC_LINK
and undefined, otherwise.
credentials (string) --
Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string arn:aws:iam::\*:user/\*
. To use resource-based permissions on supported AWS services, specify null.
requestParameters (dict) --
A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of method.request.{location}.{name}
, where location
is querystring
, path
, or header
and name
must be a valid and unique method request parameter name.
requestTemplates (dict) --
Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.
passthroughBehavior (string) --
Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in requestTemplates
. The valid value is one of the following: WHEN_NO_MATCH
: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. WHEN_NO_TEMPLATES
: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP 415 Unsupported Media Type response. NEVER
: rejects the method request with an HTTP 415 Unsupported Media Type response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.
contentHandling (string) --
Specifies how to handle request payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the passthroughBehavior
is configured to support payload pass-through.
timeoutInMillis (integer) --
Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
cacheNamespace (string) --
Specifies a group of related cached parameters. By default, API Gateway uses the resource ID as the cacheNamespace
. You can specify the same cacheNamespace
across resources to return the same cached data for requests to different resources.
cacheKeyParameters (list) --
A list of request parameters whose values API Gateway caches. To be valid values for cacheKeyParameters
, these parameters must also be specified for Method requestParameters
.
integrationResponses (dict) --
Specifies the integration's responses.
(string) --
(dict) --
Represents an integration response. The status code must map to an existing MethodResponse, and parameters and templates can be used to transform the back-end response.
statusCode (string) --
Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern (string) --
Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the .+
regex to match error response. However, make sure that the error response does not contain any newline ( \n
) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.
responseParameters (dict) --
A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of method.response.header.{name}
, where name
is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header.{name}
or integration.response.body.{JSON-expression}
, where name
is a valid and unique response header name and JSON-expression
is a valid JSON expression without the $
prefix.
responseTemplates (dict) --
Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
contentHandling (string) --
Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
tlsConfig (dict) --
Specifies the TLS configuration for an integration.
insecureSkipVerification (boolean) --
Specifies whether or not API Gateway skips verification that the certificate for an integration endpoint is issued by a supported certificate authority. This isn’t recommended, but it enables you to use certificates that are signed by private certificate authorities, or certificates that are self-signed. If enabled, API Gateway still performs basic certificate validation, which includes checking the certificate's expiration date, hostname, and presence of a root certificate authority. Supported only for HTTP
and HTTP_PROXY
integrations.
Warning
Enabling insecureSkipVerification
isn't recommended, especially for integrations with public HTTPS endpoints. If you enable insecureSkipVerification
, you increase the risk of man-in-the-middle attacks.
authorizationScopes (list) --
A list of authorization scopes configured on the method. The scopes are used with a COGNITO_USER_POOLS
authorizer to authorize the method invocation. The authorization works by matching the method scopes against the scopes parsed from the access token in the incoming request. The method invocation is authorized if any method scopes matches a claimed scope in the access token. Otherwise, the invocation is not authorized. When the method scope is configured, the client must provide an access token instead of an identity token for authorization purposes.
Exceptions
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.TooManyRequestsException
update_rest_api
(**kwargs)¶Changes information about the specified API.
See also: AWS API Documentation
Request Syntax
response = client.update_rest_api(
restApiId='string',
patchOperations=[
{
'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
'path': 'string',
'value': 'string',
'from': 'string'
},
]
)
[REQUIRED]
The string identifier of the associated RestApi.
For more information about supported patch operations, see Patch Operations.
For more information about supported patch operations, see Patch Operations.
An update operation to be performed with this PATCH request. The valid value can be add, remove, replace or copy. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message..
The op operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of {"name":"value"}, the path for this property is /name. If the name property value is a JSON object (e.g., {"name": {"child/name": "child-value"}}), the path for the child/name property will be /name/child~1name. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Each op operation can have only one path associated with it.
The new target value of the update operation. It is applicable for the add or replace operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '{"a": ...}'.
The copy update operation's source as identified by a JSON-Pointer value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with "op":"copy", "from":"/canarySettings/deploymentId" and "path":"/deploymentId".
dict
Response Syntax
{
'id': 'string',
'name': 'string',
'description': 'string',
'createdDate': datetime(2015, 1, 1),
'version': 'string',
'warnings': [
'string',
],
'binaryMediaTypes': [
'string',
],
'minimumCompressionSize': 123,
'apiKeySource': 'HEADER'|'AUTHORIZER',
'endpointConfiguration': {
'types': [
'REGIONAL'|'EDGE'|'PRIVATE',
],
'vpcEndpointIds': [
'string',
]
},
'policy': 'string',
'tags': {
'string': 'string'
},
'disableExecuteApiEndpoint': True|False
}
Response Structure
(dict) --
Represents a REST API.
id (string) --
The API's identifier. This identifier is unique across all of your APIs in API Gateway.
name (string) --
The API's name.
description (string) --
The API's description.
createdDate (datetime) --
The timestamp when the API was created.
version (string) --
A version identifier for the API.
warnings (list) --
The warning messages reported when failonwarnings
is turned on during API import.
binaryMediaTypes (list) --
The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
minimumCompressionSize (integer) --
A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
apiKeySource (string) --
The source of the API key for metering requests according to a usage plan. Valid values are: > HEADER
to read the API key from the X-API-Key
header of a request. AUTHORIZER
to read the API key from the UsageIdentifierKey
from a custom authorizer.
endpointConfiguration (dict) --
The endpoint configuration of this RestApi showing the endpoint types of the API.
types (list) --
A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is "EDGE"
. For a regional API and its custom domain name, the endpoint type is REGIONAL
. For a private API, the endpoint type is PRIVATE
.
(string) --
The endpoint type. The valid values are EDGE
for edge-optimized API setup, most suitable for mobile applications; REGIONAL
for regional API endpoint setup, most suitable for calling from AWS Region; and PRIVATE
for private APIs.
vpcEndpointIds (list) --
A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for PRIVATE
endpoint type.
policy (string) --
A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
disableExecuteApiEndpoint (boolean) --
Specifies whether clients can invoke your API by using the default execute-api
endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com
endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
update_stage
(**kwargs)¶Changes information about a Stage resource.
See also: AWS API Documentation
Request Syntax
response = client.update_stage(
restApiId='string',
stageName='string',
patchOperations=[
{
'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
'path': 'string',
'value': 'string',
'from': 'string'
},
]
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
The name of the Stage resource to change information about.
For more information about supported patch operations, see Patch Operations.
For more information about supported patch operations, see Patch Operations.
An update operation to be performed with this PATCH request. The valid value can be add, remove, replace or copy. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message..
The op operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of {"name":"value"}, the path for this property is /name. If the name property value is a JSON object (e.g., {"name": {"child/name": "child-value"}}), the path for the child/name property will be /name/child~1name. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Each op operation can have only one path associated with it.
The new target value of the update operation. It is applicable for the add or replace operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '{"a": ...}'.
The copy update operation's source as identified by a JSON-Pointer value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with "op":"copy", "from":"/canarySettings/deploymentId" and "path":"/deploymentId".
dict
Response Syntax
{
'deploymentId': 'string',
'clientCertificateId': 'string',
'stageName': 'string',
'description': 'string',
'cacheClusterEnabled': True|False,
'cacheClusterSize': '0.5'|'1.6'|'6.1'|'13.5'|'28.4'|'58.2'|'118'|'237',
'cacheClusterStatus': 'CREATE_IN_PROGRESS'|'AVAILABLE'|'DELETE_IN_PROGRESS'|'NOT_AVAILABLE'|'FLUSH_IN_PROGRESS',
'methodSettings': {
'string': {
'metricsEnabled': True|False,
'loggingLevel': 'string',
'dataTraceEnabled': True|False,
'throttlingBurstLimit': 123,
'throttlingRateLimit': 123.0,
'cachingEnabled': True|False,
'cacheTtlInSeconds': 123,
'cacheDataEncrypted': True|False,
'requireAuthorizationForCacheControl': True|False,
'unauthorizedCacheControlHeaderStrategy': 'FAIL_WITH_403'|'SUCCEED_WITH_RESPONSE_HEADER'|'SUCCEED_WITHOUT_RESPONSE_HEADER'
}
},
'variables': {
'string': 'string'
},
'documentationVersion': 'string',
'accessLogSettings': {
'format': 'string',
'destinationArn': 'string'
},
'canarySettings': {
'percentTraffic': 123.0,
'deploymentId': 'string',
'stageVariableOverrides': {
'string': 'string'
},
'useStageCache': True|False
},
'tracingEnabled': True|False,
'webAclArn': 'string',
'tags': {
'string': 'string'
},
'createdDate': datetime(2015, 1, 1),
'lastUpdatedDate': datetime(2015, 1, 1)
}
Response Structure
(dict) --
Represents a unique identifier for a version of a deployed RestApi that is callable by users.
deploymentId (string) --
The identifier of the Deployment that the stage points to.
clientCertificateId (string) --
The identifier of a client certificate for an API stage.
stageName (string) --
The name of the stage is the first path segment in the Uniform Resource Identifier (URI) of a call to API Gateway. Stage names can only contain alphanumeric characters, hyphens, and underscores. Maximum length is 128 characters.
description (string) --
The stage's description.
cacheClusterEnabled (boolean) --
Specifies whether a cache cluster is enabled for the stage.
cacheClusterSize (string) --
The size of the cache cluster for the stage, if enabled.
cacheClusterStatus (string) --
The status of the cache cluster for the stage, if enabled.
methodSettings (dict) --
A map that defines the method settings for a Stage resource. Keys (designated as /{method_setting_key
below) are method paths defined as {resource_path}/{http_method}
for an individual method override, or /\*/\*
for overriding all methods in the stage.
(string) --
(dict) --
Specifies the method setting properties.
metricsEnabled (boolean) --
Specifies whether Amazon CloudWatch metrics are enabled for this method. The PATCH path for this setting is /{method_setting_key}/metrics/enabled
, and the value is a Boolean.
loggingLevel (string) --
Specifies the logging level for this method, which affects the log entries pushed to Amazon CloudWatch Logs. The PATCH path for this setting is /{method_setting_key}/logging/loglevel
, and the available levels are OFF
, ERROR
, and INFO
. Choose ERROR
to write only error-level entries to CloudWatch Logs, or choose INFO
to include all ERROR
events as well as extra informational events.
dataTraceEnabled (boolean) --
Specifies whether data trace logging is enabled for this method, which affects the log entries pushed to Amazon CloudWatch Logs. The PATCH path for this setting is /{method_setting_key}/logging/dataTrace
, and the value is a Boolean.
throttlingBurstLimit (integer) --
Specifies the throttling burst limit. The PATCH path for this setting is /{method_setting_key}/throttling/burstLimit
, and the value is an integer.
throttlingRateLimit (float) --
Specifies the throttling rate limit. The PATCH path for this setting is /{method_setting_key}/throttling/rateLimit
, and the value is a double.
cachingEnabled (boolean) --
Specifies whether responses should be cached and returned for requests. A cache cluster must be enabled on the stage for responses to be cached. The PATCH path for this setting is /{method_setting_key}/caching/enabled
, and the value is a Boolean.
cacheTtlInSeconds (integer) --
Specifies the time to live (TTL), in seconds, for cached responses. The higher the TTL, the longer the response will be cached. The PATCH path for this setting is /{method_setting_key}/caching/ttlInSeconds
, and the value is an integer.
cacheDataEncrypted (boolean) --
Specifies whether the cached responses are encrypted. The PATCH path for this setting is /{method_setting_key}/caching/dataEncrypted
, and the value is a Boolean.
requireAuthorizationForCacheControl (boolean) --
Specifies whether authorization is required for a cache invalidation request. The PATCH path for this setting is /{method_setting_key}/caching/requireAuthorizationForCacheControl
, and the value is a Boolean.
unauthorizedCacheControlHeaderStrategy (string) --
Specifies how to handle unauthorized requests for cache invalidation. The PATCH path for this setting is /{method_setting_key}/caching/unauthorizedCacheControlHeaderStrategy
, and the available values are FAIL_WITH_403
, SUCCEED_WITH_RESPONSE_HEADER
, SUCCEED_WITHOUT_RESPONSE_HEADER
.
variables (dict) --
A map that defines the stage variables for a Stage resource. Variable names can have alphanumeric and underscore characters, and the values must match [A-Za-z0-9-._~:/?#&=,]+
.
documentationVersion (string) --
The version of the associated API documentation.
accessLogSettings (dict) --
Settings for logging access in this stage.
format (string) --
A single line format of the access logs of data, as specified by selected $context variables. The format must include at least $context.requestId
.
destinationArn (string) --
The Amazon Resource Name (ARN) of the CloudWatch Logs log group or Kinesis Data Firehose delivery stream to receive access logs. If you specify a Kinesis Data Firehose delivery stream, the stream name must begin with amazon-apigateway-
.
canarySettings (dict) --
Settings for the canary deployment in this stage.
percentTraffic (float) --
The percent (0-100) of traffic diverted to a canary deployment.
deploymentId (string) --
The ID of the canary deployment.
stageVariableOverrides (dict) --
Stage variables overridden for a canary release deployment, including new stage variables introduced in the canary. These stage variables are represented as a string-to-string map between stage variable names and their values.
useStageCache (boolean) --
A Boolean flag to indicate whether the canary deployment uses the stage cache or not.
tracingEnabled (boolean) --
Specifies whether active tracing with X-ray is enabled for the Stage.
webAclArn (string) --
The ARN of the WebAcl associated with the Stage.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
createdDate (datetime) --
The timestamp when the stage was created.
lastUpdatedDate (datetime) --
The timestamp when the stage last updated.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
update_usage
(**kwargs)¶Grants a temporary extension to the remaining quota of a usage plan associated with a specified API key.
See also: AWS API Documentation
Request Syntax
response = client.update_usage(
usagePlanId='string',
keyId='string',
patchOperations=[
{
'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
'path': 'string',
'value': 'string',
'from': 'string'
},
]
)
[REQUIRED]
The Id of the usage plan associated with the usage data.
[REQUIRED]
The identifier of the API key associated with the usage plan in which a temporary extension is granted to the remaining quota.
For more information about supported patch operations, see Patch Operations.
For more information about supported patch operations, see Patch Operations.
An update operation to be performed with this PATCH request. The valid value can be add, remove, replace or copy. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message..
The op operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of {"name":"value"}, the path for this property is /name. If the name property value is a JSON object (e.g., {"name": {"child/name": "child-value"}}), the path for the child/name property will be /name/child~1name. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Each op operation can have only one path associated with it.
The new target value of the update operation. It is applicable for the add or replace operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '{"a": ...}'.
The copy update operation's source as identified by a JSON-Pointer value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with "op":"copy", "from":"/canarySettings/deploymentId" and "path":"/deploymentId".
dict
Response Syntax
{
'usagePlanId': 'string',
'startDate': 'string',
'endDate': 'string',
'position': 'string',
'items': {
'string': [
[
123,
],
]
}
}
Response Structure
(dict) --
Represents the usage data of a usage plan.
usagePlanId (string) --
The plan Id associated with this usage data.
startDate (string) --
The starting date of the usage data.
endDate (string) --
The ending date of the usage data.
position (string) --
items (dict) --
The usage data, as daily logs of used and remaining quotas, over the specified time interval indexed over the API keys in a usage plan. For example, {..., "values" : { "{api_key}" : [ [0, 100], [10, 90], [100, 10]]}
, where {api_key}
stands for an API key value and the daily log entry is of the format [used quota, remaining quota]
.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
update_usage_plan
(**kwargs)¶Updates a usage plan of a given plan Id.
See also: AWS API Documentation
Request Syntax
response = client.update_usage_plan(
usagePlanId='string',
patchOperations=[
{
'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
'path': 'string',
'value': 'string',
'from': 'string'
},
]
)
[REQUIRED]
The Id of the to-be-updated usage plan.
For more information about supported patch operations, see Patch Operations.
For more information about supported patch operations, see Patch Operations.
An update operation to be performed with this PATCH request. The valid value can be add, remove, replace or copy. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message..
The op operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of {"name":"value"}, the path for this property is /name. If the name property value is a JSON object (e.g., {"name": {"child/name": "child-value"}}), the path for the child/name property will be /name/child~1name. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Each op operation can have only one path associated with it.
The new target value of the update operation. It is applicable for the add or replace operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '{"a": ...}'.
The copy update operation's source as identified by a JSON-Pointer value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with "op":"copy", "from":"/canarySettings/deploymentId" and "path":"/deploymentId".
dict
Response Syntax
{
'id': 'string',
'name': 'string',
'description': 'string',
'apiStages': [
{
'apiId': 'string',
'stage': 'string',
'throttle': {
'string': {
'burstLimit': 123,
'rateLimit': 123.0
}
}
},
],
'throttle': {
'burstLimit': 123,
'rateLimit': 123.0
},
'quota': {
'limit': 123,
'offset': 123,
'period': 'DAY'|'WEEK'|'MONTH'
},
'productCode': 'string',
'tags': {
'string': 'string'
}
}
Response Structure
(dict) --
Represents a usage plan used to specify who can assess associated API stages. Optionally, target request rate and quota limits can be set. In some cases clients can exceed the targets that you set. Don’t rely on usage plans to control costs. Consider using Amazon Web Services Budgets to monitor costs and WAF to manage API requests.
id (string) --
The identifier of a UsagePlan resource.
name (string) --
The name of a usage plan.
description (string) --
The description of a usage plan.
apiStages (list) --
The associated API stages of a usage plan.
(dict) --
API stage name of the associated API stage in a usage plan.
apiId (string) --
API Id of the associated API stage in a usage plan.
stage (string) --
API stage name of the associated API stage in a usage plan.
throttle (dict) --
Map containing method level throttling information for API stage in a usage plan.
(string) --
(dict) --
The API request rate limits.
burstLimit (integer) --
The API target request burst rate limit. This allows more requests through for a period of time than the target rate limit.
rateLimit (float) --
The API target request rate limit.
throttle (dict) --
A map containing method level throttling information for API stage in a usage plan.
burstLimit (integer) --
The API target request burst rate limit. This allows more requests through for a period of time than the target rate limit.
rateLimit (float) --
The API target request rate limit.
quota (dict) --
The target maximum number of permitted requests per a given unit time interval.
limit (integer) --
The target maximum number of requests that can be made in a given time period.
offset (integer) --
The number of requests subtracted from the given limit in the initial time period.
period (string) --
The time period in which the limit applies. Valid values are "DAY", "WEEK" or "MONTH".
productCode (string) --
The AWS Markeplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
update_vpc_link
(**kwargs)¶Updates an existing VpcLink of a specified identifier.
See also: AWS API Documentation
Request Syntax
response = client.update_vpc_link(
vpcLinkId='string',
patchOperations=[
{
'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
'path': 'string',
'value': 'string',
'from': 'string'
},
]
)
[REQUIRED]
The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.
For more information about supported patch operations, see Patch Operations.
For more information about supported patch operations, see Patch Operations.
An update operation to be performed with this PATCH request. The valid value can be add, remove, replace or copy. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message..
The op operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of {"name":"value"}, the path for this property is /name. If the name property value is a JSON object (e.g., {"name": {"child/name": "child-value"}}), the path for the child/name property will be /name/child~1name. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Each op operation can have only one path associated with it.
The new target value of the update operation. It is applicable for the add or replace operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '{"a": ...}'.
The copy update operation's source as identified by a JSON-Pointer value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with "op":"copy", "from":"/canarySettings/deploymentId" and "path":"/deploymentId".
dict
Response Syntax
{
'id': 'string',
'name': 'string',
'description': 'string',
'targetArns': [
'string',
],
'status': 'AVAILABLE'|'PENDING'|'DELETING'|'FAILED',
'statusMessage': 'string',
'tags': {
'string': 'string'
}
}
Response Structure
(dict) --
An API Gateway VPC link for a RestApi to access resources in an Amazon Virtual Private Cloud (VPC).
id (string) --
The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.
name (string) --
The name used to label and identify the VPC link.
description (string) --
The description of the VPC link.
targetArns (list) --
The ARN of the network load balancer of the VPC targeted by the VPC link. The network load balancer must be owned by the same AWS account of the API owner.
status (string) --
The status of the VPC link. The valid values are AVAILABLE
, PENDING
, DELETING
, or FAILED
. Deploying an API will wait if the status is PENDING
and will fail if the status is DELETING
.
statusMessage (string) --
A description about the VPC link status.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.ConflictException
APIGateway.Client.exceptions.LimitExceededException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.TooManyRequestsException
The available paginators are:
APIGateway.Paginator.GetApiKeys
APIGateway.Paginator.GetAuthorizers
APIGateway.Paginator.GetBasePathMappings
APIGateway.Paginator.GetClientCertificates
APIGateway.Paginator.GetDeployments
APIGateway.Paginator.GetDocumentationParts
APIGateway.Paginator.GetDocumentationVersions
APIGateway.Paginator.GetDomainNames
APIGateway.Paginator.GetGatewayResponses
APIGateway.Paginator.GetModels
APIGateway.Paginator.GetRequestValidators
APIGateway.Paginator.GetResources
APIGateway.Paginator.GetRestApis
APIGateway.Paginator.GetSdkTypes
APIGateway.Paginator.GetUsage
APIGateway.Paginator.GetUsagePlanKeys
APIGateway.Paginator.GetUsagePlans
APIGateway.Paginator.GetVpcLinks
APIGateway.Paginator.
GetApiKeys
¶paginator = client.get_paginator('get_api_keys')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from APIGateway.Client.get_api_keys()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
nameQuery='string',
customerId='string',
includeValues=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
true
) or not ( false
) the result contains key values.A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken
from a previous response.
dict
Response Syntax
{
'warnings': [
'string',
],
'items': [
{
'id': 'string',
'value': 'string',
'name': 'string',
'customerId': 'string',
'description': 'string',
'enabled': True|False,
'createdDate': datetime(2015, 1, 1),
'lastUpdatedDate': datetime(2015, 1, 1),
'stageKeys': [
'string',
],
'tags': {
'string': 'string'
}
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Represents a collection of API keys as represented by an ApiKeys resource.
warnings (list) --
A list of warning messages logged during the import of API keys when the failOnWarnings
option is set to true.
items (list) --
The current page of elements from this collection.
(dict) --
A resource that can be distributed to callers for executing Method resources that require an API key. API keys can be mapped to any Stage on any RestApi, which indicates that the callers with the API key can make requests to that stage.
id (string) --
The identifier of the API Key.
value (string) --
The value of the API Key.
name (string) --
The name of the API Key.
customerId (string) --
An AWS Marketplace customer identifier , when integrating with the AWS SaaS Marketplace.
description (string) --
The description of the API Key.
enabled (boolean) --
Specifies whether the API Key can be used by callers.
createdDate (datetime) --
The timestamp when the API Key was created.
lastUpdatedDate (datetime) --
The timestamp when the API Key was last updated.
stageKeys (list) --
A list of Stage resources that are associated with the ApiKey resource.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
NextToken (string) --
A token to resume pagination.
APIGateway.Paginator.
GetAuthorizers
¶paginator = client.get_paginator('get_authorizers')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from APIGateway.Client.get_authorizers()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
restApiId='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The string identifier of the associated RestApi.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken
from a previous response.
dict
Response Syntax
{
'items': [
{
'id': 'string',
'name': 'string',
'type': 'TOKEN'|'REQUEST'|'COGNITO_USER_POOLS',
'providerARNs': [
'string',
],
'authType': 'string',
'authorizerUri': 'string',
'authorizerCredentials': 'string',
'identitySource': 'string',
'identityValidationExpression': 'string',
'authorizerResultTtlInSeconds': 123
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Represents a collection of Authorizer resources.
items (list) --
The current page of elements from this collection.
(dict) --
Represents an authorization layer for methods. If enabled on a method, API Gateway will activate the authorizer when a client calls the method.
id (string) --
The identifier for the authorizer resource.
name (string) --
The name of the authorizer.
type (string) --
The authorizer type. Valid values are TOKEN
for a Lambda function using a single authorization token submitted in a custom header, REQUEST
for a Lambda function using incoming request parameters, and COGNITO_USER_POOLS
for using an Amazon Cognito user pool.
providerARNs (list) --
A list of the Amazon Cognito user pool ARNs for the COGNITO_USER_POOLS
authorizer. Each element is of this format: arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}
. For a TOKEN
or REQUEST
authorizer, this is not defined.
authType (string) --
Optional customer-defined field, used in OpenAPI imports and exports without functional impact.
authorizerUri (string) --
Specifies the authorizer's Uniform Resource Identifier (URI). For TOKEN
or REQUEST
authorizers, this must be a well-formed Lambda function URI, for example, arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations
. In general, the URI has this form arn:aws:apigateway:{region}:lambda:path/{service_api}
, where {region}
is the same as the region hosting the Lambda function, path
indicates that the remaining substring in the URI should be treated as the path to the resource, including the initial /
. For Lambda functions, this is usually of the form /2015-03-31/functions/[FunctionARN]/invocations
.
authorizerCredentials (string) --
Specifies the required credentials as an IAM role for API Gateway to invoke the authorizer. To specify an IAM role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, specify null.
identitySource (string) --
The identity source for which authorization is requested. For a TOKEN
or COGNITO_USER_POOLS
authorizer, this is required and specifies the request header mapping expression for the custom header holding the authorization token submitted by the client. For example, if the token header name is Auth
, the header mapping expression is method.request.header.Auth
. For the REQUEST
authorizer, this is required when authorization caching is enabled. The value is a comma-separated string of one or more mapping expressions of the specified request parameters. For example, if an Auth
header, a Name
query string parameter are defined as identity sources, this value is method.request.header.Auth
, method.request.querystring.Name
. These parameters will be used to derive the authorization caching key and to perform runtime validation of the REQUEST
authorizer by verifying all of the identity-related request parameters are present, not null and non-empty. Only when this is true does the authorizer invoke the authorizer Lambda function, otherwise, it returns a 401 Unauthorized response without calling the Lambda function. The valid value is a string of comma-separated mapping expressions of the specified request parameters. When the authorization caching is not enabled, this property is optional.
identityValidationExpression (string) --
A validation expression for the incoming identity token. For TOKEN
authorizers, this value is a regular expression. For COGNITO_USER_POOLS
authorizers, API Gateway will match the aud
field of the incoming token from the client against the specified regular expression. It will invoke the authorizer's Lambda function when there is a match. Otherwise, it will return a 401 Unauthorized response without calling the Lambda function. The validation expression does not apply to the REQUEST
authorizer.
authorizerResultTtlInSeconds (integer) --
The TTL in seconds of cached authorizer results. If it equals 0, authorization caching is disabled. If it is greater than 0, API Gateway will cache authorizer responses. If this field is not set, the default value is 300. The maximum value is 3600, or 1 hour.
NextToken (string) --
A token to resume pagination.
APIGateway.Paginator.
GetBasePathMappings
¶paginator = client.get_paginator('get_base_path_mappings')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from APIGateway.Client.get_base_path_mappings()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
domainName='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The domain name of a BasePathMapping resource.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken
from a previous response.
dict
Response Syntax
{
'items': [
{
'basePath': 'string',
'restApiId': 'string',
'stage': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Represents a collection of BasePathMapping resources.
items (list) --
The current page of elements from this collection.
(dict) --
Represents the base path that callers of the API must provide as part of the URL after the domain name.
basePath (string) --
The base path name that callers of the API must provide as part of the URL after the domain name.
restApiId (string) --
The string identifier of the associated RestApi.
stage (string) --
The name of the associated stage.
NextToken (string) --
A token to resume pagination.
APIGateway.Paginator.
GetClientCertificates
¶paginator = client.get_paginator('get_client_certificates')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from APIGateway.Client.get_client_certificates()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken
from a previous response.
{
'items': [
{
'clientCertificateId': 'string',
'description': 'string',
'pemEncodedCertificate': 'string',
'createdDate': datetime(2015, 1, 1),
'expirationDate': datetime(2015, 1, 1),
'tags': {
'string': 'string'
}
},
],
'NextToken': 'string'
}
Response Structure
Represents a collection of ClientCertificate resources.
The current page of elements from this collection.
Represents a client certificate used to configure client-side SSL authentication while sending requests to the integration endpoint.
The identifier of the client certificate.
The description of the client certificate.
The PEM-encoded public key of the client certificate, which can be used to configure certificate authentication in the integration endpoint .
The timestamp when the client certificate was created.
The timestamp when the client certificate will expire.
The collection of tags. Each tag element is associated with a given resource.
A token to resume pagination.
APIGateway.Paginator.
GetDeployments
¶paginator = client.get_paginator('get_deployments')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from APIGateway.Client.get_deployments()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
restApiId='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The string identifier of the associated RestApi.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken
from a previous response.
dict
Response Syntax
{
'items': [
{
'id': 'string',
'description': 'string',
'createdDate': datetime(2015, 1, 1),
'apiSummary': {
'string': {
'string': {
'authorizationType': 'string',
'apiKeyRequired': True|False
}
}
}
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Represents a collection resource that contains zero or more references to your existing deployments, and links that guide you on how to interact with your collection. The collection offers a paginated view of the contained deployments.
items (list) --
The current page of elements from this collection.
(dict) --
An immutable representation of a RestApi resource that can be called by users using Stages. A deployment must be associated with a Stage for it to be callable over the Internet.
id (string) --
The identifier for the deployment resource.
description (string) --
The description for the deployment resource.
createdDate (datetime) --
The date and time that the deployment resource was created.
apiSummary (dict) --
A summary of the RestApi at the date and time that the deployment resource was created.
(string) --
(dict) --
(string) --
(dict) --
Represents a summary of a Method resource, given a particular date and time.
authorizationType (string) --
The method's authorization type. Valid values are NONE
for open access, AWS_IAM
for using AWS IAM permissions, CUSTOM
for using a custom authorizer, or COGNITO_USER_POOLS
for using a Cognito user pool.
apiKeyRequired (boolean) --
Specifies whether the method requires a valid ApiKey.
NextToken (string) --
A token to resume pagination.
APIGateway.Paginator.
GetDocumentationParts
¶paginator = client.get_paginator('get_documentation_parts')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from APIGateway.Client.get_documentation_parts()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
restApiId='string',
type='API'|'AUTHORIZER'|'MODEL'|'RESOURCE'|'METHOD'|'PATH_PARAMETER'|'QUERY_PARAMETER'|'REQUEST_HEADER'|'REQUEST_BODY'|'RESPONSE'|'RESPONSE_HEADER'|'RESPONSE_BODY',
nameQuery='string',
path='string',
locationStatus='DOCUMENTED'|'UNDOCUMENTED',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The string identifier of the associated RestApi.
DOCUMENTED
for retrieving DocumentationPart resources with content and UNDOCUMENTED
for DocumentationPart resources without content.A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken
from a previous response.
dict
Response Syntax
{
'items': [
{
'id': 'string',
'location': {
'type': 'API'|'AUTHORIZER'|'MODEL'|'RESOURCE'|'METHOD'|'PATH_PARAMETER'|'QUERY_PARAMETER'|'REQUEST_HEADER'|'REQUEST_BODY'|'RESPONSE'|'RESPONSE_HEADER'|'RESPONSE_BODY',
'path': 'string',
'method': 'string',
'statusCode': 'string',
'name': 'string'
},
'properties': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
The collection of documentation parts of an API.
items (list) --
The current page of elements from this collection.
(dict) --
A documentation part for a targeted API entity.
id (string) --
The DocumentationPart identifier, generated by API Gateway when the DocumentationPart
is created.
location (dict) --
The location of the API entity to which the documentation applies. Valid fields depend on the targeted API entity type. All the valid location fields are not required. If not explicitly specified, a valid location field is treated as a wildcard and associated documentation content may be inherited by matching entities, unless overridden.
type (string) --
The type of API entity to which the documentation content applies. Valid values are API
, AUTHORIZER
, MODEL
, RESOURCE
, METHOD
, PATH_PARAMETER
, QUERY_PARAMETER
, REQUEST_HEADER
, REQUEST_BODY
, RESPONSE
, RESPONSE_HEADER
, and RESPONSE_BODY
. Content inheritance does not apply to any entity of the API
, AUTHORIZER
, METHOD
, MODEL
, REQUEST_BODY
, or RESOURCE
type.
path (string) --
The URL path of the target. It is a valid field for the API entity types of RESOURCE
, METHOD
, PATH_PARAMETER
, QUERY_PARAMETER
, REQUEST_HEADER
, REQUEST_BODY
, RESPONSE
, RESPONSE_HEADER
, and RESPONSE_BODY
. The default value is /
for the root resource. When an applicable child entity inherits the content of another entity of the same type with more general specifications of the other location
attributes, the child entity's path
attribute must match that of the parent entity as a prefix.
method (string) --
The HTTP verb of a method. It is a valid field for the API entity types of METHOD
, PATH_PARAMETER
, QUERY_PARAMETER
, REQUEST_HEADER
, REQUEST_BODY
, RESPONSE
, RESPONSE_HEADER
, and RESPONSE_BODY
. The default value is *
for any method. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the other location
attributes, the child entity's method
attribute must match that of the parent entity exactly.
statusCode (string) --
The HTTP status code of a response. It is a valid field for the API entity types of RESPONSE
, RESPONSE_HEADER
, and RESPONSE_BODY
. The default value is *
for any status code. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the other location
attributes, the child entity's statusCode
attribute must match that of the parent entity exactly.
name (string) --
The name of the targeted API entity. It is a valid and required field for the API entity types of AUTHORIZER
, MODEL
, PATH_PARAMETER
, QUERY_PARAMETER
, REQUEST_HEADER
, REQUEST_BODY
and RESPONSE_HEADER
. It is an invalid field for any other entity type.
properties (string) --
A content map of API-specific key-value pairs describing the targeted API entity. The map must be encoded as a JSON string, e.g., "{ \"description\": \"The API does ...\" }"
. Only OpenAPI-compliant documentation-related fields from the properties map are exported and, hence, published as part of the API entity definitions, while the original documentation parts are exported in a OpenAPI extension of x-amazon-apigateway-documentation
.
NextToken (string) --
A token to resume pagination.
APIGateway.Paginator.
GetDocumentationVersions
¶paginator = client.get_paginator('get_documentation_versions')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from APIGateway.Client.get_documentation_versions()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
restApiId='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The string identifier of the associated RestApi.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken
from a previous response.
dict
Response Syntax
{
'items': [
{
'version': 'string',
'createdDate': datetime(2015, 1, 1),
'description': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
The collection of documentation snapshots of an API.
items (list) --
The current page of elements from this collection.
(dict) --
A snapshot of the documentation of an API.
version (string) --
The version identifier of the API documentation snapshot.
createdDate (datetime) --
The date when the API documentation snapshot is created.
description (string) --
The description of the API documentation snapshot.
NextToken (string) --
A token to resume pagination.
APIGateway.Paginator.
GetDomainNames
¶paginator = client.get_paginator('get_domain_names')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from APIGateway.Client.get_domain_names()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken
from a previous response.
{
'items': [
{
'domainName': 'string',
'certificateName': 'string',
'certificateArn': 'string',
'certificateUploadDate': datetime(2015, 1, 1),
'regionalDomainName': 'string',
'regionalHostedZoneId': 'string',
'regionalCertificateName': 'string',
'regionalCertificateArn': 'string',
'distributionDomainName': 'string',
'distributionHostedZoneId': 'string',
'endpointConfiguration': {
'types': [
'REGIONAL'|'EDGE'|'PRIVATE',
],
'vpcEndpointIds': [
'string',
]
},
'domainNameStatus': 'AVAILABLE'|'UPDATING'|'PENDING'|'PENDING_CERTIFICATE_REIMPORT'|'PENDING_OWNERSHIP_VERIFICATION',
'domainNameStatusMessage': 'string',
'securityPolicy': 'TLS_1_0'|'TLS_1_2',
'tags': {
'string': 'string'
},
'mutualTlsAuthentication': {
'truststoreUri': 'string',
'truststoreVersion': 'string',
'truststoreWarnings': [
'string',
]
},
'ownershipVerificationCertificateArn': 'string'
},
],
'NextToken': 'string'
}
Response Structure
Represents a collection of DomainName resources.
The current page of elements from this collection.
Represents a custom domain name as a user-friendly host name of an API (RestApi).
The custom domain name as an API host name, for example, my-api.example.com
.
The name of the certificate that will be used by edge-optimized endpoint for this domain name.
The reference to an AWS-managed certificate that will be used by edge-optimized endpoint for this domain name. AWS Certificate Manager is the only supported source.
The timestamp when the certificate that was used by edge-optimized endpoint for this domain name was uploaded.
The domain name associated with the regional endpoint for this custom domain name. You set up this association by adding a DNS record that points the custom domain name to this regional domain name. The regional domain name is returned by API Gateway when you create a regional endpoint.
The region-specific Amazon Route 53 Hosted Zone ID of the regional endpoint. For more information, see Set up a Regional Custom Domain Name and AWS Regions and Endpoints for API Gateway.
The name of the certificate that will be used for validating the regional domain name.
The reference to an AWS-managed certificate that will be used for validating the regional domain name. AWS Certificate Manager is the only supported source.
The domain name of the Amazon CloudFront distribution associated with this custom domain name for an edge-optimized endpoint. You set up this association when adding a DNS record pointing the custom domain name to this distribution name. For more information about CloudFront distributions, see the Amazon CloudFront documentation.
The region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized endpoint. The valid value is Z2FDTNDATAQYW2
for all the regions. For more information, see Set up a Regional Custom Domain Name and AWS Regions and Endpoints for API Gateway.
The endpoint configuration of this DomainName showing the endpoint types of the domain name.
A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is "EDGE"
. For a regional API and its custom domain name, the endpoint type is REGIONAL
. For a private API, the endpoint type is PRIVATE
.
The endpoint type. The valid values are EDGE
for edge-optimized API setup, most suitable for mobile applications; REGIONAL
for regional API endpoint setup, most suitable for calling from AWS Region; and PRIVATE
for private APIs.
A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for PRIVATE
endpoint type.
The status of the DomainName migration. The valid values are AVAILABLE
and UPDATING
. If the status is UPDATING
, the domain cannot be modified further until the existing operation is complete. If it is AVAILABLE
, the domain can be updated.
An optional text message containing detailed information about status of the DomainName migration.
The Transport Layer Security (TLS) version + cipher suite for this DomainName. The valid values are TLS_1_0
and TLS_1_2
.
The collection of tags. Each tag element is associated with a given resource.
The mutual TLS authentication configuration for a custom domain name. If specified, API Gateway performs two-way authentication between the client and the server. Clients must present a trusted certificate to access your API.
An Amazon S3 URL that specifies the truststore for mutual TLS authentication, for example s3://bucket-name/key-name
. The truststore can contain certificates from public or private certificate authorities. To update the truststore, upload a new version to S3, and then update your custom domain name to use the new version. To update the truststore, you must have permissions to access the S3 object.
The version of the S3 object that contains your truststore. To specify a version, you must have versioning enabled for the S3 bucket.
A list of warnings that API Gateway returns while processing your truststore. Invalid certificates produce warnings. Mutual TLS is still enabled, but some clients might not be able to access your API. To resolve warnings, upload a new truststore to S3, and then update you domain name to use the new version.
The ARN of the public certificate issued by ACM to validate ownership of your custom domain. Only required when configuring mutual TLS and using an ACM imported or private CA certificate ARN as the regionalCertificateArn.
A token to resume pagination.
APIGateway.Paginator.
GetGatewayResponses
¶paginator = client.get_paginator('get_gateway_responses')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from APIGateway.Client.get_gateway_responses()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
restApiId='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The string identifier of the associated RestApi.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken
from a previous response.
dict
Response Syntax
{
'items': [
{
'responseType': 'DEFAULT_4XX'|'DEFAULT_5XX'|'RESOURCE_NOT_FOUND'|'UNAUTHORIZED'|'INVALID_API_KEY'|'ACCESS_DENIED'|'AUTHORIZER_FAILURE'|'AUTHORIZER_CONFIGURATION_ERROR'|'INVALID_SIGNATURE'|'EXPIRED_TOKEN'|'MISSING_AUTHENTICATION_TOKEN'|'INTEGRATION_FAILURE'|'INTEGRATION_TIMEOUT'|'API_CONFIGURATION_ERROR'|'UNSUPPORTED_MEDIA_TYPE'|'BAD_REQUEST_PARAMETERS'|'BAD_REQUEST_BODY'|'REQUEST_TOO_LARGE'|'THROTTLED'|'QUOTA_EXCEEDED'|'WAF_FILTERED',
'statusCode': 'string',
'responseParameters': {
'string': 'string'
},
'responseTemplates': {
'string': 'string'
},
'defaultResponse': True|False
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
The collection of the GatewayResponse instances of a RestApi as a responseType
-to-GatewayResponse object map of key-value pairs. As such, pagination is not supported for querying this collection.
items (list) --
Returns the entire collection, because of no pagination support.
(dict) --
A gateway response of a given response type and status code, with optional response parameters and mapping templates.
responseType (string) --
The response type of the associated GatewayResponse.
statusCode (string) --
The HTTP status code for this GatewayResponse.
responseParameters (dict) --
Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of key-value pairs.
responseTemplates (dict) --
Response templates of the GatewayResponse as a string-to-string map of key-value pairs.
defaultResponse (boolean) --
A Boolean flag to indicate whether this GatewayResponse is the default gateway response ( true
) or not ( false
). A default gateway response is one generated by API Gateway without any customization by an API developer.
NextToken (string) --
A token to resume pagination.
APIGateway.Paginator.
GetModels
¶paginator = client.get_paginator('get_models')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from APIGateway.Client.get_models()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
restApiId='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The string identifier of the associated RestApi.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken
from a previous response.
dict
Response Syntax
{
'items': [
{
'id': 'string',
'name': 'string',
'description': 'string',
'schema': 'string',
'contentType': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Represents a collection of Model resources.
items (list) --
The current page of elements from this collection.
(dict) --
Represents the data structure of a method's request or response payload.
id (string) --
The identifier for the model resource.
name (string) --
The name of the model. Must be an alphanumeric string.
description (string) --
The description of the model.
schema (string) --
The schema for the model. For application/json
models, this should be JSON schema draft 4 model. Do not include "*/" characters in the description of any properties because such "*/" characters may be interpreted as the closing marker for comments in some languages, such as Java or JavaScript, causing the installation of your API's SDK generated by API Gateway to fail.
contentType (string) --
The content-type for the model.
NextToken (string) --
A token to resume pagination.
APIGateway.Paginator.
GetRequestValidators
¶paginator = client.get_paginator('get_request_validators')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from APIGateway.Client.get_request_validators()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
restApiId='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The string identifier of the associated RestApi.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken
from a previous response.
dict
Response Syntax
{
'items': [
{
'id': 'string',
'name': 'string',
'validateRequestBody': True|False,
'validateRequestParameters': True|False
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
A collection of RequestValidator resources of a given RestApi.
items (list) --
The current page of elements from this collection.
(dict) --
A set of validation rules for incoming Method requests.
id (string) --
The identifier of this RequestValidator.
name (string) --
The name of this RequestValidator
validateRequestBody (boolean) --
A Boolean flag to indicate whether to validate a request body according to the configured Model schema.
validateRequestParameters (boolean) --
A Boolean flag to indicate whether to validate request parameters ( true
) or not ( false
).
NextToken (string) --
A token to resume pagination.
APIGateway.Paginator.
GetResources
¶paginator = client.get_paginator('get_resources')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from APIGateway.Client.get_resources()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
restApiId='string',
embed=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The string identifier of the associated RestApi.
A query parameter used to retrieve the specified resources embedded in the returned Resources resource in the response. This embed
parameter value is a list of comma-separated strings. Currently, the request supports only retrieval of the embedded Method resources this way. The query parameter value must be a single-valued list and contain the "methods"
string. For example, GET /restapis/{restapi_id}/resources?embed=methods
.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken
from a previous response.
dict
Response Syntax
{
'items': [
{
'id': 'string',
'parentId': 'string',
'pathPart': 'string',
'path': 'string',
'resourceMethods': {
'string': {
'httpMethod': 'string',
'authorizationType': 'string',
'authorizerId': 'string',
'apiKeyRequired': True|False,
'requestValidatorId': 'string',
'operationName': 'string',
'requestParameters': {
'string': True|False
},
'requestModels': {
'string': 'string'
},
'methodResponses': {
'string': {
'statusCode': 'string',
'responseParameters': {
'string': True|False
},
'responseModels': {
'string': 'string'
}
}
},
'methodIntegration': {
'type': 'HTTP'|'AWS'|'MOCK'|'HTTP_PROXY'|'AWS_PROXY',
'httpMethod': 'string',
'uri': 'string',
'connectionType': 'INTERNET'|'VPC_LINK',
'connectionId': 'string',
'credentials': 'string',
'requestParameters': {
'string': 'string'
},
'requestTemplates': {
'string': 'string'
},
'passthroughBehavior': 'string',
'contentHandling': 'CONVERT_TO_BINARY'|'CONVERT_TO_TEXT',
'timeoutInMillis': 123,
'cacheNamespace': 'string',
'cacheKeyParameters': [
'string',
],
'integrationResponses': {
'string': {
'statusCode': 'string',
'selectionPattern': 'string',
'responseParameters': {
'string': 'string'
},
'responseTemplates': {
'string': 'string'
},
'contentHandling': 'CONVERT_TO_BINARY'|'CONVERT_TO_TEXT'
}
},
'tlsConfig': {
'insecureSkipVerification': True|False
}
},
'authorizationScopes': [
'string',
]
}
}
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Represents a collection of Resource resources.
items (list) --
The current page of elements from this collection.
(dict) --
Represents an API resource.
id (string) --
The resource's identifier.
parentId (string) --
The parent resource's identifier.
pathPart (string) --
The last path segment for this resource.
path (string) --
The full path for this resource.
resourceMethods (dict) --
Gets an API resource's method of a given HTTP verb.
(string) --
(dict) --
Represents a client-facing interface by which the client calls the API to access back-end resources. A Method resource is integrated with an Integration resource. Both consist of a request and one or more responses. The method request takes the client input that is passed to the back end through the integration request. A method response returns the output from the back end to the client through an integration response. A method request is embodied in a Method resource, whereas an integration request is embodied in an Integration resource. On the other hand, a method response is represented by a MethodResponse resource, whereas an integration response is represented by an IntegrationResponse resource.
httpMethod (string) --
The method's HTTP verb.
authorizationType (string) --
The method's authorization type. Valid values are NONE
for open access, AWS_IAM
for using AWS IAM permissions, CUSTOM
for using a custom authorizer, or COGNITO_USER_POOLS
for using a Cognito user pool.
authorizerId (string) --
The identifier of an Authorizer to use on this method. The authorizationType
must be CUSTOM
.
apiKeyRequired (boolean) --
A boolean flag specifying whether a valid ApiKey is required to invoke this method.
requestValidatorId (string) --
The identifier of a RequestValidator for request validation.
operationName (string) --
A human-friendly operation identifier for the method. For example, you can assign the operationName
of ListPets
for the GET /pets
method in the PetStore
example.
requestParameters (dict) --
A key-value map defining required or optional method request parameters that can be accepted by API Gateway. A key is a method request parameter name matching the pattern of method.request.{location}.{name}
, where location
is querystring
, path
, or header
and name
is a valid and unique parameter name. The value associated with the key is a Boolean flag indicating whether the parameter is required ( true
) or optional ( false
). The method request parameter names defined here are available in Integration to be mapped to integration request parameters or templates.
requestModels (dict) --
A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key).
methodResponses (dict) --
Gets a method response associated with a given HTTP status code.
(string) --
(dict) --
Represents a method response of a given HTTP status code returned to the client. The method response is passed from the back end through the associated integration response that can be transformed using a mapping template.
statusCode (string) --
The method response's status code.
responseParameters (dict) --
A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header and the value specifies whether the associated method response header is required or not. The expression of the key must match the pattern method.response.header.{name}
, where name
is a valid and unique header name. API Gateway passes certain integration response data to the method response headers specified here according to the mapping you prescribe in the API's IntegrationResponse. The integration response data that can be mapped include an integration response header expressed in integration.response.header.{name}
, a static value enclosed within a pair of single quotes (e.g., 'application/json'
), or a JSON expression from the back-end response payload in the form of integration.response.body.{JSON-expression}
, where JSON-expression
is a valid JSON expression without the $
prefix.)
responseModels (dict) --
Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.
methodIntegration (dict) --
Gets the method's integration responsible for passing the client-submitted request to the back end and performing necessary transformations to make the request compliant with the back end.
type (string) --
Specifies an API method integration type. The valid value is one of the following:
For the HTTP and HTTP proxy integrations, each integration can specify a protocol ( http/https
), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with a connectionType
of VPC_LINK
is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC.
httpMethod (string) --
Specifies the integration's HTTP method type.
uri (string) --
Specifies Uniform Resource Identifier (URI) of the integration endpoint.
For HTTP
or HTTP_PROXY
integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, where connectionType
is not VPC_LINK
, or private integration, where connectionType
is VPC_LINK
. For a private HTTP integration, the URI is not used for routing. For AWS
or AWS_PROXY
integrations, the URI is of the form arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}
. Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is the name of the integrated Amazon Web Services service (e.g., s3); and {subdomain} is a designated subdomain supported by certain Amazon Web Services service for fast host-name lookup. action can be used for an Amazon Web Services service action-based API, using an Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing {service_api} refers to a supported action {name} plus any required input parameters. Alternatively, path can be used for an AWS service path-based API. The ensuing service_api refers to the path to an Amazon Web Services service resource, including the region of the integrated Amazon Web Services service, if applicable. For example, for integration with the S3 API of GetObject, the uri can be either arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}
or arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}
connectionType (string) --
The type of the network connection to the integration endpoint. The valid value is INTERNET
for connections through the public routable internet or VPC_LINK
for private connections between API Gateway and a network load balancer in a VPC. The default value is INTERNET
.
connectionId (string) --
The ID of the VpcLink used for the integration when connectionType=VPC_LINK
and undefined, otherwise.
credentials (string) --
Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string arn:aws:iam::\*:user/\*
. To use resource-based permissions on supported AWS services, specify null.
requestParameters (dict) --
A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of method.request.{location}.{name}
, where location
is querystring
, path
, or header
and name
must be a valid and unique method request parameter name.
requestTemplates (dict) --
Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.
passthroughBehavior (string) --
Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in requestTemplates
. The valid value is one of the following: WHEN_NO_MATCH
: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. WHEN_NO_TEMPLATES
: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP 415 Unsupported Media Type response. NEVER
: rejects the method request with an HTTP 415 Unsupported Media Type response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.
contentHandling (string) --
Specifies how to handle request payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the passthroughBehavior
is configured to support payload pass-through.
timeoutInMillis (integer) --
Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
cacheNamespace (string) --
Specifies a group of related cached parameters. By default, API Gateway uses the resource ID as the cacheNamespace
. You can specify the same cacheNamespace
across resources to return the same cached data for requests to different resources.
cacheKeyParameters (list) --
A list of request parameters whose values API Gateway caches. To be valid values for cacheKeyParameters
, these parameters must also be specified for Method requestParameters
.
integrationResponses (dict) --
Specifies the integration's responses.
(string) --
(dict) --
Represents an integration response. The status code must map to an existing MethodResponse, and parameters and templates can be used to transform the back-end response.
statusCode (string) --
Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern (string) --
Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the .+
regex to match error response. However, make sure that the error response does not contain any newline ( \n
) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.
responseParameters (dict) --
A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of method.response.header.{name}
, where name
is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header.{name}
or integration.response.body.{JSON-expression}
, where name
is a valid and unique response header name and JSON-expression
is a valid JSON expression without the $
prefix.
responseTemplates (dict) --
Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
contentHandling (string) --
Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
tlsConfig (dict) --
Specifies the TLS configuration for an integration.
insecureSkipVerification (boolean) --
Specifies whether or not API Gateway skips verification that the certificate for an integration endpoint is issued by a supported certificate authority. This isn’t recommended, but it enables you to use certificates that are signed by private certificate authorities, or certificates that are self-signed. If enabled, API Gateway still performs basic certificate validation, which includes checking the certificate's expiration date, hostname, and presence of a root certificate authority. Supported only for HTTP
and HTTP_PROXY
integrations.
Warning
Enabling insecureSkipVerification
isn't recommended, especially for integrations with public HTTPS endpoints. If you enable insecureSkipVerification
, you increase the risk of man-in-the-middle attacks.
authorizationScopes (list) --
A list of authorization scopes configured on the method. The scopes are used with a COGNITO_USER_POOLS
authorizer to authorize the method invocation. The authorization works by matching the method scopes against the scopes parsed from the access token in the incoming request. The method invocation is authorized if any method scopes matches a claimed scope in the access token. Otherwise, the invocation is not authorized. When the method scope is configured, the client must provide an access token instead of an identity token for authorization purposes.
NextToken (string) --
A token to resume pagination.
APIGateway.Paginator.
GetRestApis
¶paginator = client.get_paginator('get_rest_apis')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from APIGateway.Client.get_rest_apis()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken
from a previous response.
{
'items': [
{
'id': 'string',
'name': 'string',
'description': 'string',
'createdDate': datetime(2015, 1, 1),
'version': 'string',
'warnings': [
'string',
],
'binaryMediaTypes': [
'string',
],
'minimumCompressionSize': 123,
'apiKeySource': 'HEADER'|'AUTHORIZER',
'endpointConfiguration': {
'types': [
'REGIONAL'|'EDGE'|'PRIVATE',
],
'vpcEndpointIds': [
'string',
]
},
'policy': 'string',
'tags': {
'string': 'string'
},
'disableExecuteApiEndpoint': True|False
},
],
'NextToken': 'string'
}
Response Structure
Contains references to your APIs and links that guide you in how to interact with your collection. A collection offers a paginated view of your APIs.
The current page of elements from this collection.
Represents a REST API.
The API's identifier. This identifier is unique across all of your APIs in API Gateway.
The API's name.
The API's description.
The timestamp when the API was created.
A version identifier for the API.
The warning messages reported when failonwarnings
is turned on during API import.
The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
The source of the API key for metering requests according to a usage plan. Valid values are: > HEADER
to read the API key from the X-API-Key
header of a request. AUTHORIZER
to read the API key from the UsageIdentifierKey
from a custom authorizer.
The endpoint configuration of this RestApi showing the endpoint types of the API.
A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is "EDGE"
. For a regional API and its custom domain name, the endpoint type is REGIONAL
. For a private API, the endpoint type is PRIVATE
.
The endpoint type. The valid values are EDGE
for edge-optimized API setup, most suitable for mobile applications; REGIONAL
for regional API endpoint setup, most suitable for calling from AWS Region; and PRIVATE
for private APIs.
A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for PRIVATE
endpoint type.
A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.
The collection of tags. Each tag element is associated with a given resource.
Specifies whether clients can invoke your API by using the default execute-api
endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com
endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.
A token to resume pagination.
APIGateway.Paginator.
GetSdkTypes
¶paginator = client.get_paginator('get_sdk_types')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from APIGateway.Client.get_sdk_types()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken
from a previous response.
{
'items': [
{
'id': 'string',
'friendlyName': 'string',
'description': 'string',
'configurationProperties': [
{
'name': 'string',
'friendlyName': 'string',
'description': 'string',
'required': True|False,
'defaultValue': 'string'
},
]
},
],
'NextToken': 'string'
}
Response Structure
The collection of SdkType instances.
The current page of elements from this collection.
A type of SDK that API Gateway can generate.
The identifier of an SdkType instance.
The user-friendly name of an SdkType instance.
The description of an SdkType.
A list of configuration properties of an SdkType.
A configuration property of an SDK type.
The name of a an SdkType configuration property.
The user-friendly name of an SdkType configuration property.
The description of an SdkType configuration property.
A boolean flag of an SdkType configuration property to indicate if the associated SDK configuration property is required ( true
) or not ( false
).
The default value of an SdkType configuration property.
A token to resume pagination.
APIGateway.Paginator.
GetUsage
¶paginator = client.get_paginator('get_usage')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from APIGateway.Client.get_usage()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
usagePlanId='string',
keyId='string',
startDate='string',
endDate='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The Id of the usage plan associated with the usage data.
[REQUIRED]
The starting date (e.g., 2016-01-01) of the usage data.
[REQUIRED]
The ending date (e.g., 2016-12-31) of the usage data.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken
from a previous response.
dict
Response Syntax
{
'usagePlanId': 'string',
'startDate': 'string',
'endDate': 'string',
'items': {
'string': [
[
123,
],
]
},
'NextToken': 'string'
}
Response Structure
(dict) --
Represents the usage data of a usage plan.
usagePlanId (string) --
The plan Id associated with this usage data.
startDate (string) --
The starting date of the usage data.
endDate (string) --
The ending date of the usage data.
items (dict) --
The usage data, as daily logs of used and remaining quotas, over the specified time interval indexed over the API keys in a usage plan. For example, {..., "values" : { "{api_key}" : [ [0, 100], [10, 90], [100, 10]]}
, where {api_key}
stands for an API key value and the daily log entry is of the format [used quota, remaining quota]
.
NextToken (string) --
A token to resume pagination.
APIGateway.Paginator.
GetUsagePlanKeys
¶paginator = client.get_paginator('get_usage_plan_keys')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from APIGateway.Client.get_usage_plan_keys()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
usagePlanId='string',
nameQuery='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The Id of the UsagePlan resource representing the usage plan containing the to-be-retrieved UsagePlanKey resource representing a plan customer.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken
from a previous response.
dict
Response Syntax
{
'items': [
{
'id': 'string',
'type': 'string',
'value': 'string',
'name': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Represents the collection of usage plan keys added to usage plans for the associated API keys and, possibly, other types of keys.
items (list) --
The current page of elements from this collection.
(dict) --
Represents a usage plan key to identify a plan customer.
id (string) --
The Id of a usage plan key.
type (string) --
The type of a usage plan key. Currently, the valid key type is API_KEY
.
value (string) --
The value of a usage plan key.
name (string) --
The name of a usage plan key.
NextToken (string) --
A token to resume pagination.
APIGateway.Paginator.
GetUsagePlans
¶paginator = client.get_paginator('get_usage_plans')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from APIGateway.Client.get_usage_plans()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
keyId='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken
from a previous response.
dict
Response Syntax
{
'items': [
{
'id': 'string',
'name': 'string',
'description': 'string',
'apiStages': [
{
'apiId': 'string',
'stage': 'string',
'throttle': {
'string': {
'burstLimit': 123,
'rateLimit': 123.0
}
}
},
],
'throttle': {
'burstLimit': 123,
'rateLimit': 123.0
},
'quota': {
'limit': 123,
'offset': 123,
'period': 'DAY'|'WEEK'|'MONTH'
},
'productCode': 'string',
'tags': {
'string': 'string'
}
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Represents a collection of usage plans for an AWS account.
items (list) --
The current page of elements from this collection.
(dict) --
Represents a usage plan used to specify who can assess associated API stages. Optionally, target request rate and quota limits can be set. In some cases clients can exceed the targets that you set. Don’t rely on usage plans to control costs. Consider using Amazon Web Services Budgets to monitor costs and WAF to manage API requests.
id (string) --
The identifier of a UsagePlan resource.
name (string) --
The name of a usage plan.
description (string) --
The description of a usage plan.
apiStages (list) --
The associated API stages of a usage plan.
(dict) --
API stage name of the associated API stage in a usage plan.
apiId (string) --
API Id of the associated API stage in a usage plan.
stage (string) --
API stage name of the associated API stage in a usage plan.
throttle (dict) --
Map containing method level throttling information for API stage in a usage plan.
(string) --
(dict) --
The API request rate limits.
burstLimit (integer) --
The API target request burst rate limit. This allows more requests through for a period of time than the target rate limit.
rateLimit (float) --
The API target request rate limit.
throttle (dict) --
A map containing method level throttling information for API stage in a usage plan.
burstLimit (integer) --
The API target request burst rate limit. This allows more requests through for a period of time than the target rate limit.
rateLimit (float) --
The API target request rate limit.
quota (dict) --
The target maximum number of permitted requests per a given unit time interval.
limit (integer) --
The target maximum number of requests that can be made in a given time period.
offset (integer) --
The number of requests subtracted from the given limit in the initial time period.
period (string) --
The time period in which the limit applies. Valid values are "DAY", "WEEK" or "MONTH".
productCode (string) --
The AWS Markeplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
tags (dict) --
The collection of tags. Each tag element is associated with a given resource.
NextToken (string) --
A token to resume pagination.
APIGateway.Paginator.
GetVpcLinks
¶paginator = client.get_paginator('get_vpc_links')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from APIGateway.Client.get_vpc_links()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken
from a previous response.
{
'items': [
{
'id': 'string',
'name': 'string',
'description': 'string',
'targetArns': [
'string',
],
'status': 'AVAILABLE'|'PENDING'|'DELETING'|'FAILED',
'statusMessage': 'string',
'tags': {
'string': 'string'
}
},
],
'NextToken': 'string'
}
Response Structure
The collection of VPC links under the caller's account in a region.
The current page of elements from this collection.
An API Gateway VPC link for a RestApi to access resources in an Amazon Virtual Private Cloud (VPC).
The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.
The name used to label and identify the VPC link.
The description of the VPC link.
The ARN of the network load balancer of the VPC targeted by the VPC link. The network load balancer must be owned by the same AWS account of the API owner.
The status of the VPC link. The valid values are AVAILABLE
, PENDING
, DELETING
, or FAILED
. Deploying an API will wait if the status is PENDING
and will fail if the status is DELETING
.
A description about the VPC link status.
The collection of tags. Each tag element is associated with a given resource.
A token to resume pagination.