Add docs for azure driver.
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/5bec6f06 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/5bec6f06 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/5bec6f06 Branch: refs/heads/trunk Commit: 5bec6f0697a35bcaa8642717a6f0a244908db635 Parents: 6722d54 Author: Tomaz Muraus <[email protected]> Authored: Mon Apr 6 01:35:29 2015 +0200 Committer: Tomaz Muraus <[email protected]> Committed: Mon Apr 6 01:35:29 2015 +0200 ---------------------------------------------------------------------- .../misc/azure_upload_certificate_file.png | Bin 0 -> 90736 bytes docs/_static/images/provider_logos/azure.jpg | Bin 0 -> 87341 bytes docs/compute/drivers/azure.rst | 63 +++++++++++++++++++ docs/examples/compute/azure/instantiate.py | 6 ++ 4 files changed, 69 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/5bec6f06/docs/_static/images/misc/azure_upload_certificate_file.png ---------------------------------------------------------------------- diff --git a/docs/_static/images/misc/azure_upload_certificate_file.png b/docs/_static/images/misc/azure_upload_certificate_file.png new file mode 100644 index 0000000..7a8d3bb Binary files /dev/null and b/docs/_static/images/misc/azure_upload_certificate_file.png differ http://git-wip-us.apache.org/repos/asf/libcloud/blob/5bec6f06/docs/_static/images/provider_logos/azure.jpg ---------------------------------------------------------------------- diff --git a/docs/_static/images/provider_logos/azure.jpg b/docs/_static/images/provider_logos/azure.jpg new file mode 100644 index 0000000..c0229e1 Binary files /dev/null and b/docs/_static/images/provider_logos/azure.jpg differ http://git-wip-us.apache.org/repos/asf/libcloud/blob/5bec6f06/docs/compute/drivers/azure.rst ---------------------------------------------------------------------- diff --git a/docs/compute/drivers/azure.rst b/docs/compute/drivers/azure.rst new file mode 100644 index 0000000..62c2fad --- /dev/null +++ b/docs/compute/drivers/azure.rst @@ -0,0 +1,63 @@ +Azure Compute Driver Documentation +================================== + +Azure driver allows you to integrate with Microsoft `Azure Virtual Machines`_ +service. + +.. figure:: /_static/images/provider_logos/azure.jpg + :align: center + :width: 300 + :target: http://azure.microsoft.com/en-us/services/virtual-machines/ + +Azure Virtual Machine service allows you to launch Windows and Linux virtual +servers in many datacenters across the world. + +Connecting to Azure +------------------- + +To connect to Azure you need your subscription ID and certificate file. + +Generating and uploading a certificate file and obtaining subscription ID +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +To be able to connect to the Azure, you need to generate a X.509 certificate +which is used to authenticate yourself and upload it to the Azure Management +Portal. + +On Linux, you can generate the certificate file using the commands shown below: + +.. sourcecode:: bash + + openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout azure_cert.pem -out azure_cert.pem + openssl x509 -inform pem -in azure_cert.pem -outform der -out azure_cert.cer + +For information on how to generate certificate on Windows, see +`Create and Upload a Management Certificate for Azure <https://msdn.microsoft.com/en-us/library/azure/gg551722.aspx>`_ page. + +Once you have generated the certificate, go to the Azure Management Portal and +click Settings -> Management Certificate -> Upload as shown on the screenshot +below. + +.. figure:: /_static/images/misc/azure_upload_certificate_file.png + :align: center + :width: 900 + +In the upload Windows, select the generated ``.cer`` file (``azure_cert.cer``). + +Instantiating a driver +~~~~~~~~~~~~~~~~~~~~~~ + +Once you have generated the certificate file and obtained your subscription ID +you can instantiate the driver as shown below. + +.. literalinclude:: /examples/compute/azure/instantiate.py + :language: python + +API Docs +-------- + +.. autoclass:: libcloud.compute.drivers.azure.AzureNodeDriver + :members: + :inherited-members: + +.. _`Azure Virtual Machines`: http://azure.microsoft.com/en-us/services/virtual-machines/ http://git-wip-us.apache.org/repos/asf/libcloud/blob/5bec6f06/docs/examples/compute/azure/instantiate.py ---------------------------------------------------------------------- diff --git a/docs/examples/compute/azure/instantiate.py b/docs/examples/compute/azure/instantiate.py new file mode 100644 index 0000000..3ccf548 --- /dev/null +++ b/docs/examples/compute/azure/instantiate.py @@ -0,0 +1,6 @@ +from libcloud.compute.types import Provider +from libcloud.compute.providers import get_driver + +cls = get_driver(Provider.AZURE) +driver = cls(subscription_id='subscription-id', + key_file='/path/to/azure_cert.cer')
