-
-
Save Kami/6d066089979c2bab7c43 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
from pprint import pprint | |
from libcloud.compute.types import Provider | |
from libcloud.compute.providers import get_driver | |
API_KEY = 'exoscale api key' | |
API_SECRET_KEY = 'exoscale api secret key' | |
cls = get_driver(Provider.EXOSCALE) | |
driver = cls(API_KEY, API_SECRET_KEY) | |
size = [size for size in driver.list_sizes() if size.name == 'Micro'][0] | |
image = [image for image in driver.list_images() if 'Ubuntu 12.04 LTS 64-bit' | |
in image.name][0] | |
name = 'exoscale-node-' + str(random.randint(0,100)) | |
node = driver.create_node(name=name, image=image, size=size) | |
pprint(node) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment