Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Updated documentation on in response to GH#749:
Browse files Browse the repository at this point in the history
- In REST_API.md, added more info to what `watch` means in tasks section
- In TASKS.md, added state information
  • Loading branch information
kjlyon committed Oct 11, 2016
1 parent 87ab47c commit 238c8d4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/REST_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ _**Example Response**_
}
```
**GET /v1/tasks/:id/watch**:
Watch a task activity stream given a task ID
Watch a task activity stream given a task ID. Watch is an event stream sent over a long running HTTP connection.

_**Example Request**_
```
Expand Down
30 changes: 28 additions & 2 deletions docs/TASKS.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,37 @@
Tasks
=====

A task describes the how, what, and when to do for a Snap job. A task is described in a task _manifest_, which can be either JSON or YAML<sup>1</sup>.
A task describes the how, what, and when to do for a Snap job.

_Skip to the TL;DR example [here](#tldr)_.


## Task States

A task can be in the following states:
- **running:** a running task
- **stopped:** a task that is not running
- **disabled:** a task in a state not allowed to start. This happens when the task produces consecutive errors. A disabled task must be re-enabled before it can be started again.


![newtaskstatediagram2](https://cloud.githubusercontent.com/assets/21182867/19282545/a4179520-8fa3-11e6-9056-4fc3aa610983.png)


How To | Command
----------------------------------------|------------------------
Create task | snapctl task create _[command options] [arguments...]_ <br/> Find more details [here](https://github.com/intelsdi-x/snap/blob/master/docs/SNAPCTL.md#task)
List | snapctl task list
Start task | snapctl task start _\<task_id>_
Stop task | snapctl task stop _\<task_id>_
Remove task | snapctl task remove _\<task_id>_
Export task | snapctl task export _\<task_id>_
Watch task | snapctl task watch _\<task_id>_
Enable task | snapctl task enable _\<task_id>_


## Task Manifest

The manifest can be divided into two parts: Header and Workflow.
A task is described in a task _manifest_, which can be either JSON or YAML<sup>1</sup>. The manifest is divided into two parts: Header and Workflow.

### The Header

Expand Down

0 comments on commit 238c8d4

Please sign in to comment.