why does the 'cf run-task' command not work on swisscom cloudfoundry

那年仲夏 提交于 2019-12-10 11:19:01

问题


I'm trying to get 'cf run-task' to work on the swisscom cloudfoundry instance. But it fails with even the simplest command:

$ cf run-task hostapp "echo SUCCESS" --name task1
Creating task for app hostapp in org xxx / space yyy as xxx@yyy.com...
Unexpected Response
Response Code: 404
FAILED

Is run-task not yet supported in cf api version 2.96.0? (which seems to be the current installed version on the swisscom env)


回答1:


The Swisscom Application Cloud has not activated the cf run-task feature yet. As of now, it's best to use cf ssh and then run the command manually from within your container or include these tasks as idempotent actions in your app's startup script.

cf run-task will be enabled in a future release of the Application Cloud.




回答2:


As mentioned by @mastertinner Swisscom has since enabled cf run-task as part of their application cloud offering. They send out e-mails discussing the release on 22. November 2018, linking to the official CloudFoundry documentation: https://docs.cloudfoundry.org/devguide/using-tasks.html

You can use these commands:

cf tasks [APP_NAME]
cf run-task [APP_NAME] [COMMAND]
cf terminate-task [APP_NAME] [TASK_ID]


来源:https://stackoverflow.com/questions/47142184/why-does-the-cf-run-task-command-not-work-on-swisscom-cloudfoundry

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