Ñò
Ã#xPc @ s¹ d Z d d k l Z l Z d d k l Z d d k l Z l Z d d k l Z d d k l
Z
d d k l Z d d k
l Z d d k l Z d
e f d „ ƒ YZ e i e ƒ 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ÿÿÿÿ( t apit errors( t Command( t Strt Any( t Output( t output( t _( t context( t API_VERSIONt batchc B s¡ e Z e Z e d d e d ƒ ƒf Z e d d d d e d ƒ d d d d d
g d e d e ƒf Z e
d
e d d ƒe
d e e
f d d ƒf Z d „ Z RS( s methods*t docs Nested Methods to executet versiont cli_names@ Client version. Used to determine if server will accept request.t excludet webuit flagst no_optiont no_outputt defaultt autofillt countt t resultsc
O sS g } x1| d D]%} t ƒ } d } yd | j o t i d d ƒ ‚ n d | j o t i d d ƒ ‚ n | d } | | i j o t i d | ƒ ‚ n | d \ } } t d „ | i ƒ Dƒ ƒ } t i | i | | Ž } t i | | | Ž }
| i d t
i | d i t i | i
| ƒ ƒ d |
d