Statistics
| Branch: | Revision:

root / docs / index.rst @ efa0d1ef

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