--_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(a)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>
&lt;user_name&gt;somename(a)slu.se&lt;/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&...:
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>&l...
<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_--