Bluemix object storage - what's the difference between “bound” and “unbound” context?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-15 12:12:27

问题


I'm trying to figure out how to use the Bluemix Object Storage V2 service. I'm looking at the documentation at

https://www.ng.bluemix.net/docs/#services/ObjectStorageV2/index.html#gettingstarted

This documentation makes a fundamental distinction between an "unbound context" and a "bound context", without really explaining what this means. What does this mean? And why am I forced into choosing between one means of interaction vs the other?

As a followon question: For the "Unbound Context", the documentation states "To view the cloud credentials, go to the drop-down in the service dashboard."

What "drop down" in which "service dashboard"? Can you please be more specific?


回答1:


By 'unbound context' it means the details you need to connect to the ObjectStorage(v2) service if you are accessing it from a non Bluemix application or a Bluemix application that doesn't have the service bound to it. Conversely a 'bound context' is for when your Bluemix app is bound to that service.

When you are in the 'bound context' you will use the VCAP_SERVICES properties to look up a property called auth_url which, when called, will return the object storage credentials you need to access the service. These are the same credentials you would get if you were in the 'unbound context'.

The service dashboard it talks about is the dashboard you see on console.ng.bluemix.net (or console.eu-gb.bluemix.net) when you click on your provisioned service. Here is an example of mine:

If you are looking for an example of how to use the ObjectStorage (v2) service in a 'bound context' then have a look at my github project here https://github.com/whitfiea/bluemix-objectstorage-v2. For an 'unbound context', i.e., another app outside of Bluemix, you can use the code from this point onwards but you need to somehow provide your app with the credentials mentioned in the drop-down in the service dashboard (hardcoded or env properties etc)



来源:https://stackoverflow.com/questions/29838114/bluemix-object-storage-whats-the-difference-between-bound-and-unbound-con

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!