<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px"><div id="yiv4870970104"><div class="qtdSeparateBR" id="yui_3_16_0_1_1445338067930_25413"><br><br></div><div class="yiv4870970104yqt0049005238" id="yiv4870970104yqtfd33472"><div id="yui_3_16_0_1_1445338067930_25382"><div style="color:#000;background-color:#fff;font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px;" id="yui_3_16_0_1_1445338067930_25381"><div id="yiv4870970104yui_3_16_0_1_1445338067930_23478"><span style="font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;">Hi Salifou,</span><br clear="none"></div><div class="yiv4870970104qtdSeparateBR" id="yui_3_16_0_1_1445338067930_25383"><br clear="none"><br clear="none"></div> </div></div></div></div><div class=".yiv4870970104yahoo_quoted" id="yui_3_16_0_1_1445338067930_25398"><div id="yiv4870970104yui_3_16_0_1_1445338067930_23388" style="font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px;"><div id="yiv4870970104yui_3_16_0_1_1445338067930_23387" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"><div class="yiv4870970104y_msg_container" id="yiv4870970104yui_3_16_0_1_1445338067930_23484"><div id="yiv4870970104"><div id="yiv4870970104yui_3_16_0_1_1445338067930_23483"><div id="yiv4870970104yui_3_16_0_1_1445338067930_23482" style="color:#000;background-color:#fff;font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px;"><div id="yiv4870970104"><div id="yiv4870970104yui_3_16_0_1_1445338067930_7276"><div id="yiv4870970104yui_3_16_0_1_1445338067930_7275" style="color:#000;background-color:#fff;font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px;"><div dir="ltr" id="yiv4870970104yui_3_16_0_1_1445338067930_4283"><span></span></div><div dir="ltr" id="yiv4870970104yui_3_16_0_1_1445338067930_4283"><span style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;" id="yui_3_16_0_1_1445338067930_25412">OK, i see now, then you have two options:</span><br></div><div dir="ltr" id="yiv4870970104yui_3_16_0_1_1445338067930_4283"><span class="yiv4870970104" style="font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;"><br clear="none"></span></div><div dir="ltr" id="yiv4870970104yui_3_16_0_1_1445338067930_4283"><span class="yiv4870970104" id="yiv4870970104yui_3_16_0_1_1445338067930_7286" style="font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;">a) To extend the sdk:</span></div><div dir="ltr" id="yiv4870970104yui_3_16_0_1_1445338067930_4283"><span class="yiv4870970104" style="font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;"><br clear="none"></span></div><div dir="ltr" id="yiv4870970104yui_3_16_0_1_1445338067930_4283"><span class="yiv4870970104" id="yiv4870970104yui_3_16_0_1_1445338067930_4800" style="font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;">1. extend java-sdk by allowing to inject custom headers in every request</span><span class="yiv4870970104" style="font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;"> </span><span class="yiv4870970104" id="yiv4870970104yui_3_16_0_1_1445338067930_8082" style="font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;">(not trivial as all ovirt SDKs are auto-generated</span><span style="font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;">,</span></div><div dir="ltr" id="yiv4870970104yui_3_16_0_1_1445338067930_4283"><span class="yiv4870970104" id="yiv4870970104yui_3_16_0_1_1445338067930_9090" style="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="ltr" id="yiv4870970104yui_3_16_0_1_1445338067930_4283"><span class="yiv4870970104" style="font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;"><br clear="none"></span></div><div dir="ltr" id="yiv4870970104yui_3_16_0_1_1445338067930_4283"><span class="yiv4870970104" id="yiv4870970104yui_3_16_0_1_1445338067930_4801" style="font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;">2. fork java-sdk customizing it for your needs</span></div><div dir="ltr" id="yiv4870970104yui_3_16_0_1_1445338067930_4283"><span class="yiv4870970104" style="font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;"><br clear="none"></span></div><div dir="ltr" id="yiv4870970104yui_3_16_0_1_1445338067930_4283"><span class="yiv4870970104" id="yiv4870970104yui_3_16_0_1_1445338067930_4974" style="font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', 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="ltr" id="yiv4870970104yui_3_16_0_1_1445338067930_4283"><span class="yiv4870970104" id="yiv4870970104yui_3_16_0_1_1445338067930_7285" style="font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;">to implement new </span><span id="yiv4870970104yui_3_16_0_1_1445338067930_5162" style="font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;">features by your own (what will become a moving target very quickly)</span></div> <br clear="none"><div class="yiv4870970104qtdSeparateBR" dir="ltr" id="yiv4870970104yui_3_16_0_1_1445338067930_7274">b) Proxying the sdk</div><div class="yiv4870970104qtdSeparateBR" dir="ltr" id="yiv4870970104yui_3_16_0_1_1445338067930_7274"><br clear="none"></div><div class="yiv4870970104qtdSeparateBR" dir="ltr" id="yiv4870970104yui_3_16_0_1_1445338067930_7274">You can implement dynamic proxy wrapping SDK's HttpProxy.java#execute and intercept the context from there,</div><div class="yiv4870970104qtdSeparateBR" dir="ltr" id="yiv4870970104yui_3_16_0_1_1445338067930_7274">but you've to stay tuned as backward compatibility is for interface and not for SDK internals,</div><div class="yiv4870970104qtdSeparateBR" dir="ltr" id="yiv4870970104yui_3_16_0_1_1445338067930_7274">so "potentially" you can find your code broken in one of the following upgrades</div><div class="yiv4870970104qtdSeparateBR" dir="ltr" id="yiv4870970104yui_3_16_0_1_1445338067930_7274"><br clear="none"></div><div class="yiv4870970104qtdSeparateBR" dir="ltr" id="yiv4870970104yui_3_16_0_1_1445338067930_7274">hope it helps. <br clear="none"><br clear="none"></div><div class="yiv4870970104yqt0562777282" id="yiv4870970104yqt81591"></div></div></div></div><div class="yiv4870970104yqt7829638567" id="yiv4870970104yqt81845"><div id="yiv4870970104yui_3_16_0_1_1445338067930_8533"> <div id="yiv4870970104yui_3_16_0_1_1445338067930_8532" style="font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px;"> <div id="yiv4870970104yui_3_16_0_1_1445338067930_8531" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"> <div dir="ltr" id="yiv4870970104yui_3_16_0_1_1445338067930_8554"> <font id="yiv4870970104yui_3_16_0_1_1445338067930_8559" size="2" face="Arial"> On Monday, October 19, 2015 6:05 PM, Salifou Sidi M. Malick <ssidimah@redhat.com> wrote:<br clear="none"> </font> </div> <br clear="none"><br clear="none"> <div class="yiv4870970104y_msg_container" id="yiv4870970104yui_3_16_0_1_1445338067930_8712">Hi Micheal,<br clear="none"><br clear="none">Thanks for replying. Unfortunately the headers are dynamic ...<br clear="none"><br clear="none">Here is the story:<br clear="none"><br clear="none">We implemented a custom RHEV-M AAA module for a client<br clear="none">in order to allow their custom portal to make RHEV-M API <br clear="none">calls. <br clear="none"><br clear="none">The custom AAA module requires extra dynamic data in the HTTP <br clear="none">request (as request headers for now but request parameters <br clear="none">should be fine too). <br clear="none"><br clear="none">Their is no problem if they go with the REST API, I am just <br clear="none">trying to anticipate/identify potential integration problem ...<br clear="none"><br clear="none">It seems like they will have to use the REST API or modify the <br clear="none">java sdk ... <br clear="none"><br clear="none">Thanks a lot,<br clear="none">Salifou<br clear="none"><br clear="none"><div class="yiv4870970104yqt8023103542" id="yiv4870970104yqtfd83808"><br clear="none">----- Original Message -----<br clear="none">From: "Michael Pasternak" <<a rel="nofollow" shape="rect" ymailto="mailto:mishka8520@yahoo.com" target="_blank" href="mailto:mishka8520@yahoo.com">mishka8520@yahoo.com</a>><br clear="none">To: "Salifou Sidi M. Malick" <<a rel="nofollow" shape="rect" id="yiv4870970104yui_3_16_0_1_1445338067930_23606" ymailto="mailto:ssidimah@redhat.com" target="_blank" href="mailto:ssidimah@redhat.com">ssidimah@redhat.com</a>><br clear="none">Cc: "Users" <<a rel="nofollow" shape="rect" ymailto="mailto:users@ovirt.org" target="_blank" href="mailto:users@ovirt.org">users@ovirt.org</a>><br clear="none">Sent: Sunday, October 18, 2015 5:45:05 AM<br clear="none">Subject: Re: Question about the ovirt-engine-sdk-java<br clear="none"><br clear="none">Hi Salifou,<br clear="none">Actually java sdk is 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="none"><br clear="none">can you tell me why do you need this?<br clear="none"> <br clear="none"><br clear="none"><br clear="none"> On Friday, October 16, 2015 1:14 AM, Salifou Sidi M. Malick <<a rel="nofollow" shape="rect" ymailto="mailto:ssidimah@redhat.com" target="_blank" href="mailto:ssidimah@redhat.com">ssidimah@redhat.com</a>> wrote:<br clear="none"> <br clear="none"><br clear="none"> Hi Micheal,<br clear="none"><br clear="none">I have a question about the ovirt-engine-sdk-java.<br clear="none"><br clear="none">Is there a way to add custom request headers to each RHEVM API call?<br clear="none"><br clear="none">Here is an example of a request that I would like to do:<br clear="none"><br clear="none">$ curl -v -k \<br clear="none"> -H "ID: <a rel="nofollow" shape="rect" ymailto="mailto:user1@ad.xyz.com" target="_blank" href="mailto:user1@ad.xyz.com">user1@ad.xyz.com</a>" \<br clear="none"> -H "PASSWORD: Pwssd" \<br clear="none"> -H "TARGET: kobe" \<br clear="none"> <a rel="nofollow" shape="rect" target="_blank" href="https://vm0.smalick.com/api/hosts">https://vm0.smalick.com/api/hosts</a><br clear="none"><br clear="none"><br clear="none">I would like to add ID, PASSWORD and TARGET as HTTP request header. <br clear="none"><br clear="none">Thanks,<br clear="none">Salifou<br clear="none"><br clear="none"><br clear="none"></div><br clear="none"><br clear="none"></div> </div> </div> </div></div></div></div></div><br clear="none"><br clear="none"></div> </div> </div> </div></div></body></html>