Updated Branches: refs/heads/trunk 0f20da9d1 -> fc0c2387a
docs: Add documentation about registering a third party driver. Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/fc0c2387 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/fc0c2387 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/fc0c2387 Branch: refs/heads/trunk Commit: fc0c2387ad8a4d166f1ddc8a562da5512fa468ef Parents: 0f20da9 Author: Tomaz Muraus <[email protected]> Authored: Thu Aug 15 16:37:21 2013 +0200 Committer: Tomaz Muraus <[email protected]> Committed: Thu Aug 15 16:37:21 2013 +0200 ---------------------------------------------------------------------- .../compute/register_3rd_party_driver.py | 11 +++++++++ docs/other/registering-a-third-party-driver.rst | 25 ++++++++++++++++++++ 2 files changed, 36 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/fc0c2387/docs/examples/compute/register_3rd_party_driver.py ---------------------------------------------------------------------- diff --git a/docs/examples/compute/register_3rd_party_driver.py b/docs/examples/compute/register_3rd_party_driver.py new file mode 100644 index 0000000..ea5c458 --- /dev/null +++ b/docs/examples/compute/register_3rd_party_driver.py @@ -0,0 +1,11 @@ +from libcloud.compute.providers import get_driver +from libcloud.compute.providers import set_driver + + +set_driver('STRATUSLAB', + 'stratuslab.libcloud.stratuslab_driver', + 'StratusLabNodeDriver') + +# Your code which uses the driver. +# For example: +driver = get_driver('STRATUSLAB') http://git-wip-us.apache.org/repos/asf/libcloud/blob/fc0c2387/docs/other/registering-a-third-party-driver.rst ---------------------------------------------------------------------- diff --git a/docs/other/registering-a-third-party-driver.rst b/docs/other/registering-a-third-party-driver.rst new file mode 100644 index 0000000..c702692 --- /dev/null +++ b/docs/other/registering-a-third-party-driver.rst @@ -0,0 +1,25 @@ +Registering a third party driver +================================ + +Driver is considered third party if it's not bundled with a Libcloud release. + +To register a third party driver you should use :func:`provider.set_driver` +function from the corresponding component. + +Keep in mind that this function needs to be called before a third party driver +is used. + +:func:`set_driver` takes the following arguments: + +.. code-block:: python + + set_driver('PROVIDER_NAME', 'path.to.the.module', 'DriverClass') + +For example: + +.. literalinclude:: /examples/compute/register_3rd_party_driver.py + :language: python + + +An example of existing third party driver can be found at +https://github.com/StratusLab/libcloud-drivers
