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/02/21 16:17:54 UTC

[1/7] libcloud git commit: fix lint issue

Repository: libcloud
Updated Branches:
  refs/heads/trunk 419c69441 -> 57913fceb


fix lint issue


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

Branch: refs/heads/trunk
Commit: c778f1d42816575198759eb97a33c63855269971
Parents: 0031900
Author: Samuel Chong <sa...@Samuels-MacBook-Pro.local>
Authored: Thu Jan 5 13:30:38 2017 +1100
Committer: Anthony Shaw <an...@apache.org>
Committed: Tue Feb 21 17:17:27 2017 +0100

----------------------------------------------------------------------
 .../compute/dimensiondata/Nodes_Create_mcp2_Uncustomised.py     | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/c778f1d4/docs/examples/compute/dimensiondata/Nodes_Create_mcp2_Uncustomised.py
----------------------------------------------------------------------
diff --git a/docs/examples/compute/dimensiondata/Nodes_Create_mcp2_Uncustomised.py b/docs/examples/compute/dimensiondata/Nodes_Create_mcp2_Uncustomised.py
index f0b4042..5abb3cd 100644
--- a/docs/examples/compute/dimensiondata/Nodes_Create_mcp2_Uncustomised.py
+++ b/docs/examples/compute/dimensiondata/Nodes_Create_mcp2_Uncustomised.py
@@ -6,7 +6,7 @@ import libcloud.security
 # Get dimension data driver
 libcloud.security.VERIFY_SSL_CERT = True
 cls = get_driver(Provider.DIMENSIONDATA)
-driver = cls('myusername','mypassword', region='dd-au')
+driver = cls('myusername', 'mypassword', region='dd-au')
 
 # Get location
 location = driver.ex_get_location_by_id(id='AU9')
@@ -14,7 +14,8 @@ location = driver.ex_get_location_by_id(id='AU9')
 # Get network domain by location
 networkDomainName = "Test Apache Libcloud"
 network_domains = driver.ex_list_network_domains(location=location)
-my_network_domain = [d for d in network_domains if d.name == networkDomainName][0]
+my_network_domain = [d for d in network_domains if d.name ==
+                     networkDomainName][0]
 
 vlan = driver.ex_list_vlans(name='Libcloud Test VLAN')[0]
 


[7/7] libcloud git commit: Document xml parsing issue due to lower version of python 2.7 Closes #966

Posted by an...@apache.org.
Document xml parsing issue due to lower version of python 2.7
Closes #966


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

Branch: refs/heads/trunk
Commit: 57913fceba52b8100425c0a151aa759936d70545
Parents: c778f1d
Author: Samuel Chong <sa...@Samuels-MacBook-Pro.local>
Authored: Tue Jan 17 09:30:40 2017 +1100
Committer: Anthony Shaw <an...@apache.org>
Committed: Tue Feb 21 17:17:35 2017 +0100

----------------------------------------------------------------------
 docs/compute/drivers/dimensiondata.rst | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/57913fce/docs/compute/drivers/dimensiondata.rst
----------------------------------------------------------------------
diff --git a/docs/compute/drivers/dimensiondata.rst b/docs/compute/drivers/dimensiondata.rst
index 098f727..ac7a947 100644
--- a/docs/compute/drivers/dimensiondata.rst
+++ b/docs/compute/drivers/dimensiondata.rst
@@ -66,3 +66,25 @@ API Docs
     :inherited-members:
 
 .. _`API`: http://cloud.dimensiondata.com/au/en/services/public-cloud/api
