libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthonys...@apache.org
Subject [30/51] [abbrv] libcloud git commit: forgot to manually add some files
Date Wed, 31 Oct 2018 03:11:41 GMT
forgot to manually add some files


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

Branch: refs/heads/trunk
Commit: 7ee8bf555941cf237c46e3c93801759ad66375de
Parents: d22a526
Author: mitch <mitch.raful@itaas.dimensiondata.com>
Authored: Tue Oct 23 13:20:12 2018 -0400
Committer: mitch <mitch.raful@itaas.dimensiondata.com>
Committed: Tue Oct 23 13:20:12 2018 -0400

----------------------------------------------------------------------
 docs/_static/images/provider_logos/ntt.png      | Bin 0 -> 23017 bytes
 docs/compute/drivers/nttcis.rst                 |  89 +++++++++++++++++++
 .../nttcis/Nodes_Create_mcp2_Uncustomised.py    |  57 ++++++++++++
 docs/examples/compute/nttcis/__init__.py        |   0
 .../fixtures/nttcis/oec_0_9_myaccount.xml       |  26 ++++++
 5 files changed, 172 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/7ee8bf55/docs/_static/images/provider_logos/ntt.png
----------------------------------------------------------------------
diff --git a/docs/_static/images/provider_logos/ntt.png b/docs/_static/images/provider_logos/ntt.png
new file mode 100644
index 0000000..0f96ab7
Binary files /dev/null and b/docs/_static/images/provider_logos/ntt.png differ

http://git-wip-us.apache.org/repos/asf/libcloud/blob/7ee8bf55/docs/compute/drivers/nttcis.rst
----------------------------------------------------------------------
diff --git a/docs/compute/drivers/nttcis.rst b/docs/compute/drivers/nttcis.rst
new file mode 100644
index 0000000..852ecb5
--- /dev/null
+++ b/docs/compute/drivers/nttcis.rst
@@ -0,0 +1,89 @@
+NTTC-CIS Compute Driver Documentation
+=================================================
+
+NTT Communications has a cloud offering known as Cloud Infrastructure Services (NTTC-CIS).
+NTT-CIS provides IT-as-a-Service to customers around the globe on their
+cloud platform (Compute as a Service). The CaaS service is available either on
+one a hybrid cloud instance or as a private instance on premises.
+
+.. figure:: /_static/images/provider_logos/nttcis.png
+    :align: center
+    :width: 300
+    :target: http://www.ntt.com/en/services/cloud/enterprise-cloud.html/
+
+CaaS has its own non-standard `API`_ , `libcloud` provides a Python
+wrapper on top of this `API`_ with common methods with other IaaS solutions and
+Public cloud providers. Therefore, you can use use the NTTC-CIS libcloud
+driver to communicate with both the public and private clouds.  Currently `libcloud`
+supports `API`_ versions >= 2.4.
+
+Instantiating a driver
+----------------------
+
+When you instantiate a driver you need to pass the following arguments to the
+driver constructor:
+
+* ``user_id`` - Your Dimension Data Cloud username
+* ``key`` - Your Dimension Data Cloud password
+* ``region`` - The region key, one of the possible region keys
+
+Possible regions:
+
+* ``na`` : NTTC-CIS North America (USA)
+* ``eu`` : NTTC-CIS Europe
+* ``af`` : NTTC-CIS Africa
+* ``au`` : NTTC-CIS Australia
+* ``ap`` : NTTC-CIS Asia Pacific
+* ``canada`` : Dimension Data Canada region
+
+The base `libcloud` API allows you to:
+
+* list nodes, images, instance types, locations
+
+Non-standard functionality and extension methods
+------------------------------------------------
+
+The NTTC-CIS driver exposes some `libcloud` non-standard
+functionalities through extension methods and arguments.
+
+These functionalities include:
+
+* start and stop a node
+* list networks
+* create firewalls, configure network address translation
+* provision layer 3 networks
+
+For information on how to use these functionalities please see the method
+docstrings below. You can also use an interactive shell for exploration as
+shown in the examples.
+
+API Docs
+--------
+
+.. autoclass:: libcloud.compute.drivers.nttcis.NttCisNodeDriver
+    :members:
+    :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

