GCP: configure cloud ESPv2 endpoint with x-google-backend Parameters

728 Views Asked by At

I am using gcp cloud endpoint with a cloud run backend Service. My Problem is that the backend is configured with a default timeout of 15 seconds. Thats why I would like to set openAPI "x-google-backend" deadline parameter to increase timeout for the endpoint: (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions)

Currently I am using the following grpc service configuration for my endpoint.

https://cloud.google.com/endpoints/docs/grpc/grpc-service-config

openAPI extension is not supported for this kind of configuration. Now I am looking for a way to combine the grpc configuration with openAPI. I have read that it is possible to publish several configuration files for one endpoint.

1

There are 1 best solutions below

0
soa On

OK, this kind of configuration works well.

type: google.api.Service
config_version: 3
name: ${cloud_run_hostname_endpoint}
title: ${endpoint_title}
apis:
  - name: my_endpoint_name
usage:
  rules:
  # No APIs can be called without an API Key
  - selector: "*"
    allow_unregistered_calls: false
backend:
  rules:
    - selector: "*"
      address: grpcs://${cloud_run_hostname_backend}
      deadline: 300.0

deadline parameter is accepted.