Skip to content

Instantly share code, notes, and snippets.

@xlson
Created November 9, 2011 12:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xlson/1351346 to your computer and use it in GitHub Desktop.
Save xlson/1351346 to your computer and use it in GitHub Desktop.
Listing node metadata on ec2 with jclouds
@GrabResolver(name='jclouds snapshot', root='https://oss.sonatype.org/content/repositories/snapshots')
@Grab('org.jclouds:jclouds-allcompute:1.3.0-SNAPSHOT')
import org.jclouds.compute.ComputeServiceContextFactory
def accesskeyid = '...'
def secretkey = '...'
def context = new ComputeServiceContextFactory().createContext("aws-ec2", accesskeyid, secretkey)
def nodes = context.getComputeService().listNodes()
nodes.each{ println it.userMetadata }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment