This is an archive of the discontinued LLVM Phabricator instance.

Add lnt commandline REST client
ClosedPublic

Authored by MatzeB on Jul 17 2017, 12:58 PM.

Details

Summary

Note: I am mainly putting the review here in case we want to bikeshed the names of the commands or the names/style of configuration. I will work on the unittests while this review is going on.

This adds the following commands to lnt, so users can perform some data cleanup on LNT servers through the REST api without having ssh+database access on the server. (REST authentication works through an API token, that server administrators can optionally set).

$ > bin/lnt admin --help
...
Commands:
  create-config
  get-machine
  list-machines
  rename-machine
  rm-machine
  rm-run

The commands attempt to load lntadmin.yaml from the current directory, so you can prepare this configuration with all your server information, authentication and api tokens and don't need to retype it with every command.

Diff Detail

Repository
rL LLVM

Event Timeline

MatzeB created this revision.Jul 17 2017, 12:58 PM
cmatthews edited edge metadata.Jul 17 2017, 1:05 PM

This is a wonderful idea!

This is a wonderful idea!

Agreed!
I'm wondering if it'd be useful to also write a bit of documentation about this? For example, being a very inexperienced server admin, I'm not sure where I'd start looking to set up authentication tokens. Maybe a pointer in a section documenting this could be useful?

Thanks!

MatzeB updated this revision to Diff 107152.Jul 18 2017, 12:14 PM
  • Add unittests
  • Add documentation
MatzeB updated this revision to Diff 107709.Jul 21 2017, 1:29 PM

Reuploading with some updates:

  • Rebased to ToT
  • get-run, post-run support an arbitrary number of arguments now to download/post multiple
  • Added new merge-machine-into mode
  • Show status updates during rm-machine
grosser edited edge metadata.Jul 24 2017, 11:56 PM

I really like the idea and would like to see this going in. I am fine with the name of the commands and believe the overall patch looks good, but did not check each line.

grosser accepted this revision.Jul 25 2017, 2:20 AM

I mark this as LGTM. Depending on your confidence you may wait for other reviews, but from my side this is fine.

This revision is now accepted and ready to land.Jul 25 2017, 2:20 AM
This revision was automatically updated to reflect the committed changes.