Where do you find the Config info for IBM Cloud Storage API for Javascript

Going through the tutorial for the Cloud Storage Api Javascript API (https://console.bluemix.net/docs/services/cloud-object-storage/libraries/node.html#node-js) and it ask your to fill out the config file

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

I think apiKeyId is found in the certification

"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"
  ]
}
]

I think endpoint is found at

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

Under EndPoints an example would be (s3-api.us-geo.objectstorage.softlayer.net)

I have no idea where serviceInstanceId is found in the IBM Cloud.

Upvotes: 0

Views: 171

Answers (2)

mbridges
mbridges

Reputation: 146

I believe you can retrieve the resource_instance_id you need using the following Cloud CLI commands:

bx resource service-instances -r global

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

Upvotes: 1

Felipe Paixao
Felipe Paixao

Reputation: 411

serviceInstanceId is the "resource_instance_id" from the credential. Something like:

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

"resource_instance_id": ""

The endpoint is really one like "s3-api.us-geo.objectstorage.softlayer.net" and not the endpoint informed on the credential.

Upvotes: 0

Related Questions