danieltt / PyOCNI

PyOCNI: A Python implementation of an extended OCCI with a JSON serialization

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pyocni README
-------------

Copyright (C) Houssem Medhioub <houssem.medhioub@it-sudparis.eu>
Redistribution of this software is permitted under the terms of the LGPL License

Table of Contents
-----------------
0. What is it?
1. The Latest Version
2. API Documentation
3. Installation
3.1. Requirements
3.2. Install
3.3. Configuration
3.4. Server running
4. HowTo use (examples)
5. For developers
6. Licensing
7. Contacts
8. Acknowledgment
9. Todo
10. json files to execute the HowTo use examples

-----------------------------------------------------------------------------
0. What is it?
-----------------------------------------------------------------------------

PyOCNI (Python Open Cloud Networking Interface): A Python implementation of an extended OCCI with a JSON serialization and a cloud networking extension

-----------------------------------------------------------------------------
1. The Latest Version
-----------------------------------------------------------------------------

version 0.2
11 Jan 2012
status: Still an ongoing work

-----------------------------------------------------------------------------
2. API Documentation
-----------------------------------------------------------------------------
the api documentation are available through this html file:
 PyOCNI/pyocni/doc/index.html

-----------------------------------------------------------------------------
3. Installation
-----------------------------------------------------------------------------

3.1. Requirements
-----------------
This software needs this packages to run:
* python == 2.7
* python-all-dev (for eventlet/greenlet install/make)
* python-setuptools (to execute the setup.py file)

3.2. Install
------------
sudo python setup.py install

3.3. Configuration
------------------
Logger configuration:  OCCILogging.conf
Server configuration: occi_server.conf

3.4. Server running
-------------------
python start.py

-----------------------------------------------------------------------------
4. HowTo use (examples. The json files are at the end of this README)
-----------------------------------------------------------------------------
Retrieval of all registered Kinds and Mixins:
curl -X GET -H 'accept: application/json:occi' -v http://localhost:8090/-/
__________________________________________________________________________________________________________________

Creation of Resource instance (compute)
curl -X POST -d@post_compute.json -H 'content-type: application/json:occi' -v http://localhost:8090/compute/

Creation of Resource instance (network) with ipnetwork mixin
curl -X POST -d@post_network_ipnetwork.json -H 'content-type: application/json:occi' -v http://localhost:8090/network/

Creation of Resource instance (CloNeNode)
curl -X POST -d@post_clonenode.json -H 'content-type: application/json:occi' -v http://localhost:8090/clonenode/

Creation of Resource instance (CloNeNode) with openFlow Mixin
curl -X POST -d@post_clonenode_openflow.json -H 'content-type: application/json:occi' -v http://localhost:8090/clonenode/

Creation of Resource instance (CloNeNode) with libnetvirt Mixin
curl -X POST -d@post_clonenode_libnetvirt.json -H 'content-type: application/json:occi' -v http://localhost:8090/clonenode/

Creation of Resource instance (CloNeLink) with l3vpn Mixin
curl -X POST -d@post_clonelink_l3vpn.json -H 'content-type: application/json:occi' -v http://localhost:8090/CloNeLink/
__________________________________________________________________________________________________________________

Retrieval of Resource instance (Compute)
curl -X GET -H 'accept: application/json:occi' -v http://localhost:8090/compute/user1/compute1

Retrieval of Resource instance (CloNeNode) with OpenFlow Mixin
curl -X GET -H 'accept: application/json:occi' -v http://localhost:8090/CloNeNode/user1/CloNeNode2

Retrieval of Resource instance (CloNeLink) with l3vpn Mixin
curl -X GET -H 'accept: application/json:occi' -v http://localhost:8090/CloNeLink/user1/CloNeLink1

Retrieval of all resource instance below a path
curl -X GET -H 'accept: application/json:occi' -v http://localhost:8090/CloNeNode/user1/
__________________________________________________________________________________________________________________

UPDATE of Resource instance (CloNeLink) with l3vpn Mixin
curl -X PUT -d@post_clonelink_l3vpn.json -H 'accept: application/json:occi' -v http://localhost:8090/CloNeLink/user1/CloNeLink1

UPDATE of Resource instance (CloNeNode) with libnetvirt Mixin
curl -X PUT -d@post_clonenode_libnetvirt.json -H 'accept: application/json:occi' -v http://localhost:8090/clonenode/user1/CloNeNodeGreen
__________________________________________________________________________________________________________________

Delete of Resource instance (CloNeLink) with l3vpn Mixin
curl -X DELETE -H 'accept: application/json:occi' -v http://localhost:8090/CloNeLink/user1/CloNeLink1

Delete of Resource instance (CloNeNode) with libnetvirt Mixin
curl -X DELETE -H 'accept: application/json:occi' -v http://localhost:8090/clonenode/user1/CloNeNodeGreen
-----------------------------------------------------------------------------
5. For developers
-----------------------------------------------------------------------------

