简体   繁体   English

WAS Slack Bot集成-设置VCAP_SERVICES环境变量

[英]WAS Slack Bot Integration - VCAP_SERVICES environment variable set up

" https://watson-personal-assistant.github.io/developer/further-topics/slackbot-integration/ " https://watson-personal-assistant.github.io/developer/further-topics/slackbot-integration/

Based on the instructions from the above link, I am able to make the python app work locally. 根据上述链接的说明,我能够使python应用程序在本地运行。 However, I am not able to set up the VCAP_SERVICES environment value for it running in bluemix. 但是,我无法为其在bluemix中运行的环境设置VCAP_SERVICES环境值。 My Questions: 我的问题:

  1. A VCAP_SERVICES value JSON example VCAP_SERVICES值JSON示例
  2. How to set it up in Bluemix App? 如何在Bluemix App中进行设置? I do not see an option to add/update the VCAP_SERVICES in the console. 我在控制台中看不到添加/更新VCAP_SERVICES的选项。 Is it due to my Trial account authority limitations? 是否由于我的试用帐户权限限制?

The documentation link seems to be broken. 文档链接似乎已损坏。 Because you already seem to work on the command line, I would recommend the following approach. 因为您似乎已经在命令行上工作,所以我建议采用以下方法。 Use bx cf set-env to set environment variables: 使用bx cf set-env设置环境变量:

bx cf set-env YOUR_APP_NAME_HERE SLACK_API_TOKEN VALUE
bx cf set-env YOUR_APP_NAME_HERE BOT_ID VALUE
...
bx cf set-env YOUR_APP_NAME_HERE FALLBACK_RESPONSES "I didn't quite catch that, I don't understand"

The above commands would add the variables and their value to the runtime environment. 上面的命令会将变量及其值添加到运行时环境。 Then use the restage command as stated. 然后按照说明使用restage命令。 Another option is to add the variables in the browser UI. 另一种选择是在浏览器用户界面中添加变量。 After navigating to the app details, there is a tab for environment settings. 导航到应用程序详细信息后,有一个用于环境设置的选项卡。

Your link in the description is broken. 您在说明中的链接已损坏。 Here is the URL to the documentation on Slack client integration for Watson Assistant Solutions https://watson-personal-assistant.github.io/developer/slack/about_slackbot/ 这是Watson Assistant Solutions的Slack客户端集成文档的URL,网址为https://watson-personal-assistant.github.io/developer/slack/about_slackbot/

Step 2 in the tutorial explains how to use a .env to set the environment variables. 本教程的第2步说明了如何使用.env设置环境变量。 Here is the link to the documentation. 这是文档的链接。

https://watson-personal-assistant.github.io/developer/slack/creating_a_slackbot/ https://watson-personal-assistant.github.io/developer/slack/creating_a_slackbot/

If you don't want to put user environment variables in a .env file IBM Cloud also allows you to define those as user defined variables. 如果您不想将用户环境变量放在.env文件中,IBM Cloud还允许您将这些变量定义为用户定义的变量。 You can also use the command line option suggested by Henrik. 您也可以使用Henrik建议的命令行选项。

See the IBM Cloud documentation https://console.bluemix.net/docs/services/watson/getting-started-variables.html#vcapServices 请参阅IBM Cloud文档https://console.bluemix.net/docs/services/watson/getting-started-variables.html#vcapServices

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM