0

浏览 Cloud Storage Api Javascript API 教程 ( https://console.bluemix.net/docs/services/cloud-object-storage/libraries/node.html#node-js ) 并要求您填写配置文件

var config = {
    endpoint: '<endpoint>',
    apiKeyId: '<api-key>',
    ibmAuthEndpoint: 'https://iam.ng.bluemix.net/oidc/token',
    serviceInstanceId: '<resource-instance-id>',
};

我认为apiKeyId是在认证中找到的

"cloud-object-storage": [
{
  "credentials": {
    "apikey": "**HERE**",
    "endpoints": "",
    "iam_apikey_description": "",
    "iam_apikey_name": "",
    "iam_role_crn": "",
    "iam_serviceid_crn": "",
    "resource_instance_id": ""
  },
  "syslog_drain_url": null,
  "volume_mounts": [],
  "label": "cloud-object-storage",
  "provider": null,
  "plan": "Lite",
  "name": "Cloud Object Storage-bn",
  "tags": [
    "Lite",
    "storage",
    "ibm_release",
    "ibm_created",
    "rc_compatible"
  ]
}
]

我认为端点位于

https://console.bluemix.net/services/cloud-object-storage/

在 EndPoints 下的示例是 (s3-api.us-geo.objectstorage.softlayer.net)

我不知道在IBM Cloud 中的何处找到serviceInstanceId 。

4

2 回答 2

1

resource_instance_id我相信您可以使用以下 Cloud CLI 命令检索所需的内容:

bx resource service-instances -r global

bx resource service-instance "SERVICE NAME FROM PREVIOUS COMMAND" -r all --id

于 2017-11-22T22:26:17.653 回答
0

serviceInstanceId 是凭证中的“resource_instance_id”。就像是:

crn:v1:bluemix:public:cloud-object-storage:global:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

"resource_instance_id": ""

端点实际上类似于“s3-api.us-geo.objectstorage.softlayer.net”,而不是根据凭证通知的端点。

于 2017-11-22T22:01:55.993 回答