Implement an optional json output 4 outputing cmds
[kamaki] / docs / installation.rst
index cb5451b..4fffadf 100644 (file)
@@ -6,78 +6,88 @@ This guide describes the standard installation process for kamaki, with the aspi
 
 * Kamaki repository: `http://code.grnet.gr/git/kamaki <http://code.grnet.gr/git/kamaki>`_
 
-* Synnefo Linux packages: `http://apt.dev.grnet.gr <http://apt.dev.grnet.gr>`_, `http://apt2.dev.grnet.gr <http://apt2.dev.grnet.gr>`_
+* Kamaki at pypi: `http://pypi.python.org/pypi/kamaki <https://pypi.python.org/pypi/kamaki>`_
+
+* Synnefo Linux packages: `http://apt2.dev.grnet.gr <http://apt2.dev.grnet.gr>`_
 
 Linux and Unix-like enviroments
 -------------------------------
 
-Ubuntu and Debian packages
-^^^^^^^^^^^^^^^^^^^^^^^^^^
+Debian:
+^^^^^^^
 
 The following steps describe a command-line approach, but any graphic package manager can be used instead.
 
-Add the following to apt sources list
-"""""""""""""""""""""""""""""""""""""
+* As root, append the following to */etc/apt/sources.list* ::
 
-As root, append one of the following to */etc/apt/sources.list*:
-
-* Debian Sid (kamaki 0.6.2)::
+    deb http://apt2.dev.grnet.gr stable/
 
-    deb http://apt.dev.grnet.gr/ sid main
+* Make sure the GPG public key for the Synnefo development team is added:
 
-* Debian Stable (kamaki 0.6.1)::
+    .. code-block:: console
 
-    deb http://apt.dev.grnet.gr/ squeeze main
-    deb http://apt2.dev.grnet.gr stable/
+        $ sudo curl https://dev.grnet.gr/files/apt-grnetdev.pub|apt-key add -
 
-* Ubuntu (kamaki 0.6.1)::
+    otherwise *apt-get update* will produce GPG warnings.
 
-    deb http://apt.dev.grnet.gr/ precise main
+* Update the Debian sources:
 
+    .. code-block:: console
 
-Update
-""""""
+        $ sudo apt-get update
 
-.. note:: make sure the GPG public key for the GRNET dev team is added:
+* Install kamaki:
 
     .. code-block:: console
 
-        $ curl https://dev.grnet.gr/files/apt-grnetdev.pub|apt-key add -
+        $ sudo apt-get install kamaki
 
-    otherwise *apt-get update* will produce GPG warnings.
+Ubuntu
+^^^^^^
 
-.. code-block:: console
+The following steps describe a command-line approach, but any graphic package manager can be used instead.
 
-    $ sudo apt-get update
+* Let ppa take care of the repository configuration:
 
+    .. code-block:: console
 
-Install kamaki
-""""""""""""""
+        $ sudo apt-get install python-software-properties
+        $ sudo add-apt-repository ppa:grnet/synnefo
 
-.. note:: **versions 0.6.0 - 0.6.1:**
+* Update the Debian sources:
 
-    The *snf-common* package (available at synnefo apt repository) will be automatically installed as a dependency.
+    .. code-block:: console
 
-.. note:: **versions 0.6.2 and on:**
+        $ sudo apt-get update
 
-    Since version 0.6.2, *objpool* replaces *snf-common*. The objpool package is also available at synnefo repository and is automatically installed as a dependency. The *snf-common* dependency is removed.
+* Install kamaki:
 
-.. code-block:: console
+    .. code-block:: console
 
-    $ sudo apt-get install kamaki
+        $ sudo apt-get install kamaki
 
-Install ansicolors and/or progress (Optional)
+Install ansicolors (optional but recommended)
 """""""""""""""""""""""""""""""""""""""""""""
 
 .. code-block:: console
 
     $ sudo apt-get install python-ansicolors
-    $ sudo apt-get install python-progress
 
-.. _installing-from-source-ref:
+Install mock (for developers only)
+""""""""""""""""""""""""""""""""""
+
+.. code-block:: console
+
+    $ sudo apt-get install python-mock
 
