Google Cloud Machine Learning Engine v1 API 无法使用过滤器 jobId:rnn*

Google Cloud Machine Learning Engine v1 API is not working with filter jobId:rnn*

我开始使用机器学习引擎 API 作为终端和 python 我发现 bash API 和 python API:

$ gcloud ml-engine jobs list --filter='jobId:eval_*'
JOB_ID                                 STATUS     CREATED
eval_chest_frontal_golden_201903       SUCCEEDED  2019-03-12T14:35:50
... (30 other results)

并在 python 中:

from oauth2client.client import GoogleCredentials
from googleapiclient import discovery
from googleapiclient import errors

ml = discovery.build('ml', 'v1')

request = ml.projects().jobs().list(
  parent="<<<PROJECT_NAME_HERE>>>",
  filter="jobId:eval_*")

response = None
try:
  response = request.execute()
except errors.HttpError as err:
  raise Exception("Request failed!")

print(response)
# Prints: {}

我查看了具有相同参数的 API 资源管理器:

https://developers.google.com/apis-explorer/#p/ml/v1/ml.projects.jobs.list

我得到与 python 相同的结果:{} 但看起来 URL 没有转义 https://.../jobs?filter=jobId%3Aeval_*&key=... 中的 *。也许这就是错误。我可以通过任何方式在 python API?

中解决这个问题

刚发现您可以改用此过滤器:"jobId:eval_"。如下所示:

request = ml.projects().jobs().list(
  parent="<<<PROJECT_NAME_HERE>>>",
  filter="jobId:eval_")

"jobId:eval_*"效果相同。

唯一担心的是 Google 将来会弃用该功能:

WARNING: --filter : operator evaluation is changing for consistency across Google APIs. jobId:eval_ currently matches but will not match in the near future. Run gcloud topic filters for details.