[one-users] OCCI 3 Requests

Amine Ghrab ghrab.amine at gmail.com
Wed Aug 31 12:12:13 PDT 2011


Hi all,

I'm trying to make requests to the occi server using curl command but got no
anwers:

oneadmin at ena-desktop:~$ curl -X GET http://localhost:3000
> oneadmin at ena-desktop:~$ curl -X GET http://localhost:3000/
> oneadmin at 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.3libidn/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 at 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 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 at 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 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20110831/2ad52866/attachment-0002.htm>


More information about the Users mailing list