+
+
+Debugging Tips
+--------------
+
+**Problem description: XML parsing issue for python version 2.7.5**
+
+    *Example*::
+
+      ip_address_collection=ip_addr_collection, child_ip_address_lists=None)
+      File "/Users/andrewdas/Documents/Python/lib/python2.7/site-packages/libcloud/compute/drivers/dimensiondata.py", line 3185, in ex_edit_ip_address_list
+        'xmlns:xsi': "http://www.w3.org/2001/XMLSchema-instance"
+      File "lxml.etree.pyx", line 2912, in lxml.etree.Element (src/lxml/lxml.etree.c:68681)
+      File "apihelpers.pxi", line 140, in lxml.etree._makeElement (src/lxml/lxml.etree.c:15242)
+      File "apihelpers.pxi", line 128, in lxml.etree._makeElement (src/lxml/lxml.etree.c:15125)
+      File "apihelpers.pxi", line 287, in lxml.etree._initNodeAttributes (src/lxml/lxml.etree.c:17012)
+      File "apihelpers.pxi", line 296, in lxml.etree._addAttributeToNode (src/lxml/lxml.etree.c:17180)
+      File "apihelpers.pxi", line 1583, in lxml.etree._attributeValidOrRaise (src/lxml/lxml.etree.c:29377)
+      ValueError: Invalid attribute name u'xmlns:xsi'
+
+    *Solution*:
+    - Upgrade to python version 2.7.12 and above
\ No newline at end of file


[3/7] libcloud git commit: Add 1 blank line to fix lint issue

Posted by an...@apache.org.
Add 1 blank line to fix lint issue


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

Branch: refs/heads/trunk
Commit: 5cb945ac4577a4c3f625a984391461854231e1e2
Parents: 8d52e9f
Author: Samuel Chong <sa...@gmail.com>
Authored: Thu Jan 5 10:51:23 2017 +1100
Committer: Anthony Shaw <an...@apache.org>
Committed: Tue Feb 21 17:17:27 2017 +0100

----------------------------------------------------------------------
 libcloud/test/compute/test_dimensiondata_v2_4.py | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/5cb945ac/libcloud/test/compute/test_dimensiondata_v2_4.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_dimensiondata_v2_4.py b/libcloud/test/compute/test_dimensiondata_v2_4.py
index 12e4b63..8193622 100644
--- a/libcloud/test/compute/test_dimensiondata_v2_4.py
+++ b/libcloud/test/compute/test_dimensiondata_v2_4.py
@@ -2119,6 +2119,7 @@ class DimensionData_v2_4_Tests(unittest.TestCase, TestCaseMixin):
             ex_tagname_value_pairs = None)
         self.assertEqual(node.id, 'e75ead52-692f-4314-8725-c8a4f4d13a87')
 
+
 class InvalidRequestError(Exception):
     def __init__(self, tag):
         super(InvalidRequestError, self).__init__("Invalid Request - %s" % tag)


[2/7] libcloud git commit: Removed unwanted space

Posted by an...@apache.org.
Removed unwanted space


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

Branch: refs/heads/trunk
Commit: 003190054d8cf937ad1acf6752b30af5731a6854
Parents: 096b606
Author: Samuel Chong <sa...@gmail.com>
Authored: Thu Jan 5 11:38:28 2017 +1100
Committer: Anthony Shaw <an...@apache.org>
Committed: Tue Feb 21 17:17:27 2017 +0100

----------------------------------------------------------------------
 libcloud/test/compute/test_dimensiondata_v2_4.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/00319005/libcloud/test/compute/test_dimensiondata_v2_4.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_dimensiondata_v2_4.py b/libcloud/test/compute/test_dimensiondata_v2_4.py
index 8193622..d746d05 100644
--- a/libcloud/test/compute/test_dimensiondata_v2_4.py
+++ b/libcloud/test/compute/test_dimensiondata_v2_4.py
@@ -2095,9 +2095,9 @@ class DimensionData_v2_4_Tests(unittest.TestCase, TestCaseMixin):
             ex_primary_nic_vlan=vlan,
             ex_primary_nic_network_adapter=None,
             ex_additional_nics=None,
-            ex_disks = None,
-            ex_tagid_value_pairs = None,
-            ex_tagname_value_pairs = None)
+            ex_disks=None,
+            ex_tagid_value_pairs=None,
+            ex_tagname_value_pairs=None)
         self.assertEqual(node.id, 'e75ead52-692f-4314-8725-c8a4f4d13a87')
 
     def test_ex_create_node_uncustomized_mcp2_using_ipv4(self):
