forked from all4innov/pyOCNI
-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
364 lines (318 loc) · 13.4 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
pyocni README
-------------
Copyright (C) Houssem Medhioub <[email protected]>
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 (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
__________________________________________________________________________________________________________________
Delete of Resource instance (CloNeLink) with l3vpn Mixin
curl -X DELETE -H 'accept: application/json:occi' -v http://localhost:8090/CloNeLink/user1/CloNeLink1
-----------------------------------------------------------------------------
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 pf 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:
-----------------------------------------------------------------------------
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. There are many aspects of
the application that need tending to if it is ever going to fly.
Some of pyocni's immediate 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_clonenode_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 created by Houssem",
"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"
}
}
}