如何解决AutoMl 表 eu-automl api 端点未正确设置? “提供的位置 ID 与端点不匹配”
尝试使用 google api 客户端发现/构建查找 AutoML Tables 操作 python 的状态。
我可以使用 client_options 'eu-automl.googleapis.com:443' 验证操作(数据导入)是否发生在欧盟地区:
from google.cloud import automl_v1beta1 as automl
client_options = {'api_endpoint': 'eu-automl.googleapis.com:443'}
client = automl.TablesClient(client_options=client_options,project=project_id,region='eu')
# operation response
response = client.import_data(dataset_display_name=dataset_display_name,bigquery_input_uri=bq_uri)
但是在使用以下方法检查操作状态时:
from oauth2client.client import GoogleCredentials
from googleapiclient import discovery
credentials = GoogleCredentials.get_application_default()
service = discovery.build('eu-automl','v1beta1',credentials=credentials)
operation_name = response._operation.name
request = service.projects().locations().operations().get(name=operation_name)
print(request.execute())
我收到错误:
<HttpError 400 when requesting
https://automl.googleapis.com/v1beta1/projects/xxxxx/locations/eu/operations/TBL4579294405873106944?alt=json
returned "List of found errors: 1.Field: name; Message: The provided location ID doesn't match the endpoint. For automl.googleapis.com,the valid location ID is `us-central1`. For eu-automl.googleapis.com,the valid location ID is `eu`.".
如何正确检查“eu-automl.googleapis.com”?设置 discoveryServiceUrl="https://eu-automl.googleapis.com/$discovery/rest?version=v1beta1"
仍然给我同样的错误。
我正在使用
python 3.7
google-cloud-automl==2.2.0
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。