<div dir="ltr">These posts have all been really helpful (especially -vv... its mostly trivial to translate to JSON from the XML).  Thanks a lot for the suggestions!<div><br></div><div style>I do have one question that might be a new thread, but for me its related.  I've added a service account user to the <span style="background-color:rgb(250,250,250);color:rgb(72,72,72);font-size:11.818181991577148px">passSyncManagersDNs multi-valued list to avoid the initial account expiration, but it seems to put a 3 month expiration on the account despite the fact that my global password policy is 180 days.  Anyone know what gives?</span></div>
<div style><span style="background-color:rgb(250,250,250);color:rgb(72,72,72);font-size:11.818181991577148px"><br></span></div><div style><span style="background-color:rgb(250,250,250);color:rgb(72,72,72);font-size:11.818181991577148px">Thanks again!</span></div>
<div style><font color="#484848"><span style="font-size:12px">-Brian</span></font></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jan 15, 2013 at 6:55 AM, Petr Vobornik <span dir="ltr"><<a href="mailto:pvoborni@redhat.com" target="_blank">pvoborni@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Spying Web UI might be another way how to learn the API.<br>
<br>
Web UI uses JSON interface for everything it does. You can open developer tools in Chrome (hit F12) and watch communication (network tab). Do something and then look for requests named 'json' a inspect the request payload.<br>

<br>
To inspect the API alone you can go through metadata (in console tab) which are stored in IPA.metadata object but I guess inspecting python code might be easier.<br>
<br>
HTH<div class="im"><br>
<br>
On 01/15/2013 03:55 AM, Brian Smith wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
That helps a lot.  Thanks!  I would use ipalib, but I'm developing a Rails<br>
application, so the JSON interface is the quickest (and since XML may be<br>
deprecated) best way forward (unless you know a way to use it in Ruby :).<br>
  I'm guessing in JSON, the structure would look something like this:<br>
<br>
{<br>
   "method": "user_add",<br>
   "params": [<br>
     [],<br>
     {<br>
       "uid":"testuser",<br>
       "givenname":"Test",<br>
       "sn":"User",<br>
       "userpassword":"<u></u>mySecretPasswordBlahBlah"<br>
       ...<br>
     }<br>
   ]<br>
}<br>
<br>
Maybe I'll try to compile some documentation.  I know that this page helped<br>
a lot, to cook up a quick ruby client with Curb:<br>
<a href="http://adam.younglogic.com/2010/07/talking-to-freeipa-json-web-api-via-curl/" target="_blank">http://adam.younglogic.com/<u></u>2010/07/talking-to-freeipa-<u></u>json-web-api-via-curl/</a><br>
<br>
<br>
On Mon, Jan 14, 2013 at 9:35 PM, Rob Crittenden <<a href="mailto:rcritten@redhat.com" target="_blank">rcritten@redhat.com</a>> wrote:<br>
<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Dmitri Pal wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 01/14/2013 08:16 PM, Brian Smith wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Before I pester the dev list, I was wondering if anyone here could<br>
point me to documentation on the JSON-RPC interface to FreeIPA.  I'm<br>
not doing anything fancy, just adding users and updating passwords, so<br>
my requirements are pretty tame.  I've gone through the Python code<br>
and have somewhat pieced it together myself, but would be more<br>
comfortable if there were official docs.<br>
<br>
  I do not remember us having documentation about XML-RPC but I will<br>
</blockquote>
check.<br>
We are actually debating deprecating XML-RPC over time in favor of JSON.<br>
<br>
</blockquote>
<br>
There is no official documentation on either XML-RPC or JSON. The format<br>
is rather straightforward once you get the hang of things. Each command is<br>
effectively an RPC function (e.g ipa user-add -> user_add). The arguments<br>
consist of positional arguments followed by named arguments (there is<br>
usually only one positional arg).<br>
<br>
For XML-RPC it is generally fairly easy to work out what it's doing by<br>
adding -vv option to the command-line to see the raw request and response.<br>
I personally haven't done a lot of raw JSON work.<br>
<br>
The final option is to skip all that and use the ipalib to do the work for<br>
you.<br>
<br>
For example, to add a user you'd do something like:<br>
<br>
from ipalib import api<br>
from ipalib import errors<br>
<br>
api.bootstrap(context='cli')<br>
api.finalize()<br></div></div>
api.Backend.xmlclient.connect(<u></u>**)<br>
<br>
try:<br>
     api.Command['user_add'](u'**<u></u>newuser',<div class="im"><br>
                             loginshell=u'/bin/something',<br>
                             givenname=u'New', sn=u'User')<br>
except errors.DuplicateEntry:<br>
     print "user already exists"<br>
else:<br>
     print "user added"<br>
<br>
<br>
</div></blockquote><div class="im">
<br>
______________________________<u></u>_________________<br>
Freeipa-users mailing list<br>
<a href="mailto:Freeipa-users@redhat.com" target="_blank">Freeipa-users@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/freeipa-users" target="_blank">https://www.redhat.com/<u></u>mailman/listinfo/freeipa-users</a><br>
<br>
</div></blockquote><span class="HOEnZb"><font color="#888888">
<br>
<br>
-- <br>
Petr Vobornik<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><font color="#999999"><font face="'courier new', monospace">Brian Smith</font></font></div><div><span style="font-family:'courier new',monospace;color:rgb(153,153,153)">Assistant Director</span></div>
<div><span style="font-family:'courier new',monospace;color:rgb(153,153,153)">Research Computing, University of South Florida</span></div><div><font color="#999999"><font face="'courier new', monospace">4202 E. Fowler Ave. SVC4010</font></font></div>
<div><font color="#999999"><font face="'courier new', monospace">Office Phone: +1 813 974-1467</font></font></div><div><font color="#999999"><font face="'courier new', monospace">Organization URL: <a href="http://rc.usf.edu" target="_blank">http://rc.usf.edu</a></font></font></div>

</div>