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 with psql)
    • -P: password (should we pass it via command line arguments or enter interactively?) (or -p?)
    • -h: host (optional, default to localhost:8080)
  1. get (by id)
    • databases
    • metrics
    • presets
    • stats
  2. add: probably too many parameters? Maybe use yaml file if needed.
    • database
    • metric
    • preset
  3. delete (by id)
    • database
    • metric
    • preset
  4. update: probably too many parameters? Maybe use yaml file if needed.
    • database
    • metric
    • preset
  5. status: check status by ???
  6. sink: need to add additional api for this (if we are going to do it via REST API)
  7. 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:

  1. Is it possible to add id to the database schema since currently there are no id field (take monitored_db for example)
  2. authentication is questionable
  3. add and update is questionable
  4. is this kind of thing what you want