pwctl
In theory, all the interactions should be done via REST API
pwctl -U admin -P admin -h localhost:8080 subcommand
-U
: username (or-u
, capital U to be consistent withpsql
)-P
: password (should we pass it via command line arguments or enter interactively?) (or-p
?)-h
: host (optional, default tolocalhost:8080
)
get
(by id)databases
metrics
presets
stats
add
: probably too many parameters? Maybe use yaml file if needed.database
metric
preset
delete
(by id)database
metric
preset
update
: probably too many parameters? Maybe use yaml file if needed.database
metric
preset
status
: check status by ???sink
: need to add additional api for this (if we are going to do it via REST API)pause
: need to implement this function in pgwatch first
Each of these top-level commands might have additional flags or arguments. For example:
get databases
would not require any additional arguments.delete database --id "db123"
would require the ID of the database to delete.update metric --id 42 --params '{"md_name":"test"}'
would require both the ID of the metric and the params to update and the new parameters. But how are the user supposed to know the param key?
Questions:
- Is it possible to add id to the database schema since currently there are no
id
field (takemonitored_db
for example) - authentication is questionable
- add and update is questionable
- is this kind of thing what you want