Statistics
| Branch: | Revision:

root / docs / index.rst @ 1fa7e54b

History | View | Annotate | Download (6 kB)

1 be350355 John Giannelos
.. snf-occi documentation master file, created by
2 be350355 John Giannelos
   sphinx-quickstart on Mon Mar 26 13:45:54 2012.
3 be350355 John Giannelos
   You can adapt this file completely to your liking, but it should at least
4 be350355 John Giannelos
   contain the root `toctree` directive.
5 be350355 John Giannelos
6 813073b8 John Giannelos
snf-occi's documentation!
7 be350355 John Giannelos
====================================
8 be350355 John Giannelos
9 efa0d1ef John Giannelos
**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. 
10 813073b8 John Giannelos
11 813073b8 John Giannelos
**snf-occi** is based in modules provided by kamaki cli-tool when dealing with REST API calls to Openstack.
12 be350355 John Giannelos
13 be350355 John Giannelos
.. toctree::
14 be350355 John Giannelos
   :maxdepth: 2
15 be350355 John Giannelos
16 be350355 John Giannelos
About OCCI
17 be350355 John Giannelos
----------
18 efa0d1ef John Giannelos
The current OCCI specification consists of the following three documents:
19 be350355 John Giannelos
20 be350355 John Giannelos
* `OCCI Core <http://ogf.org/documents/GFD.183.pdf>`_
21 be350355 John Giannelos
* `OCCI Infrastructure <http://ogf.org/documents/GFD.184.pdf>`_
22 be350355 John Giannelos
* `OCCI HTTP rendering <http://ogf.org/documents/GFD.185.pdf>`_
23 be350355 John Giannelos
24 1fa7e54b Christos KK Loverdos
The master document for the OCCI specification is at `OCCI Specification <http://occi-wg.org/about/specification/>`_
25 1fa7e54b Christos KK Loverdos
26 be350355 John Giannelos
OCCI and Cyclades
27 be350355 John Giannelos
-----------------
28 efa0d1ef John Giannelos
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:
29 be350355 John Giannelos
30 813073b8 John Giannelos
+-------------------------+-------------------------+
31 813073b8 John Giannelos
|OCCI                     |Cyclades                 |
32 813073b8 John Giannelos
+=========================+=========================+
33 813073b8 John Giannelos
|Compute                  |Synnefo servers          |
34 813073b8 John Giannelos
+-------------------------+-------------------------+
35 813073b8 John Giannelos
|OS Template              |Synnefo images           |
36 813073b8 John Giannelos
+-------------------------+-------------------------+
37 813073b8 John Giannelos
|Resource Template        |Synnefo flavors          |
38 813073b8 John Giannelos
+-------------------------+-------------------------+
39 813073b8 John Giannelos
|Networking               |NA                       |
40 813073b8 John Giannelos
+-------------------------+-------------------------+
41 813073b8 John Giannelos
|Storage                  |NA                       |
42 813073b8 John Giannelos
+-------------------------+-------------------------+
43 813073b8 John Giannelos
44 813073b8 John Giannelos
45 be350355 John Giannelos
 
46 be350355 John Giannelos
**Note:** Metadata info in synnefo's servers cannot be represented (clearly) using OCCI's components.
47 be350355 John Giannelos
48 be350355 John Giannelos
49 813073b8 John Giannelos
OCCI requirements
50 813073b8 John Giannelos
------------------
51 813073b8 John Giannelos
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.
52 be350355 John Giannelos
53 d91acac3 John Giannelos
OCCI operations
54 d91acac3 John Giannelos
****************
55 be350355 John Giannelos
56 813073b8 John Giannelos
Below you can see the required procedures/operations for OCCI compatibility.
57 be350355 John Giannelos
   
58 be350355 John Giannelos
* Handling the query interface
59 be350355 John Giannelos
   * Query interface must be found under path /-/
60 be350355 John Giannelos
   * Retrieve all registered Kinds, Actions and Mixins
61 be350355 John Giannelos
   * Add a mixin definition
62 be350355 John Giannelos
   * Remove a mixin definition
63 be350355 John Giannelos
64 be350355 John Giannelos
* Operation on paths in the name-space 
65 be350355 John Giannelos
   * Retrieving the state of the name-space hierarchy
66 be350355 John Giannelos
   * Retrieving all Resource instances below a path
67 be350355 John Giannelos
   * Deletion of all Resource instances below a path
68 be350355 John Giannelos
69 be350355 John Giannelos
* Operations on Mixins and Kinds
70 be350355 John Giannelos
   * Retrieving all Resource instances belonging to Mixin or Kind
71 be350355 John Giannelos
   * Triggering actions to all instances of a Mixin or a Kind
72 be350355 John Giannelos
   * Associate resource instances with a Mixin or a Kind
73 be350355 John Giannelos
   * Full update of a Mixin collection
74 be350355 John Giannelos
   * Dissociate resource instances from a Mixin
75 be350355 John Giannelos
76 be350355 John Giannelos
* Operations on Resource instances
77 be350355 John Giannelos
   * Creating a resource instance
78 be350355 John Giannelos
   * Retrieving a resource instance
79 be350355 John Giannelos
   * Partial update of a resource instance
