Hi Amine, The GET commands you are issuing are returning a HTTP return code 200 OK. It will return nothing, if you didn't successfully create a network, storage or compute object before. Regarding the POST: If you are using OCCI v0.3, then you should use the attribute as described here: http://dev.opennebula.org/projects/ogf-occi/wiki/Occi_03
The virtualnetwork mixin was necessary for OpenNebula 2.2 but we decided to not support OpenNebula 2.2 anymore as it is missing some important features (like VLAN) for successfully mapping OCCI attributes. Thus, please use OpenNebula 3.0 together with OCCI v0.3 and then creating networks shouldn't be a problem. Cheers, Florian Von: Amine Ghrab <ghrab.am...@gmail.com<mailto:ghrab.am...@gmail.com>> Datum: Wed, 31 Aug 2011 20:12:13 +0100 An: <users@lists.opennebula.org<mailto:users@lists.opennebula.org>> Betreff: [one-users] OCCI 3 Requests Hi all, I'm trying to make requests to the occi server using curl command but got no anwers: oneadmin@ena-desktop:~$ curl -X GET http://localhost:3000 oneadmin@ena-desktop:~$ curl -X GET http://localhost:3000/ oneadmin@ena-desktop:~$ curl -X GET http://localhost:3000/network/ The occi-server logs are : passenger.3000.log D, [2011-08-31T20:02:33.963033 #1627] DEBUG -- : ################################# D, [2011-08-31T20:02:33.963112 #1627] DEBUG -- : Accept type: */* D, [2011-08-31T20:02:33.963164 #1627] DEBUG -- : Content type: text/plain D, [2011-08-31T20:02:33.963481 #1627] DEBUG -- : Response headers: Content-Typetext/plainServerOCCI/1.1 D, [2011-08-31T20:02:33.963535 #1627] DEBUG -- : Response body: 127.0.0.1 - - [31/Aug/2011 20:02:33] "POST /network/ " 400 - 0.0985 D, [2011-08-31T20:06:36.532413 #1627] DEBUG -- : Requested location: /network/ D, [2011-08-31T20:06:36.532667 #1627] DEBUG -- : * location: storagelink : object: #<OCCI::Core::Kind:0xb6d264e4> D, [2011-08-31T20:06:36.532759 #1627] DEBUG -- : * location: networkinterface : object: #<OCCI::Core::Kind:0xb6d29324> D, [2011-08-31T20:06:36.532820 #1627] DEBUG -- : * location: network : object: #<OCCI::Core::Kind:0xb6d2d76c> D, [2011-08-31T20:06:36.532905 #1627] DEBUG -- : * location: compute : object: #<OCCI::Core::Kind:0xb6d34d28> D, [2011-08-31T20:06:36.532976 #1627] DEBUG -- : * location: ipnetworking : object: #<OCCI::Core::Mixin:0xb6d1c9f8> D, [2011-08-31T20:06:36.533057 #1627] DEBUG -- : * location: storage : object: #<OCCI::Core::Kind:0xb6d30944> D, [2011-08-31T20:06:36.533136 #1627] DEBUG -- : * location: link : object: #<OCCI::Core::Kind:0xb6d29630> D, [2011-08-31T20:06:36.533205 #1627] DEBUG -- : * context: _/hash/ I, [2011-08-31T20:06:36.533333 #1627] INFO -- : Kind / mixin exact match for location [/network/]: #<OCCI::Core::Kind:0xb6d2d76c> D, [2011-08-31T20:06:36.533420 #1627] DEBUG -- : ### Information on the client ### D, [2011-08-31T20:06:36.533473 #1627] DEBUG -- : Client IP Adress: 127.0.0.1 D, [2011-08-31T20:06:36.533547 #1627] DEBUG -- : Client User Agent: curl/7.19.7 (i486-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3<http://1.2.3.3> libidn/1.15 D, [2011-08-31T20:06:36.533631 #1627] DEBUG -- : ################################# D, [2011-08-31T20:06:36.533688 #1627] DEBUG -- : Accept type: */* D, [2011-08-31T20:06:36.533762 #1627] DEBUG -- : Content type: text/plain D, [2011-08-31T20:06:36.533864 #1627] DEBUG -- : Response headers: Content-Typetext/plainServerOCCI/1.1 D, [2011-08-31T20:06:36.533938 #1627] DEBUG -- : Response body: 127.0.0.1 - - [31/Aug/2011 20:06:36] "GET /network/ " 200 - 0.0039 Using the verbose mode I get : oneadmin@ena-desktop:~$ curl -v -X GET http://localhost:3000/network/ * About to connect() to localhost port 3000 (#0) * Trying ::1... Connection refused * Trying 127.0.0.1... connected * Connected to localhost (127.0.0.1) port 3000 (#0) > GET /network/ HTTP/1.1 > User-Agent: curl/7.19.7 (i486-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k > zlib/1.2.3.3<http://1.2.3.3> libidn/1.15 > Host: localhost:3000 > Accept: */* > < HTTP/1.1 200 OK < Content-Type: text/plain < Connection: keep-alive < Status: 200 < X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.8 < Content-Length: 0 < Server: OCCI/1.1 < * Connection #0 to host localhost left intact * Closing connection #0 POST Request also failed : oneadmin@ena-desktop:~$ curl -v -X POST --header 'Category: network;scheme="http://schemas.ogf.org/occi/infrastructure#";class="kind";,virtualnetwork; scheme="http://schemas.opennebula.org/occi/infrastructure#";class="mixin";' --header 'X-OCCI-Attribute: occi.core.title="My Network",occi.core.summary="A short summary", opennebula.network.size=256, opennebula.network.address="192.168.0.0",opennebula.network.bridge=virbr0,opennebula.network.public=YES,opennebula.network.type=RANGED' http://localhost:3000/network/ * About to connect() to localhost port 3000 (#0) * Trying ::1... Connection refused * Trying 127.0.0.1... connected * Connected to localhost (127.0.0.1) port 3000 (#0) > POST /network/ HTTP/1.1 > User-Agent: curl/7.19.7 (i486-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k > zlib/1.2.3.3<http://1.2.3.3> libidn/1.15 > Host: localhost:3000 > Accept: */* > Category: > network;scheme="http://schemas.ogf.org/occi/infrastructure#";class="kind";,virtualnetwork; > scheme="http://schemas.opennebula.org/occi/infrastructure#";class="mixin"; > X-OCCI-Attribute: occi.core.title="My Network",occi.core.summary="A short > summary", opennebula.network.size=256, > opennebula.network.address="192.168.0.0",opennebula.network.bridge=virbr0,opennebula.network.public=YES,opennebula.network.type=RANGED > < HTTP/1.1 400 Bad Request < Content-Type: text/plain < Connection: keep-alive < Status: 400 < X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.8 < Content-Length: 0 < Server: OCCI/1.1 < * Connection #0 to host localhost left intact * Closing connection #0 Any suggestions on how to make successful HTTP request ? Regards, Amine _______________________________________________ Users mailing list Users@lists.opennebula.org<mailto:Users@lists.opennebula.org> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
_______________________________________________ Users mailing list Users@lists.opennebula.org http://lists.opennebula.org/listinfo.cgi/users-opennebula.org