<html><head><base href="x-msg://18/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>20 aug 2012 kl. 09.38 skrev Omer Frenkel:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; color: rgb(0, 0, 0); ">adding Ori, comment inside<br><br><hr id="zwchr"><blockquote style="border-left-width: 2px; border-left-style: solid; border-left-color: 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; "><b>From:<span class="Apple-converted-space"> </span></b>"Karli Sjöberg" <<a href="mailto:Karli.Sjoberg@slu.se">Karli.Sjoberg@slu.se</a>><br><b>To:<span class="Apple-converted-space"> </span></b>"Karli Sjöberg" <<a href="mailto:Karli.Sjoberg@slu.se">Karli.Sjoberg@slu.se</a>><br><b>Cc:<span class="Apple-converted-space"> </span></b>"users" <<a href="mailto:users@ovirt.org">users@ovirt.org</a>><br><b>Sent:<span class="Apple-converted-space"> </span></b>Monday, August 20, 2012 9:25:19 AM<br><b>Subject:<span class="Apple-converted-space"> </span></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></div></div></span></blockquote><div><br></div>Well, mostly because our domain is quite oddly set up, called "<b>ad.</b><a href="http://slu.se">slu.se</a>"(long story), while users are called only "<a href="mailto:user@slu.se">user@slu.se</a>", and I thought that maybe you´d have to be specific about that. I can try add another user without <domain id> specified, but does that have an impact to the redirection(/api/api/) you get back?<br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; color: rgb(0, 0, 0); "><blockquote style="border-left-width: 2px; border-left-style: solid; border-left-color: 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<span class="Apple-converted-space"> </span><a href="http://engine.slu.se" target="_blank">engine.slu.se</a><span class="Apple-converted-space"> </span>port 80 (#0)</div><div>* Trying XXX.XXX.XXX.XXX... connected</div><div>* Connected to<span class="Apple-converted-space"> </span><a href="http://engine.slu.se" target="_blank">engine.slu.se</a><span class="Apple-converted-space"> </span>(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:<span class="Apple-converted-space"> </span><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:<span class="Apple-converted-space"> </span><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:<span class="Apple-converted-space"> </span><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<span class="Apple-converted-space"> </span><a href="mailto:somename@foo.bar" target="_blank">somename@foo.bar</a><span class="Apple-converted-space"> </span>--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><a href="http://lists.ovirt.org/mailman/listinfo/users">http://lists.ovirt.org/mailman/listinfo/users</a><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><a href="mailto:Users@ovirt.org">Users@ovirt.org</a><br><a href="http://lists.ovirt.org/mailman/listinfo/users">http://lists.ovirt.org/mailman/listinfo/users</a><br></blockquote><br></div></div></span><br class="Apple-interchange-newline"></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><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></span>
</div>
<br></body></html>