Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions docs/compute/drivers/gandi.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Gandi Computer Driver Documentation
===================================

`Gandi SAS`_ is a registrar, web hosting and private and `public cloud`_
provider based in France with data centers in France, Luxembourg and USA.

.. figure:: /_static/images/provider_logos/gandi.png
:align: center
:width: 300
:target: https://www.gandi.net/

Instantiating a driver
----------------------

When you instantiate a driver you need to pass the API key and activate
the API platforms. See this `Gandi's documentation`_ for how to do it.

Examples
--------

Create instance
~~~~~~~~~~~~~~~

.. literalinclude:: /examples/compute/gandi/create_node.py


.. _`Gandi SAS`: https://www.gandi.net/
.. _`public cloud`: https://www.gandi.net/hebergement/serveur
.. _`Gandi's documentation`: https://wiki.gandi.net/en/xml-api/activate

API Docs
--------

.. autoclass:: libcloud.compute.drivers.gandi.GandiNodeDriver
:members:
:inherited-members:
12 changes: 12 additions & 0 deletions docs/examples/compute/gandi/create_node.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver

Gandi = get_driver(Provider.GANDI)
driver = Gandi('api_key')

image = [i for i in driver.list_images() if 'Debian 8 64' in i.name][0]
size = [s for s in driver.list_sizes() if s.name == 'Medium instance'][0]
location = [l for l in driver.list_locations() if l.name == 'Equinix Paris'][0]

node = driver.create_node(name='yournode', size=size, image=image,
location=location, login="youruser", password="pass")
8 changes: 8 additions & 0 deletions libcloud/compute/drivers/cloudstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -2260,6 +2260,14 @@ def list_key_pairs(self, **kwargs):
return key_pairs

def get_key_pair(self, name):
"""
Retrieve a single key pair.

:param name: Name of the key pair to retrieve.
:type name: ``str``

:rtype: :class:`.KeyPair`
"""
params = {'name': name}
res = self._sync_request(command='listSSHKeyPairs',
params=params,
Expand Down
Loading