| Summary: | slurm rest api '/users' return more users than CLI | ||
|---|---|---|---|
| Product: | Slurm | Reporter: | azoshima |
| Component: | slurmrestd | Assignee: | Director of Support <support> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | 4 - Minor Issue | ||
| Priority: | --- | CC: | alin4, andrew.phillips2, ihmesa, nate, tim |
| Version: | 20.11.8 | ||
| Hardware: | Linux | ||
| OS: | Linux | ||
| See Also: | https://bugs.schedmd.com/show_bug.cgi?id=13661 | ||
| Site: | U WA Health Metrics | Slinky Site: | --- |
| Alineos Sites: | --- | Atos/Eviden Sites: | --- |
| Confidential Site: | --- | Coreweave sites: | --- |
| Cray Sites: | --- | DS9 clusters: | --- |
| Google sites: | --- | HPCnow Sites: | --- |
| HPE Sites: | --- | IBM Sites: | --- |
| NOAA SIte: | --- | NoveTech Sites: | --- |
| Nvidia HWinf-CS Sites: | --- | OCF Sites: | --- |
| Recursion Pharma Sites: | --- | SFW Sites: | --- |
| SNIC sites: | --- | Tzag Elita Sites: | --- |
| Linux Distro: | --- | Machine Name: | |
| CLE Version: | Version Fixed: | 22.05.0 | |
| Target Release: | --- | DevPrio: | --- |
| Emory-Cloud Sites: | --- | ||
|
Description
azoshima
2021-12-20 14:19:29 MST
(In reply to azoshima from comment #0) > How can we get the same values with CLI with REST API? > Thank you for your support. Try calling: > sacctmgr show users withdeleted -n | wc -l Thank you! That returned the same value with RestAPI. ``` sacctmgr show users withdeleted -n | wc -l 740 ``` If we want to get users without deleted users from RestAPI, how can we achieve it? (In reply to azoshima from comment #2) > If we want to get users without deleted users from RestAPI, how can we > achieve it? The flag in the RPC is currently not getting added to the output to make it possible to filter. I will see about getting that added to the output but it will most likely go into dbv0.0.38 if approved. In the mean time, your site can apply this patch to avoid dumping deleted users: > diff --git a/src/slurmrestd/plugins/openapi/dbv0.0.36/users.c b/src/slurmrestd/plugins/openapi/dbv0.0.36/users.c > index 6ca66ff..89cdc69 100644 > --- a/src/slurmrestd/plugins/openapi/dbv0.0.36/users.c > +++ b/src/slurmrestd/plugins/openapi/dbv0.0.36/users.c > @@ -106,7 +106,7 @@ static int _dump_users(data_t *resp, data_t *errors, rest_auth_context_t *auth, > .assoc_cond = &assoc_cond, > .with_assocs = true, > .with_coords = true, > - .with_deleted = true, > + .with_deleted = false, > .with_wckeys = true, > }; > Thank you for patch information. It is great to know that filter functionality may be included in near future release. It will be very helpful. Please go ahead to close this ticket. Thank you for your support. *** Ticket 13807 has been marked as a duplicate of this ticket. *** Hello, This has been fixed for users in the upcoming 22.05.0 release, in dbv38, with the following commits: https://github.com/SchedMD/slurm/compare/4049afa4b2b0...d6478de31324 Here's a quick summary of the relevant changes: * /user[s] now defaults to with_deleted=false * /user[s] now has a "with_deleted" input you can specify in the URL. E.g. slurmdb/v0.0.38/users?with_deleted=true * /user[s] now has a "flags" output that will contain a DELETED flag for user records that are deleted. With that, I'll go ahead and close this out. Let me know if you have any questions. Thanks! -Michael (In reply to Michael Hinton from comment #31) > Hello, > > This has been fixed for users in the upcoming 22.05.0 release, in dbv38, > with the following commits: > https://github.com/SchedMD/slurm/compare/4049afa4b2b0...d6478de31324 > This is great! Thanks! |