http://git-wip-us.apache.org/repos/asf/libcloud/blob/7ee8bf55/docs/examples/compute/nttcis/Nodes_Create_mcp2_Uncustomised.py
----------------------------------------------------------------------
diff --git a/docs/examples/compute/nttcis/Nodes_Create_mcp2_Uncustomised.py b/docs/examples/compute/nttcis/Nodes_Create_mcp2_Uncustomised.py
new file mode 100644
index 0000000..69c38ba
--- /dev/null
+++ b/docs/examples/compute/nttcis/Nodes_Create_mcp2_Uncustomised.py
@@ -0,0 +1,57 @@
+from pprint import pprint
+from libcloud.compute.types import Provider
+from libcloud.compute.providers import get_driver
+import libcloud.security
+
+# Get nttcis driver
+libcloud.security.VERIFY_SSL_CERT = True
+cls = get_driver(Provider.NTTCIS)
+driver = cls('myusername', 'mypassword', region='eu')
+
+# Get location
+location = driver.ex_get_location_by_id(id='EU7')
+
+# 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)

http://git-wip-us.apache.org/repos/asf/libcloud/blob/7ee8bf55/docs/examples/compute/nttcis/__init__.py
----------------------------------------------------------------------
diff --git a/docs/examples/compute/nttcis/__init__.py b/docs/examples/compute/nttcis/__init__.py
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/libcloud/blob/7ee8bf55/libcloud/test/compute/fixtures/nttcis/oec_0_9_myaccount.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/nttcis/oec_0_9_myaccount.xml b/libcloud/test/compute/fixtures/nttcis/oec_0_9_myaccount.xml
new file mode 100644
index 0000000..4f3b132
--- /dev/null
+++ b/libcloud/test/compute/fixtures/nttcis/oec_0_9_myaccount.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns3:Account xmlns="http://oec.api.opsource.net/schemas/server" xmlns:ns9="http://oec.api.opsource.net/schemas/reset"
xmlns:ns5="http://oec.api.opsource.net/schemas/vip" xmlns:ns12="http://oec.api.opsource.net/schemas/general"
xmlns:ns6="http://oec.api.opsource.net/schemas/imageimportexport" xmlns:ns13="http://oec.api.opsource.net/schemas/support"
xmlns:ns7="http://oec.api.opsource.net/schemas/whitelabel" xmlns:ns10="http://oec.api.opsource.net/schemas/ipplan"
xmlns:ns8="http://oec.api.opsource.net/schemas/datacenter" xmlns:ns11="http://oec.api.opsource.net/schemas/storage"
xmlns:ns2="http://oec.api.opsource.net/schemas/organization" xmlns:ns4="http://oec.api.opsource.net/schemas/network"
xmlns:ns3="http://oec.api.opsource.net/schemas/directory">
+    <ns3:userName>testuser</ns3:userName>
+    <ns3:fullName>Test User</ns3:fullName>
+    <ns3:firstName>Test</ns3:firstName>
+    <ns3:lastName>User</ns3:lastName>
+    <ns3:emailAddress>test@example.com</ns3:emailAddress>
+    <ns3:orgId>8a8f6abc-2745-4d8a-9cbc-8dabe5a7d0e4</ns3:orgId>
+    <ns3:roles>
+        <ns3:role>
+            <ns3:name>create image</ns3:name>
+        </ns3:role>
+        <ns3:role>
+            <ns3:name>reports</ns3:name>
+        </ns3:role>
+        <ns3:role>
+            <ns3:name>server</ns3:name>
+        </ns3:role>
+        <ns3:role>
+            <ns3:name>primary administrator</ns3:name>
+        </ns3:role>
+        <ns3:role>
+            <ns3:name>network</ns3:name>
+        </ns3:role>
+    </ns3:roles>
+</ns3:Account>


Mime
View raw message