From edc5fc2d98b28e540de54cad313b4ce054188274 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sun, 1 Nov 2015 11:38:48 +0900 Subject: [PATCH] Update README to not reference client passthrough It's there and we support it, but we don't have to _talk_ about it. Change-Id: Ia3419a72fa13d42a17ddc0243d7800e462a827b2 --- README.rst | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/README.rst b/README.rst index 9b1d254ca..33eda5c98 100644 --- a/README.rst +++ b/README.rst @@ -24,29 +24,22 @@ Sometimes an example is nice. :: import shade - import time + + # Initialize and turn on debug loggin + shade.simple_logging(debug=True) # Initialize cloud # Cloud configs are read with os-client-config cloud = shade.openstack_cloud(cloud='mordred') - # OpenStackCloud object has an interface exposing OpenStack services methods - print cloud.list_servers() - s = cloud.list_servers()[0] + # Upload an image to the cloud + image = cloud.create_image( + 'ubuntu-trusty', filename='ubuntu-trusty.qcow2', wait=True) - # But you can also access the underlying python-*client objects - # This will go away at some point in time and should be considered only - # usable for temporary poking - cinder = cloud.cinder_client - volumes = cinder.volumes.list() - volume_id = [v for v in volumes if v['status'] == 'available'][0]['id'] - nova = cloud.nova_client - print nova.volumes.create_server_volume(s['id'], volume_id, None) - attachments = [] - print volume_id - while not attachments: - print "Waiting for attach to finish" - time.sleep(1) - attachments = cinder.volumes.get(volume_id).attachments - print attachments + # Find a flavor with at least 512M of RAM + flavor = cloud.get_flavor_by_ram(512) + # Boot a server, wait for it to boot, and then do whatever is needed + # to get a public ip for it. + cloud.create_server( + 'my-server', image=image, flavor=flavor, wait=True, auto_ip=True)