Amazon API Gateway

2016/02/11 - Amazon API Gateway - 6 new7 updated api methods

GetAuthorizer (new) Link ¶

Describe an existing Authorizer resource.

Request Syntax

client.get_authorizer(
    restApiId='string',
    authorizerId='string'
)
type restApiId:

string

param restApiId:

[REQUIRED]

The RestApi identifier for the Authorizer resource.

type authorizerId:

string

param authorizerId:

[REQUIRED]

The identifier of the Authorizer resource.

rtype:

dict

returns:

Response Syntax

{
    'id': 'string',
    'name': 'string',
    'type': 'TOKEN',
    '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.

    • 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.

GetExport (new) Link ¶

Request Syntax

client.get_export(
    restApiId='string',
    stageName='string',
    exportType='string',
    parameters={
        'string': 'string'
    },
    accepts='string'
)
type restApiId:

string

param restApiId:

[REQUIRED]

type stageName:

string

param stageName:

[REQUIRED]

type exportType:

string

param exportType:

[REQUIRED]

type parameters:

dict

param parameters:
  • (string) --

    • (string) --

type accepts:

string

param accepts:

rtype:

dict

returns:

Response Syntax

{
    'contentType': 'string',
    'contentDisposition': 'string',
    'body': StreamingBody()
}

Response Structure

  • (dict) --

    • contentType (string) --

    • contentDisposition (string) --

    • body (:class:`.StreamingBody`) --

UpdateAuthorizer (new) Link ¶

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'
        },
    ]
)
type restApiId:

string

param restApiId:

[REQUIRED]

The RestApi identifier for the Authorizer resource.

type authorizerId:

string

param authorizerId:

[REQUIRED]

The identifier of the Authorizer resource.

type patchOperations:

list

param patchOperations:

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.

rtype:

dict

returns:

Response Syntax

