我创建了一个云对象存储服务并创建了一个标准存储桶。我的目标是使用CLI中的服务ID上传文件。
在步骤-1中,我正在测试要在通过此链接创建的存储分区上运行几个命令:https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-cli-ic-cos-cli
以下是一些输出:
ibmcloud cos config list
Key Value
Last Updated Tuesday, December 17 2019 at 23:31:19
Default Region us-east
Download Location /Users/myname/Downloads
CRN crn:v1:bluemix:public:cloud-object-storage:global:a/784492b2864521d53b6c4590e0f2bf34:f743cac0-6166-404f-abea-2e1d74c6a7ac:: f743cac0-6166-404f-abea-2e1d74c6a7ac
AccessKeyID
SecretAccessKey
Authentication Method IAM
URL Style VHost
ibmcloud cos list-buckets --ibm-service-instance-id crn:v1:bluemix:public:cloud-object-storage:global:a/784492b2864521d53b6c4590e0f2bf34:f743cac0-6166-404f-abea-2e1d74c6a7ac::
OK
2 buckets found in your account:
Name Date Created
hog-bucket2 Dec 18, 2019 at 05:43:28
hog-test-bucket-name Dec 17, 2019 at 16:59:41
ibmcloud cos head-bucket --bucket hog-bucket2
FAILED
Forbidden: Forbidden
status code: 403, request id: 2fba921d-a11c-4f45-b172-3937daeab633, host id:
我在其他存储桶上尝试过,看到的是相同的403。
我进入了存储桶的访问策略,并创建了一个策略以将自己设置为管理员。但这没有帮助。
从cli创建存储桶效果很好:
ibmcloud cos create-bucket --bucket hog-cli-bucket-name --ibm-service-instance-id crn:v1:bluemix:public:cloud-object-storage:global:a/784492b2864521d53b6c4590e0f2bf34:f743cac0-6166-404f-abea-2e1d74c6a7ac::
OK
Details about bucket hog-cli-bucket-name:
Region: us-east
Class: Standard
然后我尝试获取存储桶列表:
ibmcloud cos list-buckets --ibm-service-instance-id crn:v1:bluemix:public:cloud-object-storage:global:a/784492b2864521d53b6c4590e0f2bf34:f743cac0-6166-404f-abea-2e1d74c6a7ac::
OK
3 buckets found in your account:
Name Date Created
hog-bucket2 Dec 18, 2019 at 05:43:28
hog-cli-bucket-name Dec 18, 2019 at 06:14:03
hog-test-bucket-name Dec 17, 2019 at 16:59:41
看起来不错,但是尝试检索hog-cli-bucket-name
存储桶的类却没有用。它要求我登录。
ibmcloud cos get-bucket-class --bucket hog-cli-bucket-name
FAILED
Access to your IBM Cloud account was denied. Log in again by typing ibmcloud login --sso.
当我登录get-bucket-class
时,它一直告诉我再次登录。
答案 0 :(得分:0)
我认为您的CRN看起来有问题。我只使用了CRN的最后一部分 f743cac0-6166-404f-abea-2e1d74c6a7ac