
--_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_--