So I ran some test with jclouds 1.7.1 and neutron 1.8.0.  I got the exception 
below when trying to get new ContextBuilder.   So this confirmed this 
combination doesn't work.  I guess the only choice is to upgrade jclouds.  
Thanks all for the replies!

java.util.NoSuchElementException: key [openstack-neutron] not in the list of 
providers or apis: {providers=[aws-ec2], apis=[vcloud, ec2, sts, stub, 
openstack-nova, openstack-keystone]}
        at org.jclouds.ContextBuilder.newBuilder(ContextBuilder.java:174)

-Jeffrey

From: Ignasi Barrera <[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Date: Thursday, August 14, 2014 10:50 AM
To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: Re: How to get reference to NeutronApi from ComputeServiceContext


Yep, it's not recommended at all.

Using different versions of jclouds in the sane app will bring two different 
versions of the jclouds-core to the classpath. The behavior of *any* jclouds 
api/provider in this scenario is unpredictable, as jclouds-core is the one that 
generates the http requests and jmplements all common behaviors and strategies 
to talk with the target apis.

Having different versions of this jar in the classpath (or a version that does 
not match a provider/api version) is definitely a bad idea.

I.

El 14/08/2014 17:42, "Jeffrey Nguyen (jeffrngu)" 
<[email protected]<mailto:[email protected]>> escribió:

Thank you Zack and Andrew.  I'll let you know if this works.   I'm interested 
in the PortApi in particular.  I don't know if that is enough to expose any 
potential conflicts.

Thanks,
-Jeffrey

From: Zack Shoylev 
<[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Date: Thursday, August 14, 2014 5:56 AM
To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: RE: How to get reference to NeutronApi from ComputeServiceContext

Interesting. Usually I would not recommend using different versions of the 
dependencies. However, I don't recall any particular reasons they might 
conflict. Can you give it a try and let me know?
Thanks!
-Zack
________________________________
From: Jeffrey Nguyen (jeffrngu) [[email protected]<mailto:[email protected]>]
Sent: Thursday, August 14, 2014 12:18 AM
To: [email protected]<mailto:[email protected]>
Subject: Re: How to get reference to NeutronApi from ComputeServiceContext


Ok, I'll change my dependency to reference "1.8.0" instead of "1.7.3".   Can 
you confirm this neutron dependency will still work with jclouds 1.7.1?

Thanks,
-Jeffrey

From: Zack Shoylev 
<[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Date: Wednesday, August 13, 2014 10:10 PM
To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: RE: How to get reference to NeutronApi from ComputeServiceContext

Hi Jeffrey,

As this new neutron code is... new, you will have to use 1.8.0 instead of 1.7.3 
in your dependency.
Your dependency looks good to me and with 1.8.0 it will include both v2 and 
v2_0: v2_0 is deprecated (making sure we don't break people's code).
Thanks!
-Zack
________________________________
From: Jeffrey Nguyen (jeffrngu) [[email protected]<mailto:[email protected]>]
Sent: Wednesday, August 13, 2014 11:48 PM
To: [email protected]<mailto:[email protected]>
Subject: Re: How to get reference to NeutronApi from ComputeServiceContext

Hi Zack,

I looked at the application code again.  It turns out that endpoint can be 
obtained at the application level as one of the properties of the underline 
Iaas provider.   So I'm good on this one.
Question on the version "v2": which version of jclouds have this?   I'm using 
jclouds 1.7.1 and plan to introduce just the neutron dependency below and not 
upgrading jclouds.   Will that work or does neutron have other dependencies 
that require upgrading jclouds?   Also, is the version below correct for using 
"v2" instead of "v2_0"?

                <dependency>
                        <groupId>org.apache.jclouds.labs</groupId>
                        <artifactId>openstack-neutron</artifactId>
                        <version>1.7.3</version>
                </dependency>

Thanks,

-Jeffrey

From: jeffrngu <[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Date: Wednesday, August 13, 2014 9:32 PM
To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: Re: How to get reference to NeutronApi from ComputeServiceContext


Thanks Zack.  I'm familiar with the method to get NeutronApi you mentioned.   
The problem is I can get credentials  but I'm not sure how to get the value for 
"endpoint" from the existing ComputeServiceContext.   Any idea?

-Jeffrey

From: Zack Shoylev 
<[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Date: Wednesday, August 13, 2014 6:41 PM
To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: RE: How to get reference to NeutronApi from ComputeServiceContext

Hi Jeffrey,

There is no NeutronAsyncApi, just a NeutronApi. Use neutron version v2 (instead 
of v2_0) from labs.

You should be able to do something like:
NeutronApi neutronApi = ContextBuilder.newBuilder("openstack-neutron")
.credentials(username, password).endpoint(endpoint).buildApi(NeutronApi.class);

The code you are referring to is unwrapping a provider-specific implementation 
of compute from the compute abstraction layer. At the moment, jclouds has no 
networking abstraction layer, so you get to use neutron directly.

Let me know if this helps or if you need more info.
-Zack
________________________________
From: Jeffrey Nguyen (jeffrngu) [[email protected]<mailto:[email protected]>]
Sent: Wednesday, August 13, 2014 5:09 PM
To: [email protected]<mailto:[email protected]>; 
[email protected]<mailto:[email protected]>
Subject: How to get reference to NeutronApi from ComputeServiceContext


Hi,

I'm not sure whether this should be sent to user or dev aliases, so I'm 
including both.

I'm trying to access neutron API from an existing ComputeServiceContext.   This 
context was created with the "openstack-nova" provider.   For the neutron API, 
my understanding is the provider need to be set to "openstack-neutron".   My 
question is how to get a reference to neutron API given an existing 
ComputeServiceContext that was created for "openstack-nova".

Below is the code I see for getting reference to NovaApi from 
ComputeServiceContext.   Is there something similar for NeutronApi?   I checked 
jclouds lab code and there is NeutronApi but there isn't a NeutronAsyncApi.


ComputeServiceContext context;

RestContext<NovaApi, NovaAsyncApi> nova = context.unwrap();


Thanks,

-Jeffrey

Reply via email to