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 (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 features by your own (what will 
become a moving target very quickly) 
b) Proxying the sdk
You can implement dynamic proxy wrapping SDK's HttpProxy.java#execute and 
intercept the context from there,but you've to stay tuned as backward 
compatibility 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. 

     On Monday, October 19, 2015 6:05 PM, Salifou Sidi M. Malick 
<ssidi...@redhat.com> wrote:
   

 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 
calls. 

The custom AAA module requires extra dynamic data in the HTTP 
request (as request headers for now but request parameters 
should be fine too). 

Their is no problem if they go with the REST API, I am just 
trying to anticipate/identify potential integration problem ...

It seems like they will have to use the REST API or modify the 
java sdk ...  

Thanks a lot,
Salifou


----- Original Message -----
From: "Michael Pasternak" <mishka8...@yahoo.com>
To: "Salifou Sidi M. Malick" <ssidi...@redhat.com>
Cc: "Users" <us...@ovirt.org>
Sent: Sunday, October 18, 2015 5:45:05 AM
Subject: Re: Question about the ovirt-engine-sdk-java

Hi Salifou,
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, 

can you tell me why do you need this?
 


    On Friday, October 16, 2015 1:14 AM, Salifou Sidi M. Malick 
<ssidi...@redhat.com> wrote:
  

 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 \
          -H "ID: us...@ad.xyz.com" \
          -H "PASSWORD: Pwssd" \
          -H "TARGET: kobe" \
          https://vm0.smalick.com/api/hosts


I would like to add ID, PASSWORD and TARGET as HTTP request header. 

Thanks,
Salifou




   

  
_______________________________________________
Devel mailing list
Devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/devel

Reply via email to