Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google cloud platform 使用Google ESP代理多个服务_Google Cloud Platform_Google Cloud Endpoints - Fatal编程技术网

Google cloud platform 使用Google ESP代理多个服务

Google cloud platform 使用Google ESP代理多个服务,google-cloud-platform,google-cloud-endpoints,Google Cloud Platform,Google Cloud Endpoints,我一直在回顾Google Cloud Extensible Service Proxy,它承诺是一个无服务器的NGINX实例,但是我不确定如何通过它代理app engine中运行的多个服务,并将其用作网关。它似乎需要一个位于swagger JSON配置中的主机和一个指向端点服务名称的环境变量,而我不知道在这种约束下它如何代理多个服务。我的理解是,您可以使用Cloud Run托管端点ESP。然后,这将为您提供一个可以访问它的URL,但如果需要的话,它将提供足够多的ESP实例。然后向其注册的开放AP

我一直在回顾Google Cloud Extensible Service Proxy,它承诺是一个无服务器的NGINX实例,但是我不确定如何通过它代理app engine中运行的多个服务,并将其用作网关。它似乎需要一个位于swagger JSON配置中的主机和一个指向端点服务名称的环境变量,而我不知道在这种约束下它如何代理多个服务。

我的理解是,您可以使用Cloud Run托管端点ESP。然后,这将为您提供一个可以访问它的URL,但如果需要的话,它将提供足够多的ESP实例。然后向其注册的开放API规范文档将包含与要公开的服务的每个实例对应的路径。对于每个路径,您将定义一个指向每个路径将解析的服务URL的指针

编辑: yaml文件将以某种方式如下所示:

info:
  title: Cloud Endpoints with API Keys
  description: Sample API on Cloud Endpoints with multiple App Engine with IAP backend
  version: 1.0.0
host: <ENDPOINT_URL>
schemes:
  - https
produces:
  - application/json
paths:
  /hello-gae1:
    get:
      summary: Greet a user from App Engine
      operationId: hello_gae
      x-google-backend:
        address: https://<PROJECT_ID>.appspot.com
      parameters:
        - in: query
          name: name
          required: false
          type: string
      responses:
        '200':
          description: A successful response
          schema:
            type: string
  /hello-gae2:
    get:
      summary: Greet a user from App Engine
      operationId: hello_gae
      x-google-backend:
        address: https://<SERVICE-dot-PROJECT_ID>.appspot.com
      parameters:
        - in: query
          name: name
          required: false
          type: string
      responses:
        '200':
          description: A successful response
          schema:
            type: string
  /hello-gae3:
    get:
      summary: Greet a user from App Engine
      operationId: hello_gae
      x-google-backend:
        address: https://<SERVICE-dot-PROJECT_ID>.appspot.com
      parameters:
        - in: query
          name: name
          required: false
          type: string
      responses:
        '200':
          description: A successful response
          schema:
            type: string
securityDefinitions:
  # This section configures basic authentication with an API key.
  api_key:
    type: "apiKey"
    name: "key"
    in: "query"
参考资料: