Hi folks,

I've been experimenting with jClouds over the last couple of days and I'd
like a little advice as to how to approach my problem. I've already had
some helpful advice from nacx on IRC which has got me this far.

I'm writing a tool that collects a local cache of information about
instances and other cloud resources from a number of cloud providers and
accounts and presents them through a unified API. Unfortunately it seems
that there are pieces of information that I want to include in my API
results that are not contained in the common API. Of note these are public
and private DNS names and the launch time of an instance.

After nacx pointed me in the direction of accessing the underlying specific
API (in the current case EC2), I managed to get the information I needed
but then found there were other pieces of data that I couldn't easily get -
in this case region.

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?

If it is of help, you can see the code I'm using at the moment (it's
Scala) at
https://github.com/guardian/prism/blob/sh-internal-collector/app/collectors/Collector.scala#L39
with
two approaches: getInstances - that just uses the EC2 API and
getInstancesViaAbstraction - that uses both common and specific API.

Two asides:
 - First: Is there any way to get the ARN for an instance? I'm using this
format as my unique ID (provider ID isn't unique) across all clouds but am
currently having to build it myself (as you can see in the code)
 - 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?

Many thanks for any tips or points you can give.
Simon


--
Simon Hildrew
Lead Infrastructure Developer
theguardian.com

Please consider the environment before printing this email.
------------------------------------------------------------------
Visit theguardian.com   

On your mobile, download the Guardian iPhone app theguardian.com/iphone and our 
iPad edition theguardian.com/iPad   
Save up to 33% by subscribing to the Guardian and Observer - choose the papers 
you want and get full digital access.
Visit subscribe.theguardian.com

This e-mail and all attachments are confidential and may also
be privileged. If you are not the named recipient, please notify
the sender and delete the e-mail and all attachments immediately.
Do not disclose the contents to another person. You may not use
the information for any purpose, or store, or copy, it in any way.
 
Guardian News & Media Limited is not liable for any computer
viruses or other material transmitted with or as part of this
e-mail. You should employ virus checking software.
 
Guardian News & Media Limited
 
A member of Guardian Media Group plc
Registered Office
PO Box 68164
Kings Place
90 York Way
London
N1P 2AP
 
Registered in England Number 908396

--------------------------------------------------------------------------

Reply via email to