diff options
-rw-r--r-- | lorryctl | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lorryctl b/lorryctl new file mode 100644 index 0000000..1be9341 --- /dev/null +++ b/lorryctl @@ -0,0 +1,25 @@ +# Prototype lorry-controller cli, to save remembering the HTTP API... + + +import cliapp +import requests + + +class CLI(cliapp.Application): + def cmd_promote(self, args): + '''Move a repo to the top of the processing queue.''' + + if len(args) != 1: + raise cliapp.AppException( + 'This command takes one argument: the repo to promote.') + + url = 'http://localhost:12765/1.0/move-to-top' + payload = {'path': args[0]} + r = requests.post(url, data=payload) + if r.ok: + print r.text + else: + raise cliapp.AppException(r) + + +CLI().run() |