[Users] Create domain user with api

--_000_1509062340F941AB9C2F35EABE0BD4AAsluse_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hey all, using "ovirt-shell" I can do: $ create user --user_name somename@foo.bar<mailto:somename@foo.bar> --domai= n-name something.foo.bar How do express that as a POST with the api? Could you provide a xml example= ? Med V=E4nliga H=E4lsningar ---------------------------------------------------------------------------= ---- Karli Sj=F6berg Swedish University of Agricultural Sciences Box 7079 (Visiting Address Kron=E5sv=E4gen 8) S-750 07 Uppsala, Sweden Phone: +46-(0)18-67 15 66 karli.sjoberg@slu.se<mailto:karli.sjoberg@adm.slu.se> --_000_1509062340F941AB9C2F35EABE0BD4AAsluse_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <html><head></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode:= space; -webkit-line-break: after-white-space; ">Hey all,<div><br></div><di= v>using "ovirt-shell" I can do:</div><div>$ create user --user_name <a= href=3D"mailto:somename@foo.bar">somename@foo.bar</a> --domain-name someth= ing.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> <span class=3D"Apple-style-span" style=3D"border-collapse: separate; color:= rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: no= rmal; font-weight: normal; letter-spacing: normal; line-height: normal; orp= hans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; = white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizonta= l-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorati= ons-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-wi= dth: 0px; font-size: medium; "><div><br class=3D"Apple-interchange-newline"=
<br></div><div>Med V=E4nliga H=E4lsningar<br>-----------------------------= --------------------------------------------------<br>Karli Sj=F6berg<br>Sw= edish University of Agricultural Sciences<br>Box 7079 (Visiting Address Kro= n=E5sv=E4gen 8)<br>S-750 07 Uppsala, Sweden<br>Phone: +46-(0)18-67 15= 66</div><div><a href=3D"mailto:karli.sjoberg@adm.slu.se">karli.sjoberg@slu= .se</a></div></span> </div> <br></div></body></html>=
--_000_1509062340F941AB9C2F35EABE0BD4AAsluse_--

