Summary
Add a --rest flag (or --backend=rest) to GCM CLI monitoring commands that routes Slurm queries through the REST API (SlurmRestClient) instead of the default CLI-based SlurmCliClient.
Motivation
The SlurmRestClient (PR #62) implements the same SlurmClient Protocol as SlurmCliClient, making it a drop-in replacement. However, there's currently no CLI-level switch to choose between backends. A --rest flag would allow operators to use the REST API without code changes, which is especially useful for:
- Monitoring hosts that don't have Slurm CLI tools installed
- Environments where slurmrestd is the preferred access method
- Reducing subprocess overhead in high-frequency collection loops
Proposed Interface
# Use REST API instead of CLI
gcm squeue --rest --rest-url=http://slurmctl:6820 --rest-token=<jwt> --sink=stdout --once
# Or via config file
gcm squeue --backend=rest --sink=stdout --once
Additional context
Suggested by @luccabb in PR #62 review.
Summary
Add a
--restflag (or--backend=rest) to GCM CLI monitoring commands that routes Slurm queries through the REST API (SlurmRestClient) instead of the default CLI-basedSlurmCliClient.Motivation
The
SlurmRestClient(PR #62) implements the sameSlurmClientProtocol asSlurmCliClient, making it a drop-in replacement. However, there's currently no CLI-level switch to choose between backends. A--restflag would allow operators to use the REST API without code changes, which is especially useful for:Proposed Interface
Additional context
Suggested by @luccabb in PR #62 review.