On Wed, 02 Dec 2015, Marc Boorshtein wrote:
Rob & Martin,
Thanks. This is a great resource. Is there a way to generate sample
JSONs for each command? For instance, when I make a call to
user_search, I use the following:
String lookupjson =
"{\"method\":\"batch\",\"params\":[[{\"method\":\"user_show\",\"params\":[[\""
+ userID +
"\"],{\"all\":true,\"rights\":true}]},{\"method\":\"pwpolicy_show\",\"params\":[[],{\"user\":\""
+ userID +
"\",\"all\":true,\"rights\":true}]},{\"method\":\"krbtpolicy_show\",\"params\":[[\""
+ userID + "\"],{\"all\":true,\"rights\":true}]}],{\"version\":\"2.112\"}]}";
This was figured out by reverse engineering the calls from the browser
to IPA Web. Looking at the API browser its clear that using batch
here is probably overkill. Based on the api browser I think I can do:
{
"method":"user_show",
"params":[
["myuser"],
{
"all":true,
"rights":true
}
]
}
Is that accurate? For the result object, is there something documented?
just use 'ipa -vv user-show ...' to see formatted JSON.
Did you read my article?
https://vda.li/en/posts/2015/05/28/talking-to-freeipa-api-with-sessions/
--
/ Alexander Bokovoy
--
Manage your subscription for the Freeipa-users mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-users
Go to http://freeipa.org for more info on the project