Skip to content

Commit 37b2965

Browse files
author
Doug Davis
committed
Add initial pass at a cmd line spec
Signed-off-by: Doug Davis <[email protected]>
1 parent bbaf29e commit 37b2965

File tree

3 files changed

+98
-0
lines changed

3 files changed

+98
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ DOC_FILES := \
3232
bundle.md \
3333
runtime.md \
3434
runtime-linux.md \
35+
cmd.md \
3536
config.md \
3637
config-linux.md \
3738
config-solaris.md \

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Table of Contents
1616
- Runtime and Lifecycle
1717
- [General Runtime and Lifecycle](runtime.md)
1818
- [Linux-specific Runtime and Lifecycle](runtime-linux.md)
19+
- [Runtime Command Line Interface](cmd.md)
1920
- Configuration
2021
- [General Configuration](config.md)
2122
- [Linux-specific Configuration](config-linux.md)

cmd.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Runtime Command Line Interface
2+
3+
This document specifies the command line syntax for runtime operations defined in the [Runtime and Lifecycle](runtime.md) specification.
4+
It is STRONGLY RECOMMENDED that implementations adhere to the command line definition defined below to ensure interoperability.
5+
This document will not duplicate the information/semantics specified in the [Runtime and Lifecycle](runtime.md) document, rather it just focuses on syntax of the command line.
6+
7+
## Convention
8+
9+
For the purpose of this document, the following syntactical conventions are used:
10+
11+
* `[ ... ]` denotes an optional field
12+
* `< ... >` denotes a substitution field.
13+
The word(s), or phrase, within the `<>` describes the information to be passed-in.
14+
15+
## General Format and Behavior
16+
17+
The general format of all commands MUST be:
18+
```
19+
runtime [global-options] action [action-specific-options] [arguments]
20+
```
21+
22+
Unknown options (global and action specific) MUST generate an error and exit with a non-zero exit code, without changing the state of the environment.
23+
24+
Upon successful running of an action, the exit code MUST be zero.
25+
26+
If there is an error during the running of an action, then:
27+
* the exit code MUST be non-zero
28+
* any error text MUST be displayed on stderr
29+
* the state of the environment SHOULD be the same as if the action was never attempted (modulo any possible trivial ancillary changes such as logging)
30+
31+
### Global Options
32+
33+
Global options are ones that apply to all actions.
34+
This specification doesn't define any global options.
35+
Implementation MAY define their own.
36+
37+
### Action Specific Options
38+
39+
All actions MUST support the `--help` action-specific-option, which:
40+
* MUST display some help text to stdout
41+
* MUST NOT perform the `action` itself
42+
* MUST have an exit code of zero if the help text is successfully displayed
43+
44+
Implementations MAY define their own action-specific options.
45+
46+
## Actions
47+
48+
This section defines the actions defined by this specification.
49+
50+
### State
51+
52+
Format: `runtime [global-options] state [options] <container-id>`
53+
54+
Options: None
55+
56+
This action MUST display the state of the specific container to stdout.
57+
Unless otherwise specified by the user, the format of the state MUST be in JSON.
58+
59+
See [Query State](runtime.md#query-state).
60+
61+
### Create
62+
63+
Format: `runtime [global-options] create [options] <container-id>`
64+
65+
Options:
66+
* `-b <dir>`, `--bundle <dir>` The path to the root of the bundle directory. If not specified the default value MUST be the current working directory.
67+
* `--console <path>` The PTY slave path for the newly created container.
68+
* `--pid-file <path>` The file path into which the process ID is written. If not specified then a file MUST NOT be created.
69+
70+
See [Create](runtime.md#create).
71+
72+
### Start
73+
74+
Format: `runtime [global-options] start [options] <container-id>`
75+
76+
Options: None
77+
78+
See [Start](runtime.md#start).
79+
80+
### Kill
81+
82+
Format: `runtime [global-options] kill [options] <container-id> <signal>`
83+
84+
Options: None
85+
86+
The `signal` MUST either be the signal's numerical value (e.g. `15`) or the signal's name (e.g. `SIGTERM`).
87+
88+
See [Kill](runtime.md#kill).
89+
90+
### Delete
91+
92+
Format: `runtime [global-options] delete [options] <container-id>`
93+
94+
Options: None
95+
96+
See [Delete](runtime.md#delete).

0 commit comments

Comments
 (0)