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. Step-by-step instructions
  2. Creating API gateways

Creating API gateways

    Management console
    CLI
    1. In the management console, select the folder where you want to create an API gateway.

    2. In the list of services, select API Gateway.

    3. Click Create API gateway.

    4. In the Name field, enter numbers.

    5. (optional) In the Description field, enter a description.

    6. In the Specification section, add a specification:

      openapi: "3.0.0"
      info:
        version: 1.0.0
        title: Test API
      paths:
        /hello:
          get:
            summary: Say hello
            operationId: hello
            parameters:
              - name: user
                in: query
                description: User name to appear in greetings
                required: false
                schema:
                  type: string
                  default: 'world'
            responses:
              '200':
                description: Greeting
                content:
                  'text/plain':
                     schema:
                       type: "string"
            x-yc-apigateway-integration:
              type: dummy
              http_code: 200
              http_headers:
                'Content-Type': "text/plain"
              content:
                'text/plain': "Hello, {user}!\n"
      
    7. Click Create.

    To create an API gateway:

    1. Save the following specification to a file named hello-world.yaml:

      openapi: "3.0.0"
      info:
        version: 1.0.0
        title: Test API
      paths:
        /hello:
          get:
            summary: Say hello
            operationId: hello
            parameters:
              - name: user
                in: query
                description: User name to appear in greetings
                required: false
                schema:
                  type: string
                  default: 'world'
            responses:
              '200':
                description: Greeting
                content:
                  'text/plain':
                     schema:
                       type: "string"
            x-yc-apigateway-integration:
              type: dummy
              http_code: 200
              http_headers:
                'Content-Type': "text/plain"
              content:
                'text/plain': "Hello, {user}!\n" 
      
    2. Run the command with the following parameters:

      • name: API gateway name.
      • spec: Specification file.
      • description: API gateway description.
      yc serverless api-gateway create --name hello-world --spec=hello-world.yaml --description "hello world"
      
      done (29s)
      id: d5dug9gkmu187iojcrtr
      folder_id: b1g55tflru0ek7omtfu0
      created_at: "2020-06-17T09:20:22.929Z"
      name: hello-world
      description: hello world
      status: ACTIVE
      domain: d5dug9gkmu187iojcpvp.apigw.yandexcloud.net
      log_group_id: ckghq1hm19q7ek5sjnh5
      
    Language / Region
    Careers
    Privacy policy
    Terms of use
    Brandbook
    © 2021 Yandex.Cloud LLC