1 .. snf-occi documentation master file, created by
2 sphinx-quickstart on Mon Mar 26 13:45:54 2012.
3 You can adapt this file completely to your liking, but it should at least
4 contain the root `toctree` directive.
6 snf-occi's documentation!
7 ====================================
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.
11 **snf-occi** is based in modules provided by kamaki cli-tool when dealing with REST API calls to Openstack.
18 The current OCCI specification consists of the following three documents:
20 * `OCCI Core <http://ogf.org/documents/GFD.183.pdf>`_
21 * `OCCI Infrastructure <http://ogf.org/documents/GFD.184.pdf>`_
22 * `OCCI HTTP rendering <http://ogf.org/documents/GFD.185.pdf>`_
26 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:
28 +-------------------------+-------------------------+
30 +=========================+=========================+
31 |Compute |Synnefo servers |
32 +-------------------------+-------------------------+
33 |OS Template |Synnefo images |
34 +-------------------------+-------------------------+
35 |Resource Template |Synnefo flavors |
36 +-------------------------+-------------------------+
38 +-------------------------+-------------------------+
40 +-------------------------+-------------------------+
44 **Note:** Metadata info in synnefo's servers cannot be represented (clearly) using OCCI's components.
49 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.
54 Below you can see the required procedures/operations for OCCI compatibility.
56 * Handling the query interface
57 * Query interface must be found under path /-/
58 * Retrieve all registered Kinds, Actions and Mixins
59 * Add a mixin definition
60 * Remove a mixin definition
62 * Operation on paths in the name-space
63 * Retrieving the state of the name-space hierarchy
64 * Retrieving all Resource instances below a path
65 * Deletion of all Resource instances below a path
67 * Operations on Mixins and Kinds
68 * Retrieving all Resource instances belonging to Mixin or Kind
69 * Triggering actions to all instances of a Mixin or a Kind
70 * Associate resource instances with a Mixin or a Kind
71 * Full update of a Mixin collection
72 * Dissociate resource instances from a Mixin
74 * Operations on Resource instances
75 * Creating a resource instance
76 * Retrieving a resource instance
77 * Partial update of a resource instance
78 * Full update of a resource instance
79 * Delete a resource instance
80 * Triggering an action on a resource instance
82 * Handling Link instances
83 * Inline creation of a Link instance
84 * Retrieving Resource instances with defined Links
85 * Creating of Link Resource instance
88 OCCI client/server library
89 ==========================
91 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.
96 * It includes a REST API service with the OCCI specifications already implemented
97 * It only requires a custom backend and registry to interact with Cyclades
101 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.
106 First, you need to install the required dependencies which can be found here:
108 * `pyssf <https://code.grnet.gr/attachments/download/1182/pyssf-0.4.5.tar>`_
109 * `kamaki <https://code.grnet.gr/attachments/download/1183/kamaki-0.3.tar>`_
111 Then you can install **snf-occi** API translation server by cloning our latest source code:
113 * `snf-occi <https://code.grnet.gr/projects/snf-occi>`_
115 **NOTE**: Before running setup.py you have to edit the **config.py** setting up:
118 * VM hostname naming pattern (FQDN providing the id of each compute resource)
119 * VM core architecture
121 Finally you can start the API translation server by running **snf-occi**
125 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**.
127 * Retrieve all registered Kinds, Actions and Mixins:
131 curl -v -X GET localhost:8888/-/ -H 'Auth-Token: $AUTH'
133 * Create a new VM described by the flavor 'C2R2048D20' and using the image 'Debian'
137 curl -v -X POST localhost:8888/compute/
138 -H 'Category: compute; scheme=http://schemas.ogf.org/occi/infrastructure#; class="kind";'
139 -H 'X-OCCI-Attribute: occi.core.title = newVM' -H 'Category: C2R2048D20; scheme=http://schemas.ogf.org/occi/infrastructure#; '
140 -H 'Category: Debian; scheme=http://schemas.ogf.org/occi/infrastructure#;' -H 'Auth-Token: $AUTH'
141 -H 'Content-type: text/occi'
143 * Retrieve all the details of th VM with identifier $ID
147 curl -v -X GET localhost:8888/compute/$ID -H 'Auth-Token: $AUTH'
149 * Delete the VM with identifier $ID
153 curl -v -X DELETE localhost:8888/compute/$ID -H 'Auth-Token: $AUTH'