@@ -2114,9 +2114,9 @@ class DimensionData_v2_4_Tests(unittest.TestCase, TestCaseMixin):
             ex_primary_nic_vlan=None,
             ex_primary_nic_network_adapter=None,
             ex_additional_nics=None,
-            ex_disks = None,
-            ex_tagid_value_pairs = None,
-            ex_tagname_value_pairs = None)
+            ex_disks=None,
+            ex_tagid_value_pairs=None,
+            ex_tagname_value_pairs=None)
         self.assertEqual(node.id, 'e75ead52-692f-4314-8725-c8a4f4d13a87')
 
 


[4/7] libcloud git commit: unit test and documentation for deploy uncustomised server

Posted by an...@apache.org.
unit test and documentation for deploy uncustomised server


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

Branch: refs/heads/trunk
Commit: 8d52e9f66924bbc8317dcf74b4c9c0eec2e0c7f3
Parents: 419c694
Author: Samuel Chong <sa...@gmail.com>
Authored: Wed Jan 4 14:36:27 2017 +1100
Committer: Anthony Shaw <an...@apache.org>
Committed: Tue Feb 21 17:17:27 2017 +0100

----------------------------------------------------------------------
 libcloud/compute/drivers/dimensiondata.py       | 60 ++++++++++++++++++++
 .../2.4/deploy_customised_server.xml            |  7 +++
 .../test/compute/test_dimensiondata_v2_4.py     | 48 ++++++++++++++++
 3 files changed, 115 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/8d52e9f6/libcloud/compute/drivers/dimensiondata.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/dimensiondata.py b/libcloud/compute/drivers/dimensiondata.py
index c47eedd..e172958 100644
--- a/libcloud/compute/drivers/dimensiondata.py
+++ b/libcloud/compute/drivers/dimensiondata.py
@@ -3830,6 +3830,66 @@ class DimensionDataNodeDriver(NodeDriver):
 
         Create Node in MCP2 Data Center
 
+        >>> from pprint import pprint
+        >>> from libcloud.compute.types import Provider
+        >>> from libcloud.compute.providers import get_driver
+        >>> import libcloud.security
+        >>>
+        >>> # Get dimension data driver
+        >>> libcloud.security.VERIFY_SSL_CERT = True
+        >>> cls = get_driver(Provider.DIMENSIONDATA)
+        >>> driver = cls('schong_platcaas', 'T3stst@r!', region='dd-au')
+        >>> # driver = cls('myusername','mypassword', region='dd-au')
+        >>>
+        >>> # Get location
+        >>> location = driver.ex_get_location_by_id(id='AU9')
+        >>>
+        >>> # Get network domain by location
+        >>> networkDomainName = "Test Apache Libcloud"
+        >>> network_domains = driver.ex_list_network_domains(location=location)
+        >>> my_network_domain = [d for d in network_domains if d.name ==
+        >>>                     networkDomainName][0]
+        >>>
+        >>> vlan = driver.ex_list_vlans(name='Libcloud Test VLAN')[0]
+        >>>
+        >>> # Get Image
+        >>> images = driver.ex_list_customer_images(location=location)
+        >>> image = images[1]
+        >>>
+        >>> tags = driver.ex_list_tags()
+        >>> pprint(tags)
+        >>>
+        >>> ex_tagname_value_pairs = {}
+        >>> ex_tagname_value_pairs['AA_Tag1'] = 'demo 1'
+        >>> ex_tagname_value_pairs['AA_Tag2'] = 'demo 2'
+        >>>
+        >>> ex_tagid_value_pairs = {}
+        >>> ex_tagid_value_pairs['4927c8fd-7f41-4206-a7d5-c5def927c6d2'] =
+        >>>                      'demo 1'
+        >>> ex_tagid_value_pairs['2579fc7c-a89c-47cd-ac3b-67999dded93b'] =
+        >>>                      'demo 2'
+        >>>
+        >>>
+        >>> # Create node using vlan instead of private IPv4
+        >>> node = driver.ex_create_node_uncustomized(
+        >>>     name='test_server_05',
+        >>>     image=image,
+        >>>     ex_network_domain=my_network_domain,
+        >>>     ex_is_started=False,
+        >>>     ex_description=None,
+        >>>     ex_cluster_id=None,
+        >>>     ex_cpu_specification=None,
+        >>>     ex_memory_gb=None,
+        >>>     ex_primary_nic_private_ipv4=None,
+        >>>     ex_primary_nic_vlan=vlan,
+        >>>     ex_primary_nic_network_adapter=None,
+        >>>     ex_additional_nics=None,
+        >>>     ex_disks=None,
+        >>>     ex_tagid_value_pairs=ex_tagid_value_pairs,
+        >>>     ex_tagname_value_pairs=None
+        >>> )
+        >>>
+        >>> pprint(node)
 
         :keyword    name:   (required) String with a name for this new node
         :type       name:   ``str``

