gem install overwatch
Configuration of overwatch can be done in one of two ways: command-line options, and a config file in the YAML format. If no config options are specified, the overwatch executable will look for a file called .overwatchrc in the HOME_DIR of the user that is executing the command. Parameters that can be configured in the config file are:
- Server
- Port
- API key
Even if an option is specified in the config file, it can be overridden with a command-line argument. Options ommitted will use the default values.
server: overwatch.example.com
port: 9090
key: asdf1234asdf1234asdf1234asdf234
I'm going to assume you've got overwatch-collection running somewhere on your local machine for the purpose of this documention.
All commands provide a contextual help menu. Append --help to the end of any command or subcommand to bring up its specific help menu.
When you install overwatch via RubyGems, an executable, overwatch, is installed somewhere in your $PATH (the exact location is entirely dependent upon your Ruby/Gems setup).
overwatch [OPTIONS] SUBCOMMAND [ARGS] ...
SUBCOMMAND subcommand name
[ARGS] ... subcommand arguments
run Compile and send a new snapshot to the server
resource Resources
snapshot Snapshots
-c, --config CONFIG Overwatch config file
-k, --key KEY API key (default: nil)
-s, --server SERVER collection server (default: "localhost")
-p, --port PORT collection port (default: "9001")
-f, --format [FORMAT] format (choices: pretty, json, text) (default: "pretty")
overwatch run [OPTIONS] [ARGS] ...
SUBCOMMAND subcommand name
[ARGS] ... subcommand arguments
overwatch resource [OPTIONS] SUBCOMMAND [ARGS] ...
SUBCOMMAND subcommand name
[ARGS] ... subcommand arguments
list list all resources
show show a specific resource
create create a new resource
update update an existing resource
delete delete an existing resource
regenerate regenerate a resource's API key
overwatch resource list [OPTIONS]
Pretty format:
$ overwatch resource list --format pretty
+----+------+--------------------------------+
| id | name | api_key |
+----+------+--------------------------------+
| 1 | foo | 3ec97eb0d2870db4b061533812d8a1 |
| 2 | bar | e0a5f1baf553f27115cb45ea1ef51a |
| 3 | baz | 5273d592d9a7465ed1b3ae820d06a1 |
+----+------+--------------------------------+
3 rows in set
Plaintext format for easy piping/grepping/awking:
$ overwatch resource list --format text
1 foo 3ec97eb0d2870db4b061533812d8a1
2 bar e0a5f1baf553f27115cb45ea1ef51a
3 baz 5273d592d9a7465ed1b3ae820d06a1
overwatch resource show [OPTIONS] NAME_OR_ID
NAME_OR_ID resource name or id
-a, --attributes list all resource attributes
Find a resource by name and display it
$ overwatch resource show foo
+----+------+--------------------------------+
| id | name | api_key |
+----+------+--------------------------------+
| 1 | foo | 3ec97eb0d2870db4b061533812d8a1 |
+----+------+--------------------------------+
1 row in set
Find a resource by id and display it in plain text:
$ overwatch resource show --format text 2
2 bar e0a5f1baf553f27115cb45ea1ef51a
raise NotImplementedError, "This will be available in a future release."
raise NotImplementedError, "This will be available in a future release."
raise NotImplementedError, "This will be available in a future release."
raise NotImplementedError, "This will be available in a future release."
- expand command set as other overwatch pieces are implemented
- user authentication/authorization (done in the other apps, but we'll need support here)