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

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

RE: How to get reference to NeutronApi from ComputeServiceContext

Posted by Zack Shoylev <za...@RACKSPACE.COM>.
Hi Jeffrey,

The endpoint is most likely set in the provider you use. For example, in cloudservers-us (The US rackspace provider), we have:
https://github.com/jclouds/jclouds/blob/master/providers/rackspace-cloudservers-us/src/main/java/org/jclouds/rackspace/cloudservers/us/CloudServersUSProviderMetadata.java#L84

For neutron, the endpoint will likely be the same. For openstack deployments, the endpoints will also be in the service catalog.

-Zack

________________________________
From: Jeffrey Nguyen (jeffrngu) [jeffrngu@cisco.com]
Sent: Wednesday, August 13, 2014 11:32 PM
To: user@jclouds.apache.org
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 <za...@RACKSPACE.COM>>
Reply-To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
Date: Wednesday, August 13, 2014 6:41 PM
To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
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) [jeffrngu@cisco.com<ma...@cisco.com>]
Sent: Wednesday, August 13, 2014 5:09 PM
To: user@jclouds.apache.org<ma...@jclouds.apache.org>; dev@jclouds.apache.org<ma...@jclouds.apache.org>
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

RE: How to get reference to NeutronApi from ComputeServiceContext

Posted by Andrew Phillips <an...@apache.org>.
> Usually I would not recommend using different versions of the  
> dependencies. However, I don't recall any particular reasons they  
> might conflict.

Definitely would like to repeat that it's not recommended to mix  
different versions of jclouds JARs in your app. But of course, we can  
always try and see ;-)

ap

Re: How to get reference to NeutronApi from ComputeServiceContext

Posted by "Jeffrey Nguyen (jeffrngu)" <je...@cisco.com>.
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 <ig...@gmail.com>>
Reply-To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
Date: Thursday, August 14, 2014 10:50 AM
To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
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)" <je...@cisco.com>> 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 <za...@RACKSPACE.COM>>
Reply-To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
Date: Thursday, August 14, 2014 5:56 AM
To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
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) [jeffrngu@cisco.com<ma...@cisco.com>]
Sent: Thursday, August 14, 2014 12:18 AM
To: user@jclouds.apache.org<ma...@jclouds.apache.org>
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 <za...@RACKSPACE.COM>>
Reply-To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
Date: Wednesday, August 13, 2014 10:10 PM
To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
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) [jeffrngu@cisco.com<ma...@cisco.com>]
Sent: Wednesday, August 13, 2014 11:48 PM
To: user@jclouds.apache.org<ma...@jclouds.apache.org>
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 <je...@cisco.com>>
Reply-To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
Date: Wednesday, August 13, 2014 9:32 PM
To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
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 <za...@RACKSPACE.COM>>
Reply-To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
Date: Wednesday, August 13, 2014 6:41 PM
To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
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) [jeffrngu@cisco.com<ma...@cisco.com>]
Sent: Wednesday, August 13, 2014 5:09 PM
To: user@jclouds.apache.org<ma...@jclouds.apache.org>; dev@jclouds.apache.org<ma...@jclouds.apache.org>
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

Re: How to get reference to NeutronApi from ComputeServiceContext

Posted by Ignasi Barrera <ig...@gmail.com>.
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)" <je...@cisco.com>
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 <za...@RACKSPACE.COM>
> Reply-To: "user@jclouds.apache.org" <us...@jclouds.apache.org>
> Date: Thursday, August 14, 2014 5:56 AM
> To: "user@jclouds.apache.org" <us...@jclouds.apache.org>
> 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) [jeffrngu@cisco.com]
> *Sent:* Thursday, August 14, 2014 12:18 AM
> *To:* user@jclouds.apache.org
> *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 <za...@RACKSPACE.COM>
> Reply-To: "user@jclouds.apache.org" <us...@jclouds.apache.org>
> Date: Wednesday, August 13, 2014 10:10 PM
> To: "user@jclouds.apache.org" <us...@jclouds.apache.org>
> 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) [jeffrngu@cisco.com]
> *Sent:* Wednesday, August 13, 2014 11:48 PM
> *To:* user@jclouds.apache.org
> *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 <je...@cisco.com>
> Reply-To: "user@jclouds.apache.org" <us...@jclouds.apache.org>
> Date: Wednesday, August 13, 2014 9:32 PM
> To: "user@jclouds.apache.org" <us...@jclouds.apache.org>
> 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 <za...@RACKSPACE.COM>
> Reply-To: "user@jclouds.apache.org" <us...@jclouds.apache.org>
> Date: Wednesday, August 13, 2014 6:41 PM
> To: "user@jclouds.apache.org" <us...@jclouds.apache.org>
> 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) [jeffrngu@cisco.com]
> *Sent:* Wednesday, August 13, 2014 5:09 PM
> *To:* user@jclouds.apache.org; dev@jclouds.apache.org
> *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
>
>

Re: How to get reference to NeutronApi from ComputeServiceContext

