Hi Jeffrey,

As you've seen, requests are automatically generated based on the
annotations of the interface methods.

There is no implementation of the api interfaces. jclouds creates a dynamic
proxy that implements the interface and generates the request.

Api objects are created by the Guice injector as configured here [1]. That
creates the dynamic proxy for the requested api. The proxy code is here
[2], but it doesn't do much. It delegates to this class [3], which is the
one that calls the RestAnnotationProcessor to generate the request and the
transformers/fallbacks to convert the response/error to the desired result.

HTH!

Ignasi

[1]
https://github.com/jclouds/jclouds/blob/master/core/src/main/java/org/jclouds/rest/config/AnnotatedHttpApiProvider.java
[2]
https://github.com/jclouds/jclouds/blob/master/core/src/main/java/org/jclouds/rest/internal/DelegatesToInvocationFunction.java
[3]
https://github.com/jclouds/jclouds/blob/master/core/src/main/java/org/jclouds/rest/internal/InvokeHttpMethod.java
El 28/02/2014 08:08, "Jeffrey Nguyen (jeffrngu)" <[email protected]>
escribió:

>
>
> Hi Andrew,
>
> Thank you for the pointers on how ServerApi is implemented.  I'm still
> having trouble understanding how each of the methods defined in ServerApi
> class is translated into Rest calls to the underline OpenStack.
>
> Take the ServerApi.create() method as an example.  How is the invocation
> to this method mapped into a Rest call in RestAnnotationProcessor?   I
> know what the request and response for this particular Rest API looks like
> based on the test code.   However, I don't really see the connection
> between ServerApi and RestAnnotationProcessor.  It looks like
> ContextBuilder is also involved.
>
> Could you or someone on the @Dev mailing list shed some lights on this?
>
> Thanks,
> -Jeffrey
>
> On 2/27/14 2:52 PM, "Jeffrey Nguyen (jeffrngu)" <[email protected]>
> wrote:
>
> >Thanks Andrew for the quick reply.
> >
> >JCLOUDS-416 seems to deal with the ability to assign a list of private
> >network UUIDs to a template via the networks() method.  I'm aware of this
> >new enhancement in 1.7.1 and already using it.
> >
> >What I'm trying to do is be able to specify a private IP address for each
> >of those network UUIDs.  What I observe now is for each of the network
> >UUIDs I specify, when I create a new node, OpenStack assigns a random IP
> >for that particular network.  I want to be able to tell jCloud/OpenStack
> >to use a fixed private IP address.
> >
> >It looks like jClouds currently does not support this, so I'm trying to
> >see what's involved to add that feature.
> >
> >Any pointer on how to go about doing that?
> >
> >Thanks,
> >-Jeffrey
> >
> >
> >On 2/27/14 2:27 PM, "Andrew Phillips" <[email protected]> wrote:
> >
> >>> I'm trying to see if it's possible to modify the create() method so
> >>> that I can inject the list of private IP addresses instead of taking
> >>>  random values assigned by OpenStack.
> >>
> >>I think JCLOUDS-416 [1] might help you, if I am understanding your
> >>question correctly..?
> >>
> >>ap
> >>
> >>[1] https://issues.apache.org/jira/browse/JCLOUDS-416
> >
>
>

Reply via email to