API Gateway GCP - proxy to not-gcp endpoint

189 Views Asked by At

I couldnt find example in documentation. I work with API Gateway from GCP to use it for Cloud Functions/Cloud Run etc, all are part of GCP infra.

But now I want to have external URL

I know they are respecting x-google-backend so I tried to 'cheat':

swagger: "2.0"
info:
  title: migration-api
  description: API for migration sql
  version: 1.2.3
schemes:
  - https
consumes:
  - application/json
produces:
  - application/json
basePath:
  /api/track
paths:
  /track:
    post:
      operationId: track
      x-google-backend:
        address: https://notgoogle.com/
        path_translation: CONSTANT_ADDRESS
      responses:
        200:
          description: Success

But it does not work. I tried few other ways but without success Current error

<Error>
<Code>
InvalidArgument
</Code>
<Message>
Invalid argument.
</Message>
<Details>
POST object expects Content-Type multipart/form-data
</Details>
</Error>

Ofc request is made with content type of json. So I suspect that maybe x-google-backend is doing something here under it. But I don't know if there's other way to tell endpoint to call some another service outside of GCP

0

There are 0 best solutions below