index.rst 6.01 KB
Newer Older
John Giannelos's avatar
John Giannelos committed
1 2 3 4 5
.. snf-occi documentation master file, created by
   sphinx-quickstart on Mon Mar 26 13:45:54 2012.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

John Giannelos's avatar
John Giannelos committed
6
snf-occi's documentation!
John Giannelos's avatar
John Giannelos committed
7 8
====================================

John Giannelos's avatar
John Giannelos committed
9
**snf-occi** snf-occi implements the OCCI specification on top of synnefo’s API in order to achieve greater interoperability in common tasks referring cyclades management. This module is a translation bridge between OCCI and the Openstack API and is designed to be as independent as possible from the rest IaaS, providing an OCCI compatibility layer to other services using Openstack API. 
John Giannelos's avatar
John Giannelos committed
10 11

**snf-occi** is based in modules provided by kamaki cli-tool when dealing with REST API calls to Openstack.
John Giannelos's avatar
John Giannelos committed
12 13 14 15 16 17

.. toctree::
   :maxdepth: 2

About OCCI
----------
John Giannelos's avatar
John Giannelos committed
18
The current OCCI specification consists of the following three documents:
John Giannelos's avatar
John Giannelos committed
19 20 21 22 23

* `OCCI Core <http://ogf.org/documents/GFD.183.pdf>`_
* `OCCI Infrastructure <http://ogf.org/documents/GFD.184.pdf>`_
* `OCCI HTTP rendering <http://ogf.org/documents/GFD.185.pdf>`_

24 25
The master document for the OCCI specification is at `OCCI Specification <http://occi-wg.org/about/specification/>`_

John Giannelos's avatar
John Giannelos committed
26 27
OCCI and Cyclades
-----------------
John Giannelos's avatar
John Giannelos committed
28
The OCCI implementation in Cyclades is going to be based in the OCCI Infrastructure specification, in which common Cloud IaaS components are described. The correspondence between OCCI and Cyclades is as follows:
John Giannelos's avatar
John Giannelos committed
29

John Giannelos's avatar
John Giannelos committed
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
+-------------------------+-------------------------+
|OCCI                     |Cyclades                 |
+=========================+=========================+
|Compute                  |Synnefo servers          |
+-------------------------+-------------------------+
|OS Template              |Synnefo images           |
+-------------------------+-------------------------+
|Resource Template        |Synnefo flavors          |
+-------------------------+-------------------------+
|Networking               |NA                       |
+-------------------------+-------------------------+
|Storage                  |NA                       |
+-------------------------+-------------------------+


John Giannelos's avatar
John Giannelos committed
45 46 47 48
 
**Note:** Metadata info in synnefo's servers cannot be represented (clearly) using OCCI's components.


John Giannelos's avatar
John Giannelos committed
49 50 51
OCCI requirements
------------------
Due to OCCI's structure there cannot be straightforward mapping to Cyclades/OpenStack API. The missing elements are networking and storage capabilities using current Cyclades API.
John Giannelos's avatar
John Giannelos committed
52

John Giannelos's avatar
John Giannelos committed
53 54
OCCI operations
****************
John Giannelos's avatar
John Giannelos committed
55

John Giannelos's avatar
John Giannelos committed
56
Below you can see the required procedures/operations for OCCI compatibility.
John Giannelos's avatar
John Giannelos committed
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
   
* Handling the query interface
   * Query interface must be found under path /-/
   * Retrieve all registered Kinds, Actions and Mixins
   * Add a mixin definition
   * Remove a mixin definition

* Operation on paths in the name-space 
   * Retrieving the state of the name-space hierarchy
   * Retrieving all Resource instances below a path
   * Deletion of all Resource instances below a path

* Operations on Mixins and Kinds
   * Retrieving all Resource instances belonging to Mixin or Kind
   * Triggering actions to all instances of a Mixin or a Kind
   * Associate resource instances with a Mixin or a Kind
   * Full update of a Mixin collection
   * Dissociate resource instances from a Mixin

* Operations on Resource instances
   * Creating a resource instance
   * Retrieving a resource instance
   * Partial update of a resource instance
   * Full update of a resource instance
   * Delete a resource instance
   * Triggering an action on a resource instance

John Giannelos's avatar
John Giannelos committed
84 85 86 87
* Handling Link instances
   * Inline creation of a Link instance
   * Retrieving Resource instances with defined Links
   * Creating of Link Resource instance
John Giannelos's avatar
John Giannelos committed
88 89 90 91 92


OCCI client/server library
==========================

93
pyssf is a collection of OCCI python modules. It aims to provide a high-level interface for the integration of OCCI to other new or existing applications. 
John Giannelos's avatar
John Giannelos committed
94 95 96 97 98

Features:
---------

* It includes a REST API service with the OCCI specifications already implemented
John Giannelos's avatar
John Giannelos committed
99
* It only requires a custom backend and registry to interact with Cyclades
John Giannelos's avatar
John Giannelos committed
100

101 102 103 104 105 106 107 108 109 110
Current progress
=================
By now we have considered implementing only the **Compute** backend of the OCCI to Cyclades/Openstack API bridge and we are planning to extend it for **networking** and **storage** capabilities.

Installation
-------------

First, you need to install the required dependencies which can be found here:

* `pyssf <https://code.grnet.gr/attachments/download/1182/pyssf-0.4.5.tar>`_
John Giannelos's avatar
John Giannelos committed
111
* `kamaki <https://code.grnet.gr/projects/kamaki>`_  
112 113 114 115 116

Then you can install **snf-occi** API translation server by cloning our latest source code:

* `snf-occi <https://code.grnet.gr/projects/snf-occi>`_ 

John Giannelos's avatar
John Giannelos committed
117
**NOTE**: Before running setup.py you have to edit the **config.py** setting up:
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155

* API Server port
* VM hostname naming pattern (FQDN providing the id of each compute resource)
* VM core architecture

Finally you can start the API translation server by running **snf-occi**

Examples:
---------
For the examples below we assume server is running on localhost (port 8888) and authentication token is $AUTH. For the HTTP requests we are using **curl**.

* Retrieve all registered Kinds, Actions and Mixins:

  ::

    curl -v -X GET localhost:8888/-/ -H 'Auth-Token: $AUTH'

* Create a new VM described by the flavor 'C2R2048D20' and using the image 'Debian'

  ::
 
    curl -v -X POST localhost:8888/compute/ 
    -H 'Category: compute; scheme=http://schemas.ogf.org/occi/infrastructure#;  class="kind";' 
    -H 'X-OCCI-Attribute: occi.core.title = newVM' -H 'Category: C2R2048D20; scheme=http://schemas.ogf.org/occi/infrastructure#; ' 
    -H 'Category: Debian; scheme=http://schemas.ogf.org/occi/infrastructure#;' -H 'Auth-Token: $AUTH' 
    -H 'Content-type: text/occi'

* Retrieve all the details of th VM with identifier $ID

  ::

    curl -v -X GET localhost:8888/compute/$ID -H 'Auth-Token: $AUTH'

* Delete the VM with identifier $ID

  ::
  
    curl -v -X DELETE localhost:8888/compute/$ID -H 'Auth-Token: $AUTH'
John Giannelos's avatar
John Giannelos committed
156 157 158 159 160 161 162 163


Indices and tables
==================

* :ref:`genindex`
* :ref:`search`