--_000_0684264A6C09444FA8F28E1BCFEA6614sluse_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hey all, I kind of figured this out on my own. Still have some kinks to iro= n out, from the web perspective, but I=B4ll get back to you on that. In the= mean time I noticed a rather strange redirection sent back when adding a u= ser. Check this out: # curl -v -X POST -H "Accept: application/xml" -H "Accept: application/xml"= -H "Content-type: application/xml" -u admin@internal:letmein! -T upload.xm= l http://engine.slu.se:80/api/users upload.xml: <user> <user_name>somename@slu.se</user_name> <domain id=3D"61642e73-6c75-2e73-6561-642e736c752e" /> <roles> <role> <name>SomeRole</name> </role> </roles> </user> * About to connect() to engine.slu.se<http://engine.slu.se> port 80 (#0) * Trying XXX.XXX.XXX.XXX... connected * Connected to engine.slu.se<http://engine.slu.se> (XXX.XXX.XXX.XXX) port 8= 0 (#0) * Server auth using Basic with user 'admin@internal' POST /api/users HTTP/1.1 Authorization: Basic YWRtaW5AaW50ZXJuYGH4UiXVhaDJkYWk=3D User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL= /0.9.8r zlib/1.2.3 Host: engine.slu.se<http://engine.slu.se> Accept: application/xml Accept: application/xml Content-type: application/xml Content-Length: 184 Expect: 100-continue < HTTP/1.1 100 Continue < HTTP/1.1 201 Created < Date: Fri, 17 Aug 2012 13:47:00 GMT < Set-Cookie: JSESSIONID=3DLXBbH1Wcmv-jepsSl06FtMaA.undefined; Path=3D/api < Location: http://engine.slu.se/api/api/domains/61642e73-6c75-2e73-6561-64= 2e736c752e/users/94155e69-4691-4cbb-a6b5-d30a6bd5b667 < Content-Type: application/xml < Connection: close < Transfer-Encoding: chunked < That Location is invalid. Proper location would be: < Location: http://engine.slu.se/api/domains/61642e73-6c75-2e73-6561-642e73= 6c752e/users/94155e69-4691-4cbb-a6b5-d30a6bd5b667 Bug? /Karli 17 aug 2012 kl. 10.45 skrev Karli Sj=F6berg: Hey all, using "ovirt-shell" I can do: $ create user --user_name somename@foo.bar<mailto:somename@foo.bar> --domai= n-name something.foo.bar How do express that as a POST with the api? Could you provide a xml example= ? Med V=E4nliga H=E4lsningar ---------------------------------------------------------------------------= ---- Karli Sj=F6berg Swedish University of Agricultural Sciences Box 7079 (Visiting Address Kron=E5sv=E4gen 8) S-750 07 Uppsala, Sweden Phone: +46-(0)18-67 15 66 karli.sjoberg@slu.se<mailto:karli.sjoberg@adm.slu.se> _______________________________________________ Users mailing list Users@ovirt.org<mailto:Users@ovirt.org> http://lists.ovirt.org/mailman/listinfo/users Med V=E4nliga H=E4lsningar ---------------------------------------------------------------------------= ---- Karli Sj=F6berg Swedish University of Agricultural Sciences Box 7079 (Visiting Address Kron=E5sv=E4gen 8) S-750 07 Uppsala, Sweden Phone: +46-(0)18-67 15 66 karli.sjoberg@slu.se<mailto:karli.sjoberg@adm.slu.se> --_000_0684264A6C09444FA8F28E1BCFEA6614sluse_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <html><head></head><body style=3D"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 perspe= ctive, but I=B4ll get back to you on that. In the mean time I noticed a rat= her strange redirection sent back when adding a user. Check this out:<div><= br></div><div># curl -v -X POST -H "Accept: application/xml" -H "Accep= t: application/xml" -H "Content-type: application/xml" -u admin@internal:le= tmein! -T upload.xml <a href=3D"http://engine.slu.se:80/api/users">http://e= ngine.slu.se:80/api/users</a></div><div><br></div><div>upload.xml:</div><di= v><div><user></div><div> <user_name>somename@slu.se</u= ser_name></div><div> <domain id=3D"61642e73-6c75-2e73-6561-642e= 736c752e" /></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=3D"http://engine.slu.se">engine.slu.se</a> port 80 (#0)</div><di= v>* Trying XXX.XXX.XXX.XXX... connected</div><div>* Connected to <a = href=3D"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><di= v>POST /api/users HTTP/1.1</div><div>Authorization: Basic YWRtaW5AaW50ZXJuY= GH4UiXVhaDJkYWk=3D</div><div>User-Agent: curl/7.19.7 (universal-apple-darwi= n10.0) libcurl/7.19.7 OpenSSL/0.9.8r zlib/1.2.3</div><div>Host: <a href=3D"= http://engine.slu.se">engine.slu.se</a></div><div>Accept: application/xml</= div><div>Accept: application/xml</div><div>Content-type: application/xml</d= iv><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</di= v><div>< Date: Fri, 17 Aug 2012 13:47:00 GMT</div><div>< Set-Cookie: = JSESSIONID=3DLXBbH1Wcmv-jepsSl06FtMaA.undefined; Path=3D/api</div><div><= Location: <a href=3D"http://engine.slu.se">http://engine.slu.se</a><b>/api= /api/</b>domains/61642e73-6c75-2e73-6561-642e736c752e/users/94155e69-4691-4= cbb-a6b5-d30a6bd5b667</div><div>< Content-Type: application/xml</div><di= v>< Connection: close</div><div>< Transfer-Encoding: chunked</div><di= v><</div><div><br></div><div>That Location is invalid. Proper location w= ould be:</div><div>< Location: <a href=3D"http://engine.slu.se/">http://= engine.slu.se/</a>api/domains/61642e73-6c75-2e73-6561-642e736c752e/users/94= 155e69-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 s= krev Karli Sj=F6berg:</div><br class=3D"Apple-interchange-newline"><blockqu= ote type=3D"cite"><div style=3D"word-wrap: break-word; -webkit-nbsp-mode: s= pace; -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 h= ref=3D"mailto:somename@foo.bar">somename@foo.bar</a> --domain-name somethin= g.foo.bar</div><div><br></div><div>How do express that as a POST with the a= pi? Could you provide a xml example?</div><div><br><div> <div><br class=3D"Apple-interchange-newline"><br></div><div>Med V=E4nliga H= =E4lsningar<br>------------------------------------------------------------= -------------------<br>Karli Sj=F6berg<br>Swedish University of Agricultura= l Sciences<br>Box 7079 (Visiting Address Kron=E5sv=E4gen 8)<br>S-750 07 Upp= sala, Sweden<br>Phone: +46-(0)18-67 15 66</div><div><a href=3D"mailto= :karli.sjoberg@adm.slu.se">karli.sjoberg@slu.se</a></div> </div> <br></div></div>_______________________________________________<br>Users ma= iling list<br><a href=3D"mailto:Users@ovirt.org">Users@ovirt.org</a><br>htt= p://lists.ovirt.org/mailman/listinfo/users<br></blockquote></div><br><div> <div><br class=3D"Apple-interchange-newline"><br></div><div>Med V=E4nliga H= =E4lsningar<br>------------------------------------------------------------= -------------------<br>Karli Sj=F6berg<br>Swedish University of Agricultura= l Sciences<br>Box 7079 (Visiting Address Kron=E5sv=E4gen 8)<br>S-750 07 Upp= sala, Sweden<br>Phone: +46-(0)18-67 15 66</div><div><a href=3D"mailto= :karli.sjoberg@adm.slu.se">karli.sjoberg@slu.se</a></div> </div> <br></div></body></html>= --_000_0684264A6C09444FA8F28E1BCFEA6614sluse_--

