You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2013/09/15 11:13:53 UTC
git commit: Issue LIBCLOUD-397: Add an IBM SCE Windows node example
to documentation
Updated Branches:
refs/heads/trunk 6791d030a -> 45dbb6bc9
Issue LIBCLOUD-397: Add an IBM SCE Windows node example to documentation
Signed-off-by: Tomaz Muraus <to...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/45dbb6bc
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/45dbb6bc
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/45dbb6bc
Branch: refs/heads/trunk
Commit: 45dbb6bc94343ec177a05db5b8cc76bbba8b89a0
Parents: 6791d03
Author: Sengor Kusturica <se...@gmail.com>
Authored: Sun Sep 15 11:13:01 2013 +1000
Committer: Tomaz Muraus <to...@apache.org>
Committed: Sun Sep 15 10:57:36 2013 +0200
----------------------------------------------------------------------
docs/compute/examples.rst | 12 ++++++++++
.../compute/create_ibm_sce_windows_node.py | 23 ++++++++++++++++++++
2 files changed, 35 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/45dbb6bc/docs/compute/examples.rst
----------------------------------------------------------------------
diff --git a/docs/compute/examples.rst b/docs/compute/examples.rst
index 86f1efd..1176795 100644
--- a/docs/compute/examples.rst
+++ b/docs/compute/examples.rst
@@ -116,3 +116,15 @@ This example demonstrates how to use OpenStack's floating IPs.
.. literalinclude:: /examples/compute/openstack_floating_ips.py
:language: python
+
+Create an IBM SCE Windows node using generic provider
+-----------------------------------------------------
+
+.. note::
+
+ ex_configurationData is the key component of this example.
+
+This example shows how to create a Windows node using IBM SmartCloud Enterpiese.
+
+.. literalinclude:: /examples/compute/create_ibm_sce_windows_node.py
+ :language: python
http://git-wip-us.apache.org/repos/asf/libcloud/blob/45dbb6bc/docs/examples/compute/create_ibm_sce_windows_node.py
----------------------------------------------------------------------
diff --git a/docs/examples/compute/create_ibm_sce_windows_node.py b/docs/examples/compute/create_ibm_sce_windows_node.py
new file mode 100644
index 0000000..bb940e8
--- /dev/null
+++ b/docs/examples/compute/create_ibm_sce_windows_node.py
@@ -0,0 +1,23 @@
+from libcloud.compute.types import Provider
+from libcloud.compute.providers import get_driver
+
+Driver = get_driver(Provider.IBM)
+conn = Driver("user@name.com", "ibm_sce_password")
+
+images = conn.list_images()
+image = [i for i in images if i.id == '20014110'][0]
+
+locations = conn.list_locations()
+location = [l for l in locations if l.id == '82'][0]
+
+sizes = conn.list_sizes()
+size = [s for s in sizes if s.id == 'COP32.1/2048/60'][0]
+
+node = conn.create_node(name="windows box",
+ image=image,
+ size=size,
+ ex_configurationData={
+ 'UserName': 'someone',
+ 'Password': 'Wind0wsPass'},
+ location=location)
+print(conn.list_nodes())