Jens Günther writes:
Thanks for this advice. I did read the doc and figured out, that PUT and PATCH for my concerns should be the right way to do it:
I'm not real sure about the semantics of those verbs, but I imagine Barry did it right.
So my main question is now: does anybody know of a possibility with this command to extract only writable attributes!?
If you mean doing this so you can PUT all of those at once, I'm pretty sure it doesn't work that way. PUT creates or replaces a whole object. If there's an existing value with read-only attributes, that's not going to work. It may be possible to specify multiple values to PATCH, but that's beyond my knowledge.
Getting the config: curl -u restadmin:restpass localhost:8001/3.1/lists/listname.domain/config | jq > listname.domain
Do you need to use curl (or anything other than Python 3) to do your work for some reason? Life is a lot easier if you use mailmanclient.
-> one has to be careful when deleting attributes, at the end of an array, there must not be a "," (!) :-)
Yeah, JSON objects are not Python dicts, no, nope, everybody's been burned before. ;-)
Just tried getting all the members: curl -u restadmin:restpass localhost:8001/3.1/lists/listname.domain/roster/member | jq > listname.domain.members
But putting them back seems to be a different thing: curl -u restadmin:restpass -d @listname.domain.members -H "Content-Type: application/json" -X PUT localhost:8001/3.1/lists/listname.domain/roster/members
Do you mean the difference between roster/member and roster/members? Not sure why the would be, would have to look at the source.
Happy new year!
Steve