from libcloud.compute.providers import get_driver from libcloud.compute.types import Provider cls = get_driver(Provider.AWS_EC2) driver = cls('ACCESS_KEY', 'SECRET_KEY') sizes = driver.list_sizes() for size in sizes: print size.id, size.name, size.ram, size.disk, size.bandwidth, size.price
from libcloud.compute.providers import get_driver from libcloud.compute.types import Provider from libcloud.compute.base import NodeSize cls = get_driver(Provider.AWS_EC2) driver = cls('ACCESS_KEY', 'SECRET_KEY') new_size = NodeSize('new_size', 'New Size', 2048, 80, 4, None, driver) driver.create_size(new_size)These examples demonstrate how the NodeSize class can be used to interact with cloud providers. The libcloud package provides a high-level interface for working with multiple cloud providers, including AWS EC2, Google Compute Engine, OpenStack, and many others.