<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta http-equiv="content-type"
 content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
I think I have an approach that will work for pacaking up multiple
commands at once.<br>
<br>
Stage 1:<br>
<br>
<br>
1.  We create a new plugin, we call it bulk.  For now, it will speak
only JSON.<br>
<br>
2.  The  json requests look like this:<br>
<br>
<br>
<code role="listitem" class="focusRow subFocusRow ">{"method":"bulk","params":[[</code><br>
<code role="listitem" class="focusRow subFocusRow ">   
{"method":"user_find","params":[[""],{}]},</code><br>
<code role="listitem" class="focusRow subFocusRow ">   
{"method":"user_show","params":[[""],{}]},</code><br>
<code role="listitem" class="focusRow subFocusRow ">   
{"method":"user_add","params":[[""],{}]},</code><br>
    <code role="listitem" class="focusRow subFocusRow ">{"method":"user_blah","params":[[""],{}]}</code>,<br>
<code role="listitem" class="focusRow subFocusRow ">],{"all":true,"sizelimit":100}],"id":2}</code><br>
<br>
<br>
This gets sent as a single json_request.  <br>
<br>
On the server side, each request is pulled out of the params  and the
common items all=true and sizelimit=100 is added to each request.  The
resulting json request is then executed locally, without re-requiring
the kerberos auth.  THe response from the individual requests are put
into the response array,  like so:<br>
<br>
<pre role="list"><code class="wrappedText focusRow" role="listitem">{
</code><code class="wrappedText focusRow" role="listitem">    "error": null, 
</code><code class="wrappedText focusRow" role="listitem">    "id": 2, 
</code><code class="wrappedText focusRow" role="listitem">    "result": {
</code><code class="wrappedText focusRow" role="listitem">        "count": 1, 
</code><code class="wrappedText focusRow" role="listitem">        "result": [{                         
</code><code class="wrappedText focusRow" role="listitem">          "error": null,                                          //start of the response for the first nested command.
</code><code class="wrappedText focusRow" role="listitem">          "id": 1, 
</code><code class="wrappedText focusRow" role="listitem">          "result": {
</code><code class="wrappedText focusRow" role="listitem">              "count": 1, 
</code><code class="wrappedText focusRow" role="listitem">              "result": [
</code><code class="wrappedText focusRow" role="listitem">                  {
</code><code class="wrappedText focusRow" role="listitem">                      "cn": [
</code><code class="wrappedText focusRow" role="listitem">                      "Administrator"
</code><code class="wrappedText focusRow" role="listitem">                      ], </code>
</pre>
...<br>
<br>
Thus the plugin is responsible for processing each request, marshalling
up the return and adding it to the current response.<br>
<br>
<br>
<br>
<br>
Stage 2:  we add an asynchronous mechanism.  We add an option for the
email notification address to the bulk plugin.  The response returns
immediately.  Meanwhile, the plugin hands off the processing of the
initial request to a queue that will be handled by another thread or
process, and email the response to the address.  Alternatively, we
email back just an abbreviated status message.<br>
<br>
<br>
Stage 3:  Store the response in a filesystem or the DirSrv, and mail
back a link that allows the user to fetch the status.<br>
<br>
<br>
<br>
<br>
I really only care about Stage 1 for now.  THe json_metadata plugin is
getting loaded up with too many unrelated calls in it.  I'd like to be
able to craft and arbitraty message that gets sent and returned with
all of the information required to initialize the IPA Web UI.<br>
<br>
user-find  --whoami<br>
json_metadata<br>
I18N_messages<br>
Effective rights<br>
plugin lists (to enable/disable UI features based on what is active)<br>
<br>
While we would do this initially as a JSON only call, the XML-RPC
should nest the same way.  I leave it to Rob and Simo to figureo ut if
this would support the CLI, but it seems to me that it should be pretty
easy to do:<br>
<br>
<br>
ipa bulk<br>
>ipa user-mod ...<br>
>ipa user-del ...<br>
>upa group-add ...<br>
^D<br>
<br>
And have that sent as a single command, with the responses again parsed
out by the cli.  Then the user can do:<br>
<br>
cat mycommands | ipa bulk > bulk.response<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</body>
</html>