如何在不绑定到应用程序的情况下获取VCAP_SERVICES环境变量? [英] How to get VCAP_SERVICES environment variables WITHOUT binding to an application?

查看:70
本文介绍了如何在不绑定到应用程序的情况下获取VCAP_SERVICES环境变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常,我在Bluemix中创建独立的服务.例如,适用于Apache Hadoop,Cloudant和DashDB的Google Analytics(分析).

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

我不需要使用这些服务的应用程序,但是似乎我必须绑定到一个应用程序只是为了使用URL,用户名,密码等访问VCAP_SERVICES环境变量.

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.

问题:如何在不绑定到应用程序的情况下获取VCAP_SERVICES环境变量?

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

推荐答案

对于许多服务,您必须将它们绑定到应用程序才能获得VCAP_SERVICES凭据.

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

有些服务开始采用一种服务密钥功能,该功能使您可以创建和访问凭据,而无需绑定到应用程序.使用cf命令行工具,以下命令可在服务支持的情况下使用:

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

位于 https://docs.cloudfoundry.org/devguide/上的CloudFoundry文档services/service-keys.html 提供更多详细信息.

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

在Bluemix UI中,当服务支持此功能时,在查看服务仪表板时,您会在面板中看到服务凭证"选项.选择此选项,您可以查看已创建的凭据以及用于创建新凭据的添加凭据"按钮.

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.

这篇关于如何在不绑定到应用程序的情况下获取VCAP_SERVICES环境变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