If you want export the use of your service through OCCI, two parts should be developped:
(1) the definition of the mixin with the list of attributes
(2) implementation of the specific service backend (CRUD operations)

-----------------------------------------------------------------------------
6. Licensing
-----------------------------------------------------------------------------

Copyright (C) 2011 Houssem Medhioub - Institut Telecom

This library is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with this library.  If not, see <http://www.gnu.org/licenses/>.

-----------------------------------------------------------------------------
7. Contacts
-----------------------------------------------------------------------------

Houssem Medhioub:
houssem.medhioub@it-sudparis.eu

-----------------------------------------------------------------------------
8. Acknowledgment
-----------------------------------------------------------------------------
This work has been supported by:
     SAIL project (IST 7th Framework Programme Integrated Project) [http://sail-project.eu/]
     CompatibleOne Project (French FUI project) [http://compatibleone.org/]



-----------------------------------------------------------------------------
9. Todo
-----------------------------------------------------------------------------
This release of pyocni is experimental.

Some of pyocni's needs might be:

  - 

-----------------------------------------------------------------------------
10. json files to execute the HowTo use examples
-----------------------------------------------------------------------------

post_compute.json
-----------------
    {
        "kind": {
            "term": "compute",
            "scheme": "http://schemas.ogf.org/occi/infrastructure",
            "class": "kind"
        },
        "occi.core.id": "compute1000",
        "occi.core.title": "compute1000 created by Houssem",
        "occi.core.summary": "a summary of Compute 1 resource",
        "mixins": [ ],
        "links": ["a", "b"],
        "attributes": {
            "occi.compute.architecture": "x86",
            "occi.compute.state": "active",
            "occi.compute.speed": 1.0,
            "occi.compute.memory": 512,
            "occi.compute.cores": 1,
            "occi.compute.hostname": "compute10"
        }
    }

post_network_ipnetwork.json
---------------------------
    {
        "kind": {
            "term": "network",
            "scheme": "http://schemas.ogf.org/occi/infrastructure",
            "class": "kind"
        },
        "occi.core.id": "network1",
        "occi.core.title": "network1 created by Houssem",
        "occi.core.summary": "a summary of Network 1 resource",
        "mixins": [
            {
            "term": "ipnetwork",
            "scheme": "http://schemas.ogf.org/occi/infrastructure/network",
            "class": "mixin"
            }
        ],
        "links": [],
        "attributes": {
            "occi.network.vlan": "10",
            "occi.network.label": "dmz",
            "occi.network.state": "active",
            "occi.network.address": "192.168.1.1",
            "occi.network.gateway": "192.168.1.1",
            "occi.network.allocation": "dynamic"
        }
    }

post_clonenode.json
-------------------
    {
        "kind": {
            "term": "CloNeNode",
            "scheme": "http://schemas.ogf.org/occi/ocni",
            "class": "kind"
        },
        "occi.core.id": "CloNeNode1",
        "occi.core.title": "CloNeNode1",
        "occi.core.summary": "CloNeNode created by Houssem",
        "mixins": [
        ],
        "links": ["a", "b"],
        "attributes": {
            "ocni.clonenode.availability":[
                {
                    "ocni.availability.start":"08:00",
                    "ocni.availability.end":"12:30"
                },
                {
                    "ocni.availability.start":"14:00",
                    "ocni.availability.end":"18:00"
                }
            ],
            "ocni.clonenode.location": "EU",
            "ocni.clonenode.state": "active"
        }
    }

post_clonenode_openflow.json
----------------------------
    {
        "kind": {
            "term": "CloNeNode",
            "scheme": "http://schemas.ogf.org/occi/ocni",
            "class": "kind"
        },
        "occi.core.id": "CloNeNode2",
        "occi.core.title": "CloNeNode2",
        "occi.core.summary": "CloNeNode with openflow mixin created by Houssem",
        "mixins": [
            {
                "term": "OpenFlowCloNeNode",
                "scheme": "http://schemas.ogf.org/occi/ocni",
                "class": "mixin"
            }
        ],
        "links": [],
        "attributes": {
            "ocni.clonenode.availability":[
                {
                    "ocni.availability.start":"08:00",
                    "ocni.availability.end":"12:30"
                },
                {
                    "ocni.availability.start":"14:00",
                    "ocni.availability.end":"18:00"
                }
            ],
            "ocni.clonenode.location": "EU",
            "ocni.clonenode.state": "active",
            "ocni.openflowclonenode.datapath_id" : "0x004E46324304",
            "ocni.openflowclonenode.ports" : ["6632","245"],
            "ocni.openflowclonenode.of_controller" : ["192.168.10.2","192.168.10.2"],
            "ocni.openflowclonenode.of_controller_port" : "6633"
        }
    }

post_clonelink_l3vpn.json
-------------------------
    {
       "kind":{
          "term":"CloNeLink",
          "scheme":"http://schemas.ogf.org/occi/ocni",
          "class":"kind"
       },
       "occi.core.id":"CloNeLink1",
       "occi.core.title":"CloNeLink1",
       "occi.core.summary":"CloNeLink with l3vpn mixin",
       "mixins":[
          {
             "term":"L3VPN",
             "scheme":"http://schemas.ogf.org/occi/ocni",
             "class":"mixin"
          }
       ],
       "links":[

       ],
       "attributes":{
          "ocni.clonelink.availability":[
             {
                "ocni.availability.start":"08:00",
                "ocni.availability.end":"12:30"
             },
             {
                "ocni.availability.start":"14:00",
                "ocni.availability.end":"18:00"
             }
          ],
          "ocni.clonelink.state":"active",
          "ocni.clonelink.bandwidth":"100Mbps",
          "ocni.clonelink.latency":"100ms",
          "ocni.clonelink.jitter":"",
          "ocni.clonelink.loss":"0.01%",
          "ocni.clonelink.routing_scheme":"unicast",
          "ocni.l3vpn.infrastructure_request_id":"2222",
          "ocni.l3vpn.customer_id":"0987",
          "ocni.l3vpn.service_type":{
             "ocni.l3vpn.service_type.type":"CaaS",
             "ocni.l3vpn.service_type.layer":"L2",
             "ocni.l3vpn.service_type.class_of_service":"guaranteed"
          },
          "ocni.l3vpn.service_description":[
             {
                "ocni.l3vpn.service_description.endpoint_id":"0987",
                "ocni.l3vpn.service_description.in_bandwidth":"100Mbps",
                "ocni.l3vpn.service_description.out_bandwidth":"100Mbps",
                "ocni.l3vpn.service_description.max_in_bandwidth":"120Mbps",
                "ocni.l3vpn.service_description.max_out_bandwidth":"120Mbps",
                "ocni.l3vpn.service_description.latency":"100ms",
                "ocni.l3vpn.service_description.max_latency":"200ms"
             },
             {
                "ocni.l3vpn.service_description.endpoint_id":"1001",
                "ocni.l3vpn.service_description.in_bandwidth":"100Mbps",
                "ocni.l3vpn.service_description.out_bandwidth":"100Mbps",
                "ocni.l3vpn.service_description.max_in_bandwidth":"120Mbps",
                "ocni.l3vpn.service_description.max_out_bandwidth":"120Mbps",
                "ocni.l3vpn.service_description.latency":"100ms",
                "ocni.l3vpn.service_description.max_latency":"200ms"
             }
          ],
          "ocni.l3vpn.elastisity":{
             "ocni.l3vpn.elastisity.supported":"yes",
             "ocni.l3vpn.elastisity.reconfiguration_time":"120s"
          },
          "ocni.l3vpn.scalability":{
             "ocni.l3vpn.scalability.supported":"yes",
             "ocni.l3vpn.scalability.setup_time":"10s"
          }
       }
    }

post_clonenode_libnetvirt.json
--------------------
{
        "kind": {
            "term": "CloNeNode",
            "scheme": "http://schemas.ogf.org/occi/ocni",
            "class": "kind"
        },
        "occi.core.id": "CloNeNodeGreen",
        "occi.core.title": "Clone node for libnetvirt",
        "occi.core.summary": "CloNeNode with libnetvirt mixin created by Daniel",
        "mixins": [
            {
                "term": "libnetvirt",
                "scheme": "http://schemas.ogf.org/occi/ocni",
                "class": "mixin"
            }
        ],
        "links": [],
        "attributes": {
            "ocni.clonenode.availability":[
                {
                    "ocni.availability.start":"08:00",
                    "ocni.availability.end":"12:30"
                },
                {
                    "ocni.availability.start":"14:00",
                    "ocni.availability.end":"18:00"
                }
            ],
            "ocni.clonenode.location": "EU",
            "ocni.clonenode.state": "active",
            "ocni.libnetvirt.uuid" : "1",
            "ocni.libnetvirt.endpoint" : [
		{
	            "ocni.libnetvirt.endpoint.uuid" : "12",
	            "ocni.libnetvirt.endpoint.swid" : "1",
		    "ocni.libnetvirt.endpoint.port" : "2"
		},
		{
		    "ocni.libnetvirt.endpoint.uuid" : "21",
		    "ocni.libnetvirt.endpoint.swid" : "2",
		    "ocni.libnetvirt.endpoint.port" : "2",
		    "ocni.libnetvirt.endpoint.vlan" : "10"
		},
		{
		    "ocni.libnetvirt.endpoint.uuid" : "41",
		    "ocni.libnetvirt.endpoint.swid" : "4",
		    "ocni.libnetvirt.endpoint.port" : "1",
		    "ocni.libnetvirt.endpoint.vlan" : "20"
		}
            ],
            "ocni.libnetvirt.of_controller" : "192.168.56.1",
            "ocni.libnetvirt.of_controller_port" : "2000",
            "ocni.libnetvirt.constraint" : []
        }
}

About

PyOCNI: A Python implementation of an extended OCCI with a JSON serialization

License:GNU Lesser General Public License v3.0


Languages

Language:Python 95.9%Language:JavaScript 4.1%