<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">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">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> <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">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">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">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">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/">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 type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hey all,<div><br></div><div>using "ovirt-shell" I can do:</div><div>$ create user --user_name <a href="mailto:somename@foo.bar">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">karli.sjoberg@slu.se</a></div>
</div>
<br></div></div>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@ovirt.org">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">karli.sjoberg@slu.se</a></div>
</div>
<br></div></body></html>