80 be350355 John Giannelos
   * Full update of a resource instance
81 be350355 John Giannelos
   * Delete a resource instance
82 be350355 John Giannelos
   * Triggering an action on a resource instance
83 be350355 John Giannelos
84 813073b8 John Giannelos
* Handling Link instances
85 813073b8 John Giannelos
   * Inline creation of a Link instance
86 813073b8 John Giannelos
   * Retrieving Resource instances with defined Links
87 813073b8 John Giannelos
   * Creating of Link Resource instance
88 be350355 John Giannelos
89 be350355 John Giannelos
90 be350355 John Giannelos
OCCI client/server library
91 be350355 John Giannelos
==========================
92 be350355 John Giannelos
93 43b14afb John Giannelos
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. 
94 be350355 John Giannelos
95 be350355 John Giannelos
Features:
96 be350355 John Giannelos
---------
97 be350355 John Giannelos
98 be350355 John Giannelos
* It includes a REST API service with the OCCI specifications already implemented
99 813073b8 John Giannelos
* It only requires a custom backend and registry to interact with Cyclades
100 be350355 John Giannelos
101 43b14afb John Giannelos
Current progress
102 43b14afb John Giannelos
=================
103 43b14afb John Giannelos
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.
104 43b14afb John Giannelos
105 43b14afb John Giannelos
Installation
106 43b14afb John Giannelos
-------------
107 43b14afb John Giannelos
108 43b14afb John Giannelos
First, you need to install the required dependencies which can be found here:
109 43b14afb John Giannelos
110 43b14afb John Giannelos
* `pyssf <https://code.grnet.gr/attachments/download/1182/pyssf-0.4.5.tar>`_
111 456b6b8f John Giannelos
* `kamaki <https://code.grnet.gr/projects/kamaki>`_  
112 43b14afb John Giannelos
113 43b14afb John Giannelos
Then you can install **snf-occi** API translation server by cloning our latest source code:
114 43b14afb John Giannelos
115 43b14afb John Giannelos
* `snf-occi <https://code.grnet.gr/projects/snf-occi>`_ 
116 43b14afb John Giannelos
117 efa0d1ef John Giannelos
**NOTE**: Before running setup.py you have to edit the **config.py** setting up:
118 43b14afb John Giannelos
119 43b14afb John Giannelos
* API Server port
120 43b14afb John Giannelos
* VM hostname naming pattern (FQDN providing the id of each compute resource)
121 43b14afb John Giannelos
* VM core architecture
122 43b14afb John Giannelos
123 43b14afb John Giannelos
Finally you can start the API translation server by running **snf-occi**
124 43b14afb John Giannelos
125 43b14afb John Giannelos
Examples:
126 43b14afb John Giannelos
---------
127 43b14afb John Giannelos
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**.
128 43b14afb John Giannelos
129 43b14afb John Giannelos
* Retrieve all registered Kinds, Actions and Mixins:
130 43b14afb John Giannelos
131 43b14afb John Giannelos
  ::
132 43b14afb John Giannelos
133 43b14afb John Giannelos
    curl -v -X GET localhost:8888/-/ -H 'Auth-Token: $AUTH'
134 43b14afb John Giannelos
135 43b14afb John Giannelos
* Create a new VM described by the flavor 'C2R2048D20' and using the image 'Debian'
136 43b14afb John Giannelos
137 43b14afb John Giannelos
  ::
138 43b14afb John Giannelos
 
139 43b14afb John Giannelos
    curl -v -X POST localhost:8888/compute/ 
140 43b14afb John Giannelos
    -H 'Category: compute; scheme=http://schemas.ogf.org/occi/infrastructure#;  class="kind";' 
141 43b14afb John Giannelos
    -H 'X-OCCI-Attribute: occi.core.title = newVM' -H 'Category: C2R2048D20; scheme=http://schemas.ogf.org/occi/infrastructure#; ' 
142 43b14afb John Giannelos
    -H 'Category: Debian; scheme=http://schemas.ogf.org/occi/infrastructure#;' -H 'Auth-Token: $AUTH' 
143 43b14afb John Giannelos
    -H 'Content-type: text/occi'
144 43b14afb John Giannelos
145 43b14afb John Giannelos
* Retrieve all the details of th VM with identifier $ID
146 43b14afb John Giannelos
147 43b14afb John Giannelos
  ::
148 43b14afb John Giannelos
149 43b14afb John Giannelos
    curl -v -X GET localhost:8888/compute/$ID -H 'Auth-Token: $AUTH'
150 43b14afb John Giannelos
151 43b14afb John Giannelos
* Delete the VM with identifier $ID
152 43b14afb John Giannelos
153 43b14afb John Giannelos
  ::
154 43b14afb John Giannelos
  
155 43b14afb John Giannelos
    curl -v -X DELETE localhost:8888/compute/$ID -H 'Auth-Token: $AUTH'
156 be350355 John Giannelos
157 be350355 John Giannelos
158 be350355 John Giannelos
Indices and tables
159 be350355 John Giannelos
==================
160 be350355 John Giannelos
161 be350355 John Giannelos
* :ref:`genindex`
162 be350355 John Giannelos
* :ref:`search`