You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by an...@apache.org on 2017/07/10 07:45:24 UTC

[06/11] libcloud git commit: openstack example

openstack example


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/384f63d7
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/384f63d7
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/384f63d7

Branch: refs/heads/trunk
Commit: 384f63d7c09cd9455f6ba420dfa2cc721562ba3d
Parents: 17fa4a3
Author: Anthony Shaw <an...@apache.org>
Authored: Fri May 5 14:58:18 2017 +1000
Committer: Anthony Shaw <an...@apache.org>
Committed: Fri May 5 14:58:18 2017 +1000

----------------------------------------------------------------------
 demos/example_openstack.py | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/384f63d7/demos/example_openstack.py
----------------------------------------------------------------------
diff --git a/demos/example_openstack.py b/demos/example_openstack.py
new file mode 100644
index 0000000..4e3c42b
--- /dev/null
+++ b/demos/example_openstack.py
@@ -0,0 +1,17 @@
+from pprint import pprint
+
+from libcloud.compute.providers import get_driver
+from libcloud.compute.types import Provider
+
+Openstack = get_driver(Provider.OPENSTACK)
+
+con = Openstack(
+    'admin', 'password',
+    ex_force_auth_url='http://23.12.198.36/identity/v3/auth/tokens',
+    ex_force_base_url='http://23.12.198.36:8774/v2.1',
+    api_version='2.0',
+    ex_tenant_name='demo')
+
+pprint(con.list_locations())
+pprint(con.list_images())
+pprint(con.list_nodes())