Skip to content

Commit 96b34fd

Browse files
author
Severine Tymon
committed
[#134606323] Edits with Steven
1 parent 7934cbc commit 96b34fd

File tree

1 file changed

+39
-23
lines changed

1 file changed

+39
-23
lines changed

using-tasks.html.md.erb

Lines changed: 39 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ Tasks are used to perform one-off jobs. For example, you can use a task to:
3434
The life-cycle of a task is:
3535

3636
1. A user initiates a task in Cloud Foundry. A user can initiate a task in CF by using one of the following mechanisms:
37-
* `cf run-task APPNAME TASK` command
38-
* Cloud Controler v3 API call. See the [Tasks](http://v3-apidocs.cloudfoundry.org/version/3.0.0/index.html#tasks) API reference page.
39-
* Cloud Foundry Java Client. See
37+
* `cf run-task APPNAME TASK` command. See
38+
* Cloud Controller v3 API call. See the [Tasks](http://v3-apidocs.cloudfoundry.org/version/3.0.0/index.html#tasks) API reference page.
39+
* Cloud Foundry Java Client. See [Cloud Foundry Java Client Library](../buildpacks/java/java-client.html) and [Cloud Foundry Java Client](https://github.com/cloudfoundry/cf-java-client).
4040

4141
1. Cloud Foundry creates container specifically for the task.
4242
1. Cloud Foundry runs the task on the container using the value provided to the `cf run-task` command
@@ -56,45 +56,61 @@ The life-cycle of a task is:
5656
* A syslog drain attached to an app will receive task log output
5757
* Stdout/stderr from the task will be available on the app’s firehose logs
5858

59-
## <a id='run-task'></a> Managing Tasks
59+
## <a id='manage-tasks'></a> Managing Tasks
6060

61-
* Admins can use the CAPI API to view all the tasks that are running in and org or space. (link to API docs)
62-
* Admins can set memory usage on a global level (link)
63-
64-
Tasks have the following states:
61+
* Admins can use the Cloud Controller v3 API to view all the tasks that are running in an org or space. See http://v3-apidocs.cloudfoundry.org/version/3.0.0/index.html#list-tasks
6562

66-
* RUNNING: the task is currently in progress.
67-
* FAILED: the task did not complete. This state occurs when a task does not work correctly or a user cancels the task.
68-
* SUCCEEDED: the task completed successfully.
69-
70-
* To re-execute a task, you must create it as a new task.
71-
* A task is cancellable
63+
* Admins can set memory usage on a global level (link)
7264

73-
### CF CLI Support
65+
## <a id='run-tasks'></a> Running Tasks
7466

7567
You can use the cf CLI to run a task in the context of an application.
7668

69+
<p class="note"><strong>Note</strong>: To run tasks with the cf CLI, you must install the cf CLI v6.23 (?) or later. See the <a href="../cf-cli/install-go-cli.html">Installing the Cloud Foundry Command Line Interface</a> topic for information about downloading, installing, and uninstalling the cf CLI.</p>
7770

71+
To run a task on an application, first push your application. Then use the `cf run-task APPNAME TASK` command on your deployed application. For example:
7872

73+
<pre class="terminal">
74+
$ cf run-task my-app "bin/rails db:migrate"
75+
Creating task for app my-app in org jdoe-org / space development as [email protected]...
76+
OK
77+
Task 1 has been submitted successfully for execution.
78+
</pre>
7979

80+
To re-run a task, you must create it as a new task.
8081

81-
To support running and managing tasks, the cf CLI supports the following commands:
82+
## <a id='list-tasks'></a> Listing Tasks
83+
84+
Tasks have the following states:
8285

83-
<table>
86+
<table class="nice" border="1">
87+
<tr>
88+
<th>State</th>
89+
<th>Description</th>
90+
</tr>
8491
<tr>
85-
<td>run-task</td>
86-
<td>Run a one-off task on an app</td>
92+
<td>RUNNING</td>
93+
<td>The task is currently in progress.</td>
8794
</tr>
8895
<tr>
89-
<td>tasks</td>
90-
<td>List tasks of an app</td>
96+
<td>FAILED</td>
97+
<td>The task did not complete. This state occurs when a task does not work correctly or a user cancels the task.</td>
9198
</tr>
9299
<tr>
93-
<td>terminate-task</td>
94-
<td>Terminate a running task of an app</td>
100+
<td>SUCCEEDED</td>
101+
<td>The task completed successfully.</td>
95102
</tr>
96103
</table>
97104

105+
## <a id='cancel-task'></a>
106+
107+
* A task is cancellable
108+
109+
110+
To support running and managing tasks, the cf CLI supports the following commands:
111+
112+
113+
98114
* <strong>Comment</strong> I think it would be nice to include more how tasks are run. Is there a queue? Is the task run in a separate container?
99115
* provide "architectural" information about how tasks work. For example, are they run in a separate container.
100116
* different container, same code

0 commit comments

Comments
 (0)