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)
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.
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