-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsubcommand_api
107 lines (100 loc) · 5.75 KB
/
subcommand_api
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
optionDefinition := getopt.SubCommandOptions{
"*": {
{"command", "command to execute", getopt.IsSubcommand, ""}},
"list": { },
"describe":{
{"name|n", "app's name", getopt.IsArg | getopt.Required, ""}},
"register": {
{"name|n", "app's name", getopt.IsArg | getopt.Required, ""},
{"deploytype|t", "deploy type (one of mount, bazapta, lxc)", getopt.Optional | getopt.ExampleIsDefault, "lxc"},
{"repourl|r", "repository url of this app", getopt.Optional | getopt.ExampleIsDefault, "http://github.com/soundcloud/<name>"},
{"stack|s", "stack version this app should be pinned to -- ommit if you always want the latest stack", getopt.Optional, ""},
{"irc|i", "comma separated list of irc channels where a deploy should be announced", getopt.Optional | getopt.ExampleIsDefault, "deploys"}},
"unregister": {
{"name|n", "app's name", getopt.IsArg | getopt.Required, ""}},
"setenv": {
{"name", "app's name", getopt.IsArg | getopt.Required, ""},
{"key", "environment variable's name", getopt.IsArg | getopt.Required, ""},
{"value", "environment variable's value (omit in order to delete variable)", getopt.IsArg | getopt.Optional, ""}},
"getenv": {
{"name", "app's name", getopt.IsArg | getopt.Required, ""},
{"key", "environment variable's name", getopt.IsArg | getopt.Required, ""}},
"env": {
{"name", "app's name", getopt.IsArg | getopt.Required, ""}}
"revisions": {
{"name|n", "app's name", getopt.IsArg | getopt.Required, ""}}
}
optionDefinition := getopt.SubSubCommandOptions{
"*" : {
{"config|c", "config file", getopt.IsConfigFile | getopt.ExampleIsDefault, "/etc/visor.conf"},
{"server|s", "doozer server", getopt.Required, ""},
{"port|p", "port the doozer server is listening on", getopt.Optional | getopt.ExampleIsDefault, "8046"},
{"root|r", "visor namespace within doozer: all entries will be prepended with this path", getopt.Optional | getopt.ExampleIsDefault, "/visor"},
{"scope", "scope a command should be executed on; call 'visor help' for an overview", getopt.IsSubcommand, ""},
{"command", "command to execute", getopt.IsSubcommand, ""}},
"app" : {
"*": {
{"command", "command to execute", getopt.IsSubcommand, ""}},
"list": { },
"describe":{
{"name|n", "app's name", getopt.IsArg | getopt.Required, ""}},
"register": {
{"name|n", "app's name", getopt.IsArg | getopt.Required, ""},
{"deploytype|t", "deploy type (one of mount, bazapta, lxc)", getopt.Optional | getopt.ExampleIsDefault, "lxc"},
{"repourl|r", "repository url of this app", getopt.Optional | getopt.ExampleIsDefault, "http://github.com/soundcloud/<name>"},
{"stack|s", "stack version this app should be pinned to -- ommit if you always want the latest stack", getopt.Optional, ""},
{"irc|i", "comma separated list of irc channels where a deploy should be announced", getopt.Optional | getopt.ExampleIsDefault, "deploys"}},
"unregister": {
{"name|n", "app's name", getopt.IsArg | getopt.Required, ""}},
"setenv": {
{"name", "app's name", getopt.IsArg | getopt.Required, ""},
{"key", "environment variable's name", getopt.IsArg | getopt.Required, ""},
{"value", "environment variable's value (omit in order to delete variable)", getopt.IsArg | getopt.Optional, ""}},
"getenv": {
{"name", "app's name", getopt.IsArg | getopt.Required, ""},
{"key", "environment variable's name", getopt.IsArg | getopt.Required, ""}},
"env": {
{"name", "app's name", getopt.IsArg | getopt.Required, ""}}
"revisions": {
{"name|n", "app's name", getopt.IsArg | getopt.Required, ""}}
},
"revision": {
"*" : {
{"command", "command to execute", getopt.IsSubcommand, ""}},
"list": {
{"app|n", "app's name", getopt.IsArg | getopt.Required, ""}},
"describe": {
{"app|n", "app's name", getopt.IsArg | getopt.Required, ""},
{"rev|v", "revision", getopt.IsArg | getopt.Optional | getopt.ExampleIsDefault, "HEAD"}},
"register": {
{"app", "app's name", getopt.IsArg | getopt.Required, ""},
{"rev", "revision", getopt.IsArg | getopt.Required, ""},
{"artifacturl|u", "url of the build artifact for this application-revision", getopt.Required, ""},
{"proctypes|t", "comma seperated list of proc types available in this application-revision", getopt.Optional, ""}},
"unregister": {
{"app", "app's name", getopt.IsArg | getopt.Required, ""},
{"rev", "revision", getopt.IsArg | getopt.Required, ""}},
"scale": {
{"app", "app's name", getopt.IsArg | getopt.Required, ""},
{"rev", "revision", getopt.IsArg | getopt.Required, ""},
{"proc", "proc type that is to be scaled", getopt.IsArg | getopt.Required, ""},
{"num", "number of instances that should be running of this app-rev-proc-type (N for absolute values, -N for scaling down by N, +N for scaling up by N)", getopt.IsArg | getopt.Required, ""}},
"instances": {
{"app", "app's name", getopt.IsArg | getopt.Required, ""},
{"rev", "revision", getopt.IsArg | getopt.Required, ""}},
"instances": {
{"app", "app's name", getopt.IsArg | getopt.Required, ""},
{"rev", "revision", getopt.IsArg | getopt.Required, ""}},
},
"instance": {
"*" : {
{"command", "command to execute", getopt.IsSubcommand, ""}},
"describe": {
{"instanceid", "id of the instance (<hostname>:<port>)", getopt.IsArg | getopt.Required, ""}},
"tail": {
{"instanceid", "id of the instance (<hostname>:<port>)", getopt.IsArg | getopt.Required, ""},
"kill": {
{"instanceid", "id of the instance (<hostname>:<port>)", getopt.IsArg | getopt.Required, ""},
{"signalname|s", "signal to send to instance (according to the normal unix kill command)", getopt.Optional | getopt.ExampleIsDefault, "SIGTERM"}}
}
}