-Installing from source (git repos.)
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. warning:: kamaki.clients unit-tests need python-mock 1.X or better. e.g.::
+
+    $ sudo apt-get install python-mock=1.0.1
+
+.. _installing-from-pypi-ref:
+
+Installing from pypi
+^^^^^^^^^^^^^^^^^^^^
 
 Requirements
 """"""""""""
@@ -101,106 +111,91 @@ With virtualenv users can setup kamaki and synnefo services in a sandbox environ
     $ virtualenv kamaki-env
     $ source kamaki-env/bin/activate
 
-A more detailed example of using virtual env can be found at the `snf-image-creator setup guide <http://docs.dev.grnet.gr/snf-image-creator/latest/install.html#python-virtual-environment>`_
-
-Install objpool (was: snf-common)
-"""""""""""""""""""""""""""""""""
+A more detailed example of using virtual env can be found at the `snf-image-creator setup guide <http://www.synnefo.org/docs/snf-image-creator/latest/install.html#python-virtual-environment>`_
 
-.. note:: **versions 0.6.0 - 0.6.1**
-
-    Package snf-common is part of the synnefo project and used to be a kamaki dependency in versions from 0.6.0 to 0.6.1 to provide a connection pooling mechanism. Users who still run 0.6.0 or 0.6.1 may need to manually install the snf-common package:
-
-    .. code-block:: console
-
-        $ git clone http://code.grnet.gr/git/synnefo
-        $ cd synnefo/snf-common
-        $ ./setup build install
-        $ cd -
-
-**Version 0.6.2 and on:**
-
-Since 0.6.2, kamaki is based on objpool (hence the snf-common dependency is now obsolete). The objpool package is easy to install from source, even on windows platforms:
+Install kamaki
+""""""""""""""
 
 .. code-block:: console
 
-    $ git clone http://code.grnet.gr/git/objpool
-    $ cd objpool
-    $ ./setup build install
-    $ cd -
+    $ pip install kamaki
 
-Install kamaki
-""""""""""""""
+Install ansicolors
+""""""""""""""""""
 
-.. code-block:: console
+The **ansicolors** package is not required for running kamaki, but it is
+recommended as a user experience improvement. In specific, ansicolors
+adds colors to kamaki responses.
 
-    $ git clone http://code.grnet.gr/git/kamaki
-    $ cd kamaki
-    $ ./setup build install
+.. code-block:: console
 
-Install progress and/or ansicolors (optional)
-"""""""""""""""""""""""""""""""""""""""""""""
+    $ pip install ansicolors
 
-progress: command-line progress bars (in some commands)
+Install mock
+""""""""""""
 
-ansicolors: color kamaki output (can switched on and off in `setup <setup.html>`_)
+The **mock** package is needed for running the prepared unit-tests in the kamaki.clients
+package. This feature is useful when extendnig / debugging kamaki functionality and is
+aimed to kamaki developers and contributors. Therefore, users can enjoy the full kamaki
+user experience without installing mock.
 
 .. code-block:: console
 
-    $ pip install progress
-    $ pip install ansicolors
+    $ pip install mock
+
+.. warning:: mock version >= 1.X
 
 Mac OS X
 --------
 
-Kamaki can be installed on Mac OS X systems from source, by following the steps at :ref:`installing-from-source-ref`.
+Kamaki can be installed on Mac OS X systems from source, by following the steps at :ref:`installing-from-pypi-ref`.
 
 Windows
 -------
 
-Since version 0.6.2 kamaki can run on Windows, either on standard Windows console, or inside an improved command line shell. The present guide presents a tested method for using kamaki in windows
+Kamaki can be installed on Windows by following the pypi method. Installing the requirements is a bit different than in other systems. 
+
+The full process is detailed in the following:
 
 Requirements
 ^^^^^^^^^^^^
 
