1

I want to list nodes in ec2 region using libcoud. How do I do that? Below gives east only.

Driver = get_driver(Provider.EC2)
conn = Driver(key, secret)
conn.list_nodes()
Assaf Lavie
  • 73,079
  • 34
  • 148
  • 203
Tampa
  • 75,446
  • 119
  • 278
  • 425

2 Answers2

1

You can get the relevant driver for that region:

cls = get_driver(Provider.EC2_US_WEST)
driver = cls(ACCESS_ID, SECRET_KEY)

Taken from the bottom example in this documentation page.

Assaf Lavie
  • 73,079
  • 34
  • 148
  • 203
1

You can do this via the driver initialization. For example:

ec2_conn = get_driver(Provider.EC2)(aws_key, aws_secret, region='us-west-1')
instances = ec2_conn.list_nodes(ex_node_ids=[i-xxxxxx])
print instances
cgseller
  • 3,875
  • 2
  • 19
  • 21