Просмотр исходного кода

Merge branch 'master' of https://github.com/gvlproject/cloudbridge

Nuwan Goonasekera 10 лет назад
Родитель
Сommit
4129eb0e09
4 измененных файлов с 47 добавлено и 5 удалено
  1. 10 0
      cloudbridge/__init__.py
  2. 19 0
      docs/topics/block_storage.rst
  3. 17 5
      docs/topics/install.rst
  4. 1 0
      docs/topics/overview.rst

+ 10 - 0
cloudbridge/__init__.py

@@ -1,6 +1,16 @@
 import logging
 import sys
 
+# Current version of the library
+__version__ = '0.1.0'
+
+
+def get_version():
+    """
+    Returns a string with the current version of the library (e.g., "0.1.0")
+    """
+    return __version__
+
 
 def init_logging():
     """

+ 19 - 0
docs/topics/block_storage.rst

@@ -0,0 +1,19 @@
+Working with block storage
+==========================
+To add persistent storage to your cloud environments, you would use block
+storage devices, namley volumes and volume snapshots. A volume is attached to
+an instance and mounted as a file system for use by the applications. A volume
+snapshot is a point-in-time snapshot of a volume that can be shared with other
+cloud users. Before a snapshot can be used, it is necessary to create a volume
+from it.
+
+Volume storage
+--------------
+Operations, such as creating a new volume and listing the eixsting ones, are
+perfomed via the :class:`.VolumeService`.
+
+.. code-block:: python
+
+    vol = provider.block_store.volumes.create('Cloudbridge-vol', 1, 'us-east-1a')
+    vol.wait_till_ready()
+    provider.block_store.volumes.list()

+ 17 - 5
docs/topics/install.rst

@@ -1,21 +1,33 @@
 Installation
 ============
 
-**Latest release**::
+**Prerequisites**: CloudBridge runs on Python 2.7 and higher. Python 3 is recommended.
+
+Latest release
+--------------
+The latest release of cloudbridge can be installed from PyPI::
 
     pip install cloudbridge
 
-**Manual installation**::
+Manual installation
+-------------------
+The development version of the library can be installed from the
+`Github repo <https://github.com/gvlproject/cloudbridge>`_::
 
     $ git clone https://github.com/gvlproject/cloudbridge.git
     $ cd cloudbridge
     $ python setup.py install
 
-**Developer installation**::
+Developer installation
+----------------------
+To install additional libraries required by CloudBridge contributors, such as
+`tox <https://tox.readthedocs.org/en/latest/>`_, run the following command::
 
     pip install cloudbridge[dev]
 
-This will install additional libraries required by CloudBridge contributors, such as tox.
+----------
 
-**Prerequisites**: CloudBridge runs on Python 2.7 and higher. Python 3 is recommended.
+To check what version of the library you have installed, do the following::
 
+    import cloudbridge
+    cloudbridge.get_version()

+ 1 - 0
docs/topics/overview.rst

@@ -8,3 +8,4 @@ Introductions to all the key parts of Cloudbridge you'll need to know:
     How to install Cloudbridge <install.rst>
     Connection and authentication setup <setup.rst>
     Launching instances <launch.rst>
+    Using block storage <block_storage.rst>