Created attachment 29766 [details] JSON dump of results from REST query Running a query with "sacctmgr" $ sacctmgr show assoc user=alamaom format=user,account User Account ---------- ---------- alamaom pi-caninim Comparing this to the output of: http://slurm:6820/slurmdb/v0.0.37/user/alamaom doesn't match. (See attachment with full results of REST GET) Is this the correct REST query to fetch the associations of a user? If so, is it expected to match the output of an equivalent "sacctmgr"? -Greg
You're using the user endpoint: > http://slurm:6820/slurmdb/v0.0.37/user/alamaom But calling sacctmgr show assoc (not show user): > $ sacctmgr show assoc user=alamaom format=user,account If you want the association data, then use the association[s] endpoint: https://slurm.schedmd.com/rest_api.html#slurmdbV0038GetAssociation https://slurm.schedmd.com/rest_api.html#slurmdbV0038GetAssociations Does this answer your question?
Hi Marshall, Ah! Ok. Thanks. The user endpoint returns associations too thou, which is a bit confusing as it returns both active and deleted associations. -Greg
Confirming the /associations endpoint works great - even includes "is_default" which is quite handy.
Thanks for letting me know that the associations endpoint works great for you. (In reply to Greg Wickham from comment #3) > The user endpoint returns associations too thou, which is a bit confusing as > it returns both active and deleted associations. I only see active associations. When I delete an association (for example, a user from one of their accounts), and run the user[s] endpoint, I don't see that association for that user anymore. What deleted associations do you see with the users endpoint?
Hi Marshall, In the initial example doing a "show assoc" with sacctmgr showed a single association however using the user REST endpoint found deleted associations. (See the attached file). -greg
Hi Greg, Sorry for the delayed response. (In reply to Greg Wickham from comment #7) > Hi Marshall, > > In the initial example doing a "show assoc" with sacctmgr showed a single > association however using the user REST endpoint found deleted associations. The reason I could not reproduce this is that I was deleting an association without running jobs in that association, thus removing it from the database instead of just marking it as deleted. https://slurm.schedmd.com/sacctmgr.html#OPT_WithDeleted_1 With that in mind, I reproduced the user endpoint showing deleted associations. Showing deleted associations is actually the default for dbv37, but was changed for dbv38, alongside adding the "with_deleted" query parameter. See these entries in the NEWS file: -- openapi/dbv0.0.38 - set with_deleted to false by default for /user[s]. -- openapi/dbv0.0.38 - add with_deleted input parameter to GET /user[s]. -- openapi/dbv0.0.38 - add deleted flag to /user[s] output. -- openapi/dbv0.0.38 - set with_deleted to false by default for GET /qos. -- openapi/dbv0.0.38 - add with_deleted input to GET /qos. -- openapi/dbv0.0.38 - set with_deleted to false by default for GET /account[s] -- openapi/dbv0.0.38 - add with_deleted input to GET /account[s]. So, this is expected behavior. I'm closing this as infogiven, but don't hesitate to ask if you have more questions.