~~NOTOC~~
OpenNebula OCCI Specification
* **Network Collection**
* **Storage Collection**
===== The Network Resource =====
The ''NETWORK'' element defines a virtual network that interconnects those ''COMPUTES'' with a network interface card attached to that network. The traffic of each network is isolated from any other network, so it constitutes a broadcasting domain.
The following elements can be defined for a ''NETWORK'':
* ''ID'', the uuid of the network
* ''NAME,'' describing the network
* ''ADDRESS'', of the network
* ''SIZE'', of the network, defaults to C
Example:
123
BlueNetwork
192.168.0.1
C
===== The Storage Resource =====
The ''STORAGE'' is a resource containing an operative system or data, to be used as a virtual machine disk:
* ''ID'', the uuid of the image
* ''NAME'', name of the image
* ''DESCRIPTION'', describing the image
* ''TYPE'', type of the image
* ''OS'': contains a working operative system
* ''CDROM'': readonly data
* ''DATABLOCK'': storage for data, which can be accessed and modified from different Computes
* ''SIZE'', of the image in MBs
* ''FSTYPE'', in case of DATABLOCK, the type of filesystem desired
Example:
123
Ubuntu Desktop
UUbuntu 10.04 desktop for students.
OS
2048
===== The Compute Resource =====
The ''COMPUTE'' element defines a virtual machine by specifying its basic configuration attributes such as ''NIC'' or ''DISK''. The following elements can be defined:
* ''ID'', the uuid of the virtual machine.
* ''NAME'', describing the virtual machine.
* ''TYPE'', a COMPUTE type specifies a CPU and memory capacity, valid types are small, medium and large.
* ''STATE'', the state of the COMPUTE. This can be changed to
* stopped
* suspended
* resume
* cancel
* shutdown
* done
* ''DISK'', the block devices attached to the virtual machine.
* ''NIC'', the network interfaces.
Example:
32
Web Server
small
running
OS
hda
...
CDROM
hdc
...
...
00:ff:72:31:23:17
192.168.0.12
...
00:ff:72:17:20:27
192.168.0.25
...
...
====== Authentication & Authorization ======
User authentication will be [[http://tools.ietf.org/html/rfc1945#section-11|HTTP Basic access authentication]] to comply with REST philosophy. Authorization will be handled by OpenNebula's user management module, that currently works as:
* There are normal users and one privilege user (known as oneadmin)
* All users can access retrieve information of all PRs
* All users can perform operations over all PRs
* Normal users can perform operations over their ERs, but no over other users'
* Privilege user oneadmin can perform operations over all ERs
====== HTTP Headers ======
The following headers are compulsory:
* **Content-Length**: The size of the Entity Body in octets
* **Content-Type**: application/xml
Uploading images needs HTTP multi part support, and also the following header
* **Content-Type**: multipart/form-data
====== Return Codes ======
The OpenNebula Cloud API uses the following subset of HTTP Status codes:
* **200 OK** : The request has succeeded. The information returned with the response is dependent on the method used in the request, as follows:
* **GET** an entity corresponding to the requested resource is sent in the response
* **POST** an entity containing the result of the action
* **201 Created** : Request was successful and a new resource has being created
* **202 Accepted** : The request has been accepted for processing, but the processing has not been completed
* **204 No Content** : The request has been accepted for processing, but no info in the response
* **400 Bad Request** : Malformed syntax
* **401 Unauthorized** : Bad authentication
* **403 Forbidden** : Bad authorization
* **404 Not Found** : Resource not found
* **500 Internal Server Error** : The server encountered an unexpected condition which prevented it from fulfilling the request.
* **501 Not Implemented** : The functionality requested is not supported
The methods specified below are described without taking into account **4xx** (can be inferred from authorization information in section above) and **5xx** errors (which are method independent). HTTP verbs not defined for a particular entity will return a **501 Not Implemented**.
====== Pool Resource Methods ======
===== Computes =====
* Base URL : http://www.opennebula.org/compute
===== Networks =====
* Base URL : http://www.opennebula.org/network
===== Storage =====
* Base URL : http://www.opennebula.org/storage
All the above resources share the same HTTP verb semantics: