2017/12/19 - Amazon API Gateway - 3 new10 updated api methods
Changes Update apigateway client to latest version
Removes Tags from a given resource.
See also: AWS API Documentation
Request Syntax
client.untag_resource( resourceArn='string', tagKeys=[ 'string', ] )
string
[REQUIRED]
[Required] The ARN of a resource that can be tagged. At present, Stage is the only taggable resource.
list
[REQUIRED]
The Tag keys to delete.
(string) --
None
Adds or updates Tags on a gievn resource.
See also: AWS API Documentation
Request Syntax
client.tag_resource( resourceArn='string', tags={ 'string': 'string' } )
string
[REQUIRED]
[Required] The ARN of a resource that can be tagged. At present, Stage is the only taggable resource.
dict
[REQUIRED]
[Required] Key/Value map of strings. Valid character set is [a-zA-Z+-=._:/]. Tag key can be up to 128 characters and must not start with "aws:". Tag value can be up to 256 characters.
(string) --
(string) --
None
Gets the Tags collection for a given resource.
See also: AWS API Documentation
Request Syntax
client.get_tags( resourceArn='string', position='string', limit=123 )
string
[REQUIRED]
[Required] The ARN of a resource that can be tagged. At present, Stage is the only taggable resource.
string
(Not currently supported) The current pagination position in the paged result set.
integer
(Not currently supported) The maximum number of returned results per page.
dict
Response Syntax
{ 'tags': { 'string': 'string' } }
Response Structure
(dict) --
A collection of Tags associated with a given resource.
tags (dict) --
A collection of Tags associated with a given resource.
(string) --
(string) --
{'apiKeySource': 'HEADER | AUTHORIZER', 'minimumCompressionSize': 'integer'}
Creates a new RestApi resource.
See also: AWS API Documentation
Request Syntax
client.create_rest_api( name='string', description='string', version='string', cloneFrom='string', binaryMediaTypes=[ 'string', ], minimumCompressionSize=123, apiKeySource='HEADER'|'AUTHORIZER', endpointConfiguration={ 'types': [ 'REGIONAL'|'EDGE', ] } )
string
[REQUIRED]
The name of the RestApi.
string
The description of the RestApi.
string
A version identifier for the API.
string
The ID of the RestApi that you want to clone from.
list
The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
(string) --
integer
A nullable integer used to enable (non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable (null) compression on an API. When compression is enabled, compression or decompression are not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
string
The source of the API key for metring 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.
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.
(string) --
The endpoint type. The valid value is EDGE for edge-optimized API setup, most suitable for mobile applications, REGIONAL for regional API endpoint setup, most suitable for calling from AWS Region
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', ] } }
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.
(string) --
binaryMediaTypes (list) --
The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
(string) --
minimumCompressionSize (integer) --
A nullable integer used to enable (non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable (null) compression on an API. When compression is enabled, compression or decompression are 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 metring 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.
(string) --
The endpoint type. The valid value is EDGE for edge-optimized API setup, most suitable for mobile applications, REGIONAL for regional API endpoint setup, most suitable for calling from AWS Region
{'tags': {'string': 'string'}}
Creates a new Stage resource that references a pre-existing Deployment for the API.
See also: AWS API Documentation
Request Syntax
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 }, tags={ 'string': 'string' } )
string
[REQUIRED]
The string identifier of the associated RestApi.
string
[REQUIRED]
[Required] The name for the Stage resource.
string
[REQUIRED]
[Required] The identifier of the Deployment resource for the Stage resource.
string
The description of the Stage resource.
boolean
Whether cache clustering is enabled for the stage.
string
The stage's cache cluster size.
dict
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-._~:/?#&=,]+.
(string) --
(string) --
string
The version of the associated API documentation.
dict
The canary deployment settings of 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.
(string) --
(string) --
useStageCache (boolean) --
A Boolean flag to indicate whether the canary deployment uses the stage cache or not.
dict
Key/Value map of strings. Valid character set is [a-zA-Z+-=._:/]. Tag key can be up to 128 characters and must not start with "aws:". Tag value can be up to 256 characters.
(string) --
(string) --
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 }, '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.
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 effects 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.
dataTraceEnabled (boolean) --
Specifies whether data trace logging is enabled for this method, which effects 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-._~:/?#&=,]+.
(string) --
(string) --
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 ARN of the CloudWatch Logs log group to receive access logs.
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.
(string) --
(string) --
useStageCache (boolean) --
A Boolean flag to indicate whether the canary deployment uses the stage cache or not.
tags (dict) --
A collection of Tags associated with a given resource.
(string) --
(string) --
createdDate (datetime) --
The timestamp when the stage was created.
lastUpdatedDate (datetime) --
The timestamp when the stage last updated.
{'apiKeySource': 'HEADER | AUTHORIZER', 'minimumCompressionSize': 'integer'}
Lists the RestApi resource in the collection.
See also: AWS API Documentation
Request Syntax
client.get_rest_api( restApiId='string' )
string
[REQUIRED]
The identifier of the RestApi resource.
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', ] } }
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.
(string) --
binaryMediaTypes (list) --
The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
(string) --
minimumCompressionSize (integer) --
A nullable integer used to enable (non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable (null) compression on an API. When compression is enabled, compression or decompression are 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 metring 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.
(string) --
The endpoint type. The valid value is EDGE for edge-optimized API setup, most suitable for mobile applications, REGIONAL for regional API endpoint setup, most suitable for calling from AWS Region
{'items': {'apiKeySource': 'HEADER | AUTHORIZER', 'minimumCompressionSize': 'integer'}}
Lists the RestApis resources for your collection.
See also: AWS API Documentation
Request Syntax
client.get_rest_apis( position='string', limit=123 )
string
The current pagination position in the paged result set.
integer
The maximum number of returned results per page. The value is 25 by default and could be between 1 - 500.
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', ] } }, ] }
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.
(string) --
binaryMediaTypes (list) --
The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
(string) --
minimumCompressionSize (integer) --
A nullable integer used to enable (non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable (null) compression on an API. When compression is enabled, compression or decompression are 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 metring 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.
(string) --
The endpoint type. The valid value is EDGE for edge-optimized API setup, most suitable for mobile applications, REGIONAL for regional API endpoint setup, most suitable for calling from AWS Region
{'tags': {'string': 'string'}}
Gets information about a Stage resource.
See also: AWS API Documentation
Request Syntax
client.get_stage( restApiId='string', stageName='string' )
string
[REQUIRED]
The string identifier of the associated RestApi.
string
[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 }, '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.
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 effects 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.
dataTraceEnabled (boolean) --
Specifies whether data trace logging is enabled for this method, which effects 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-._~:/?#&=,]+.
(string) --
(string) --
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 ARN of the CloudWatch Logs log group to receive access logs.
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.
(string) --
(string) --
useStageCache (boolean) --
A Boolean flag to indicate whether the canary deployment uses the stage cache or not.
tags (dict) --
A collection of Tags associated with a given resource.
(string) --
(string) --
createdDate (datetime) --
The timestamp when the stage was created.
lastUpdatedDate (datetime) --
The timestamp when the stage last updated.
{'item': {'tags': {'string': 'string'}}}
Gets information about one or more Stage resources.
See also: AWS API Documentation
Request Syntax
client.get_stages( restApiId='string', deploymentId='string' )
string
[REQUIRED]
The string identifier of the associated RestApi.
string
The stages' deployment identifiers.
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 }, '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.
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 effects 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.
dataTraceEnabled (boolean) --
Specifies whether data trace logging is enabled for this method, which effects 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-._~:/?#&=,]+.
(string) --
(string) --
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 ARN of the CloudWatch Logs log group to receive access logs.
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.
(string) --
(string) --
useStageCache (boolean) --
A Boolean flag to indicate whether the canary deployment uses the stage cache or not.
tags (dict) --
A collection of Tags associated with a given resource.
(string) --
(string) --
createdDate (datetime) --
The timestamp when the stage was created.
lastUpdatedDate (datetime) --
The timestamp when the stage last updated.
{'apiKeySource': 'HEADER | AUTHORIZER', 'minimumCompressionSize': 'integer'}
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
client.import_rest_api( failOnWarnings=True|False, parameters={ 'string': 'string' }, body=b'bytes'|file )
boolean
A query parameter to indicate whether to rollback the API creation ( true) or not ( false) when a warning is encountered. The default value is false.
dict
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 or endpointConfigurationTypes=REGIONAL. 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:
aws apigateway import-rest-api --parameters ignore=documentation --body 'file:///path/to/imported-api-body.json
The AWS CLI command to set the regional endpoint on the imported API is:
aws apigateway import-rest-api --parameters endpointConfigurationTypes=REGIONAL --body 'file:///path/to/imported-api-body.json
(string) --
(string) --
bytes or seekable file-like object
[REQUIRED]
The POST request body containing external API definitions. Currently, only Swagger definition JSON files are supported. The maximum size of the API definition file is 2MB.
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', ] } }
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.
(string) --
binaryMediaTypes (list) --
The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
(string) --
minimumCompressionSize (integer) --
A nullable integer used to enable (non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable (null) compression on an API. When compression is enabled, compression or decompression are 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 metring 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.
(string) --
The endpoint type. The valid value is EDGE for edge-optimized API setup, most suitable for mobile applications, REGIONAL for regional API endpoint setup, most suitable for calling from AWS Region
{'apiKeySource': 'HEADER | AUTHORIZER', 'minimumCompressionSize': 'integer'}
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
client.put_rest_api( restApiId='string', mode='merge'|'overwrite', failOnWarnings=True|False, parameters={ 'string': 'string' }, body=b'bytes'|file )
string
[REQUIRED]
The string identifier of the associated RestApi.
string
The mode query parameter to specify the update mode. Valid values are "merge" and "overwrite". By default, the update mode is "merge".
boolean
A query parameter to indicate whether to rollback the API update ( true) or not ( false) when a warning is encountered. The default value is false.
dict
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.
(string) --
(string) --
bytes or seekable file-like object
[REQUIRED]
The PUT request body containing external API definitions. Currently, only Swagger definition JSON files are supported. The maximum size of the API definition file is 2MB.
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', ] } }
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.
(string) --
binaryMediaTypes (list) --
The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
(string) --
minimumCompressionSize (integer) --
A nullable integer used to enable (non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable (null) compression on an API. When compression is enabled, compression or decompression are 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 metring 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.
(string) --
The endpoint type. The valid value is EDGE for edge-optimized API setup, most suitable for mobile applications, REGIONAL for regional API endpoint setup, most suitable for calling from AWS Region
{'apiKeySource': 'HEADER | AUTHORIZER', 'minimumCompressionSize': 'integer'}
Changes information about the specified API.
See also: AWS API Documentation
Request Syntax
client.update_rest_api( restApiId='string', patchOperations=[ { 'op': 'add'|'remove'|'replace'|'move'|'copy'|'test', 'path': 'string', 'value': 'string', 'from': 'string' }, ] )
string
[REQUIRED]
The string identifier of the associated RestApi.
list
A list of update operations to be applied to the specified resource and in the order specified in this list.
(dict) -- A single patch operation to apply to the specified resource. Please refer to http://tools.ietf.org/html/rfc6902#section-4 for an explanation of how each operation is used.
op (string) --
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.
path (string) --
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.
value (string) --
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": ...}'. In a Windows shell, see Using JSON for Parameters.
from (string) --
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', ] } }
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.
(string) --
binaryMediaTypes (list) --
The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
(string) --
minimumCompressionSize (integer) --
A nullable integer used to enable (non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable (null) compression on an API. When compression is enabled, compression or decompression are 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 metring 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.
(string) --
The endpoint type. The valid value is EDGE for edge-optimized API setup, most suitable for mobile applications, REGIONAL for regional API endpoint setup, most suitable for calling from AWS Region
{'tags': {'string': 'string'}}
Changes information about a Stage resource.
See also: AWS API Documentation
Request Syntax
client.update_stage( restApiId='string', stageName='string', patchOperations=[ { 'op': 'add'|'remove'|'replace'|'move'|'copy'|'test', 'path': 'string', 'value': 'string', 'from': 'string' }, ] )
string
[REQUIRED]
The string identifier of the associated RestApi.
string
[REQUIRED]
The name of the Stage resource to change information about.
list
A list of update operations to be applied to the specified resource and in the order specified in this list.
(dict) -- A single patch operation to apply to the specified resource. Please refer to http://tools.ietf.org/html/rfc6902#section-4 for an explanation of how each operation is used.
op (string) --
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.
path (string) --
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.
value (string) --
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": ...}'. In a Windows shell, see Using JSON for Parameters.
from (string) --
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 }, '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.
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 effects 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.
dataTraceEnabled (boolean) --
Specifies whether data trace logging is enabled for this method, which effects 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-._~:/?#&=,]+.
(string) --
(string) --
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 ARN of the CloudWatch Logs log group to receive access logs.
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.
(string) --
(string) --
useStageCache (boolean) --
A Boolean flag to indicate whether the canary deployment uses the stage cache or not.
tags (dict) --
A collection of Tags associated with a given resource.
(string) --
(string) --
createdDate (datetime) --
The timestamp when the stage was created.
lastUpdatedDate (datetime) --
The timestamp when the stage last updated.