Bigquery不接受Stackdriver的Sink Writer身份

时间:2017-04-28 20:27:44

标签: google-bigquery google-cloud-platform stackdriver google-python-api

我一直在关注文档,将日志从Stackdriver导出到Bigquery。我尝试了以下内容:

from google.cloud.logging.client import Client as lClient
from google.cloud.bigquery.client import Client as bqClient
from google.cloud.bigquery.dataset import AccessGrant

import os
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = 'path_to_json.json'

lc = lClient()
bqc = bqClient()

ds = bqc.dataset('working_dataset')
acc = ds.access_grants
acc.append(AccessGrant('WRITER', 'groupByEmail', 'cloud-logs@system.gserviceaccount.com')) #this is the service account that is shown in our Exports tab in GCP.
ds.access_grants = acc
ds.update()

但我们收到错误消息:

NotFound: 404 Not found: Email cloud-logs@system.gserviceaccount.com (PUT https://www.googleapis.com/bigquery/v2/projects/[project-id]/datasets/[working-dataset])

为什么我们的数据集不会更新?使用的密钥是已经创建数据集的密钥。

0 个答案:

没有答案