------=_Part_291056_1850182726.1445347932554
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Hi Salifou,
OK, i see now, then you have two options:
a) To extend the sdk:
1. extend java-sdk by allowing to inject custom headers in every request=C2=
=A0(not trivial as all ovirt SDKs are auto-generated,but if its common case=
, you may find yourself getting help from community/maintainers)
2. fork java-sdk customizing it for your needs
I'd recommend the former as fork will leave you with no support/maintenance=
from community plus you'll haveto implement new=C2=A0features by your own =
(what will become a moving target very quickly)=20
b) Proxying the sdk
You can implement dynamic proxy wrapping SDK's HttpProxy.java#execute and i=
ntercept the context from there,but you've to stay tuned as backward compat=
ibility is for interface and not for SDK internals,so "potentially" you can=
find your code broken in one of the following upgrades
hope it helps.=C2=A0
On Monday, October 19, 2015 6:05 PM, Salifou Sidi M. Malick <ssidimah@=
redhat.com> wrote:
=20
Hi Micheal,
Thanks for replying. Unfortunately the headers are dynamic ...
Here is the story:
We implemented a custom RHEV-M AAA module for a client
in order to allow their custom portal to make RHEV-M API=20
calls.=20
The custom AAA module requires extra dynamic data in the HTTP=20
request (as request headers for now but request parameters=20
should be fine too).=20
Their is no problem if they go with the REST API, I am just=20
trying to anticipate/identify potential integration problem ...
It seems like they will have to use the REST API or modify the=20
java sdk ...=C2=A0=20
Thanks a lot,
Salifou
----- Original Message -----
From: "Michael Pasternak" <mishka8520(a)yahoo.com>
To: "Salifou Sidi M. Malick" <ssidimah(a)redhat.com>
Cc: "Users" <users(a)ovirt.org>
Sent: Sunday, October 18, 2015 5:45:05 AM
Subject: Re: Question about the ovirt-engine-sdk-java
Hi=C2=A0Salifou,
Actually java sdk is=C2=A0intentionally=C2=A0hiding transport level interna=
ls so developers could stay in java domain,if your headers are static, easi=
est way would be using reverse proxy in a middle to intercept requests,=C2=
=A0
can you tell me why do you need this?
=20
=C2=A0 =C2=A0 On Friday, October 16, 2015 1:14 AM, Salifou Sidi M. Malick <=
ssidimah(a)redhat.com> wrote:
=C2=A0=20
Hi Micheal,
I have a question about the ovirt-engine-sdk-java.
Is there a way to add custom request headers to each RHEVM API call?
Here is an example of a request that I would like to do:
$ curl -v -k \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -H "ID: user1(a)ad.xyz.com" \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -H "PASSWORD: Pwssd" \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -H "TARGET: kobe" \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
https://vm0.smalick.com/api/hosts
I would like to add ID, PASSWORD and TARGET as HTTP request header.=20
Thanks,
Salifou
=20
------=_Part_291056_1850182726.1445347932554
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<html><head></head><body><div style=3D"color:#000;
background-color:#fff; f=
ont-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helve=
tica, Arial, Lucida Grande, sans-serif;font-size:13px"><div
id=3D"yiv487097=
0104"><div class=3D"qtdSeparateBR"
id=3D"yui_3_16_0_1_1445338067930_25413">=
<br><br></div><div class=3D"yiv4870970104yqt0049005238"
id=3D"yiv4870970104=
yqtfd33472"><div id=3D"yui_3_16_0_1_1445338067930_25382"><div
style=3D"colo=
r:#000;background-color:#fff;font-family:HelveticaNeue-Light, Helvetica Neu=
e Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-s=
ize:13px;" id=3D"yui_3_16_0_1_1445338067930_25381"><div
id=3D"yiv4870970104=
yui_3_16_0_1_1445338067930_23478"><span
style=3D"font-family:'Helvetica Neu=
e', 'Segoe UI', Helvetica, Arial, 'Lucida Grande',
sans-serif;">Hi Salifou,=
</span><br clear=3D"none"></div><div
class=3D"yiv4870970104qtdSeparateBR" i=
d=3D"yui_3_16_0_1_1445338067930_25383"><br
clear=3D"none"><br clear=3D"none=
"></div> </div></div></div></div><div
class=3D".yiv4870970104yahoo_quoted" =
id=3D"yui_3_16_0_1_1445338067930_25398"><div
id=3D"yiv4870970104yui_3_16_0_=
1_1445338067930_23388" style=3D"font-family:HelveticaNeue-Light, Helvetica =
Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;fon=
t-size:13px;"><div
id=3D"yiv4870970104yui_3_16_0_1_1445338067930_23387" sty=
le=3D"font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida G=
rande, sans-serif;font-size:16px;"><div
class=3D"yiv4870970104y_msg_contain=
er" id=3D"yiv4870970104yui_3_16_0_1_1445338067930_23484"><div
id=3D"yiv4870=
970104"><div
id=3D"yiv4870970104yui_3_16_0_1_1445338067930_23483"><div id=
=3D"yiv4870970104yui_3_16_0_1_1445338067930_23482"
style=3D"color:#000;back=
ground-color:#fff;font-family:HelveticaNeue-Light, Helvetica Neue Light, He=
lvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px;">=
<div id=3D"yiv4870970104"><div
id=3D"yiv4870970104yui_3_16_0_1_144533806793=
0_7276"><div id=3D"yiv4870970104yui_3_16_0_1_1445338067930_7275"
style=3D"c=
olor:#000;background-color:#fff;font-family:HelveticaNeue-Light, Helvetica =
Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;fon=
t-size:13px;"><div dir=3D"ltr"
id=3D"yiv4870970104yui_3_16_0_1_144533806793=
0_4283"><span></span></div><div dir=3D"ltr"
id=3D"yiv4870970104yui_3_16_0_1=
_1445338067930_4283"><span style=3D"font-family: 'Helvetica Neue',
'Segoe U=
I', Helvetica, Arial, 'Lucida Grande', sans-serif;"
id=3D"yui_3_16_0_1_1445=
338067930_25412">OK, i see now, then you have two
options:</span><br></div>=
<div dir=3D"ltr"
id=3D"yiv4870970104yui_3_16_0_1_1445338067930_4283"><span =
class=3D"yiv4870970104" style=3D"font-family:'Helvetica Neue',
'Segoe UI', =
Helvetica, Arial, 'Lucida Grande', sans-serif;"><br
clear=3D"none"></span><=
/div><div dir=3D"ltr"
id=3D"yiv4870970104yui_3_16_0_1_1445338067930_4283"><=
span class=3D"yiv4870970104"
id=3D"yiv4870970104yui_3_16_0_1_1445338067930_=
7286" style=3D"font-family:'Helvetica Neue', 'Segoe UI',
Helvetica, Arial, =
'Lucida Grande', sans-serif;">a) To extend the
sdk:</span></div><div dir=3D=
"ltr" id=3D"yiv4870970104yui_3_16_0_1_1445338067930_4283"><span
class=3D"yi=
v4870970104" style=3D"font-family:'Helvetica Neue', 'Segoe UI',
Helvetica, =
Arial, 'Lucida Grande', sans-serif;"><br
clear=3D"none"></span></div><div d=
ir=3D"ltr"
id=3D"yiv4870970104yui_3_16_0_1_1445338067930_4283"><span class=
=3D"yiv4870970104" id=3D"yiv4870970104yui_3_16_0_1_1445338067930_4800"
styl=
e=3D"font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial,
'Lucida Gr=
ande', sans-serif;">1. extend java-sdk by allowing to inject custom headers=
in every request</span><span class=3D"yiv4870970104"
style=3D"font-family:=
'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande',
sans-serif=
;"> </span><span class=3D"yiv4870970104"
id=3D"yiv4870970104yui_3_16_0=
_1_1445338067930_8082" style=3D"font-family:'Helvetica Neue', 'Segoe
UI', H=
elvetica, Arial, 'Lucida Grande', sans-serif;">(not trivial as all ovirt
SD=
Ks are auto-generated</span><span style=3D"font-family:'Helvetica
Neue', 'S=
egoe UI', Helvetica, Arial, 'Lucida Grande',
sans-serif;">,</span></div><di=
v dir=3D"ltr"
id=3D"yiv4870970104yui_3_16_0_1_1445338067930_4283"><span cla=
ss=3D"yiv4870970104"
id=3D"yiv4870970104yui_3_16_0_1_1445338067930_9090" st=
yle=3D"font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial,
'Lucida =
Grande', sans-serif;">but if its common case, you may find yourself getting=
help from community/maintainers)</span></div><div dir=3D"ltr"
id=3D"yiv487=
0970104yui_3_16_0_1_1445338067930_4283"><span class=3D"yiv4870970104"
style=
=3D"font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial,
'Lucida Gra=
nde', sans-serif;"><br
clear=3D"none"></span></div><div dir=3D"ltr"
id=3D"y=
iv4870970104yui_3_16_0_1_1445338067930_4283"><span
class=3D"yiv4870970104" =
id=3D"yiv4870970104yui_3_16_0_1_1445338067930_4801"
style=3D"font-family:'H=
elvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande',
sans-serif;"=
2. fork java-sdk customizing it for your
needs</span></div><div dir=3D"ltr=
"
id=3D"yiv4870970104yui_3_16_0_1_1445338067930_4283"><span
class=3D"yiv487=
0970104" style=3D"font-family:'Helvetica Neue', 'Segoe UI',
Helvetica, Aria=
l, 'Lucida Grande', sans-serif;"><br
clear=3D"none"></span></div><div dir=
=3D"ltr"
id=3D"yiv4870970104yui_3_16_0_1_1445338067930_4283"><span class=3D=
"yiv4870970104" id=3D"yiv4870970104yui_3_16_0_1_1445338067930_4974"
style=
=3D"font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial,
'Lucida Gra=
nde', sans-serif;">I'd recommend the former as fork will leave you with no
=
support/maintenance from community plus you'll have</span></div><div
dir=3D=
"ltr" id=3D"yiv4870970104yui_3_16_0_1_1445338067930_4283"><span
class=3D"yi=
v4870970104" id=3D"yiv4870970104yui_3_16_0_1_1445338067930_7285"
style=3D"f=
ont-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida
Grande',=
sans-serif;">to implement new </span><span
id=3D"yiv4870970104yui_3_1=
6_0_1_1445338067930_5162" style=3D"font-family:'Helvetica Neue',
'Segoe UI'=
, Helvetica, Arial, 'Lucida Grande', sans-serif;">features by your own
(wha=
t will become a moving target very quickly)</span></div> <br
clear=3D"none=
"><div class=3D"yiv4870970104qtdSeparateBR" dir=3D"ltr"
id=3D"yiv4870970104=
yui_3_16_0_1_1445338067930_7274">b) Proxying the sdk</div><div
class=3D"yiv=
4870970104qtdSeparateBR" dir=3D"ltr"
id=3D"yiv4870970104yui_3_16_0_1_144533=
8067930_7274"><br clear=3D"none"></div><div
class=3D"yiv4870970104qtdSepara=
teBR" dir=3D"ltr"
id=3D"yiv4870970104yui_3_16_0_1_1445338067930_7274">You c=
an implement dynamic proxy wrapping SDK's HttpProxy.java#execute and interc=
ept the context from there,</div><div
class=3D"yiv4870970104qtdSeparateBR" =
dir=3D"ltr" id=3D"yiv4870970104yui_3_16_0_1_1445338067930_7274">but
you've =
to stay tuned as backward compatibility is for interface and not for SDK in=
ternals,</div><div class=3D"yiv4870970104qtdSeparateBR"
dir=3D"ltr" id=3D"y=
iv4870970104yui_3_16_0_1_1445338067930_7274">so "potentially" you can
find =
your code broken in one of the following upgrades</div><div
class=3D"yiv487=
0970104qtdSeparateBR" dir=3D"ltr"
id=3D"yiv4870970104yui_3_16_0_1_144533806=
7930_7274"><br clear=3D"none"></div><div
class=3D"yiv4870970104qtdSeparateB=
R" dir=3D"ltr"
id=3D"yiv4870970104yui_3_16_0_1_1445338067930_7274">hope it =
helps. <br clear=3D"none"><br
clear=3D"none"></div><div class=3D"yiv48=
70970104yqt0562777282"
id=3D"yiv4870970104yqt81591"></div></div></div></div=
<div class=3D"yiv4870970104yqt7829638567"
id=3D"yiv4870970104yqt81845"><di=
v
id=3D"yiv4870970104yui_3_16_0_1_1445338067930_8533"> <div
id=3D"yiv487097=
0104yui_3_16_0_1_1445338067930_8532" style=3D"font-family:HelveticaNeue-Lig=
ht, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, =
sans-serif;font-size:13px;"> <div
id=3D"yiv4870970104yui_3_16_0_1_144533806=
7930_8531" style=3D"font-family:HelveticaNeue, Helvetica Neue, Helvetica, A=
rial, Lucida Grande, sans-serif;font-size:16px;"> <div dir=3D"ltr"
id=3D"yi=
v4870970104yui_3_16_0_1_1445338067930_8554"> <font
id=3D"yiv4870970104yui_3=
_16_0_1_1445338067930_8559" size=3D"2" face=3D"Arial"> On
Monday, October 1=
9, 2015 6:05 PM, Salifou Sidi M. Malick &lt;ssidimah(a)redhat.com&gt; wrote:<=
br clear=3D"none"> </font> </div> <br
clear=3D"none"><br clear=3D"none"> <=
div class=3D"yiv4870970104y_msg_container"
id=3D"yiv4870970104yui_3_16_0_1_=
1445338067930_8712">Hi Micheal,<br clear=3D"none"><br
clear=3D"none">Thanks=
for replying. Unfortunately the headers are dynamic ...<br
clear=3D"none">=
<br clear=3D"none">Here is the story:<br
clear=3D"none"><br clear=3D"none">=
We implemented a custom RHEV-M AAA module for a client<br
clear=3D"none">in=
order to allow their custom portal to make RHEV-M API <br
clear=3D"none">c=
alls. <br clear=3D"none"><br clear=3D"none">The custom AAA
module requires =
extra dynamic data in the HTTP <br clear=3D"none">request (as request
heade=
rs for now but request parameters <br clear=3D"none">should be fine too).
<=
br clear=3D"none"><br clear=3D"none">Their is no problem if
they go with th=
e REST API, I am just <br clear=3D"none">trying to anticipate/identify
pote=
ntial integration problem ...<br clear=3D"none"><br
clear=3D"none">It seems=
like they will have to use the REST API or modify the <br
clear=3D"none">j=
ava sdk ... <br clear=3D"none"><br
clear=3D"none">Thanks a lot,<br cl=
ear=3D"none">Salifou<br clear=3D"none"><br
clear=3D"none"><div class=3D"yiv=
4870970104yqt8023103542" id=3D"yiv4870970104yqtfd83808"><br
clear=3D"none">=
----- Original Message -----<br clear=3D"none">From: "Michael
Pasternak" &l=
t;<a rel=3D"nofollow" shape=3D"rect"
ymailto=3D"mailto:mishka8520@yahoo.com=
" target=3D"_blank"
href=3D"mailto:mishka8520@yahoo.com">mishka8520@yahoo.c=
om</a>><br clear=3D"none">To: "Salifou Sidi M.
Malick" <<a rel=3D"nof=
ollow" shape=3D"rect"
id=3D"yiv4870970104yui_3_16_0_1_1445338067930_23606" =
ymailto=3D"mailto:ssidimah@redhat.com" target=3D"_blank"
href=3D"mailto:ssi=
dimah@redhat.com">ssidimah(a)redhat.com</a>&gt;<br
clear=3D"none">Cc: "Users"=
<<a rel=3D"nofollow" shape=3D"rect"
ymailto=3D"mailto:users@ovirt.org" =
target=3D"_blank"
href=3D"mailto:users@ovirt.org">users@ovirt.org</a>><b=
r clear=3D"none">Sent: Sunday, October 18, 2015 5:45:05 AM<br
clear=3D"none=
">Subject: Re: Question about the ovirt-engine-sdk-java<br
clear=3D"none"><=
br clear=3D"none">Hi Salifou,<br
clear=3D"none">Actually java sdk is&n=
bsp;intentionally hiding transport level internals so developers could=
stay in java domain,if your headers are static, easiest way would be using=
reverse proxy in a middle to intercept requests, <br
clear=3D"none"><=
br clear=3D"none">can you tell me why do you need this?<br
clear=3D"none"> =
<br clear=3D"none"><br clear=3D"none"><br
clear=3D"none"> On =
Friday, October 16, 2015 1:14 AM, Salifou Sidi M. Malick <<a rel=3D"nofo=
llow" shape=3D"rect" ymailto=3D"mailto:ssidimah@redhat.com"
target=3D"_blan=
k"
href=3D"mailto:ssidimah@redhat.com">ssidimah@redhat.com</a>>
wrote:<b=
r clear=3D"none"> <br clear=3D"none"><br
clear=3D"none"> Hi Micheal,=
<br clear=3D"none"><br clear=3D"none">I have a question
about the ovirt-eng=
ine-sdk-java.<br clear=3D"none"><br clear=3D"none">Is
there a way to add cu=
stom request headers to each RHEVM API call?<br clear=3D"none"><br
clear=3D=
"none">Here is an example of a request that I would like to do:<br
clear=3D=
"none"><br clear=3D"none">$ curl -v -k \<br
clear=3D"none"> &n=
bsp; -H "ID: <a rel=3D"nofollow"
shape=3D"rect" ymailto=3D"ma=
ilto:user1@ad.xyz.com" target=3D"_blank"
href=3D"mailto:user1@ad.xyz.com">u=
ser1(a)ad.xyz.com</a>" \<br clear=3D"none">
=
-H "PASSWORD: Pwssd" \<br clear=3D"none">
 =
; -H "TARGET: kobe" \<br clear=3D"none">
=
<a rel=3D"nofollow" shape=3D"rect" target=3D"_blank"
href=3D"https://vm0.sm=
alick.com/api/hosts">https://vm0.smalick.com/api/hosts</a>&...
clear=3D"none=
"><br clear=3D"none"><br clear=3D"none">I would
like to add ID, PASSWORD an=
d TARGET as HTTP request header. <br clear=3D"none"><br
clear=3D"none">Than=
ks,<br clear=3D"none">Salifou<br clear=3D"none"><br
clear=3D"none"><br clea=
r=3D"none"></div><br clear=3D"none"><br
clear=3D"none"></div> </div> </div=
</div></div></div></div></div><br
clear=3D"none"><br clear=3D"none"></di=
v>
</div> </div> </div></div></body></html>
------=_Part_291056_1850182726.1445347932554--