Hi Simon
It seems that the common API is a good starting point (and does sensible
things around location and image), but I'd like to pull in a few fields
from the vendor specific API. However, I don't really want to call the API
twice. In an ideal world I'd like to call the common API and then unwrap
the results to get the specific API result data. Is this possible or does
the common API simply not contain the data?
From what I know, the data returned by calls to the portable APIs
has, for most providers, genuinely been transformed/extracted from the
data returned by the underlying provider (see e.g. [1])
In other words, we're not looking at some kind of "transparent view"
through which you could trapdoor your way to the underlying data - the
underlying response has been lost at that point. Hope that explanation
makes some kind of sense ;-)
With regard specifically to public/private DNS, if this is an
attribute offered by a fair number of providers, the best bet might be
to open a JIRA issue to add that to the standard metadata, or
otherwise expose it via the portable API. Obviously, that's only one
of many potential data points you might be after.
- First: Is there any way to get the ARN for an instance?
You *can* get the ARN for the IAM instance profile [2], but I'm not
aware of something to get the ARN of the instance itself. Seems like a
good candidate for a feature request (or, better still, *pull* request
[3] ;-)) to something like AWSRunningInstance [4].
- Secondly: I'm doing buildApi(classOf[AWSEC2Client]) on the
ContextBuilder to get the vendor specific API - however AWSEC2Client is
deprecated. If I use AWSEC2Api as suggested in the JavaDoc then I get a
guice exception (No implementation for org.jclouds.aws.ec2.AWSEC2Api was
bound) - any thoughts on what I should be doing?
Which version of jclouds are you using? If you're on 1.7.0-SNAPSHOT
and are still getting the Guice exception trying to use buildApi,
please put the full error in a Gist or Pastie and respond to this
thread.
Hope that helps!
ap
[1]
https://github.com/jclouds/jclouds/blob/master/apis/ec2/src/main/java/org/jclouds/ec2/compute/functions/RunningInstanceToNodeMetadata.java
[2]
http://javadocs.jclouds.cloudbees.net/org/jclouds/aws/ec2/domain/AWSRunningInstance.IAMInstanceProfile.html#getArn()
[3] https://wiki.apache.org/jclouds/How%20to%20Contribute
[4]
https://github.com/jclouds/jclouds/blob/master/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/domain/AWSRunningInstance.java