2016/03/02 - Amazon API Gateway - 2 new4 updated api methods
Flushes all authorizer cache entries on a stage.
Request Syntax
client.flush_stage_authorizers_cache( restApiId='string', stageName='string' )
string
[REQUIRED]
The API identifier of the stage to flush.
string
[REQUIRED]
The name of the stage to flush.
None
Request Syntax
client.test_invoke_authorizer( restApiId='string', authorizerId='string', headers={ 'string': 'string' }, pathWithQueryString='string', body='string', stageVariables={ 'string': 'string' }, additionalContext={ 'string': 'string' } )
string
[REQUIRED]
string
[REQUIRED]
dict
(string) --
(string) --
string
string
dict
(string) --
(string) --
dict
(string) --
(string) --
dict
Response Syntax
{ 'clientStatus': 123, 'log': 'string', 'latency': 123, 'principalId': 'string', 'policy': 'string', 'authorization': { 'string': [ 'string', ] } }
Response Structure
(dict) --
Represents the response of the test invoke request in 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 Amazon 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 policy JSON document returned by the Authorizer
authorization (dict) --
(string) --
(list) --
(string) --
{'methodSettings': {'requireAuthorizationForCacheControl': 'boolean', 'unauthorizedCacheControlHeaderStrategy': 'FAIL_WITH_403 | ' 'SUCCEED_WITH_RESPONSE_HEADER ' '| ' 'SUCCEED_WITHOUT_RESPONSE_HEADER'}}
Creates a new Stage resource that references a pre-existing Deployment for the API.
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' } )
string
[REQUIRED]
The identifier of the RestApi resource for the Stage resource to create.
string
[REQUIRED]
The name for the Stage resource.
string
[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 characters, and the values must match [A-Za-z0-9-._~:/?#&=,]+.
(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' }, '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) --
stageName (string) --
The name of the stage is the first path segment in the Uniform Resource Identifier (URI) of a call to Amazon 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 are defined as {resource_path}/{http_method} for an individual method override, or \*/\* for the settings applied to 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 the 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 a 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 the strategy on how to handle the 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 characters, and the values must match [A-Za-z0-9-._~:/?#&=,]+.
(string) --
(string) --
createdDate (datetime) --
The date and time that the stage was created, in ISO 8601 format.
lastUpdatedDate (datetime) --
The date and time that information about the stage was last updated, in ISO 8601 format.
{'methodSettings': {'requireAuthorizationForCacheControl': 'boolean', 'unauthorizedCacheControlHeaderStrategy': 'FAIL_WITH_403 | ' 'SUCCEED_WITH_RESPONSE_HEADER ' '| ' 'SUCCEED_WITHOUT_RESPONSE_HEADER'}}
Gets information about a Stage resource.
Request Syntax
client.get_stage( restApiId='string', stageName='string' )
string
[REQUIRED]
The identifier of the RestApi resource for the Stage resource to get information about.
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' }, '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) --
stageName (string) --
The name of the stage is the first path segment in the Uniform Resource Identifier (URI) of a call to Amazon 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 are defined as {resource_path}/{http_method} for an individual method override, or \*/\* for the settings applied to 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 the 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 a 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 the strategy on how to handle the 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 characters, and the values must match [A-Za-z0-9-._~:/?#&=,]+.
(string) --
(string) --
createdDate (datetime) --
The date and time that the stage was created, in ISO 8601 format.
lastUpdatedDate (datetime) --
The date and time that information about the stage was last updated, in ISO 8601 format.
{'item': {'methodSettings': {'requireAuthorizationForCacheControl': 'boolean', 'unauthorizedCacheControlHeaderStrategy': 'FAIL_WITH_403 ' '| ' 'SUCCEED_WITH_RESPONSE_HEADER ' '| ' 'SUCCEED_WITHOUT_RESPONSE_HEADER'}}}
Gets information about one or more Stage resources.
Request Syntax
client.get_stages( restApiId='string', deploymentId='string' )
string
[REQUIRED]
The stages' API identifiers.
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' }, 'createdDate': datetime(2015, 1, 1), 'lastUpdatedDate': datetime(2015, 1, 1) }, ] }
Response Structure
(dict) --
A list of Stage resource that are associated with the ApiKey resource.
item (list) --
An individual Stage resource.
(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) --
stageName (string) --
The name of the stage is the first path segment in the Uniform Resource Identifier (URI) of a call to Amazon 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 are defined as {resource_path}/{http_method} for an individual method override, or \*/\* for the settings applied to 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 the 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 a 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 the strategy on how to handle the 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 characters, and the values must match [A-Za-z0-9-._~:/?#&=,]+.
(string) --
(string) --
createdDate (datetime) --
The date and time that the stage was created, in ISO 8601 format.
lastUpdatedDate (datetime) --
The date and time that information about the stage was last updated, in ISO 8601 format.
{'methodSettings': {'requireAuthorizationForCacheControl': 'boolean', 'unauthorizedCacheControlHeaderStrategy': 'FAIL_WITH_403 | ' 'SUCCEED_WITH_RESPONSE_HEADER ' '| ' 'SUCCEED_WITHOUT_RESPONSE_HEADER'}}
Changes information about a Stage resource.
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 identifier of the RestApi resource for the Stage resource to change information about.
string
[REQUIRED]
The name of the Stage resource to change information about.
list
A list of operations describing the updates to apply to the specified resource. The patches are applied in the order specified in the 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) --
A patch operation whose value indicates the operation to perform. Its value MUST be one of "add", "remove", "replace", "move", "copy", or "test"; other values are errors.
path (string) --
Operation objects MUST have exactly one "path" member. That member's value is a string containing a JSON-Pointer value that references a location within the target document (the "target location") where the operation is performed.
value (string) --
The actual value content.
from (string) --
The "move" and "copy" operation object MUST contain a "from" member, which is a string containing a JSON Pointer value that references the location in the target document to move the value from.
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' }, '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) --
stageName (string) --
The name of the stage is the first path segment in the Uniform Resource Identifier (URI) of a call to Amazon 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 are defined as {resource_path}/{http_method} for an individual method override, or \*/\* for the settings applied to 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 the 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 a 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 the strategy on how to handle the 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 characters, and the values must match [A-Za-z0-9-._~:/?#&=,]+.
(string) --
(string) --
createdDate (datetime) --
The date and time that the stage was created, in ISO 8601 format.
lastUpdatedDate (datetime) --
The date and time that information about the stage was last updated, in ISO 8601 format.