<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000'>adding Ori, comment inside<br><br><hr id="zwchr"><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Karli Sjöberg" <Karli.Sjoberg@slu.se><br><b>To: </b>"Karli Sjöberg" <Karli.Sjoberg@slu.se><br><b>Cc: </b>"users" <users@ovirt.org><br><b>Sent: </b>Monday, August 20, 2012 9:25:19 AM<br><b>Subject: </b>Re: [Users] Create domain user with api<br><br>Hey all, I kind of figured this out on my own. Still have some kinks to iron out, from the web perspective, but I´ll get back to you on that. In the mean time I noticed a rather strange redirection sent back when adding a user. Check this out:<div><br></div><div># curl -v -X POST -H "Accept: application/xml" -H "Accept: application/xml" -H "Content-type: application/xml" -u admin@internal:letmein! -T upload.xml <a href="http://engine.slu.se:80/api/users" target="_blank">http://engine.slu.se:80/api/users</a></div><div><br></div><div>upload.xml:</div><div><div><user></div><div> <user_name>somename@slu.se</user_name></div><div> <domain id="61642e73-6c75-2e73-6561-642e736c752e" /></div><div id="DWT3381"> </div></div></blockquote>maybe i missed something, but why you have domain id under user?<br>user entity has 'domain' which is the directory server.<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><div><div><roles></roles></div><div> <role></div><div> <name>SomeRole</name></div><div> </role></div><div> </roles></div><div></user></div></div><div><br></div><div><div>* About to connect() to <a href="http://engine.slu.se" target="_blank">engine.slu.se</a> port 80 (#0)</div><div>* Trying XXX.XXX.XXX.XXX... connected</div><div>* Connected to <a href="http://engine.slu.se" target="_blank">engine.slu.se</a> (XXX.XXX.XXX.XXX) port 80 (#0)</div><div>* Server auth using Basic with user 'admin@internal'</div><div>POST /api/users HTTP/1.1</div><div>Authorization: Basic YWRtaW5AaW50ZXJuYGH4UiXVhaDJkYWk=</div><div>User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8r zlib/1.2.3</div><div>Host: <a href="http://engine.slu.se" target="_blank">engine.slu.se</a></div><div>Accept: application/xml</div><div>Accept: application/xml</div><div>Content-type: application/xml</div><div>Content-Length: 184</div><div>Expect: 100-continue</div><div><br></div><div>< HTTP/1.1 100 Continue</div><div>< HTTP/1.1 201 Created</div><div>< Date: Fri, 17 Aug 2012 13:47:00 GMT</div><div>< Set-Cookie: JSESSIONID=LXBbH1Wcmv-jepsSl06FtMaA.undefined; Path=/api</div><div>< Location: <a href="http://engine.slu.se" target="_blank">http://engine.slu.se</a><b>/api/api/</b>domains/61642e73-6c75-2e73-6561-642e736c752e/users/94155e69-4691-4cbb-a6b5-d30a6bd5b667</div><div>< Content-Type: application/xml</div><div>< Connection: close</div><div>< Transfer-Encoding: chunked</div><div><</div><div><br></div><div>That Location is invalid. Proper location would be:</div><div>< Location: <a href="http://engine.slu.se/" target="_blank">http://engine.slu.se/</a>api/domains/61642e73-6c75-2e73-6561-642e736c752e/users/94155e69-4691-4cbb-a6b5-d30a6bd5b667</div><div><br></div><div>Bug?</div><div><br></div><div>/Karli</div><div><br></div><div><div>17 aug 2012 kl. 10.45 skrev Karli Sjöberg:</div><br class="Apple-interchange-newline"><blockquote><div style="word-wrap: break-word;">Hey all,<div><br></div><div>using "ovirt-shell" I can do:</div><div>$ create user --user_name <a href="mailto:somename@foo.bar" target="_blank">somename@foo.bar</a> --domain-name something.foo.bar</div><div><br></div><div>How do express that as a POST with the api? Could you provide a xml example?</div><div><br><div>
<div><br class="Apple-interchange-newline"><br></div><div>Med Vänliga Hälsningar<br>-------------------------------------------------------------------------------<br>Karli Sjöberg<br>Swedish University of Agricultural Sciences<br>Box 7079 (Visiting Address Kronåsvägen 8)<br>S-750 07 Uppsala, Sweden<br>Phone: +46-(0)18-67 15 66</div><div><a href="mailto:karli.sjoberg@adm.slu.se" target="_blank">karli.sjoberg@slu.se</a></div>
</div>
<br></div></div>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@ovirt.org" target="_blank">Users@ovirt.org</a><br>http://lists.ovirt.org/mailman/listinfo/users<br></blockquote></div><br><div>
<div><br class="Apple-interchange-newline"><br></div><div>Med Vänliga Hälsningar<br>-------------------------------------------------------------------------------<br>Karli Sjöberg<br>Swedish University of Agricultural Sciences<br>Box 7079 (Visiting Address Kronåsvägen 8)<br>S-750 07 Uppsala, Sweden<br>Phone: +46-(0)18-67 15 66</div><div><a href="mailto:karli.sjoberg@adm.slu.se" target="_blank">karli.sjoberg@slu.se</a></div>
</div>
<br></div><br>_______________________________________________<br>Users mailing list<br>Users@ovirt.org<br>http://lists.ovirt.org/mailman/listinfo/users<br></blockquote><br></div></body></html>