Posted by "Jeffrey Nguyen (jeffrngu)" <je...@cisco.com>.
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 <za...@RACKSPACE.COM>>
Reply-To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
Date: Thursday, August 14, 2014 5:56 AM
To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
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) [jeffrngu@cisco.com<ma...@cisco.com>]
Sent: Thursday, August 14, 2014 12:18 AM
To: user@jclouds.apache.org<ma...@jclouds.apache.org>
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 <za...@RACKSPACE.COM>>
Reply-To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
Date: Wednesday, August 13, 2014 10:10 PM
To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
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) [jeffrngu@cisco.com<ma...@cisco.com>]
Sent: Wednesday, August 13, 2014 11:48 PM
To: user@jclouds.apache.org<ma...@jclouds.apache.org>
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 <je...@cisco.com>>
Reply-To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
Date: Wednesday, August 13, 2014 9:32 PM
To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
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 <za...@RACKSPACE.COM>>
Reply-To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
Date: Wednesday, August 13, 2014 6:41 PM
To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
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) [jeffrngu@cisco.com<ma...@cisco.com>]
Sent: Wednesday, August 13, 2014 5:09 PM
To: user@jclouds.apache.org<ma...@jclouds.apache.org>; dev@jclouds.apache.org<ma...@jclouds.apache.org>
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

RE: How to get reference to NeutronApi from ComputeServiceContext

Posted by Zack Shoylev <za...@RACKSPACE.COM>.
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) [jeffrngu@cisco.com]
Sent: Thursday, August 14, 2014 12:18 AM
To: user@jclouds.apache.org
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 <za...@RACKSPACE.COM>>
Reply-To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
Date: Wednesday, August 13, 2014 10:10 PM
To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
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) [jeffrngu@cisco.com<ma...@cisco.com>]
Sent: Wednesday, August 13, 2014 11:48 PM
To: user@jclouds.apache.org<ma...@jclouds.apache.org>
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 <je...@cisco.com>>
Reply-To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
Date: Wednesday, August 13, 2014 9:32 PM
To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
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 <za...@RACKSPACE.COM>>
Reply-To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
Date: Wednesday, August 13, 2014 6:41 PM
To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
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) [jeffrngu@cisco.com<ma...@cisco.com>]
Sent: Wednesday, August 13, 2014 5:09 PM
To: user@jclouds.apache.org<ma...@jclouds.apache.org>; dev@jclouds.apache.org<ma...@jclouds.apache.org>
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

Re: How to get reference to NeutronApi from ComputeServiceContext

Posted by "Jeffrey Nguyen (jeffrngu)" <je...@cisco.com>.
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 <za...@RACKSPACE.COM>>
Reply-To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
Date: Wednesday, August 13, 2014 10:10 PM
To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
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) [jeffrngu@cisco.com<ma...@cisco.com>]
Sent: Wednesday, August 13, 2014 11:48 PM
To: user@jclouds.apache.org<ma...@jclouds.apache.org>
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 <je...@cisco.com>>
Reply-To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
Date: Wednesday, August 13, 2014 9:32 PM
To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
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 <za...@RACKSPACE.COM>>
Reply-To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
Date: Wednesday, August 13, 2014 6:41 PM
To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
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) [jeffrngu@cisco.com<ma...@cisco.com>]
Sent: Wednesday, August 13, 2014 5:09 PM
To: user@jclouds.apache.org<ma...@jclouds.apache.org>; dev@jclouds.apache.org<ma...@jclouds.apache.org>
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

RE: How to get reference to NeutronApi from ComputeServiceContext

Posted by Zack Shoylev <za...@RACKSPACE.COM>.
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) [jeffrngu@cisco.com]
Sent: Wednesday, August 13, 2014 11:48 PM
To: user@jclouds.apache.org
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 <je...@cisco.com>>
Reply-To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
Date: Wednesday, August 13, 2014 9:32 PM
To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
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 <za...@RACKSPACE.COM>>
Reply-To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
Date: Wednesday, August 13, 2014 6:41 PM
To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
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) [jeffrngu@cisco.com<ma...@cisco.com>]
Sent: Wednesday, August 13, 2014 5:09 PM
To: user@jclouds.apache.org<ma...@jclouds.apache.org>; dev@jclouds.apache.org<ma...@jclouds.apache.org>
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

Re: How to get reference to NeutronApi from ComputeServiceContext

Posted by "Jeffrey Nguyen (jeffrngu)" <je...@cisco.com>.
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 <je...@cisco.com>>
Reply-To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
Date: Wednesday, August 13, 2014 9:32 PM
To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
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 <za...@RACKSPACE.COM>>
Reply-To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
Date: Wednesday, August 13, 2014 6:41 PM
To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
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) [jeffrngu@cisco.com<ma...@cisco.com>]
Sent: Wednesday, August 13, 2014 5:09 PM
To: user@jclouds.apache.org<ma...@jclouds.apache.org>; dev@jclouds.apache.org<ma...@jclouds.apache.org>
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

Re: How to get reference to NeutronApi from ComputeServiceContext

Posted by "Jeffrey Nguyen (jeffrngu)" <je...@cisco.com>.
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 <za...@RACKSPACE.COM>>
Reply-To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
Date: Wednesday, August 13, 2014 6:41 PM
To: "user@jclouds.apache.org<ma...@jclouds.apache.org>" <us...@jclouds.apache.org>>
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) [jeffrngu@cisco.com<ma...@cisco.com>]
Sent: Wednesday, August 13, 2014 5:09 PM
To: user@jclouds.apache.org<ma...@jclouds.apache.org>; dev@jclouds.apache.org<ma...@jclouds.apache.org>
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

RE: How to get reference to NeutronApi from ComputeServiceContext

Posted by Zack Shoylev <za...@RACKSPACE.COM>.
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) [jeffrngu@cisco.com]
Sent: Wednesday, August 13, 2014 5:09 PM
To: user@jclouds.apache.org; dev@jclouds.apache.org
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