Google Cloud Storage 找不到项目名称
Google Cloud Storage can't find project name
我正在为 Google 存储 API 使用 python 客户端库,并且我有一个文件 pythonScript.py,其内容为:
# Imports the Google Cloud client library
from google.cloud import storage
# Instantiates a client
storage_client = storage.Client()
# The name for the new bucket
bucket_name = 'my-new-bucket'
# Creates the new bucket
bucket = storage_client.create_bucket(bucket_name)
print('Bucket {} created.'.format(bucket.name))
当我尝试 运行 它时,我在终端中得到了这个:
Traceback (most recent call last): File
"pythonScript.py", line 11, in
bucket = storage_client.create_bucket(bucket_name) File "/home/joel/MATI/env/lib/python3.5/site-packages/google/cloud/storage/client.py",
line 218, in create_bucket
bucket.create(client=self) File "/home/joel/MATI/env/lib/python3.5/site-packages/google/cloud/storage/bucket.py",
line 199, in create
data=properties, _target_object=self) File "/home/joel/MATI/env/lib/python3.5/site-packages/google/cloud/_http.py",
line 293, in api_request
raise exceptions.from_http_response(response) google.cloud.exceptions.Conflict: 409 POST
https://www.googleapis.com/storage/v1/b?project=avid-folder-180918:
Sorry, that name is not available. Please try a different one.
我不确定为什么,因为我确实为我的项目启用了 GSS API,而且默认配置似乎是正确的。 gcloud config list
的输出是:
[compute]
region = us-east1
zone = us-east1-d
[core]
account = joel@southbendcodeschool.com
disable_usage_reporting = True
project = avid-folder-180918
Your active configuration is: [default]
桶名是全局唯一的。其他人必须已经拥有名为 "my-new-bucket."
的存储桶
我正在为 Google 存储 API 使用 python 客户端库,并且我有一个文件 pythonScript.py,其内容为:
# Imports the Google Cloud client library
from google.cloud import storage
# Instantiates a client
storage_client = storage.Client()
# The name for the new bucket
bucket_name = 'my-new-bucket'
# Creates the new bucket
bucket = storage_client.create_bucket(bucket_name)
print('Bucket {} created.'.format(bucket.name))
当我尝试 运行 它时,我在终端中得到了这个:
Traceback (most recent call last): File "pythonScript.py", line 11, in bucket = storage_client.create_bucket(bucket_name) File "/home/joel/MATI/env/lib/python3.5/site-packages/google/cloud/storage/client.py", line 218, in create_bucket bucket.create(client=self) File "/home/joel/MATI/env/lib/python3.5/site-packages/google/cloud/storage/bucket.py", line 199, in create data=properties, _target_object=self) File "/home/joel/MATI/env/lib/python3.5/site-packages/google/cloud/_http.py", line 293, in api_request raise exceptions.from_http_response(response) google.cloud.exceptions.Conflict: 409 POST https://www.googleapis.com/storage/v1/b?project=avid-folder-180918: Sorry, that name is not available. Please try a different one.
我不确定为什么,因为我确实为我的项目启用了 GSS API,而且默认配置似乎是正确的。 gcloud config list
的输出是:
[compute]
region = us-east1
zone = us-east1-d
[core] account = joel@southbendcodeschool.com
disable_usage_reporting = True
project = avid-folder-180918
Your active configuration is: [default]
桶名是全局唯一的。其他人必须已经拥有名为 "my-new-bucket."
的存储桶