2016/04/05 - Amazon API Gateway - 2 new10 updated api methods
A feature of the Amazon API Gateway control service for creating a new API from an external API definition file.
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
Custom header parameters as part of the request.
(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.
dict
Response Syntax
{ 'id': 'string', 'name': 'string', 'description': 'string', 'createdDate': datetime(2015, 1, 1), 'warnings': [ 'string', ] }
Response Structure
(dict) --
Represents a REST API.
id (string) --
The API's identifier. This identifier is unique across all of your APIs in Amazon API Gateway.
name (string) --
The API's name.
description (string) --
The API's description.
createdDate (datetime) --
The date when the API was created, in ISO 8601 format.
warnings (list) --
(string) --
A feature of the Amazon 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.
Request Syntax
client.put_rest_api( restApiId='string', mode='merge'|'overwrite', failOnWarnings=True|False, parameters={ 'string': 'string' }, body=b'bytes'|file )
string
[REQUIRED]
The identifier of the RestApi to be updated.
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 headers supplied as part of the request.
(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.
dict
Response Syntax
{ 'id': 'string', 'name': 'string', 'description': 'string', 'createdDate': datetime(2015, 1, 1), 'warnings': [ 'string', ] }
Response Structure
(dict) --
Represents a REST API.
id (string) --
The API's identifier. This identifier is unique across all of your APIs in Amazon API Gateway.
name (string) --
The API's name.
description (string) --
The API's description.
createdDate (datetime) --
The date when the API was created, in ISO 8601 format.
warnings (list) --
(string) --
{'authType': 'string'}
Adds a new Authorizer resource to an existing RestApi resource.
Request Syntax
client.create_authorizer( restApiId='string', name='string', type='TOKEN', authType='string', authorizerUri='string', authorizerCredentials='string', identitySource='string', identityValidationExpression='string', authorizerResultTtlInSeconds=123 )
string
[REQUIRED]
The RestApi identifier under which the Authorizer will be created.
string
[REQUIRED]
[Required] The name of the authorizer.
string
[REQUIRED]
[Required] The type of the authorizer.
string
Optional customer-defined field, used in Swagger imports/exports. Has no functional impact.
string
[REQUIRED]
[Required] Specifies the authorizer's Uniform Resource Identifier (URI).
string
Specifies the credentials required for the authorizer, if any.
string
[REQUIRED]
[Required] The source of the identity in an incoming request.
string
A validation expression for the incoming identity.
integer
The TTL of cached authorizer results.
dict
Response Syntax
{ 'id': 'string', 'name': 'string', 'type': 'TOKEN', '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) --
[Required] The name of the authorizer.
type (string) --
[Required] The type of the authorizer. Currently, the only valid type is TOKEN.
authType (string) --
Optional customer-defined field, used in Swagger imports/exports. Has no functional impact.
authorizerUri (string) --
[Required] Specifies the authorizer's Uniform Resource Identifier (URI). For TOKEN authorizers, this must be a well-formed Lambda function URI. The URI should be of the form arn:aws:apigateway:{region}:lambda:path/{service_api}. Region is used to determine the right endpoint. In this case, path is used to indicate 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 credentials required for the authorizer, if any. Two options are available. To specify an IAM Role for Amazon 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) --
[Required] The source of the identity in an incoming request. For TOKEN authorizers, this value is a mapping expression with the same syntax as integration parameter mappings. The only valid source for tokens is 'header', so the expression should match 'method.request.header.[headerName]'. The value of the header '[headerName]' will be interpreted as the incoming token.
identityValidationExpression (string) --
A validation expression for the incoming identity. For TOKEN authorizers, this value should be a regular expression. The incoming token from the client is matched against this expression, and will proceed if the token matches. If the token doesn't match, the client receives a 401 Unauthorized response.
authorizerResultTtlInSeconds (integer) --
The TTL in seconds of cached authorizer results. If 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.
{'warnings': ['string']}
Creates a new RestApi resource.
Request Syntax
client.create_rest_api( name='string', description='string', cloneFrom='string' )
string
[REQUIRED]
The name of the RestApi.
string
The description of the RestApi.
string
The Id of the RestApi that you want to clone from.
dict
Response Syntax
{ 'id': 'string', 'name': 'string', 'description': 'string', 'createdDate': datetime(2015, 1, 1), 'warnings': [ 'string', ] }
Response Structure
(dict) --
Represents a REST API.
id (string) --
The API's identifier. This identifier is unique across all of your APIs in Amazon API Gateway.
name (string) --
The API's name.
description (string) --
The API's description.
createdDate (datetime) --
The date when the API was created, in ISO 8601 format.
warnings (list) --
(string) --
{'authType': 'string'}
Describe an existing Authorizer resource.
Request Syntax
client.get_authorizer( restApiId='string', authorizerId='string' )
string
[REQUIRED]
The RestApi identifier for the Authorizer resource.
string
[REQUIRED]
The identifier of the Authorizer resource.
dict
Response Syntax
{ 'id': 'string', 'name': 'string', 'type': 'TOKEN', '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) --
[Required] The name of the authorizer.
type (string) --
[Required] The type of the authorizer. Currently, the only valid type is TOKEN.
authType (string) --
Optional customer-defined field, used in Swagger imports/exports. Has no functional impact.
authorizerUri (string) --
[Required] Specifies the authorizer's Uniform Resource Identifier (URI). For TOKEN authorizers, this must be a well-formed Lambda function URI. The URI should be of the form arn:aws:apigateway:{region}:lambda:path/{service_api}. Region is used to determine the right endpoint. In this case, path is used to indicate 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 credentials required for the authorizer, if any. Two options are available. To specify an IAM Role for Amazon 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) --
[Required] The source of the identity in an incoming request. For TOKEN authorizers, this value is a mapping expression with the same syntax as integration parameter mappings. The only valid source for tokens is 'header', so the expression should match 'method.request.header.[headerName]'. The value of the header '[headerName]' will be interpreted as the incoming token.
identityValidationExpression (string) --
A validation expression for the incoming identity. For TOKEN authorizers, this value should be a regular expression. The incoming token from the client is matched against this expression, and will proceed if the token matches. If the token doesn't match, the client receives a 401 Unauthorized response.
authorizerResultTtlInSeconds (integer) --
The TTL in seconds of cached authorizer results. If 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.
{'items': {'authType': 'string'}}
Describe an existing Authorizers resource.
Request Syntax
client.get_authorizers( restApiId='string', position='string', limit=123 )
string
[REQUIRED]
The RestApi identifier for the Authorizers resource.
string
If not all Authorizer resources in the response were present, the position will specificy where to start the next page of results.
integer
Limit the number of Authorizer resources in the response.
dict
Response Syntax
{ 'position': 'string', 'items': [ { 'id': 'string', 'name': 'string', 'type': 'TOKEN', '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) --
Gets the current list of Authorizer resources in the 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) --
[Required] The name of the authorizer.
type (string) --
[Required] The type of the authorizer. Currently, the only valid type is TOKEN.
authType (string) --
Optional customer-defined field, used in Swagger imports/exports. Has no functional impact.
authorizerUri (string) --
[Required] Specifies the authorizer's Uniform Resource Identifier (URI). For TOKEN authorizers, this must be a well-formed Lambda function URI. The URI should be of the form arn:aws:apigateway:{region}:lambda:path/{service_api}. Region is used to determine the right endpoint. In this case, path is used to indicate 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 credentials required for the authorizer, if any. Two options are available. To specify an IAM Role for Amazon 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) --
[Required] The source of the identity in an incoming request. For TOKEN authorizers, this value is a mapping expression with the same syntax as integration parameter mappings. The only valid source for tokens is 'header', so the expression should match 'method.request.header.[headerName]'. The value of the header '[headerName]' will be interpreted as the incoming token.
identityValidationExpression (string) --
A validation expression for the incoming identity. For TOKEN authorizers, this value should be a regular expression. The incoming token from the client is matched against this expression, and will proceed if the token matches. If the token doesn't match, the client receives a 401 Unauthorized response.
authorizerResultTtlInSeconds (integer) --
The TTL in seconds of cached authorizer results. If 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.
{'warnings': ['string']}
Lists the RestApi resource in the collection.
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), 'warnings': [ 'string', ] }
Response Structure
(dict) --
Represents a REST API.
id (string) --
The API's identifier. This identifier is unique across all of your APIs in Amazon API Gateway.
name (string) --
The API's name.
description (string) --
The API's description.
createdDate (datetime) --
The date when the API was created, in ISO 8601 format.
warnings (list) --
(string) --
{'items': {'warnings': ['string']}}
Lists the RestApis resources for your collection.
Request Syntax
client.get_rest_apis( position='string', limit=123 )
string
The position of the current RestApis resource in the collection to get information about.
integer
The maximum number of RestApi resources in the collection to get information about. The default limit is 25. It should be an integer between 1 - 500.
dict
Response Syntax
{ 'position': 'string', 'items': [ { 'id': 'string', 'name': 'string', 'description': 'string', 'createdDate': datetime(2015, 1, 1), 'warnings': [ 'string', ] }, ] }
Response Structure
(dict) --
Contains references to your APIs and links that guide you in ways to interact with your collection. A collection offers a paginated view of your APIs.
position (string) --
items (list) --
An array of links to the current page of RestApi resources.
(dict) --
Represents a REST API.
id (string) --
The API's identifier. This identifier is unique across all of your APIs in Amazon API Gateway.
name (string) --
The API's name.
description (string) --
The API's description.
createdDate (datetime) --
The date when the API was created, in ISO 8601 format.
warnings (list) --
(string) --
{'warnings': ['string']}
A feature of the Amazon API Gateway control service for creating a new API from an external API definition file.
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
Custom header parameters as part of the request.
(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.
dict
Response Syntax
{ 'id': 'string', 'name': 'string', 'description': 'string', 'createdDate': datetime(2015, 1, 1), 'warnings': [ 'string', ] }
Response Structure
(dict) --
Represents a REST API.
id (string) --
The API's identifier. This identifier is unique across all of your APIs in Amazon API Gateway.
name (string) --
The API's name.
description (string) --
The API's description.
createdDate (datetime) --
The date when the API was created, in ISO 8601 format.
warnings (list) --
(string) --
{'warnings': ['string']}
A feature of the Amazon 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.
Request Syntax
client.put_rest_api( restApiId='string', mode='merge'|'overwrite', failOnWarnings=True|False, parameters={ 'string': 'string' }, body=b'bytes'|file )
string
[REQUIRED]
The identifier of the RestApi to be updated.
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 headers supplied as part of the request.
(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.
dict
Response Syntax
{ 'id': 'string', 'name': 'string', 'description': 'string', 'createdDate': datetime(2015, 1, 1), 'warnings': [ 'string', ] }
Response Structure
(dict) --
Represents a REST API.
id (string) --
The API's identifier. This identifier is unique across all of your APIs in Amazon API Gateway.
name (string) --
The API's name.
description (string) --
The API's description.
createdDate (datetime) --
The date when the API was created, in ISO 8601 format.
warnings (list) --
(string) --
{'authType': 'string'}
Updates an existing Authorizer resource.
Request Syntax
client.update_authorizer( restApiId='string', authorizerId='string', patchOperations=[ { 'op': 'add'|'remove'|'replace'|'move'|'copy'|'test', 'path': 'string', 'value': 'string', 'from': 'string' }, ] )
string
[REQUIRED]
The RestApi identifier for the Authorizer resource.
string
[REQUIRED]
The identifier of the Authorizer resource.
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
{ 'id': 'string', 'name': 'string', 'type': 'TOKEN', '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) --
[Required] The name of the authorizer.
type (string) --
[Required] The type of the authorizer. Currently, the only valid type is TOKEN.
authType (string) --
Optional customer-defined field, used in Swagger imports/exports. Has no functional impact.
authorizerUri (string) --
[Required] Specifies the authorizer's Uniform Resource Identifier (URI). For TOKEN authorizers, this must be a well-formed Lambda function URI. The URI should be of the form arn:aws:apigateway:{region}:lambda:path/{service_api}. Region is used to determine the right endpoint. In this case, path is used to indicate 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 credentials required for the authorizer, if any. Two options are available. To specify an IAM Role for Amazon 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) --
[Required] The source of the identity in an incoming request. For TOKEN authorizers, this value is a mapping expression with the same syntax as integration parameter mappings. The only valid source for tokens is 'header', so the expression should match 'method.request.header.[headerName]'. The value of the header '[headerName]' will be interpreted as the incoming token.
identityValidationExpression (string) --
A validation expression for the incoming identity. For TOKEN authorizers, this value should be a regular expression. The incoming token from the client is matched against this expression, and will proceed if the token matches. If the token doesn't match, the client receives a 401 Unauthorized response.
authorizerResultTtlInSeconds (integer) --
The TTL in seconds of cached authorizer results. If 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.
{'warnings': ['string']}
Changes information about the specified API.
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 ID of the RestApi you want to update.
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
{ 'id': 'string', 'name': 'string', 'description': 'string', 'createdDate': datetime(2015, 1, 1), 'warnings': [ 'string', ] }
Response Structure
(dict) --
Represents a REST API.
id (string) --
The API's identifier. This identifier is unique across all of your APIs in Amazon API Gateway.
name (string) --
The API's name.
description (string) --
The API's description.
createdDate (datetime) --
The date when the API was created, in ISO 8601 format.
warnings (list) --
(string) --