0

我試圖服務於2層不同的API有一組不同的方法,如記錄在這裏:https://cloud.google.com/endpoints/docs/deploying-apis-subdomains服務在谷歌雲端點多個API

通過GCE,這是在我的main.py結構如下

@endpoints.api(name = 'first', version = 'v1') 
class firstApi(remote.Service): 
    @endpoints.method(
    # Lots of stuff here 
    path = 'first' 
    # Lots more here 

@endpoints.api(name = 'second', version = 'v1') 
class secondApi(remote.Service): 
    @endpoints.method(
     # Lots of stuff here 
     path = 'second' 
     # Lots more here 

api = endpoints.api_server([firstApi, secondApi]) 

但是當我生成firstv1openapi.json和secondv1openapi.json並部署它們時,會發生一些奇怪的事情。當我在谷歌的API資源管理器中加載它,我看到 API的

更糟糕的是,當我點擊第二個API,並通過API探險嘗試任何方法,下兩方法路徑始終引用第1個API。

POST https://my_backend_here.appspot.com/_ah/api/第一/V1/第二

其預期失敗,一個404

我已經看了兩個firstv1openapi.json和secondv1openapi.json,看看API的十字架完全相互引用,他們都看起來很好。

我出於嘗試不同的選擇,任何幫助將不勝感激。

回答

0

我看到你正在使用Python端點框架。該框架目前僅適用於App Engine的標準環境,而不適用於GCE。