{
    'id': 'string',
    'name': 'string',
    'type': 'TOKEN',
    '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.

    • 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.

CreateAuthorizer (new) Link ¶

Request Syntax

client.create_authorizer(
    restApiId='string',
    name='string',
    type='TOKEN',
    authorizerUri='string',
    authorizerCredentials='string',
    identitySource='string',
    identityValidationExpression='string',
    authorizerResultTtlInSeconds=123
)
type restApiId:

string

param restApiId:

[REQUIRED]

type name:

string

param name:

[REQUIRED]

[Required] The name of the authorizer.

type type:

string

param type:

[REQUIRED]

[Required] The type of the authorizer.

type authorizerUri:

string

param authorizerUri:

[REQUIRED]

[Required] Specifies the authorizer's Uniform Resource Identifier (URI).

type authorizerCredentials:

string

param authorizerCredentials:

Specifies the credentials required for the authorizer, if any.

type identitySource:

string

param identitySource:

[REQUIRED]

[Required] The source of the identity in an incoming request.

type identityValidationExpression:

string

param identityValidationExpression:

A validation expression for the incoming identity.

type authorizerResultTtlInSeconds:

integer

param authorizerResultTtlInSeconds:

The TTL of cached authorizer results.

rtype:

dict

returns:

Response Syntax

{
    'id': 'string',
    'name': 'string',
    'type': 'TOKEN',
    '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.

    • 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.

DeleteAuthorizer (new) Link ¶

Deletes an existing Authorizer resource.

Request Syntax

client.delete_authorizer(
    restApiId='string',
    authorizerId='string'
)
type restApiId:

string

param restApiId:

[REQUIRED]

The RestApi identifier for the Authorizer resource.

type authorizerId:

string

param authorizerId:

[REQUIRED]

The identifier of the Authorizer resource.

returns:

None

GetAuthorizers (new) Link ¶

Describe an existing Authorizers resource.

Request Syntax

client.get_authorizers(
    restApiId='string',
    position='string',
    limit=123
)
type restApiId:

string

param restApiId:

[REQUIRED]

The RestApi identifier for the Authorizers resource.

type position:

string

param position:

type limit:

integer

param limit:

rtype:

dict

returns:

Response Syntax

{
    'position': 'string',
    'items': [
        {
            'id': 'string',
            'name': 'string',
            'type': 'TOKEN',
            '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.

        • 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.

CreateResource (updated) Link ¶
Changes (response)
{'resourceMethods': {'authorizerId': 'string'}}

Creates a Resource resource.

Request Syntax

client.create_resource(
    restApiId='string',
    parentId='string',
    pathPart='string'
)
type restApiId:

string

param restApiId:

[REQUIRED]

The identifier of the RestApi for the resource.

type parentId:

string

param parentId:

[REQUIRED]

The parent resource's identifier.

type pathPart:

string

param pathPart:

[REQUIRED]

The last path segment for this resource.

rtype:

dict

returns:

Response Syntax

{
    'id': 'string',
    'parentId': 'string',
    'pathPart': 'string',
    'path': 'string',
    'resourceMethods': {
        'string': {
            'httpMethod': 'string',
            'authorizationType': 'string',
            'authorizerId': 'string',
            'apiKeyRequired': True|False,
            'requestParameters': {
                'string': True|False
            },
            'requestModels': {
                'string': 'string'
            },
            'methodResponses': {
                'string': {
                    'statusCode': 'string',
                    'responseParameters': {
                        'string': True|False
                    },
                    'responseModels': {
                        'string': 'string'
                    }
                }
            },
            'methodIntegration': {
                'type': 'HTTP'|'AWS'|'MOCK',
                'httpMethod': 'string',
                'uri': 'string',
                'credentials': 'string',
                'requestParameters': {
                    'string': 'string'
                },
                'requestTemplates': {
                    'string': 'string'
                },
                'cacheNamespace': 'string',
                'cacheKeyParameters': [
                    'string',
                ],
                'integrationResponses': {
                    'string': {
                        'statusCode': 'string',
                        'selectionPattern': 'string',
                        'responseParameters': {
                            'string': 'string'
                        },
                        'responseTemplates': {
                            'string': 'string'
                        }
                    }
                }
            }
        }
    }
}

Response Structure

  • (dict) --

    Represents a resource.

    • id (string) --

      The resource's identifier.

    • parentId (string) --

      The parent resource's identifier.

    • pathPart (string) --

      The last path segment for this resource.

    • path (string) --

      The full path for this resource.

    • resourceMethods (dict) --

      Map of methods for this resource, which is included only if requested using the embed option.

      • (string) --

        • (dict) --

          Represents a method.

          • httpMethod (string) --

            The HTTP method.

          • authorizationType (string) --

            The method's authorization type.

          • authorizerId (string) --

            Specifies the identifier of an Authorizer to use on this Method. The authorizationType must be CUSTOM.

          • apiKeyRequired (boolean) --

            Specifies whether the method requires a valid ApiKey.

          • requestParameters (dict) --

            Represents request parameters that can be accepted by Amazon API Gateway. Request parameters are represented as a key/value map, with a source as the key and a Boolean flag as the value. The Boolean flag is used to specify whether the parameter is required. A source must match the pattern method.request.{location}.{name}, where location is either querystring, path, or header. name is a valid, unique parameter name. Sources specified here are available to the integration for mapping to integration request parameters or templates.

            • (string) --

              • (boolean) --

          • requestModels (dict) --

            Specifies the Model resources used for the request's content type. Request models are represented as a key/value map, with a content type as the key and a Model name as the value.

            • (string) --

              • (string) --

          • methodResponses (dict) --

            Represents available responses that can be sent to the caller. Method responses are represented as a key/value map, with an HTTP status code as the key and a MethodResponse as the value. The status codes are available for the Integration responses to map to.

            • (string) --

              • (dict) --

                Represents a method response. Amazon API Gateway sends back the status code to the caller as the HTTP status code. Parameters and models can be used to transform the response from the method's integration.

                • statusCode (string) --

                  The method response's status code.

                • responseParameters (dict) --

                  Represents response parameters that can be sent back to the caller by Amazon API Gateway. Response parameters are represented as a key/value map, with a destination as the key and a boolean flag as the value, which is used to specify whether the parameter is required. A destination must match the pattern method.response.header.{name}, where name is a valid, unique header name. Destinations specified here are available to the integration for mapping from integration response parameters.

                  • (string) --

                    • (boolean) --

                • responseModels (dict) --

                  Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.

                  • (string) --

                    • (string) --

          • methodIntegration (dict) --

            The method's integration.

            • type (string) --

              Specifies the integration's type.

            • httpMethod (string) --

              Specifies the integration's HTTP method type.

            • uri (string) --

              Specifies the integration's Uniform Resource Identifier (URI). For HTTP integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification. For AWS integrations, the URI should be of the form arn:aws:apigateway:{region}:{subdomain.service|service}:{path|action}/{service_api}. Region, subdomain and service are used to determine the right endpoint. For AWS services that use the Action= query string parameter, service_api should be a valid action for the desired service. For RESTful AWS service APIs, path is used to indicate that the remaining substring in the URI should be treated as the path to the resource, including the initial /.

            • credentials (string) --

              Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for Amazon API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string arn:aws:iam::\*:user/\*. To use resource-based permissions on supported AWS services, specify null.

            • requestParameters (dict) --

              Represents requests parameters that are sent with the backend request. Request parameters are represented as a key/value map, with a destination as the key and a source as the value. A source must match an existing method request parameter, or a static value. Static values must be enclosed with single quotes, and be pre-encoded based on their destination in the request. The destination must match the pattern integration.request.{location}.{name}, where location is either querystring, path, or header. name must be a valid, unique parameter name.

              • (string) --

                • (string) --

            • requestTemplates (dict) --

              Specifies the integration's request templates.

              • (string) --

                • (string) --

            • cacheNamespace (string) --

              Specifies the integration's cache namespace.

            • cacheKeyParameters (list) --

              Specifies the integration's cache key parameters.

              • (string) --

            • integrationResponses (dict) --

              Specifies the integration's responses.

              • (string) --

                • (dict) --

                  Represents an integration response. The status code must map to an existing MethodResponse, and parameters and templates can be used to transform the backend response.

                  • statusCode (string) --

                    Specifies the status code that is used to map the integration response to an existing MethodResponse.

                  • selectionPattern (string) --

                    Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the backend. If the backend is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS backends, the HTTP status code is matched.

                  • responseParameters (dict) --

                    Represents response parameters that can be read from the backend response. Response parameters are represented as a key/value map, with a destination as the key and a source as the value. A destination must match an existing response parameter in the MethodResponse. The source can be a header from the backend response, or a static value. Static values are specified using enclosing single quotes, and backend response headers can be read using the pattern integration.response.header.{name}.

                    • (string) --

                      • (string) --

                  • responseTemplates (dict) --

                    Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.

                    • (string) --

                      • (string) --

GetMethod (updated) Link ¶
Changes (response)
{'authorizerId': 'string'}

Describe an existing Method resource.

Request Syntax

client.get_method(
    restApiId='string',
    resourceId='string',
    httpMethod='string'
)
type restApiId:

string

param restApiId:

[REQUIRED]

The RestApi identifier for the Method resource.

type resourceId:

string

param resourceId:

[REQUIRED]

The Resource identifier for the Method resource.

type httpMethod:

string

param httpMethod:

[REQUIRED]

Specifies the put method request's HTTP method type.

rtype:

dict

returns:

Response Syntax

{
    'httpMethod': 'string',
    'authorizationType': 'string',
    'authorizerId': 'string',
    'apiKeyRequired': True|False,
    'requestParameters': {
        'string': True|False
    },
    'requestModels': {
        'string': 'string'
    },
    'methodResponses': {
        'string': {
            'statusCode': 'string',
            'responseParameters': {
                'string': True|False
            },
            'responseModels': {
                'string': 'string'
            }
        }
    },
    'methodIntegration': {
        'type': 'HTTP'|'AWS'|'MOCK',
        'httpMethod': 'string',
        'uri': 'string',
        'credentials': 'string',
        'requestParameters': {
            'string': 'string'
        },
        'requestTemplates': {
            'string': 'string'
        },
        'cacheNamespace': 'string',
        'cacheKeyParameters': [
            'string',
        ],
        'integrationResponses': {
            'string': {
                'statusCode': 'string',
                'selectionPattern': 'string',
                'responseParameters': {
                    'string': 'string'
                },
                'responseTemplates': {
                    'string': 'string'
                }
            }
        }
    }
}

Response Structure

  • (dict) --

    Represents a method.

    • httpMethod (string) --

      The HTTP method.

    • authorizationType (string) --

      The method's authorization type.

    • authorizerId (string) --

      Specifies the identifier of an Authorizer to use on this Method. The authorizationType must be CUSTOM.

    • apiKeyRequired (boolean) --

      Specifies whether the method requires a valid ApiKey.

    • requestParameters (dict) --

      Represents request parameters that can be accepted by Amazon API Gateway. Request parameters are represented as a key/value map, with a source as the key and a Boolean flag as the value. The Boolean flag is used to specify whether the parameter is required. A source must match the pattern method.request.{location}.{name}, where location is either querystring, path, or header. name is a valid, unique parameter name. Sources specified here are available to the integration for mapping to integration request parameters or templates.

      • (string) --

        • (boolean) --

    • requestModels (dict) --

      Specifies the Model resources used for the request's content type. Request models are represented as a key/value map, with a content type as the key and a Model name as the value.

      • (string) --

        • (string) --

    • methodResponses (dict) --

      Represents available responses that can be sent to the caller. Method responses are represented as a key/value map, with an HTTP status code as the key and a MethodResponse as the value. The status codes are available for the Integration responses to map to.

      • (string) --

        • (dict) --

          Represents a method response. Amazon API Gateway sends back the status code to the caller as the HTTP status code. Parameters and models can be used to transform the response from the method's integration.

          • statusCode (string) --

            The method response's status code.

          • responseParameters (dict) --

            Represents response parameters that can be sent back to the caller by Amazon API Gateway. Response parameters are represented as a key/value map, with a destination as the key and a boolean flag as the value, which is used to specify whether the parameter is required. A destination must match the pattern method.response.header.{name}, where name is a valid, unique header name. Destinations specified here are available to the integration for mapping from integration response parameters.

            • (string) --

              • (boolean) --

          • responseModels (dict) --

            Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.

            • (string) --

              • (string) --

    • methodIntegration (dict) --

      The method's integration.

      • type (string) --

        Specifies the integration's type.

      • httpMethod (string) --

        Specifies the integration's HTTP method type.

      • uri (string) --

        Specifies the integration's Uniform Resource Identifier (URI). For HTTP integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification. For AWS integrations, the URI should be of the form arn:aws:apigateway:{region}:{subdomain.service|service}:{path|action}/{service_api}. Region, subdomain and service are used to determine the right endpoint. For AWS services that use the Action= query string parameter, service_api should be a valid action for the desired service. For RESTful AWS service APIs, path is used to indicate that the remaining substring in the URI should be treated as the path to the resource, including the initial /.

      • credentials (string) --

        Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for Amazon API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string arn:aws:iam::\*:user/\*. To use resource-based permissions on supported AWS services, specify null.

      • requestParameters (dict) --

        Represents requests parameters that are sent with the backend request. Request parameters are represented as a key/value map, with a destination as the key and a source as the value. A source must match an existing method request parameter, or a static value. Static values must be enclosed with single quotes, and be pre-encoded based on their destination in the request. The destination must match the pattern integration.request.{location}.{name}, where location is either querystring, path, or header. name must be a valid, unique parameter name.

        • (string) --

          • (string) --

      • requestTemplates (dict) --

        Specifies the integration's request templates.

        • (string) --

          • (string) --

      • cacheNamespace (string) --

        Specifies the integration's cache namespace.

      • cacheKeyParameters (list) --

        Specifies the integration's cache key parameters.

        • (string) --

      • integrationResponses (dict) --

        Specifies the integration's responses.

        • (string) --

          • (dict) --

            Represents an integration response. The status code must map to an existing MethodResponse, and parameters and templates can be used to transform the backend response.

            • statusCode (string) --

              Specifies the status code that is used to map the integration response to an existing MethodResponse.

            • selectionPattern (string) --

              Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the backend. If the backend is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS backends, the HTTP status code is matched.

            • responseParameters (dict) --

              Represents response parameters that can be read from the backend response. Response parameters are represented as a key/value map, with a destination as the key and a source as the value. A destination must match an existing response parameter in the MethodResponse. The source can be a header from the backend response, or a static value. Static values are specified using enclosing single quotes, and backend response headers can be read using the pattern integration.response.header.{name}.

              • (string) --

                • (string) --

            • responseTemplates (dict) --

              Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.

              • (string) --

                • (string) --

GetResource (updated) Link ¶
Changes (response)
{'resourceMethods': {'authorizerId': 'string'}}

Lists information about a resource.

Request Syntax

client.get_resource(
    restApiId='string',
    resourceId='string'
)
type restApiId:

string

param restApiId:

[REQUIRED]

The RestApi identifier for the resource.

type resourceId:

string

param resourceId:

[REQUIRED]

The identifier for the Resource resource.

rtype:

dict

returns:

Response Syntax

{
    'id': 'string',
    'parentId': 'string',
    'pathPart': 'string',
    'path': 'string',
    'resourceMethods': {
        'string': {
            'httpMethod': 'string',
            'authorizationType': 'string',
            'authorizerId': 'string',
            'apiKeyRequired': True|False,
            'requestParameters': {
                'string': True|False
            },
            'requestModels': {
                'string': 'string'
            },
            'methodResponses': {
                'string': {
                    'statusCode': 'string',
                    'responseParameters': {
                        'string': True|False
                    },
                    'responseModels': {
                        'string': 'string'
                    }
                }
            },
            'methodIntegration': {
                'type': 'HTTP'|'AWS'|'MOCK',
                'httpMethod': 'string',
                'uri': 'string',
                'credentials': 'string',
                'requestParameters': {
                    'string': 'string'
                },
                'requestTemplates': {
                    'string': 'string'
                },
                'cacheNamespace': 'string',
                'cacheKeyParameters': [
                    'string',
                ],
                'integrationResponses': {
                    'string': {
                        'statusCode': 'string',
                        'selectionPattern': 'string',
                        'responseParameters': {
                            'string': 'string'
                        },
                        'responseTemplates': {
                            'string': 'string'
                        }
                    }
                }
            }
        }
    }
}

Response Structure

  • (dict) --

    Represents a resource.

    • id (string) --

      The resource's identifier.

    • parentId (string) --

      The parent resource's identifier.

    • pathPart (string) --

      The last path segment for this resource.

    • path (string) --

      The full path for this resource.

    • resourceMethods (dict) --

      Map of methods for this resource, which is included only if requested using the embed option.

      • (string) --

        • (dict) --

          Represents a method.

          • httpMethod (string) --

            The HTTP method.

          • authorizationType (string) --

            The method's authorization type.

          • authorizerId (string) --

            Specifies the identifier of an Authorizer to use on this Method. The authorizationType must be CUSTOM.

          • apiKeyRequired (boolean) --

            Specifies whether the method requires a valid ApiKey.

          • requestParameters (dict) --

            Represents request parameters that can be accepted by Amazon API Gateway. Request parameters are represented as a key/value map, with a source as the key and a Boolean flag as the value. The Boolean flag is used to specify whether the parameter is required. A source must match the pattern method.request.{location}.{name}, where location is either querystring, path, or header. name is a valid, unique parameter name. Sources specified here are available to the integration for mapping to integration request parameters or templates.

            • (string) --

              • (boolean) --

          • requestModels (dict) --

            Specifies the Model resources used for the request's content type. Request models are represented as a key/value map, with a content type as the key and a Model name as the value.

            • (string) --

              • (string) --

          • methodResponses (dict) --

            Represents available responses that can be sent to the caller. Method responses are represented as a key/value map, with an HTTP status code as the key and a MethodResponse as the value. The status codes are available for the Integration responses to map to.

            • (string) --

              • (dict) --

                Represents a method response. Amazon API Gateway sends back the status code to the caller as the HTTP status code. Parameters and models can be used to transform the response from the method's integration.

                • statusCode (string) --

                  The method response's status code.

                • responseParameters (dict) --

                  Represents response parameters that can be sent back to the caller by Amazon API Gateway. Response parameters are represented as a key/value map, with a destination as the key and a boolean flag as the value, which is used to specify whether the parameter is required. A destination must match the pattern method.response.header.{name}, where name is a valid, unique header name. Destinations specified here are available to the integration for mapping from integration response parameters.

                  • (string) --

                    • (boolean) --

                • responseModels (dict) --

                  Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.

                  • (string) --

                    • (string) --

          • methodIntegration (dict) --

            The method's integration.

            • type (string) --

              Specifies the integration's type.

            • httpMethod (string) --

              Specifies the integration's HTTP method type.

            • uri (string) --

              Specifies the integration's Uniform Resource Identifier (URI). For HTTP integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification. For AWS integrations, the URI should be of the form arn:aws:apigateway:{region}:{subdomain.service|service}:{path|action}/{service_api}. Region, subdomain and service are used to determine the right endpoint. For AWS services that use the Action= query string parameter, service_api should be a valid action for the desired service. For RESTful AWS service APIs, path is used to indicate that the remaining substring in the URI should be treated as the path to the resource, including the initial /.

            • credentials (string) --

              Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for Amazon API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string arn:aws:iam::\*:user/\*. To use resource-based permissions on supported AWS services, specify null.

            • requestParameters (dict) --

              Represents requests parameters that are sent with the backend request. Request parameters are represented as a key/value map, with a destination as the key and a source as the value. A source must match an existing method request parameter, or a static value. Static values must be enclosed with single quotes, and be pre-encoded based on their destination in the request. The destination must match the pattern integration.request.{location}.{name}, where location is either querystring, path, or header. name must be a valid, unique parameter name.

              • (string) --

                • (string) --

            • requestTemplates (dict) --

              Specifies the integration's request templates.

              • (string) --

                • (string) --

            • cacheNamespace (string) --

              Specifies the integration's cache namespace.

            • cacheKeyParameters (list) --

              Specifies the integration's cache key parameters.

              • (string) --

            • integrationResponses (dict) --

              Specifies the integration's responses.

              • (string) --

                • (dict) --

                  Represents an integration response. The status code must map to an existing MethodResponse, and parameters and templates can be used to transform the backend response.

                  • statusCode (string) --

                    Specifies the status code that is used to map the integration response to an existing MethodResponse.

                  • selectionPattern (string) --

                    Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the backend. If the backend is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS backends, the HTTP status code is matched.

                  • responseParameters (dict) --

                    Represents response parameters that can be read from the backend response. Response parameters are represented as a key/value map, with a destination as the key and a source as the value. A destination must match an existing response parameter in the MethodResponse. The source can be a header from the backend response, or a static value. Static values are specified using enclosing single quotes, and backend response headers can be read using the pattern integration.response.header.{name}.

                    • (string) --

                      • (string) --

                  • responseTemplates (dict) --

                    Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.

                    • (string) --

                      • (string) --

GetResources (updated) Link ¶
Changes (response)
{'items': {'resourceMethods': {'authorizerId': 'string'}}}

Lists information about a collection of Resource resources.

Request Syntax

client.get_resources(
    restApiId='string',
    position='string',
    limit=123
)
type restApiId:

string

param restApiId:

[REQUIRED]

The RestApi identifier for the Resource.

type position:

string

param position:

The position of the next set of results in the current Resources resource to get information about.

type limit:

integer

param limit:

The maximum number of Resource resources in the collection to get information about. The default limit is 25. It should be an integer between 1 - 500.

rtype:

dict

returns:

Response Syntax

{
    'position': 'string',
    'items': [
        {
            'id': 'string',
            'parentId': 'string',
            'pathPart': 'string',
            'path': 'string',
            'resourceMethods': {
                'string': {
                    'httpMethod': 'string',
                    'authorizationType': 'string',
                    'authorizerId': 'string',
                    'apiKeyRequired': True|False,
                    'requestParameters': {
                        'string': True|False
                    },
                    'requestModels': {
                        'string': 'string'
                    },
                    'methodResponses': {
                        'string': {
                            'statusCode': 'string',
                            'responseParameters': {
                                'string': True|False
                            },
                            'responseModels': {
                                'string': 'string'
                            }
                        }
                    },
                    'methodIntegration': {
                        'type': 'HTTP'|'AWS'|'MOCK',
                        'httpMethod': 'string',
                        'uri': 'string',
                        'credentials': 'string',
                        'requestParameters': {
                            'string': 'string'
                        },
                        'requestTemplates': {
                            'string': 'string'
                        },
                        'cacheNamespace': 'string',
                        'cacheKeyParameters': [
                            'string',
                        ],
                        'integrationResponses': {
                            'string': {
                                'statusCode': 'string',
                                'selectionPattern': 'string',
                                'responseParameters': {
                                    'string': 'string'
                                },
                                'responseTemplates': {
                                    'string': 'string'
                                }
                            }
                        }
                    }
                }
            }
        },
    ]
}

Response Structure

  • (dict) --

    Represents a collection of Resource resources.

    • position (string) --

    • items (list) --

      Gets the current Resource resource in the collection.

      • (dict) --

        Represents a resource.

        • id (string) --

          The resource's identifier.

        • parentId (string) --

          The parent resource's identifier.

        • pathPart (string) --

          The last path segment for this resource.

        • path (string) --

          The full path for this resource.

        • resourceMethods (dict) --

          Map of methods for this resource, which is included only if requested using the embed option.

          • (string) --

            • (dict) --

              Represents a method.

              • httpMethod (string) --

                The HTTP method.

              • authorizationType (string) --

                The method's authorization type.

              • authorizerId (string) --

                Specifies the identifier of an Authorizer to use on this Method. The authorizationType must be CUSTOM.

              • apiKeyRequired (boolean) --

                Specifies whether the method requires a valid ApiKey.

              • requestParameters (dict) --

                Represents request parameters that can be accepted by Amazon API Gateway. Request parameters are represented as a key/value map, with a source as the key and a Boolean flag as the value. The Boolean flag is used to specify whether the parameter is required. A source must match the pattern method.request.{location}.{name}, where location is either querystring, path, or header. name is a valid, unique parameter name. Sources specified here are available to the integration for mapping to integration request parameters or templates.

                • (string) --

                  • (boolean) --

              • requestModels (dict) --

                Specifies the Model resources used for the request's content type. Request models are represented as a key/value map, with a content type as the key and a Model name as the value.

                • (string) --

                  • (string) --

              • methodResponses (dict) --

                Represents available responses that can be sent to the caller. Method responses are represented as a key/value map, with an HTTP status code as the key and a MethodResponse as the value. The status codes are available for the Integration responses to map to.

                • (string) --

                  • (dict) --

                    Represents a method response. Amazon API Gateway sends back the status code to the caller as the HTTP status code. Parameters and models can be used to transform the response from the method's integration.

                    • statusCode (string) --

                      The method response's status code.

                    • responseParameters (dict) --

                      Represents response parameters that can be sent back to the caller by Amazon API Gateway. Response parameters are represented as a key/value map, with a destination as the key and a boolean flag as the value, which is used to specify whether the parameter is required. A destination must match the pattern method.response.header.{name}, where name is a valid, unique header name. Destinations specified here are available to the integration for mapping from integration response parameters.

                      • (string) --

                        • (boolean) --

                    • responseModels (dict) --

                      Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.

                      • (string) --

                        • (string) --

              • methodIntegration (dict) --

                The method's integration.

                • type (string) --

                  Specifies the integration's type.

                • httpMethod (string) --

                  Specifies the integration's HTTP method type.

                • uri (string) --

                  Specifies the integration's Uniform Resource Identifier (URI). For HTTP integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification. For AWS integrations, the URI should be of the form arn:aws:apigateway:{region}:{subdomain.service|service}:{path|action}/{service_api}. Region, subdomain and service are used to determine the right endpoint. For AWS services that use the Action= query string parameter, service_api should be a valid action for the desired service. For RESTful AWS service APIs, path is used to indicate that the remaining substring in the URI should be treated as the path to the resource, including the initial /.

                • credentials (string) --

                  Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for Amazon API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string arn:aws:iam::\*:user/\*. To use resource-based permissions on supported AWS services, specify null.

                • requestParameters (dict) --

                  Represents requests parameters that are sent with the backend request. Request parameters are represented as a key/value map, with a destination as the key and a source as the value. A source must match an existing method request parameter, or a static value. Static values must be enclosed with single quotes, and be pre-encoded based on their destination in the request. The destination must match the pattern integration.request.{location}.{name}, where location is either querystring, path, or header. name must be a valid, unique parameter name.

                  • (string) --

                    • (string) --

                • requestTemplates (dict) --

                  Specifies the integration's request templates.

                  • (string) --

                    • (string) --

                • cacheNamespace (string) --

                  Specifies the integration's cache namespace.

                • cacheKeyParameters (list) --

                  Specifies the integration's cache key parameters.

                  • (string) --

                • integrationResponses (dict) --

                  Specifies the integration's responses.

                  • (string) --

                    • (dict) --

                      Represents an integration response. The status code must map to an existing MethodResponse, and parameters and templates can be used to transform the backend response.

                      • statusCode (string) --

                        Specifies the status code that is used to map the integration response to an existing MethodResponse.

                      • selectionPattern (string) --

                        Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the backend. If the backend is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS backends, the HTTP status code is matched.

                      • responseParameters (dict) --

                        Represents response parameters that can be read from the backend response. Response parameters are represented as a key/value map, with a destination as the key and a source as the value. A destination must match an existing response parameter in the MethodResponse. The source can be a header from the backend response, or a static value. Static values are specified using enclosing single quotes, and backend response headers can be read using the pattern integration.response.header.{name}.

                        • (string) --

                          • (string) --

                      • responseTemplates (dict) --

                        Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.

                        • (string) --

                          • (string) --

PutMethod (updated) Link ¶
Changes (both)
{'authorizerId': 'string'}

Add a method to an existing Resource resource.

Request Syntax

client.put_method(
    restApiId='string',
    resourceId='string',
    httpMethod='string',
    authorizationType='string',
    authorizerId='string',
    apiKeyRequired=True|False,
    requestParameters={
        'string': True|False
    },
    requestModels={
        'string': 'string'
    }
)
type restApiId:

string

param restApiId:

[REQUIRED]

The RestApi identifier for the new Method resource.

type resourceId:

string

param resourceId:

[REQUIRED]

The Resource identifier for the new Method resource.

type httpMethod:

string

param httpMethod:

[REQUIRED]

Specifies the put method request's HTTP method type.

type authorizationType:

string

param authorizationType:

[REQUIRED]

Specifies the type of authorization used for the method.

type authorizerId:

string

param authorizerId:

Specifies the identifier of an Authorizer to use on this Method, if the type is CUSTOM.

type apiKeyRequired:

boolean

param apiKeyRequired:

Specifies whether the method required a valid ApiKey.

type requestParameters:

dict

param requestParameters:

Represents requests parameters that are sent with the backend request. Request parameters are represented as a key/value map, with a destination as the key and a source as the value. A source must match an existing method request parameter, or a static value. Static values must be enclosed with single quotes, and be pre-encoded based on their destination in the request. The destination must match the pattern integration.request.{location}.{name}, where location is either querystring, path, or header. name must be a valid, unique parameter name.

  • (string) --

    • (boolean) --

type requestModels:

dict

param requestModels:

Specifies the Model resources used for the request's content type. Request models are represented as a key/value map, with a content type as the key and a Model name as the value.

  • (string) --

    • (string) --

rtype:

dict

returns:

Response Syntax

{
    'httpMethod': 'string',
    'authorizationType': 'string',
    'authorizerId': 'string',
    'apiKeyRequired': True|False,
    'requestParameters': {
        'string': True|False
    },
    'requestModels': {
        'string': 'string'
    },
    'methodResponses': {
        'string': {
            'statusCode': 'string',
            'responseParameters': {
                'string': True|False
            },
            'responseModels': {
                'string': 'string'
            }
        }
    },
    'methodIntegration': {
        'type': 'HTTP'|'AWS'|'MOCK',
        'httpMethod': 'string',
        'uri': 'string',
        'credentials': 'string',
        'requestParameters': {
            'string': 'string'
        },
        'requestTemplates': {
            'string': 'string'
        },
        'cacheNamespace': 'string',
        'cacheKeyParameters': [
            'string',
        ],
        'integrationResponses': {
            'string': {
                'statusCode': 'string',
                'selectionPattern': 'string',
                'responseParameters': {
                    'string': 'string'
                },
                'responseTemplates': {
                    'string': 'string'
                }
            }
        }
    }
}

Response Structure

  • (dict) --

    Represents a method.

    • httpMethod (string) --

      The HTTP method.

    • authorizationType (string) --

      The method's authorization type.

    • authorizerId (string) --

      Specifies the identifier of an Authorizer to use on this Method. The authorizationType must be CUSTOM.

    • apiKeyRequired (boolean) --

      Specifies whether the method requires a valid ApiKey.

    • requestParameters (dict) --

      Represents request parameters that can be accepted by Amazon API Gateway. Request parameters are represented as a key/value map, with a source as the key and a Boolean flag as the value. The Boolean flag is used to specify whether the parameter is required. A source must match the pattern method.request.{location}.{name}, where location is either querystring, path, or header. name is a valid, unique parameter name. Sources specified here are available to the integration for mapping to integration request parameters or templates.

      • (string) --

        • (boolean) --

    • requestModels (dict) --

      Specifies the Model resources used for the request's content type. Request models are represented as a key/value map, with a content type as the key and a Model name as the value.

      • (string) --

        • (string) --

    • methodResponses (dict) --

      Represents available responses that can be sent to the caller. Method responses are represented as a key/value map, with an HTTP status code as the key and a MethodResponse as the value. The status codes are available for the Integration responses to map to.

      • (string) --

        • (dict) --

          Represents a method response. Amazon API Gateway sends back the status code to the caller as the HTTP status code. Parameters and models can be used to transform the response from the method's integration.

          • statusCode (string) --

            The method response's status code.

          • responseParameters (dict) --

            Represents response parameters that can be sent back to the caller by Amazon API Gateway. Response parameters are represented as a key/value map, with a destination as the key and a boolean flag as the value, which is used to specify whether the parameter is required. A destination must match the pattern method.response.header.{name}, where name is a valid, unique header name. Destinations specified here are available to the integration for mapping from integration response parameters.

            • (string) --

              • (boolean) --

          • responseModels (dict) --

            Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.

            • (string) --

              • (string) --

    • methodIntegration (dict) --

      The method's integration.

      • type (string) --

        Specifies the integration's type.

      • httpMethod (string) --

        Specifies the integration's HTTP method type.

      • uri (string) --

        Specifies the integration's Uniform Resource Identifier (URI). For HTTP integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification. For AWS integrations, the URI should be of the form arn:aws:apigateway:{region}:{subdomain.service|service}:{path|action}/{service_api}. Region, subdomain and service are used to determine the right endpoint. For AWS services that use the Action= query string parameter, service_api should be a valid action for the desired service. For RESTful AWS service APIs, path is used to indicate that the remaining substring in the URI should be treated as the path to the resource, including the initial /.

      • credentials (string) --

        Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for Amazon API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string arn:aws:iam::\*:user/\*. To use resource-based permissions on supported AWS services, specify null.

      • requestParameters (dict) --

        Represents requests parameters that are sent with the backend request. Request parameters are represented as a key/value map, with a destination as the key and a source as the value. A source must match an existing method request parameter, or a static value. Static values must be enclosed with single quotes, and be pre-encoded based on their destination in the request. The destination must match the pattern integration.request.{location}.{name}, where location is either querystring, path, or header. name must be a valid, unique parameter name.

        • (string) --

          • (string) --

      • requestTemplates (dict) --

        Specifies the integration's request templates.

        • (string) --

          • (string) --

      • cacheNamespace (string) --

        Specifies the integration's cache namespace.

      • cacheKeyParameters (list) --

        Specifies the integration's cache key parameters.

        • (string) --

      • integrationResponses (dict) --

        Specifies the integration's responses.

        • (string) --

          • (dict) --

            Represents an integration response. The status code must map to an existing MethodResponse, and parameters and templates can be used to transform the backend response.

            • statusCode (string) --

              Specifies the status code that is used to map the integration response to an existing MethodResponse.

            • selectionPattern (string) --

              Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the backend. If the backend is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS backends, the HTTP status code is matched.

            • responseParameters (dict) --

              Represents response parameters that can be read from the backend response. Response parameters are represented as a key/value map, with a destination as the key and a source as the value. A destination must match an existing response parameter in the MethodResponse. The source can be a header from the backend response, or a static value. Static values are specified using enclosing single quotes, and backend response headers can be read using the pattern integration.response.header.{name}.

              • (string) --

                • (string) --

            • responseTemplates (dict) --

              Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.

              • (string) --

                • (string) --

UpdateMethod (updated) Link ¶
Changes (response)
{'authorizerId': 'string'}

Updates an existing Method resource.

Request Syntax

client.update_method(
    restApiId='string',
    resourceId='string',
    httpMethod='string',
    patchOperations=[
        {
            'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
            'path': 'string',
            'value': 'string',
            'from': 'string'
        },
    ]
)
type restApiId:

string

param restApiId:

[REQUIRED]

The RestApi identifier for the Method resource.

type resourceId:

string

param resourceId:

[REQUIRED]

The Resource identifier for the Method resource.

type httpMethod:

string

param httpMethod:

[REQUIRED]

The HTTP verb that identifies the Method resource.

type patchOperations:

list

param patchOperations:

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.

rtype:

dict

returns:

Response Syntax

{
    'httpMethod': 'string',
    'authorizationType': 'string',
    'authorizerId': 'string',
    'apiKeyRequired': True|False,
    'requestParameters': {
        'string': True|False
    },
    'requestModels': {
        'string': 'string'
    },
    'methodResponses': {
        'string': {
            'statusCode': 'string',
            'responseParameters': {
                'string': True|False
            },
            'responseModels': {
                'string': 'string'
            }
        }
    },
    'methodIntegration': {
        'type': 'HTTP'|'AWS'|'MOCK',
        'httpMethod': 'string',
        'uri': 'string',
        'credentials': 'string',
        'requestParameters': {
            'string': 'string'
        },
        'requestTemplates': {
            'string': 'string'
        },
        'cacheNamespace': 'string',
        'cacheKeyParameters': [
            'string',
        ],
        'integrationResponses': {
            'string': {
                'statusCode': 'string',
                'selectionPattern': 'string',
                'responseParameters': {
                    'string': 'string'
                },
                'responseTemplates': {
                    'string': 'string'
                }
            }
        }
    }
}

Response Structure

  • (dict) --

    Represents a method.

    • httpMethod (string) --

      The HTTP method.

    • authorizationType (string) --

      The method's authorization type.

    • authorizerId (string) --

      Specifies the identifier of an Authorizer to use on this Method. The authorizationType must be CUSTOM.

    • apiKeyRequired (boolean) --

      Specifies whether the method requires a valid ApiKey.

    • requestParameters (dict) --

      Represents request parameters that can be accepted by Amazon API Gateway. Request parameters are represented as a key/value map, with a source as the key and a Boolean flag as the value. The Boolean flag is used to specify whether the parameter is required. A source must match the pattern method.request.{location}.{name}, where location is either querystring, path, or header. name is a valid, unique parameter name. Sources specified here are available to the integration for mapping to integration request parameters or templates.

      • (string) --

        • (boolean) --

    • requestModels (dict) --

      Specifies the Model resources used for the request's content type. Request models are represented as a key/value map, with a content type as the key and a Model name as the value.

      • (string) --

        • (string) --

    • methodResponses (dict) --

      Represents available responses that can be sent to the caller. Method responses are represented as a key/value map, with an HTTP status code as the key and a MethodResponse as the value. The status codes are available for the Integration responses to map to.

      • (string) --

        • (dict) --

          Represents a method response. Amazon API Gateway sends back the status code to the caller as the HTTP status code. Parameters and models can be used to transform the response from the method's integration.

          • statusCode (string) --

            The method response's status code.

          • responseParameters (dict) --

            Represents response parameters that can be sent back to the caller by Amazon API Gateway. Response parameters are represented as a key/value map, with a destination as the key and a boolean flag as the value, which is used to specify whether the parameter is required. A destination must match the pattern method.response.header.{name}, where name is a valid, unique header name. Destinations specified here are available to the integration for mapping from integration response parameters.

            • (string) --

              • (boolean) --

          • responseModels (dict) --

            Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.

            • (string) --

              • (string) --

    • methodIntegration (dict) --

      The method's integration.

      • type (string) --

        Specifies the integration's type.

      • httpMethod (string) --

        Specifies the integration's HTTP method type.

      • uri (string) --

        Specifies the integration's Uniform Resource Identifier (URI). For HTTP integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification. For AWS integrations, the URI should be of the form arn:aws:apigateway:{region}:{subdomain.service|service}:{path|action}/{service_api}. Region, subdomain and service are used to determine the right endpoint. For AWS services that use the Action= query string parameter, service_api should be a valid action for the desired service. For RESTful AWS service APIs, path is used to indicate that the remaining substring in the URI should be treated as the path to the resource, including the initial /.

      • credentials (string) --

        Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for Amazon API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string arn:aws:iam::\*:user/\*. To use resource-based permissions on supported AWS services, specify null.

      • requestParameters (dict) --

        Represents requests parameters that are sent with the backend request. Request parameters are represented as a key/value map, with a destination as the key and a source as the value. A source must match an existing method request parameter, or a static value. Static values must be enclosed with single quotes, and be pre-encoded based on their destination in the request. The destination must match the pattern integration.request.{location}.{name}, where location is either querystring, path, or header. name must be a valid, unique parameter name.

        • (string) --

          • (string) --

      • requestTemplates (dict) --

        Specifies the integration's request templates.

        • (string) --

          • (string) --

      • cacheNamespace (string) --

        Specifies the integration's cache namespace.

      • cacheKeyParameters (list) --

        Specifies the integration's cache key parameters.

        • (string) --

      • integrationResponses (dict) --

        Specifies the integration's responses.

        • (string) --

          • (dict) --

            Represents an integration response. The status code must map to an existing MethodResponse, and parameters and templates can be used to transform the backend response.

            • statusCode (string) --

              Specifies the status code that is used to map the integration response to an existing MethodResponse.

            • selectionPattern (string) --

              Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the backend. If the backend is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS backends, the HTTP status code is matched.

            • responseParameters (dict) --

              Represents response parameters that can be read from the backend response. Response parameters are represented as a key/value map, with a destination as the key and a source as the value. A destination must match an existing response parameter in the MethodResponse. The source can be a header from the backend response, or a static value. Static values are specified using enclosing single quotes, and backend response headers can be read using the pattern integration.response.header.{name}.

              • (string) --

                • (string) --

            • responseTemplates (dict) --

              Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.

              • (string) --

                • (string) --

UpdateResource (updated) Link ¶
Changes (response)
{'resourceMethods': {'authorizerId': 'string'}}

Changes information about a Resource resource.

Request Syntax

client.update_resource(
    restApiId='string',
    resourceId='string',
    patchOperations=[
        {
            'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
            'path': 'string',
            'value': 'string',
            'from': 'string'
        },
    ]
)
type restApiId:

string

param restApiId:

[REQUIRED]

The RestApi identifier for the Resource resource.

type resourceId:

string

param resourceId:

[REQUIRED]

The identifier of the Resource resource.

type patchOperations:

list

param patchOperations:

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.

rtype:

dict

returns:

Response Syntax

{
    'id': 'string',
    'parentId': 'string',
    'pathPart': 'string',
    'path': 'string',
    'resourceMethods': {
        'string': {
            'httpMethod': 'string',
            'authorizationType': 'string',
            'authorizerId': 'string',
            'apiKeyRequired': True|False,
            'requestParameters': {
                'string': True|False
            },
            'requestModels': {
                'string': 'string'
            },
            'methodResponses': {
                'string': {
                    'statusCode': 'string',
                    'responseParameters': {
                        'string': True|False
                    },
                    'responseModels': {
                        'string': 'string'
                    }
                }
            },
            'methodIntegration': {
                'type': 'HTTP'|'AWS'|'MOCK',
                'httpMethod': 'string',
                'uri': 'string',
                'credentials': 'string',
                'requestParameters': {
                    'string': 'string'
                },
                'requestTemplates': {
                    'string': 'string'
                },
                'cacheNamespace': 'string',
                'cacheKeyParameters': [
                    'string',
                ],
                'integrationResponses': {
                    'string': {
                        'statusCode': 'string',
                        'selectionPattern': 'string',
                        'responseParameters': {
                            'string': 'string'
                        },
                        'responseTemplates': {
                            'string': 'string'
                        }
                    }
                }
            }
        }
    }
}

Response Structure

  • (dict) --

    Represents a resource.

    • id (string) --

      The resource's identifier.

    • parentId (string) --

      The parent resource's identifier.

    • pathPart (string) --

      The last path segment for this resource.

    • path (string) --

      The full path for this resource.

    • resourceMethods (dict) --

      Map of methods for this resource, which is included only if requested using the embed option.

      • (string) --

        • (dict) --

          Represents a method.

          • httpMethod (string) --

            The HTTP method.

          • authorizationType (string) --

            The method's authorization type.

          • authorizerId (string) --

            Specifies the identifier of an Authorizer to use on this Method. The authorizationType must be CUSTOM.

          • apiKeyRequired (boolean) --

            Specifies whether the method requires a valid ApiKey.

          • requestParameters (dict) --

            Represents request parameters that can be accepted by Amazon API Gateway. Request parameters are represented as a key/value map, with a source as the key and a Boolean flag as the value. The Boolean flag is used to specify whether the parameter is required. A source must match the pattern method.request.{location}.{name}, where location is either querystring, path, or header. name is a valid, unique parameter name. Sources specified here are available to the integration for mapping to integration request parameters or templates.

            • (string) --

              • (boolean) --

          • requestModels (dict) --

            Specifies the Model resources used for the request's content type. Request models are represented as a key/value map, with a content type as the key and a Model name as the value.

            • (string) --

              • (string) --

          • methodResponses (dict) --

            Represents available responses that can be sent to the caller. Method responses are represented as a key/value map, with an HTTP status code as the key and a MethodResponse as the value. The status codes are available for the Integration responses to map to.

            • (string) --

              • (dict) --

                Represents a method response. Amazon API Gateway sends back the status code to the caller as the HTTP status code. Parameters and models can be used to transform the response from the method's integration.

                • statusCode (string) --

                  The method response's status code.

                • responseParameters (dict) --

                  Represents response parameters that can be sent back to the caller by Amazon API Gateway. Response parameters are represented as a key/value map, with a destination as the key and a boolean flag as the value, which is used to specify whether the parameter is required. A destination must match the pattern method.response.header.{name}, where name is a valid, unique header name. Destinations specified here are available to the integration for mapping from integration response parameters.

                  • (string) --

                    • (boolean) --

                • responseModels (dict) --

                  Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.

                  • (string) --

                    • (string) --

          • methodIntegration (dict) --

            The method's integration.

            • type (string) --

              Specifies the integration's type.

            • httpMethod (string) --

              Specifies the integration's HTTP method type.

            • uri (string) --

              Specifies the integration's Uniform Resource Identifier (URI). For HTTP integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification. For AWS integrations, the URI should be of the form arn:aws:apigateway:{region}:{subdomain.service|service}:{path|action}/{service_api}. Region, subdomain and service are used to determine the right endpoint. For AWS services that use the Action= query string parameter, service_api should be a valid action for the desired service. For RESTful AWS service APIs, path is used to indicate that the remaining substring in the URI should be treated as the path to the resource, including the initial /.

            • credentials (string) --

              Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for Amazon API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string arn:aws:iam::\*:user/\*. To use resource-based permissions on supported AWS services, specify null.

            • requestParameters (dict) --

              Represents requests parameters that are sent with the backend request. Request parameters are represented as a key/value map, with a destination as the key and a source as the value. A source must match an existing method request parameter, or a static value. Static values must be enclosed with single quotes, and be pre-encoded based on their destination in the request. The destination must match the pattern integration.request.{location}.{name}, where location is either querystring, path, or header. name must be a valid, unique parameter name.

              • (string) --

                • (string) --

            • requestTemplates (dict) --

              Specifies the integration's request templates.

              • (string) --

                • (string) --

            • cacheNamespace (string) --

              Specifies the integration's cache namespace.

            • cacheKeyParameters (list) --

              Specifies the integration's cache key parameters.

              • (string) --

            • integrationResponses (dict) --

              Specifies the integration's responses.

              • (string) --

                • (dict) --

                  Represents an integration response. The status code must map to an existing MethodResponse, and parameters and templates can be used to transform the backend response.

                  • statusCode (string) --

                    Specifies the status code that is used to map the integration response to an existing MethodResponse.

                  • selectionPattern (string) --

                    Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the backend. If the backend is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS backends, the HTTP status code is matched.

                  • responseParameters (dict) --

                    Represents response parameters that can be read from the backend response. Response parameters are represented as a key/value map, with a destination as the key and a source as the value. A destination must match an existing response parameter in the MethodResponse. The source can be a header from the backend response, or a static value. Static values are specified using enclosing single quotes, and backend response headers can be read using the pattern integration.response.header.{name}.

                    • (string) --

                      • (string) --

                  • responseTemplates (dict) --

                    Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.

                    • (string) --

                      • (string) --