http://git-wip-us.apache.org/repos/asf/libcloud/blob/8d52e9f6/libcloud/test/compute/fixtures/dimensiondata/2.4/deploy_customised_server.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/dimensiondata/2.4/deploy_customised_server.xml b/libcloud/test/compute/fixtures/dimensiondata/2.4/deploy_customised_server.xml
new file mode 100644
index 0000000..d849494
--- /dev/null
+++ b/libcloud/test/compute/fixtures/dimensiondata/2.4/deploy_customised_server.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<response xmlns="urn:didata.com:api:cloud:types" requestId="na9_20160321T074626030- 0400_7e9fffe7-190b-46f2-9107-9d52fe57d0ad">
+  <operation>DEPLOY_UNCUSTOMIZED_SERVER</operation>
+  <responseCode>IN_PROGRESS</responseCode>
+  <message>Request to deploy uncustomized Server 'Production Server' has been accepted and is being processed.</message>
+  <info name="serverId" value="e75ead52-692f-4314-8725-c8a4f4d13a87"/>
+</response>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/libcloud/blob/8d52e9f6/libcloud/test/compute/test_dimensiondata_v2_4.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_dimensiondata_v2_4.py b/libcloud/test/compute/test_dimensiondata_v2_4.py
index 22ae407..12e4b63 100644
--- a/libcloud/test/compute/test_dimensiondata_v2_4.py
+++ b/libcloud/test/compute/test_dimensiondata_v2_4.py
@@ -2077,6 +2077,47 @@ class DimensionData_v2_4_Tests(unittest.TestCase, TestCaseMixin):
             network_adapter_name='E1000')
         self.assertTrue(success)
 
+    def test_ex_create_node_uncustomized_mcp2_using_vlan(self):
+        # Get VLAN
+        vlan = self.driver.ex_get_vlan('0e56433f-d808-4669-821d-812769517ff8')
+
+        # Create node using vlan instead of private IPv4
+        node = self.driver.ex_create_node_uncustomized(
+            name='test_server_05',
+            image='fake_customer_image',
+            ex_network_domain='fakenetworkdomain',
+            ex_is_started=False,
+            ex_description=None,
+            ex_cluster_id=None,
+            ex_cpu_specification=None,
+            ex_memory_gb=None,
+            ex_primary_nic_private_ipv4=None,
+            ex_primary_nic_vlan=vlan,
+            ex_primary_nic_network_adapter=None,
+            ex_additional_nics=None,
+            ex_disks = None,
+            ex_tagid_value_pairs = None,
+            ex_tagname_value_pairs = None)
+        self.assertEqual(node.id, 'e75ead52-692f-4314-8725-c8a4f4d13a87')
+
+    def test_ex_create_node_uncustomized_mcp2_using_ipv4(self):
+        node = self.driver.ex_create_node_uncustomized(
+            name='test_server_05',
+            image='fake_customer_image',
+            ex_network_domain='fakenetworkdomain',
+            ex_is_started=False,
+            ex_description=None,
+            ex_cluster_id=None,
+            ex_cpu_specification=None,
+            ex_memory_gb=None,
+            ex_primary_nic_private_ipv4='10.0.0.1',
+            ex_primary_nic_vlan=None,
+            ex_primary_nic_network_adapter=None,
+            ex_additional_nics=None,
+            ex_disks = None,
+            ex_tagid_value_pairs = None,
+            ex_tagname_value_pairs = None)
+        self.assertEqual(node.id, 'e75ead52-692f-4314-8725-c8a4f4d13a87')
 
 class InvalidRequestError(Exception):
     def __init__(self, tag):
