Ñò Ã#xPc @s¹dZddklZlZddklZddklZlZddkl Z ddkl Z ddk l Z ddk lZdd klZd efd „ƒYZeieƒd S( s Plugin to make multiple ipa calls via one remote procedure call To run this code in the lite-server curl -H "Content-Type:application/json" -H "Accept:application/json" -H "Accept-Language:en" --negotiate -u : --cacert /etc/ipa/ca.crt -d @batch_request.json -X POST http://localhost:8888/ipa/json where the contents of the file batch_request.json follow the below example {"method":"batch","params":[[ {"method":"group_find","params":[[],{}]}, {"method":"user_find","params":[[],{"whoami":"true","all":"true"}]}, {"method":"user_show","params":[["admin"],{"all":true}]} ],{}],"id":1} The format of the response is nested the same way. At the top you will see "error": null, "id": 1, "result": { "count": 3, "results": [ And then a nested response for each IPA command method sent in the request iÿÿÿÿ(tapiterrors(tCommand(tStrtAny(tOutput(toutput(t_(tcontext(t API_VERSIONtbatchcBs¡eZeZeddedƒƒfZeddddedƒdddd d gd ed eƒfZ e d e ddƒe de e fddƒfZd„ZRS(smethods*tdocsNested Methods to executetversiontcli_names@Client version. Used to determine if server will accept request.texcludetwebuitflagst no_optiont no_outputtdefaulttautofilltcountttresultsc OsSg}x1|dD]%}tƒ}d}yd|jotiddƒ‚nd|jotiddƒ‚n|d}||ijotid|ƒ‚n|d\}}td„|iƒDƒƒ} ti|i|| Ž}ti||| Ž} |i dt i |di ti|i |ƒƒd| d`s s%s: batch: %s(%s): SUCCESSs, terrors %s: batch: %ss%s: batch: %s(%s): %st error_codet error_nameRR(tdicttNoneRtRequirementErrorRt CommandErrort iteritemsRtargs_options_2_paramstinfoRt principaltjoint _repr_itert Exceptiont isinstancet __class__t__name__t PublicErrort InternalErrortstrerrorterrnotunicodettypetappendtlen( tselftargstoptionsRtargRRtatkwtnewkwtresulttetreported_error((s8/usr/lib/python2.6/site-packages/ipalib/plugins/batch.pytexecuteRsH     ,5    (R/t __module__tTruetNO_CLIRRt takes_argsRR t take_optionsRtinttlistttuplet has_outputRB(((s8/usr/lib/python2.6/site-packages/ipalib/plugins/batch.pyR 9s     N(t__doc__tipalibRRRtipalib.parametersRRt ipalib.outputRRt ipalib.textRtipalib.requestRtipapython.versionR R tregister(((s8/usr/lib/python2.6/site-packages/ipalib/plugins/batch.pyt.sE