------=_Part_32071891_1853162604.1345448307836 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable adding Ori, comment inside=20 ----- Original Message -----
From: "Karli Sj=C3=B6berg" <Karli.Sjoberg@slu.se> To: "Karli Sj=C3=B6berg" <Karli.Sjoberg@slu.se> Cc: "users" <users@ovirt.org> Sent: Monday, August 20, 2012 9:25:19 AM Subject: Re: [Users] Create domain user with api
Hey all, I kind of figured this out on my own. Still have some kinks to iron out, from the web perspective, but I=C2=B4ll 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:
# curl -v -X POST -H "Accept: application/xml" -H "Accept: application/xml" -H "Content-type: application/xml" -u admin@internal:letmein! -T upload.xml http://engine.slu.se:80/api/users
upload.xml:
<user> <user_name>somename@slu.se</user_name> <domain id=3D"61642e73-6c75-2e73-6561-642e736c752e" />
maybe i missed something, but why you have domain id under user?=20 user entity has 'domain' which is the directory server.=20
<role> <name>SomeRole</name> </role> </roles> </user>
* About to connect() to engine.slu.se port 80 (#0) * Trying XXX.XXX.XXX.XXX... connected * Connected to engine.slu.se (XXX.XXX.XXX.XXX) port 80 (#0) * Server auth using Basic with user 'admin@internal' POST /api/users HTTP/1.1 Authorization: Basic YWRtaW5AaW50ZXJuYGH4UiXVhaDJkYWk=3D User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8r zlib/1.2.3 Host: engine.slu.se Accept: application/xml Accept: application/xml Content-type: application/xml Content-Length: 184 Expect: 100-continue
< HTTP/1.1 100 Continue < HTTP/1.1 201 Created < Date: Fri, 17 Aug 2012 13:47:00 GMT < Set-Cookie: JSESSIONID=3DLXBbH1Wcmv-jepsSl06FtMaA.undefined; Path=3D/api < Location: http://engine.slu.se /api/api/ domains/61642e73-6c75-2e73-6561-642e736c752e/users/94155e69-4691-4cbb-a6b= 5-d30a6bd5b667 < Content-Type: application/xml < Connection: close < Transfer-Encoding: chunked <
That Location is invalid. Proper location would be: < Location: http://engine.slu.se/ api/domains/61642e73-6c75-2e73-6561-642e736c752e/users/94155e69-4691-4cbb= -a6b5-d30a6bd5b667
Bug?
/Karli
17 aug 2012 kl. 10.45 skrev Karli Sj=C3=B6berg:
Hey all, =20
using "ovirt-shell" I can do: =20 $ create user --user_name somename@foo.bar --domain-name something.foo.bar =20
How do express that as a POST with the api? Could you provide a xml example? =20
Med V=C3=A4nliga H=C3=A4lsningar =20 -----------------------------------------------------------------------=
=20
Karli Sj=C3=B6berg =20 Swedish University of Agricultural Sciences =20 Box 7079 (Visiting Address Kron=C3=A5sv=C3=A4gen 8) =20 S-750 07 Uppsala, Sweden =20 Phone: +46-(0)18-67 15 66 =20 karli.sjoberg@slu.se =20 _______________________________________________ =20 Users mailing list =20 Users@ovirt.org =20 http://lists.ovirt.org/mailman/listinfo/users =20
Med V=C3=A4nliga H=C3=A4lsningar -------------------------------------------------------------------------=
Karli Sj=C3=B6berg Swedish University of Agricultural Sciences Box 7079 (Visiting Address Kron=C3=A5sv=C3=A4gen 8) S-750 07 Uppsala, Sweden Phone: +46-(0)18-67 15 66 karli.sjoberg@slu.se
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
engine.slu.se</a></div><div>Accept: application/xml</div><div>Accept: appl= ication/xml</div><div>Content-type: application/xml</div><div>Content-Lengt= h: 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=3DLXBbH1Wc= mv-jepsSl06FtMaA.undefined; Path=3D/api</div><div>< Location: <a href=3D= "http://engine.slu.se" target=3D"_blank">http://engine.slu.se</a><b>/api/ap= i/</b>domains/61642e73-6c75-2e73-6561-642e736c752e/users/94155e69-4691-4cbb= -a6b5-d30a6bd5b667</div><div>< Content-Type: application/xml</div><div>&= lt; Connection: close</div><div>< Transfer-Encoding: chunked</div><div>&= lt;</div><div><br></div><div>That Location is invalid. Proper location woul= d be:</div><div>< Location: <a href=3D"http://engine.slu.se/" target=3D"= _blank">http://engine.slu.se/</a>api/domains/61642e73-6c75-2e73-6561-642e73= 6c752e/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 2= 012 kl. 10.45 skrev Karli Sj=C3=B6berg:</div><br class=3D"Apple-interchange= -newline"><blockquote><div style=3D"word-wrap: break-word;">Hey all,<div><b= r></div><div>using "ovirt-shell" I can do:</div><div>$ create user --u= ser_name <a href=3D"mailto:somename@foo.bar" target=3D"_blank">somename@foo= .bar</a> --domain-name something.foo.bar</div><div><br></div><div>How do ex=
------=_Part_32071891_1853162604.1345448307836 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable <html><head><style type=3D'text/css'>p { margin: 0; }</style></head><body><= div style=3D'font-family: times new roman,new york,times,serif; font-size: = 12pt; color: #000000'>adding Ori, comment inside<br><br><hr id=3D"zwchr"><b= lockquote style=3D"border-left:2px solid rgb(16, 16, 255);margin-left:5px;p= adding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decora= tion:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: = </b>"Karli Sj=C3=B6berg" <Karli.Sjoberg@slu.se><br><b>To: </b>"Karli = Sj=C3=B6berg" <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>Subj= ect: </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=C2=B4ll get back to you on that. In the mean time I not= iced 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@i= nternal:letmein! -T upload.xml <a href=3D"http://engine.slu.se:80/api/users= " target=3D"_blank">http://engine.slu.se:80/api/users</a></div><div><br></d= iv><div>upload.xml:</div><div><div><user></div><div> <user_n= ame>somename@slu.se</user_name></div><div> <domain id=3D"= 61642e73-6c75-2e73-6561-642e736c752e" /></div><div id=3D"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=3D"border-left: 2px solid rgb(16, 16, 255); margin-lef= t: 5px; padding-left: 5px; color: rgb(0, 0, 0); font-weight: normal; font-s= tyle: normal; text-decoration: none; font-family: Helvetica,Arial,sans-seri= f; 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=3D"http://engine.slu.se" target=3D"_blank">engine.slu.se</a> por= t 80 (#0)</div><div>* Trying XXX.XXX.XXX.XXX... connected</div><div>= * Connected to <a href=3D"http://engine.slu.se" target=3D"_blank">engine.sl= u.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>Au= thorization: Basic YWRtaW5AaW50ZXJuYGH4UiXVhaDJkYWk=3D</div><div>User-Agent= : curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8r zl= ib/1.2.3</div><div>Host: <a href=3D"http://engine.slu.se" target=3D"_blank"= press that as a POST with the api? Could you provide a xml example?</div><d= iv><br><div> <div><br class=3D"Apple-interchange-newline"><br></div><div>Med V=C3=A4nlig= a H=C3=A4lsningar<br>------------------------------------------------------= -------------------------<br>Karli Sj=C3=B6berg<br>Swedish University of Ag= ricultural Sciences<br>Box 7079 (Visiting Address Kron=C3=A5sv=C3=A4gen 8)<= br>S-750 07 Uppsala, Sweden<br>Phone: +46-(0)18-67 15 66</div><div><a= href=3D"mailto:karli.sjoberg@adm.slu.se" target=3D"_blank">karli.sjoberg@s= lu.se</a></div> </div> <br></div></div>_______________________________________________<br>Users ma= iling list<br><a href=3D"mailto:Users@ovirt.org" target=3D"_blank">Users@ov= irt.org</a><br>http://lists.ovirt.org/mailman/listinfo/users<br></blockquot= e></div><br><div> <div><br class=3D"Apple-interchange-newline"><br></div><div>Med V=C3=A4nlig= a H=C3=A4lsningar<br>------------------------------------------------------= -------------------------<br>Karli Sj=C3=B6berg<br>Swedish University of Ag= ricultural Sciences<br>Box 7079 (Visiting Address Kron=C3=A5sv=C3=A4gen 8)<= br>S-750 07 Uppsala, Sweden<br>Phone: +46-(0)18-67 15 66</div><div><a= href=3D"mailto:karli.sjoberg@adm.slu.se" target=3D"_blank">karli.sjoberg@s= lu.se</a></div> </div> <br></div><br>_______________________________________________<br>Users mail= ing list<br>Users@ovirt.org<br>http://lists.ovirt.org/mailman/listinfo/user= s<br></blockquote><br></div></body></html> ------=_Part_32071891_1853162604.1345448307836--

--_000_BFE9D2EE2E224128AEF9C2BD4A65A6E7sluse_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 20 aug 2012 kl. 09.38 skrev Omer Frenkel: adding Ori, comment inside ________________________________ From: "Karli Sj=F6berg" <Karli.Sjoberg@slu.se<mailto:Karli.Sjoberg@slu.se>> To: "Karli Sj=F6berg" <Karli.Sjoberg@slu.se<mailto:Karli.Sjoberg@slu.se>> Cc: "users" <users@ovirt.org<mailto:users@ovirt.org>> Sent: Monday, August 20, 2012 9:25:19 AM Subject: Re: [Users] Create domain user with api Hey all, I kind of figured this out on my own. Still have some kinks to iro= n out, from the web perspective, but I=B4ll get back to you on that. In the= mean time I noticed a rather strange redirection sent back when adding a u= ser. Check this out: # curl -v -X POST -H "Accept: application/xml" -H "Accept: application/xml"= -H "Content-type: application/xml" -u admin@internal:letmein! -T upload.xm= lhttp://engine.slu.se:80/api/users upload.xml: <user> <user_name>somename@slu.se</user_name> <domain id=3D"61642e73-6c75-2e73-6561-642e736c752e" /> maybe i missed something, but why you have domain id under user? user entity has 'domain' which is the directory server. Well, mostly because our domain is quite oddly set up, called "ad.slu.se<ht= tp://slu.se>"(long story), while users are called only "user@slu.se<mailto:= user@slu.se>", and I thought that maybe you=B4d have to be specific about t= hat. I can try add another user without <domain id> specified, but does tha= t have an impact to the redirection(/api/api/) you get back? <role> <name>SomeRole</name> </role> </roles> </user> * About to connect() to engine.slu.se<http://engine.slu.se> port 80 (#0) * Trying XXX.XXX.XXX.XXX... connected * Connected to engine.slu.se<http://engine.slu.se> (XXX.XXX.XXX.XXX) port 8= 0 (#0) * Server auth using Basic with user 'admin@internal' POST /api/users HTTP/1.1 Authorization: Basic YWRtaW5AaW50ZXJuYGH4UiXVhaDJkYWk=3D User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL= /0.9.8r zlib/1.2.3 Host: engine.slu.se<http://engine.slu.se> Accept: application/xml Accept: application/xml Content-type: application/xml Content-Length: 184 Expect: 100-continue < HTTP/1.1 100 Continue < HTTP/1.1 201 Created < Date: Fri, 17 Aug 2012 13:47:00 GMT < Set-Cookie: JSESSIONID=3DLXBbH1Wcmv-jepsSl06FtMaA.undefined; Path=3D/api < Location: http://engine.slu.se/api/api/domains/61642e73-6c75-2e73-6561-64= 2e736c752e/users/94155e69-4691-4cbb-a6b5-d30a6bd5b667 < Content-Type: application/xml < Connection: close < Transfer-Encoding: chunked < That Location is invalid. Proper location would be: < Location: http://engine.slu.se/api/domains/61642e73-6c75-2e73-6561-642e73= 6c752e/users/94155e69-4691-4cbb-a6b5-d30a6bd5b667 Bug? /Karli 17 aug 2012 kl. 10.45 skrev Karli Sj=F6berg: Hey all, using "ovirt-shell" I can do: $ create user --user_name somename@foo.bar<mailto:somename@foo.bar> --domai= n-name something.foo.bar How do express that as a POST with the api? Could you provide a xml example= ? Med V=E4nliga H=E4lsningar ---------------------------------------------------------------------------= ---- Karli Sj=F6berg Swedish University of Agricultural Sciences Box 7079 (Visiting Address Kron=E5sv=E4gen 8) S-750 07 Uppsala, Sweden Phone: +46-(0)18-67 15 66 karli.sjoberg@slu.se<mailto:karli.sjoberg@adm.slu.se> _______________________________________________ Users mailing list Users@ovirt.org<mailto:Users@ovirt.org> http://lists.ovirt.org/mailman/listinfo/users Med V=E4nliga H=E4lsningar ---------------------------------------------------------------------------= ---- Karli Sj=F6berg Swedish University of Agricultural Sciences Box 7079 (Visiting Address Kron=E5sv=E4gen 8) S-750 07 Uppsala, Sweden Phone: +46-(0)18-67 15 66 karli.sjoberg@slu.se<mailto:karli.sjoberg@adm.slu.se> _______________________________________________ Users mailing list Users@ovirt.org<mailto:Users@ovirt.org> http://lists.ovirt.org/mailman/listinfo/users Med V=E4nliga H=E4lsningar ---------------------------------------------------------------------------= ---- Karli Sj=F6berg Swedish University of Agricultural Sciences Box 7079 (Visiting Address Kron=E5sv=E4gen 8) S-750 07 Uppsala, Sweden Phone: +46-(0)18-67 15 66 karli.sjoberg@slu.se<mailto:karli.sjoberg@adm.slu.se> --_000_BFE9D2EE2E224128AEF9C2BD4A65A6E7sluse_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <html><head><base href=3D"x-msg://18/"></head><body style=3D"word-wrap: bre= ak-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=3D"= Apple-interchange-newline"><blockquote type=3D"cite"><span class=3D"Apple-s= tyle-span" style=3D"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-ind= ent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacin= g: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spa= cing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adju= st: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div><div st= yle=3D"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=3D"z= wchr"><blockquote style=3D"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-decorat= ion: none; font-family: Helvetica, Arial, sans-serif; font-size: 12pt; "><b= >From:<span class=3D"Apple-converted-space"> </span></b>"Karli Sj=F6be= rg" <<a href=3D"mailto:Karli.Sjoberg@slu.se">Karli.Sjoberg@slu.se</a>>= ;<br><b>To:<span class=3D"Apple-converted-space"> </span></b>"Karli Sj= =F6berg" <<a href=3D"mailto:Karli.Sjoberg@slu.se">Karli.Sjoberg@slu.se</= a>><br><b>Cc:<span class=3D"Apple-converted-space"> </span></b>"use= rs" <<a href=3D"mailto:users@ovirt.org">users@ovirt.org</a>><br><b>Se= nt:<span class=3D"Apple-converted-space"> </span></b>Monday, August 20= , 2012 9:25:19 AM<br><b>Subject:<span class=3D"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=B4ll get back to you on that. In the mean time I not= iced 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@i= nternal:letmein! -T upload.xml<a href=3D"http://engine.slu.se:80/api/users"= target=3D"_blank">http://engine.slu.se:80/api/users</a></div><div><br></di= v><div>upload.xml:</div><div><div><user></div><div> <user_na= me>somename@slu.se</user_name></div><div> <domain id=3D"6= 1642e73-6c75-2e73-6561-642e736c752e" /></div><div id=3D"DWT3381"> <= /div></div></blockquote>maybe i missed something, but why you have domain i= d under user?<br>user entity has 'domain' which is the directory server.<br= ></div></div></span></blockquote><div><br></div>Well, mostly because our do= main is quite oddly set up, called "<b>ad.</b><a href=3D"http://slu.se">slu= .se</a>"(long story), while users are called only "<a href=3D"mailto:user@s= lu.se">user@slu.se</a>", and I thought that maybe you=B4d have to be specif= ic about that. I can try add another user without <domain id> specifi= ed, but does that have an impact to the redirection(/api/api/) you get back= ?<br><blockquote type=3D"cite"><span class=3D"Apple-style-span" style=3D"bo= rder-collapse: separate; font-family: Helvetica; font-style: normal; font-v= ariant: normal; font-weight: normal; letter-spacing: normal; line-height: n= ormal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transfo= rm: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border= -horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-tex= t-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text= -stroke-width: 0px; font-size: medium; "><div><div style=3D"font-family: 't= imes new roman', 'new york', times, serif; font-size: 12pt; color: rgb(0, 0= , 0); "><blockquote style=3D"border-left-width: 2px; border-left-style: sol= id; border-left-color: rgb(16, 16, 255); margin-left: 5px; padding-left: 5p= x; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decor= ation: none; font-family: Helvetica, Arial, sans-serif; font-size: 12pt; ">= <div><div><roles></roles></div><div> <role></div><div>&n= bsp; <name>SomeRole</name></div><div>  = ; </role></div><div> </roles></div><div></user></di= v></div><div><br></div><div><div>* About to connect() to<span class=3D"Appl= e-converted-space"> </span><a href=3D"http://engine.slu.se" target=3D"= _blank">engine.slu.se</a><span class=3D"Apple-converted-space"> </span= >port 80 (#0)</div><div>* Trying XXX.XXX.XXX.XXX... connected</div><= div>* Connected to<span class=3D"Apple-converted-space"> </span><a hre= f=3D"http://engine.slu.se" target=3D"_blank">engine.slu.se</a><span class= =3D"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 YWRtaW5AaW50ZXJuYGH4UiXVh= aDJkYWk=3D</div><div>User-Agent: curl/7.19.7 (universal-apple-darwin10.0) l= ibcurl/7.19.7 OpenSSL/0.9.8r zlib/1.2.3</div><div>Host:<span class=3D"Apple= -converted-space"> </span><a href=3D"http://engine.slu.se" target=3D"_= 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>< H= TTP/1.1 100 Continue</div><div>< HTTP/1.1 201 Created</div><div>< Dat= e: Fri, 17 Aug 2012 13:47:00 GMT</div><div>< Set-Cookie: JSESSIONID=3DLX= BbH1Wcmv-jepsSl06FtMaA.undefined; Path=3D/api</div><div>< Location:<span= class=3D"Apple-converted-space"> </span><a href=3D"http://engine.slu.= se" target=3D"_blank">http://engine.slu.se</a><b>/api/api/</b>domains/61642= e73-6c75-2e73-6561-642e736c752e/users/94155e69-4691-4cbb-a6b5-d30a6bd5b667<= /div><div>< Content-Type: application/xml</div><div>< Connection: clo= se</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=3D"Apple-converted-space"> </span><a href=3D"ht= tp://engine.slu.se/" target=3D"_blank">http://engine.slu.se/</a>api/domains= /61642e73-6c75-2e73-6561-642e736c752e/users/94155e69-4691-4cbb-a6b5-d30a6bd= 5b667</div><div><br></div><div>Bug?</div><div><br></div><div>/Karli</div><d= iv><br></div><div><div>17 aug 2012 kl. 10.45 skrev Karli Sj=F6berg:</div><b= r class=3D"Apple-interchange-newline"><blockquote><div style=3D"word-wrap: = break-word; ">Hey all,<div><br></div><div>using "ovirt-shell" I can do:</di= v><div>$ create user --user_name<span class=3D"Apple-converted-space">= </span><a href=3D"mailto:somename@foo.bar" target=3D"_blank">somename= @foo.bar</a><span class=3D"Apple-converted-space"> </span>--domain-nam= e 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=3D"Apple-interchange-newline"><br></div><div>Med V=E4nliga H=E4lsning= ar<br>---------------------------------------------------------------------= ----------<br>Karli Sj=F6berg<br>Swedish University of Agricultural Science= s<br>Box 7079 (Visiting Address Kron=E5sv=E4gen 8)<br>S-750 07 Uppsala, Swe= den<br>Phone: +46-(0)18-67 15 66</div><div><a href=3D"mailto:karli.sj= oberg@adm.slu.se" target=3D"_blank">karli.sjoberg@slu.se</a></div></div><br= ></div></div>_______________________________________________<br>Users maili= ng list<br><a href=3D"mailto:Users@ovirt.org" target=3D"_blank">Users@ovirt= .org</a><br><a href=3D"http://lists.ovirt.org/mailman/listinfo/users">http:= //lists.ovirt.org/mailman/listinfo/users</a><br></blockquote></div><br><div= ><div><br class=3D"Apple-interchange-newline"><br></div><div>Med V=E4nliga = H=E4lsningar<br>-----------------------------------------------------------= --------------------<br>Karli Sj=F6berg<br>Swedish University of Agricultur= al Sciences<br>Box 7079 (Visiting Address Kron=E5sv=E4gen 8)<br>S-750 07 Up= psala, Sweden<br>Phone: +46-(0)18-67 15 66</div><div><a href=3D"mailt= o:karli.sjoberg@adm.slu.se" target=3D"_blank">karli.sjoberg@slu.se</a></div= ></div><br></div><br>_______________________________________________<br>Use= rs mailing list<br><a href=3D"mailto:Users@ovirt.org">Users@ovirt.org</a><b= r><a href=3D"http://lists.ovirt.org/mailman/listinfo/users">http://lists.ov= irt.org/mailman/listinfo/users</a><br></blockquote><br></div></div></span><= br class=3D"Apple-interchange-newline"></blockquote></div><br><div> <span class=3D"Apple-style-span" style=3D"border-collapse: separate; color:= rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: no= rmal; font-weight: normal; letter-spacing: normal; line-height: normal; orp= hans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; = white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizonta= l-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorati= ons-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-wi= dth: 0px; font-size: medium; "><div><br class=3D"Apple-interchange-newline"= ><br></div><div>Med V=E4nliga H=E4lsningar<br>-----------------------------= --------------------------------------------------<br>Karli Sj=F6berg<br>Sw= edish University of Agricultural Sciences<br>Box 7079 (Visiting Address Kro= n=E5sv=E4gen 8)<br>S-750 07 Uppsala, Sweden<br>Phone: +46-(0)18-67 15= 66</div><div><a href=3D"mailto:karli.sjoberg@adm.slu.se">karli.sjoberg@slu= .se</a></div></span> </div> <br></body></html>=
--_000_BFE9D2EE2E224128AEF9C2BD4A65A6E7sluse_--
participants (2)
-
Karli Sjöberg
-
Omer Frenkel