-* Python 2.7 or better (Official versions `here <http://www.python.org/getit>`_)
-
-* Git (download `windows version <http://git-scm.com/download/win>`_)
+* Python 2.7 or better (`Official versions <http://www.python.org/getit>`_)
 
-* Setuptools (Official versions and workarrounds `here <http://pypi.python.org/pypi/setuptools>`_)
+* Setuptools (`Official versions and workarounds <http://pypi.python.org/pypi/setuptools>`_)
 
-Installation from source
-^^^^^^^^^^^^^^^^^^^^^^^^
+Users who have already set up python and setuptools (e.g. for another project) may skip python and / or setup tools installation.
 
 Install python
-""""""""""""""
+^^^^^^^^^^^^^^
 
 Download and run the Windows installer from `here <http://www.python.org/getit>`_
 
 Users should pick the installer that fits their windows version and architecture.
 
 Add python to windows path
-""""""""""""""""""""""""""
+^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 The following will allow users to run python and python scripts from command line.
 
 * Select **System** from the Control Panel, select the **Advanced** tab, the **Environment Variables** button and then find the **PATH** (user or system) and **edit**
 
-* Without removing existing values, append the following to PATH:
+* Without removing existing values, append the following to PATH::
 
     C:\Python;C:\Python\Scripts
 
-    .. note:: Path values are separated by a semicolons
+.. note:: Path values are separated by semicolons
 
-    .. warning:: C:\Python should be replaced with the actual python path in the system, e.g. C:\Python27
+.. warning:: C:\\Python should be replaced with the actual python path in the system, e.g. C:\\Python27
 
 Install setuptools
-""""""""""""""""""
+^^^^^^^^^^^^^^^^^^
 
-According to the corresponding `python.org page <http://pypi.python.org/pypi/setuptools>`_, the setuptools installer doesn't currently work on 64bit machines.
+According to the corresponding `python org page <http://pypi.python.org/pypi/setuptools>`_, the setuptools installer doesn't currently work on 64bit machines.
 
 * Users with 32-bit operating systems should download and run the graphic installer
 
-* Users with 64-bit machines should download the `ez_setup.py <http://peak.telecommunity.com/dist/ez_setup.py>`_ script and install it from a command shell. In the following, the script is downloaded at C:\Downloads::
+* Users with 64-bit machines should download the `ez_setup.py <http://peak.telecommunity.com/dist/ez_setup.py>`_ script and install it from a command shell. In the following example, the script was downloaded at C:\\Downloads::
 
     C:\> cd Downloads
     C:\Downloads\> python ez_setup.py
@@ -208,43 +203,9 @@ According to the corresponding `python.org page <http://pypi.python.org/pypi/set
     Installation finished
     C:\Downloads\>
 
-Install GIT
-"""""""""""
-
-Download GIT from `here <http://git-scm.com/download/win>`_ and run the graphic installer. During the installation, users will be able to modify some installation options. The present guide is tested with the default selections.
-
-After the installation is completed, a GIT standalone shell will be installed (a desktop shortcut is created, by default). Users are advised to run kamaki through this shell.
-
 Install kamaki
-""""""""""""""
-
-* Run the GIT standalone shell
-
-* Enter the location where kamaki will be installed, e.g. *C\:*
-
-.. code-block:: console
-
-    $ cd /c/
-
-* Download source from GRNET repository
-
-.. code-block:: console
-
-    $ git clone http://code.grnet.gr/git/kamaki
-    Cloning into 'kamaki'...
-    Receiving objects: ...
-    Resolving Deltas: ...
-
-* Enter source and install kamaki
+^^^^^^^^^^^^^^
 
 .. code-block:: console
 
-    $ cd kamaki
-    $ python setup.py install
-    running install
-    ...
-    Finished processing dependencies for kamaki==0.6.2
-
-.. warning:: kamaki version should be 0.6.2 or better, otherwise it will not function. Users can test that by running::
-
-    $ kamaki --version
+    $ easy_setup kamaki