requiring target's selectable checks #3160
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
During hackweek I attempted implementing a TUI (
trentoctl
) to interact with Trento.I wanted to be able to:
Now, besides the fanciness and challenges of implementing a tui in rust and https://ratatui.rs/, it is mainly a matter of integrating with Trento APIs: serialize/deserialize json, making http requests, checking responses... pretty common things.
Let's focus on: showing selectable checks for a target
In order to answer the question which are the selectable checks for a given target (cluster/host)? we need to query Wanda's catalog API with a specific set of parameters based on the target for which we are querying selectable checks.
For a host we need just a provider, while for a cluster we need its type, the architecture type if hana scale up or hana scale out, while we need ensa version and filesystem type when talking about an ascs/ers cluster...
This sounds like delegating too much to integrating clients (logic leakage), and leads to a lot of boilerplate code to achieve a well known outcome like the selectable checks for a given target (cluster/host/maybemorecomingnext).
As someone integrating with trento I'd find it useful having something more straightforward to interact with in order to get that information.
Here is where I was considering the option of having two endpoints in trento doing this
/clusters/:cluster_id/available_checks
/hosts/:id/available_checks
What I like about this option:
What I don't like much:
Note that wanda as such remains untouched in it's agnosticism.
Happy to hear thoughts. If the team agrees on this approach the implementation will be finalized.