How to get VCAP_SERVICES environment variables WITHOUT binding to an application?

我怕爱的太早我们不能终老 提交于 2019-12-12 18:06:55

问题


Frequently, I'm create standalone services in Bluemix. For example, Analytics for Apache Hadoop, Cloudant and DashDB.

I don't need an application to work with these services, but it seems I have to bind to an application just to get access to the VCAP_SERVICES environment variables with urls, usernames, passwords, etc.

Question: How to get VCAP_SERVICES environment variables WITHOUT binding to an application?


回答1:


For many services, you will have to bind them to an app in order to get the VCAP_SERVICES credentials.

There is a service key capability which some services are starting to adopt which allows you to create and access credentials without binding to an app. Using the cf command line tool, the commands below are available to use if a service supports them:

SERVICES:
   create-service-key, csk                       Create key for a service instance
   service-keys, sk                              List keys for a service instance
   service-key                                   Show service key info
   delete-service-key, dsk                       Delete a service key

The CloudFoundry docs at https://docs.cloudfoundry.org/devguide/services/service-keys.html provide more detail.

In the Bluemix UI, you would see a 'Service Credentials' option in the panel when viewing a service dashboard when a service supports this capability. Selecting this option allows you to see credentials that have been created as well as an "Add Credentials" button to create new ones.



来源:https://stackoverflow.com/questions/33098568/how-to-get-vcap-services-environment-variables-without-binding-to-an-application

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