@@ -3355,5 +3396,12 @@ class DimensionDataMockHttp(StorageMockHttp, MockHttp):
         )
         return httplib.OK, body, {}, httplib.responses[httplib.OK]
 
+    def _caas_2_4_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deployUncustomizedServer(
+            self, method, url, body, headers):
+        body = self.fixtures.load(
+            '2.4/deploy_customised_server.xml'
+        )
+        return httplib.OK, body, {}, httplib.responses[httplib.OK]
+
 if __name__ == '__main__':
     sys.exit(unittest.main())


[5/7] libcloud git commit: Move sample code to docs/examples

Posted by an...@apache.org.
Move sample code to docs/examples


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

Branch: refs/heads/trunk
Commit: 168c7a1981cfe406b040c33a66228206dbeee3d5
Parents: 5cb945a
Author: Samuel Chong <sa...@gmail.com>
Authored: Thu Jan 5 11:01:34 2017 +1100
Committer: Anthony Shaw <an...@apache.org>
Committed: Tue Feb 21 17:17:27 2017 +0100

----------------------------------------------------------------------
 libcloud/compute/drivers/dimensiondata.py | 61 --------------------------
 1 file changed, 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/168c7a19/libcloud/compute/drivers/dimensiondata.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/dimensiondata.py b/libcloud/compute/drivers/dimensiondata.py
index e172958..697a072 100644
--- a/libcloud/compute/drivers/dimensiondata.py
+++ b/libcloud/compute/drivers/dimensiondata.py
@@ -3830,67 +3830,6 @@ class DimensionDataNodeDriver(NodeDriver):
 
         Create Node in MCP2 Data Center
 
-        >>> from pprint import pprint
-        >>> from libcloud.compute.types import Provider
-        >>> from libcloud.compute.providers import get_driver
-        >>> import libcloud.security
-        >>>
-        >>> # Get dimension data driver
-        >>> libcloud.security.VERIFY_SSL_CERT = True
-        >>> cls = get_driver(Provider.DIMENSIONDATA)
-        >>> driver = cls('schong_platcaas', 'T3stst@r!', region='dd-au')
-        >>> # driver = cls('myusername','mypassword', region='dd-au')
-        >>>
-        >>> # Get location
-        >>> location = driver.ex_get_location_by_id(id='AU9')
-        >>>
-        >>> # Get network domain by location
-        >>> networkDomainName = "Test Apache Libcloud"
-        >>> network_domains = driver.ex_list_network_domains(location=location)
-        >>> my_network_domain = [d for d in network_domains if d.name ==
-        >>>                     networkDomainName][0]
-        >>>
-        >>> vlan = driver.ex_list_vlans(name='Libcloud Test VLAN')[0]
-        >>>
-        >>> # Get Image
-        >>> images = driver.ex_list_customer_images(location=location)
-        >>> image = images[1]
-        >>>
-        >>> tags = driver.ex_list_tags()
-        >>> pprint(tags)
-        >>>
-        >>> ex_tagname_value_pairs = {}
-        >>> ex_tagname_value_pairs['AA_Tag1'] = 'demo 1'
-        >>> ex_tagname_value_pairs['AA_Tag2'] = 'demo 2'
-        >>>
-        >>> ex_tagid_value_pairs = {}
-        >>> ex_tagid_value_pairs['4927c8fd-7f41-4206-a7d5-c5def927c6d2'] =
-        >>>                      'demo 1'
-        >>> ex_tagid_value_pairs['2579fc7c-a89c-47cd-ac3b-67999dded93b'] =
-        >>>                      'demo 2'
-        >>>
-        >>>
-        >>> # Create node using vlan instead of private IPv4
-        >>> node = driver.ex_create_node_uncustomized(
-        >>>     name='test_server_05',
-        >>>     image=image,
-        >>>     ex_network_domain=my_network_domain,
-        >>>     ex_is_started=False,
-        >>>     ex_description=None,
-        >>>     ex_cluster_id=None,
-        >>>     ex_cpu_specification=None,
-        >>>     ex_memory_gb=None,
-        >>>     ex_primary_nic_private_ipv4=None,
-        >>>     ex_primary_nic_vlan=vlan,
-        >>>     ex_primary_nic_network_adapter=None,
-        >>>     ex_additional_nics=None,
-        >>>     ex_disks=None,
-        >>>     ex_tagid_value_pairs=ex_tagid_value_pairs,
-        >>>     ex_tagname_value_pairs=None
-        >>> )
-        >>>
-        >>> pprint(node)
-
         :keyword    name:   (required) String with a name for this new node
         :type       name:   ``str``
 


