def explicit():
from google.cloud import storage
# Explicitly use service account credentials by specifying the private key
# file.
storage_client = storage.Client.from_service_account_json(
'service_account.json')
# Make an authenticated API request
buckets = list(storage_client.list_buckets())
print(buckets)
1条答案
按热度按时间ie3xauqp1#
您可以根据本例在代码中指向您的服务帐户文件
你可以在这里的官方文档中找到它。