You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jclouds.apache.org by "Jeffrey Nguyen (jeffrngu)" <je...@cisco.com> on 2014/02/27 23:01:09 UTC

Where is the implementation for org.jclouds.openstack.nova.v2_0.features.ServerApi interface?

Hi Devs,

This might be a stupid question but I'm having a hard time finding the class that implements the org.jclouds.openstack.nova.v2_0.features.ServerApi interface.

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.

Does anyone know where to find it?

Thanks,
-Jeffrey

Re: Where is the implementation for org.jclouds.openstack.nova.v2_0.features.ServerApi interface?

Posted by Ignasi Barrera <ig...@gmail.com>.
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)" <je...@cisco.com>
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)" <je...@cisco.com>
> 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" <ap...@qrmedia.com> 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
> >
>
>

Re: Where is the implementation for org.jclouds.openstack.nova.v2_0.features.ServerApi interface?

Posted by "Jeffrey Nguyen (jeffrngu)" <je...@cisco.com>.
Thank you Ignasi and Everett for the detailed explanation.  That was
really helpful information.

Regards,
-Jeffrey

On 2/28/14 7:53 AM, "Everett Toews" <ev...@RACKSPACE.COM> wrote:

>I think the piece you might be missing is the ServerAsyncApi [1]. The
>methods in ServerAsyncApi map to the methods in ServerApi. The
>annotations on the methods in ServerAsyncApi are processed by the
>RestAnnotationProcessor.
>
>Everett
>
>[1] 
>https://github.com/jclouds/jclouds/blob/master/apis/openstack-nova/src/mai
>n/java/org/jclouds/openstack/nova/v2_0/features/ServerAsyncApi.java#L224-2
>25
>
>
>On Feb 28, 2014, at 1:07 AM, Jeffrey Nguyen (jeffrngu)
><je...@cisco.com> wrote:
>
>> 
>> 
>> 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)" <je...@cisco.com>
>>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" <ap...@qrmedia.com> 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
>>> 
>> 
>


Re: Where is the implementation for org.jclouds.openstack.nova.v2_0.features.ServerApi interface?

Posted by Everett Toews <ev...@RACKSPACE.COM>.
I think the piece you might be missing is the ServerAsyncApi [1]. The methods in ServerAsyncApi map to the methods in ServerApi. The annotations on the methods in ServerAsyncApi are processed by the RestAnnotationProcessor.

Everett

[1] https://github.com/jclouds/jclouds/blob/master/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ServerAsyncApi.java#L224-225


On Feb 28, 2014, at 1:07 AM, Jeffrey Nguyen (jeffrngu) <je...@cisco.com> wrote:

> 
> 
> 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)" <je...@cisco.com> 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" <ap...@qrmedia.com> 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
>> 
> 


Re: Where is the implementation for org.jclouds.openstack.nova.v2_0.features.ServerApi interface?

Posted by "Jeffrey Nguyen (jeffrngu)" <je...@cisco.com>.

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)" <je...@cisco.com> 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" <ap...@qrmedia.com> 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
>


Re: Where is the implementation for org.jclouds.openstack.nova.v2_0.features.ServerApi interface?

Posted by "Jeffrey Nguyen (jeffrngu)" <je...@cisco.com>.
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" <ap...@qrmedia.com> 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


Re: Where is the implementation for org.jclouds.openstack.nova.v2_0.features.ServerApi interface?

Posted by Ignasi Barrera <ig...@gmail.com>.
Thanks Jeffrey!

I've added you as a collaborator to the project and assigned the issue to you.


I.

On 11 March 2014 06:43, Jeffrey Nguyen (jeffrngu) <je...@cisco.com> wrote:
> FYI, I just created https://issues.apache.org/jira/browse/JCLOUDS-493 for
> this enhancement.
>
> I'm currently working on this enhancement.  Could someone please assign
> this JIRA to me?
>
> Thanks,
> -Jeffrey
>
> On 2/27/14 2:57 PM, "Zack Shoylev" <za...@RACKSPACE.COM> wrote:
>
>>I don't think this is supported right now.
>>We should be getting a new jira about this.
>>
>>________________________________________
>>From: Andrew Phillips [aphillips@qrmedia.com]
>>Sent: Thursday, February 27, 2014 4:27 PM
>>To: dev@jclouds.apache.org
>>Subject: Re: Where is the implementation for
>>org.jclouds.openstack.nova.v2_0.features.ServerApi interface?
>>
>>> 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
>

Re: Where is the implementation for org.jclouds.openstack.nova.v2_0.features.ServerApi interface?

Posted by "Jeffrey Nguyen (jeffrngu)" <je...@cisco.com>.
FYI, I just created https://issues.apache.org/jira/browse/JCLOUDS-493 for
this enhancement.

I'm currently working on this enhancement.  Could someone please assign
this JIRA to me?

Thanks,
-Jeffrey

On 2/27/14 2:57 PM, "Zack Shoylev" <za...@RACKSPACE.COM> wrote:

>I don't think this is supported right now.
>We should be getting a new jira about this.
>
>________________________________________
>From: Andrew Phillips [aphillips@qrmedia.com]
>Sent: Thursday, February 27, 2014 4:27 PM
>To: dev@jclouds.apache.org
>Subject: Re: Where is the implementation for
>org.jclouds.openstack.nova.v2_0.features.ServerApi interface?
>
>> 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


RE: Where is the implementation for org.jclouds.openstack.nova.v2_0.features.ServerApi interface?

Posted by Zack Shoylev <za...@RACKSPACE.COM>.
I don't think this is supported right now.
We should be getting a new jira about this.

________________________________________
From: Andrew Phillips [aphillips@qrmedia.com]
Sent: Thursday, February 27, 2014 4:27 PM
To: dev@jclouds.apache.org
Subject: Re: Where is the implementation for    org.jclouds.openstack.nova.v2_0.features.ServerApi interface?

> 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

Re: Where is the implementation for org.jclouds.openstack.nova.v2_0.features.ServerApi interface?

Posted by Andrew Phillips <ap...@qrmedia.com>.
> 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