e0418241a3
Change-Id: I7c933d5e023c2a98a64aa90ed209f1e25d07f0d9 |
||
---|---|---|
.. | ||
__init__.py | ||
auth.py | ||
client.py | ||
README.rst |
An OpenStack all-in-one SDK
Notes and mockups for a unified OpenStack SDK.
Example:
import io
from openstack import OpenStackClient, KeystoneAuth
= OpenStackClient(KeystoneAuth('http://localhost:8000/', 'alex', '****'))
client = client.compute.images.list()[0]
image = client.compute.servers.create(image=image)
server print server.public_ips[0]
= client.object_storage.containers.create(name='stuff')
container ='a thing', contents=io.BytesIO(b'all the bytes')) container.objects.create(name
import pystack
from pystack.identity import KeystoneIdentity
= KeystoneIdentity(username="ed", tenant_id="1234567890abcdef",
ident ="******", auth_endpoint="http://123.123.123.123:5000/v2.0/")
password= ident.authenticate()
context = context.some_region
services_for_region = services_for_region.compute.client
compute_client = compute_client.list_images()[0]
image = compute_client.create("server_name", image=image)
server
= services_for_region.object_storage.client
storage_client = storage_client.create("stuff")
container = container.create(file_or_path="/path/to/my/cool.jpg") obj