jclouds-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Phillips <andr...@apache.org>
Subject Re: Retrieving provider specific details using JClouds
Date Wed, 07 Aug 2013 13:43:56 GMT
> Here the nodes will be represented using NodeMetaData having standard
> attributes which hold true for all the cloud providers. What if I wish to
> access say aws-ec2 specific attributes without compromising on the generic
> code which hold true across vendors?

If you need to get access at AWS-specific APIs or classes, you can  
"unwrap" [1] the context to access the underlying API [2]:

AWSEC2Api awsApi = context.unwrapApi(AWSEC2Api.class);

If you only use the API in places where provider-specific logic is  
required, the remainder of the code should remain generic. See this  
recent thread [3] for an example of testing for a specific backing  
provider before unwrapping.


[3] http://apache.markmail.org/thread/g24ahltkamzf6bpp

View raw message