Repository: libcloud Updated Branches: refs/heads/trunk 25c5ba962 -> cc9a01304
Updated RunAbove doc to OVH Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/a2cde6be Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/a2cde6be Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/a2cde6be Branch: refs/heads/trunk Commit: a2cde6beaa2538602662522610be52d567f165d4 Parents: 4f87f55 Author: ZuluPro <montheanth...@hotmail.com> Authored: Wed Oct 5 17:01:01 2016 -0400 Committer: Anthony Shaw <anthonys...@apache.org> Committed: Fri Oct 7 09:23:34 2016 +1100 ---------------------------------------------------------------------- docs/_static/images/provider_logos/ovh.png | Bin 0 -> 47729 bytes docs/_static/images/provider_logos/runabove.png | Bin 15052 -> 0 bytes docs/compute/drivers/ovh.rst | 81 +++++++++++++++++++ docs/compute/drivers/runabove.rst | 77 ------------------ docs/examples/compute/ovh/attach_volume.py | 11 +++ docs/examples/compute/ovh/create_node.py | 12 +++ docs/examples/compute/runabove/attach_volume.py | 11 --- docs/examples/compute/runabove/create_node.py | 12 --- 8 files changed, 104 insertions(+), 100 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/a2cde6be/docs/_static/images/provider_logos/ovh.png ---------------------------------------------------------------------- diff --git a/docs/_static/images/provider_logos/ovh.png b/docs/_static/images/provider_logos/ovh.png new file mode 100644 index 0000000..95a9c50 Binary files /dev/null and b/docs/_static/images/provider_logos/ovh.png differ http://git-wip-us.apache.org/repos/asf/libcloud/blob/a2cde6be/docs/_static/images/provider_logos/runabove.png ---------------------------------------------------------------------- diff --git a/docs/_static/images/provider_logos/runabove.png b/docs/_static/images/provider_logos/runabove.png deleted file mode 100644 index c249888..0000000 Binary files a/docs/_static/images/provider_logos/runabove.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/libcloud/blob/a2cde6be/docs/compute/drivers/ovh.rst ---------------------------------------------------------------------- diff --git a/docs/compute/drivers/ovh.rst b/docs/compute/drivers/ovh.rst new file mode 100644 index 0000000..8633595 --- /dev/null +++ b/docs/compute/drivers/ovh.rst @@ -0,0 +1,81 @@ +OVH Compute Driver Documentation +================================ + +`OVH`_ is an Internet Service Provider providing dedicated servers, shared and +cloud hosting, domain registration, and VOIP telephony services. + +.. figure:: /_static/images/provider_logos/ovh.png + :align: center + :width: 300 + :target: https://www.ovh.com + +OVH driver uses a REST API, for more information about that, please refer to +`API console`_. + +Instantiating a driver +---------------------- + +When you instantiate a driver you need to pass the following arguments to the +driver constructor: + +* ``key`` - Application key +* ``secret`` - Application secret +* ``ex_project_id`` - Project ID +* ``ex_consumer_key`` - Consumer key + +For get application key and secret, you must register an application +at https://eu.api.ovh.com/createApp/. Next step, create a consumer key with +following command: :: + + curl -X POST \ + -H 'X-Ra-Application: youApplicationKey' \ + -H 'Content-Type: application/json' \ + -d '{ + "accessRules": + [ + {"method":"GET","path":"/*"}, + {"method":"POST","path":"/*"}, + {"method":"DELETE","path":"/*"}, + {"method":"PUT","path":"/*"}, + ], + "redirection":"http://ovh.com" + }' \ + https://eu.api.ovh.com/1.0/auth/credential + +This will answer a JSON like below with inside your Consumer Key and +``validationUrl``. Follow this link for valid your key. :: + + { + "validationUrl":"https://eu.api.ovh.com/auth/?credentialToken=fIDK6KCVHfEMuSTP3LV84D3CsHTq4T3BhOrmEEdd2hQ0CNcfVgGVWZRqIlolDJ3W", + "consumerKey":"y7epYeHCIqoO17BzBgxluvB4XLedpba9", + "state":"pendingValidation" + } + + +Secondly, you must create a cloud project and retrieve its ID, from URL for +example. + +Now you have and can use you credentials with Libcloud. + +Examples +-------- + +Create node +~~~~~~~~~~~ + +.. literalinclude:: /examples/compute/ovh/create_node.py + +Create and attach a volume to a node +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. literalinclude:: /examples/compute/ovh/attach_volume.py + +API Docs +-------- + +.. autoclass:: libcloud.compute.drivers.ovh.OvhNodeDriver + :members: + :inherited-members: + +.. _`OVH`: https://www.ovh.com +.. _`API console`: https://api.ovh.com/console/#/ http://git-wip-us.apache.org/repos/asf/libcloud/blob/a2cde6be/docs/compute/drivers/runabove.rst ---------------------------------------------------------------------- diff --git a/docs/compute/drivers/runabove.rst b/docs/compute/drivers/runabove.rst deleted file mode 100644 index 2b3c476..0000000 --- a/docs/compute/drivers/runabove.rst +++ /dev/null @@ -1,77 +0,0 @@ -RunAbove Compute Driver Documentation -===================================== - -`RunAbove`_ is a public cloud offer created by OVH Group with datacenters -in North America and Europe. - -.. figure:: /_static/images/provider_logos/runabove.png - :align: center - :width: 300 - :target: https://www.runabove.com/index.xml - -RunAbove driver uses the OVH/RunAbove API so for more information about -that, please refer to `RunAbove knowledge base`_ page and `API console`_. - -Instantiating a driver ----------------------- - -When you instantiate a driver you need to pass the following arguments to the -driver constructor: - -* ``key`` - Application key -* ``secret`` - Application secret -* ``ex_consumer_key`` - Consumer key - -For get application key and secret, you must first register an application -at https://api.runabove.com/createApp/. Next step, create a consumer key with -following command: :: - - curl -X POST \ - -H 'X-Ra-Application: youApplicationKey' \ - -H 'Content-Type: application/json' \ - -d '{ - "accessRules": - [ - {"method":"GET","path":"/*"}, - {"method":"POST","path":"/*"}, - {"method":"DELETE","path":"/*"}, - {"method":"PUT","path":"/*"}, - ], - "redirection":"http://runabove.com" - }' \ - "https://api.runabove.com/1.0/auth/credential" - -This will answer a JSON like below with inside your Consumer Key and -``validationUrl``. Follow this link for valid your key. :: - - { - "validationUrl":"https://api.runabove.com/login/?credentialToken=fIDK6KCVHfEMuSTP3LV84D3CsHTq4T3BhOrmEEdd2hQ0CNcfVgGVWZRqIlolDJ3W", - "consumerKey":"y7epYeHCIqoO17BzBgxluvB4XLedpba9", - "state":"pendingValidation" - } - -Now you have and can use you credentials with Libcloud. - -Examples --------- - -Create node -~~~~~~~~~~~ - -.. literalinclude:: /examples/compute/runabove/create_node.py - -Create and attach a volume to a node -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. literalinclude:: /examples/compute/runabove/attach_volume.py - -API Docs --------- - -.. autoclass:: libcloud.compute.drivers.runabove.RunAboveNodeDriver - :members: - :inherited-members: - -.. _`Runabove`: https://www.runabove.com/index.xml -.. _`RunAbove knowledge base`: https://community.runabove.com/kb/ -.. _`API console`: https://api.runabove.com/console/#/ http://git-wip-us.apache.org/repos/asf/libcloud/blob/a2cde6be/docs/examples/compute/ovh/attach_volume.py ---------------------------------------------------------------------- diff --git a/docs/examples/compute/ovh/attach_volume.py b/docs/examples/compute/ovh/attach_volume.py new file mode 100644 index 0000000..a1cc02b --- /dev/null +++ b/docs/examples/compute/ovh/attach_volume.py @@ -0,0 +1,11 @@ +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +Ovh = get_driver(Provider.OVH) +driver = Ovh('yourAppKey', 'yourAppSecret', 'youProjectId', 'yourConsumerKey') + +location = [l for l in driver.list_locations() if l.id == 'SBG1'][0] +node = driver.list_nodes()[0] + +volume = driver.create_volume(size=10, location=location) +driver.attach_volume(node=node, volume=volume) http://git-wip-us.apache.org/repos/asf/libcloud/blob/a2cde6be/docs/examples/compute/ovh/create_node.py ---------------------------------------------------------------------- diff --git a/docs/examples/compute/ovh/create_node.py b/docs/examples/compute/ovh/create_node.py new file mode 100644 index 0000000..80147b5 --- /dev/null +++ b/docs/examples/compute/ovh/create_node.py @@ -0,0 +1,12 @@ +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +Ovh = get_driver(Provider.OVH) +driver = Ovh('yourAppKey', 'yourAppSecret', 'yourProjectId', 'yourConsumerKey') + +location = [l for l in driver.list_locations() if l.id == 'SBG1'][0] +image = [i for i in driver.list_images() if 'Debian 8' == i.name][0] +size = [s for s in driver.list_sizes() if s.name == 'vps-ssd-1'][0] + +node = driver.create_node(name='yournode', size=size, image=image, + location=location) http://git-wip-us.apache.org/repos/asf/libcloud/blob/a2cde6be/docs/examples/compute/runabove/attach_volume.py ---------------------------------------------------------------------- diff --git a/docs/examples/compute/runabove/attach_volume.py b/docs/examples/compute/runabove/attach_volume.py deleted file mode 100644 index c4c0178..0000000 --- a/docs/examples/compute/runabove/attach_volume.py +++ /dev/null @@ -1,11 +0,0 @@ -from libcloud.compute.types import Provider -from libcloud.compute.providers import get_driver - -RunAbove = get_driver(Provider.RUNABOVE) -driver = RunAbove('yourAppKey', 'yourAppSecret', 'YourConsumerKey') - -location = [l for l in driver.list_locations() if l.id == 'SBG-1'][0] -node = driver.list_nodes()[0] - -volume = driver.create_volume(size=10, location=location) -driver.attach_volume(node=node, volume=volume) http://git-wip-us.apache.org/repos/asf/libcloud/blob/a2cde6be/docs/examples/compute/runabove/create_node.py ---------------------------------------------------------------------- diff --git a/docs/examples/compute/runabove/create_node.py b/docs/examples/compute/runabove/create_node.py deleted file mode 100644 index 7137ff4..0000000 --- a/docs/examples/compute/runabove/create_node.py +++ /dev/null @@ -1,12 +0,0 @@ -from libcloud.compute.types import Provider -from libcloud.compute.providers import get_driver - -RunAbove = get_driver(Provider.RUNABOVE) -driver = RunAbove('yourAppKey', 'yourAppSecret', 'YourConsumerKey') - -image = [i for i in driver.list_images() if 'Debian 8' == i.name][0] -size = [s for s in driver.list_sizes() if s.name == 'ra.s'][0] -location = [l for l in driver.list_locations() if l.id == 'SBG-1'][0] - -node = driver.create_node(name='yournode', size=size, image=image, - location=location)