[6/7] libcloud git commit: add sample code create node uncustomised

Posted by an...@apache.org.
add sample code create node uncustomised


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

Branch: refs/heads/trunk
Commit: 096b6065f8454ff70b07dc45b9fc24619397ab8b
Parents: 168c7a1
Author: Samuel Chong <sa...@gmail.com>
Authored: Thu Jan 5 11:03:21 2017 +1100
Committer: Anthony Shaw <an...@apache.org>
Committed: Tue Feb 21 17:17:27 2017 +0100

----------------------------------------------------------------------
 .../Nodes_Create_mcp2_Uncustomised.py           | 56 ++++++++++++++++++++
 1 file changed, 56 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/096b6065/docs/examples/compute/dimensiondata/Nodes_Create_mcp2_Uncustomised.py
----------------------------------------------------------------------
diff --git a/docs/examples/compute/dimensiondata/Nodes_Create_mcp2_Uncustomised.py b/docs/examples/compute/dimensiondata/Nodes_Create_mcp2_Uncustomised.py
new file mode 100644
index 0000000..f0b4042
--- /dev/null
+++ b/docs/examples/compute/dimensiondata/Nodes_Create_mcp2_Uncustomised.py
@@ -0,0 +1,56 @@
+from pprint import pprint
+from libcloud.compute.types import Provider
+from libcloud.compute.providers import get_driver
+import libcloud.security
+
+# Get dimension data driver
+libcloud.security.VERIFY_SSL_CERT = True
+cls = get_driver(Provider.DIMENSIONDATA)
+driver = cls('myusername','mypassword', region='dd-au')
+
+# Get location
+location = driver.ex_get_location_by_id(id='AU9')
+
+# Get network domain by location
+networkDomainName = "Test Apache Libcloud"
+network_domains = driver.ex_list_network_domains(location=location)
+my_network_domain = [d for d in network_domains if d.name == networkDomainName][0]
+
+vlan = driver.ex_list_vlans(name='Libcloud Test VLAN')[0]
+
+# Get Image
+images = driver.ex_list_customer_images(location=location)
+image = images[1]
+
+tags = driver.ex_list_tags()
+pprint(tags)
+
+ex_tagname_value_pairs = {}
+ex_tagname_value_pairs['AA_Tag1'] = 'demo 1'
+ex_tagname_value_pairs['AA_Tag2'] = 'demo 2'
+
+ex_tagid_value_pairs = {}
+ex_tagid_value_pairs['4927c8fd-7f41-4206-a7d5-c5def927c6d2'] = 'demo 1'
+ex_tagid_value_pairs['2579fc7c-a89c-47cd-ac3b-67999dded93b'] = 'demo 2'
+
+
+# Create node using vlan instead of private IPv4
+node = driver.ex_create_node_uncustomized(
+    name='test_server_05',
+    image=image,
+    ex_network_domain=my_network_domain,
+    ex_is_started=False,
+    ex_description=None,
+    ex_cluster_id=None,
+    ex_cpu_specification=None,
+    ex_memory_gb=None,
+    ex_primary_nic_private_ipv4=None,
+    ex_primary_nic_vlan=vlan,
+    ex_primary_nic_network_adapter=None,
+    ex_additional_nics=None,
+    ex_disks=None,
+    ex_tagid_value_pairs=ex_tagid_value_pairs,
+    ex_tagname_value_pairs=None
+)
+
+pprint(node)