如何获取app的环境变量?

Ivar_PredixCN 2017-08-28 09:48:01
PROBLEM
Your app or service uses environment variables at run time (possibly set through a manifest.yml file) to connect apps and services, but the connections seem to not be working properly.

Or, you want to find out:
Client ID

Zone ID

Logging Level

Application ID

Application URI



For example: You might have an app that points to a particular service. This service URL is referenced in the manifest.yml file. However, since you've been trying a few things out, you've pushed several versions of the service and you want to check which service the deployed app is pointing to.



STEPS
cf env NAME_OF_APP_OR_SERVICE


Example result:

Getting env variables for app NAME_OF_APPLICATION_OR_SERVICE in org ORG_NAME / space SPACE_NAME as USER_NAME...
OK

System-Provided:


{
"VCAP_APPLICATION": {
"application_id": "1234567890abcdef1234567890abcdef",
"application_name": "NAME_OF_APPLICATION_OR_SERVICE",
"application_uris": [
"NAME_OF_APPLICATION_OR_SERVICE.ROUTING.predix.io"
],
"application_version": "1234567890abcdef1234567890abcdef",
"limits": {
"disk": 1024,
"fds": 12345,
"mem": 1024
},
"name": "1234567890abcdef1234567890abcdef",
"space_id": "1234567890abcdef1234567890abcdef",
"space_name": "SPACE_NAME",
"uris": [
"1234567890abcdef1234567890abcdef.ROUTING.predix.io"
],
"users": null,
"version": "1234567890abcdef1234567890abcdef"
}
}

User-Provided:
AUTH_URL: https://1234567890abcdef1234567890abcdef.ROUTING.predix.io
CLIENT_ID: CLIENT_ID
CLIENT_SECRET: secret
EVENTHUB_PORT: 443
EVENTHUB_URI: some.eventhub.uri.io
SPRING_PROFILES_ACTIVE: cloud
ZONE_ID: 1234567890abcdef1234567890abcdef
logging_level_com_ge_predix_solsvc: DEBUG
logging_level_org_springframework: INFO
logging_level_root: INFO

No running env variables have been set

No staging env variables have been set


DEPENDENCIES
Cloud Foundry CLI
You can retrieve environment variables for your pushed apps/services, but you will not be able to see logs for the service instances which you depend on such as Time Series, Asset, or UAA.

...全文
65 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

163

社区成员

发帖
与我相关
我的任务
社区描述
GE的Predix平台整合云计算可扩展性、大数据管理和高级分析技术来助力新一代的数字化企业。结合GE自己作为全球工业界领导者的经验,Predix云平台为开发高级工业应用程序提供可连接性、安全和高性能。
云计算大数据 技术论坛(原bbs)
社区管理员
  • GE Predix工业互联网开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