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
This commit is contained in:
Monty Taylor 2015-11-01 11:38:48 +09:00
parent 91e01482c6
commit edc5fc2d98
1 changed files with 12 additions and 19 deletions

View File

@ -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)