New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace RunAbove driver by OVH #891

Closed
wants to merge 4 commits into
base: trunk
from
Jump to file or symbol
Failed to load files and symbols.
+88 −84
Diff settings

Always

Just for now

Viewing a subset of changes. View all

Updated RunAbove doc to OVH

  • Loading branch information...
ZuluPro committed Oct 5, 2016
commit a5ed7e1f907cd1fcb5dde3f873bf4855012f3fe7
Binary file not shown.
Binary file not shown.
@@ -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/#/

This file was deleted.

Oops, something went wrong.
@@ -1,10 +1,10 @@
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
RunAbove = get_driver(Provider.RUNABOVE)
driver = RunAbove('yourAppKey', 'yourAppSecret', 'YourConsumerKey')
Ovh = get_driver(Provider.OVH)
driver = Ovh('yourAppKey', 'yourAppSecret', 'youProjectId', 'yourConsumerKey')
location = [l for l in driver.list_locations() if l.id == 'SBG-1'][0]
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)
@@ -1,12 +1,12 @@
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
RunAbove = get_driver(Provider.RUNABOVE)
driver = RunAbove('yourAppKey', 'yourAppSecret', 'YourConsumerKey')
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 == 'ra.s'][0]
location = [l for l in driver.list_locations() if l.id == 'SBG-1'][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)
ProTip! Use n and p to navigate between commits in a pull request.