Yandex.Cloud
  • Services
  • Why Yandex.Cloud
  • Solutions
  • Pricing
  • Documentation
  • Contact us
Get started
Yandex API Gateway
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Creating API gateways
    • Updating API gateways and their specifications
    • Connecting a domain
    • Deleting API gateways
    • Viewing monitoring charts
    • Viewing the execution log
  • Concepts
    • Relationship between service resources
    • Specification extensions
      • Overview
      • Static response
      • Invoking a function
      • Access via HTTP
      • Integration with Object Storage
    • Quotas and limits
  • Access management
  • Pricing policy
  • API reference
    • Authentication in the API
    • gRPC
      • Overview
      • ApiGatewayService
      • OperationService
    • REST
      • Overview
      • ApiGateway
        • Overview
        • create
        • delete
        • get
        • getOpenapiSpec
        • list
        • listAccessBindings
        • listOperations
        • setAccessBindings
        • update
        • updateAccessBindings
  • Questions and answers
  1. Concepts
  2. Specification extensions
  3. Invoking a function

x-yc-apigateway-integration:cloud_functions extension

  • Supported parameters
  • Extension specification

The x-yc-apigateway-integration:cloud-functions extension invokes the specified function. As its input, the function accepts the HTTP request data and values of the parameters listed in the specification. As the output, it returns the result of function execution to the client. The request data is transmitted in the same format as that of the current version of HTTP-integration when invoking the function with the integration=raw request string parameter that is most compatible with the AWS API Gateway format. The values of parameters listed in the specification are passed to the params field of the data parameter.

Supported parameters

The table below lists the parameters specific to API Gateway API gateways. Read more about other parameters in the OpenAPI Specification 3.0.

Parameter Type Description
function_id string Function ID.
tag string Optional parameter. Version tag. The default value is $latest.
Parameters are substituted in tag.
service_account_id string ID of the service account used for authorization when accessing the function. If the parameter is omitted, the value of the top-level service_account_id parameter is used. If there is no top-level parameter, the function is invoked without authorization.

Extension specification

Sample specification:

/example/{ID}:
    get:
      summary: Get ID
      operationId: getID
      tags:
        - example
      parameters:
        - name: ID
          in: path
          description: Return ID
          required: true
          schema:
            type: string
      x-yc-apigateway-integration:
        type: cloud_functions
        function_id: b095c95icnvbuf4v755l
        tag: "$latest"
        service_account_id: ajehfe41hhliq4n93q1g

Function example:

exports.handler= async function (data, context) {
    return {
        'statusCode': 200,
        'isBase64Encoded': false,
        'body': JSON.stringify({
            'petId': data.params.ID
        }),
    }
};
In this article:
  • Supported parameters
  • Extension specification
Language / Region
Careers
Privacy policy
Terms of use
Brandbook
© 2021 Yandex.Cloud LLC