To add a collaborator to this project you will need to use the Relish gem to add the collaborator via a terminal command. Soon you'll be able to also add collaborators here!
More about adding a collaboratorCreate server (python)
The following code example shows how to list flavors for the python SDK.
See also Listing Flavors in the OpenStack documentation.
- Scenarios
-
- Create server (python)
-
- Given
- I am setup to run example code for python
- When
-
I execute the following code:
import os import pyrax pyrax.set_setting("identity_type", "rackspace") pyrax.set_credentials(os.environ['OS_USERNAME'], os.environ['OS_PASSWORD']) cs = pyrax.cloudservers server_name = 'pyrax_text' ubu_image = [img for img in cs.images.list() if "12.04" in img.name][0] flavor_512 = [flavor for flavor in cs.flavors.list() if flavor.ram == 512][0] server = cs.servers.create(server_name, ubu_image.id, flavor_512.id) pyrax.utils.wait_until(server, "status", "ACTIVE", interval=1, attempts=30) print server.id
- Then
- I should have created an "Ubuntu" server with 512MB of RAM
Last published almost 7 years ago by Max Lincoln.