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) [[email protected]]
Sent: Wednesday, August 13, 2014 11:32 PM
To: [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