您在哪里可以找到适用于Javascript的IBM Cloud Storage API的配置信息

时间:2017-11-22 15:27:44

标签: ibm-cloud cloud-storage ibm-cloud-storage ibm-cloud-applaunch

浏览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 的位置。

2 个答案:

答案 0 :(得分:1)

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

bx resource service-instances -r global

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

答案 1 :(得分:0)

serviceInstanceId是凭证中的“resource_instance_id”。类似的东西:

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

"resource_instance_id": ""

端点实际上就像“s3-api.us-geo.objectstorage.softlayer.net”,而不是通知凭据的端点。