NAICNO / Jobanalyzer

Easy to use resource usage report
MIT License
0 stars 1 forks source link

Define the REST API properly #502

Open lars-t-hansen opened 1 month ago

lars-t-hansen commented 1 month ago

One thing that came up in discussions at the AHM was that we need to define the REST API to naic-monitor in a way that allows it to be used by clients that don't want to go via sonalyze. This probably involves using some sort of standard API spec tech (something was mentioned but I forget which). cc @ashenr. We need to define both the query packets and the result packets, with explicit syntax & semantics for all the data fields. This is better defined and documented in the new Go version of the server than in the old Rust version, but it's still going to be a substantial job.

lars-t-hansen commented 1 week ago

The tool we may want to use is Swagger, there is a Go implementation at https://github.com/swaggo/swag for example. Since our REST API is fairly narrow - there's basically one API for every command verb, and there are few verbs - we'll have to see if this is the most appropriate technology, but there's anyway a lot of inspiration to be had here.

lars-t-hansen commented 2 days ago

We can also get rid of the xxxxxtruexxxxx hack, this was an artifact of using the Rust command line parser.