[Openstack-operators] Problem send HTTP GET request.

Salman Zubair Toor salman.toor at it.uu.se
Wed Nov 9 22:41:07 UTC 2011


Hi,

just to explain little more. using S3 python API this header works  
perfectly fine

'GET /rootContainer/AFile.root HTTP/1.1\r\nHost: swift.uppmax.se\r 
\nAccept-Encoding: identity\r\nDate: Wed, 09 Nov 2011 22:19:43 GMT\r 
\nAuthorization: AWS system:root:k1lEc9aqTTX+54492q29OPZCq18=\r\n\r\n'

But when I use this same header within C++ simple code to it didn't  
work.

Can some point what I am doing wrong?

Regards.
Salman.

On Nov 9, 2011, at 11:15 PM, Salman Zubair Toor wrote:

> Hi Marcelo,
>
> Thanks for the reply.
>
> With curl I manage to access the file.
>
> # curl -v -k -H 'X-Storage-User: system:root' -H 'X-Storage-Pass:  
> testpass' https://swift.uppmax.se:443/auth/v1.0
>
> # curl -v -k -H "GET HTTP/1.1" -H 'X-Auth-Token:  
> AUTH_tk63e5a2291f9b44a1ab5afb9674c05779' https://swift.uppmax.se/v1/AUTH_286270d2-3d18-46f5-a5dc-7c6c88da1e7d/rootContainer/eventdata.root
>
> following is the correct header
>
>
> > GET /v1/AUTH_286270d2-3d18-46f5-a5dc-7c6c88da1e7d/rootContainer/ 
> eventdata.root HTTP/1.1
> > User-Agent: curl/7.19.7 (x86_64-pc-linux-gnu) libcurl/7.19.7  
> OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15
> > Host: swift.uppmax.se
> > Accept: */*
> > X-Auth-Token: AUTH_tk63e5a2291f9b44a1ab5afb9674c05779
>
>
> Actually my original task is a bit different. I am working on a  
> project where we already have S3 plugin available and I want to  
> access SWIFT using S3 plugin,
> Thats why I want to use Authentication rather than X-Auth-Token.
>
> With this solution I can continue but is there anything else you  
> want me to try ?
>
> Regards..
> Salman.
>
>
>
> On Nov 9, 2011, at 3:53 PM, Marcelo Martins wrote:
>
>>
>> Hi Salman,
>>
>> My first suggestion is use curl .. I assume you are using telnet  
>> here. If you are using telnet and still want to try things out with  
>> it, you should be passing the "X-Auth-Token" header and not the  
>> "Authorization" .
>>
>> Example:
>> ================================
>> root at saio-2:~# telnet 127.0.0.1 8080
>> Trying 127.0.0.1...
>> Connected to 127.0.0.1.
>> Escape character is '^]'.
>> GET /v1/AUTH_100d771c-d41e-4614-8370-8848e63a7b1b
>> Host: 127.0.0.1:8080
>> X-Auth-Token: AUTH_tk03eebc77f9d4432cbc223f08f4b24cf5
>>
>> HTTP/1.1 200 OK
>> X-Account-Object-Count: 0
>> X-Account-Bytes-Used: 0
>> X-Account-Container-Count: 1
>> Accept-Ranges: bytes
>> Content-Length: 8
>> Content-Type: text/plain; charset=utf-8
>> X-Trans-Id: tx7d2415d0e2dd4bd8ba8adaadb8d3deef
>> Date: Wed, 09 Nov 2011 14:46:20 GMT
>> Connection: close
>>
>> test900
>> Connection closed by foreign host.
>> ================================
>>
>> Also the Bexar docs are pretty old, if you are using 1.4.X check  
>> out http://docs.openstack.org/diablo/openstack-object-storage/admin/content/
>>
>>
>>
>>
>>
>> Marcelo Martins
>> Openstack-swift
>> btorch-os at zeroaccess.org
>>
>> “Knowledge is the wings on which our aspirations take flight and  
>> soar. When it comes to surfing and life if you know what to do you  
>> can do it. If you desire anything become educated about it and  
>> succeed. “
>>
>>
>>
>>
>> On Nov 9, 2011, at 6:13 AM, Salman Zubair Toor wrote:
>>
>>> Hi,
>>>
>>> I am trying to get the object from Swift store using GET request  
>>> header but facing some problem,
>>>
>>> I read from the following document
>>>
>>> http://docs.openstack.org/bexar/openstack-object-storage/developer/content/ch03s03.html
>>>
>>> That the header should look like this
>>>
>>> GET /<api version>/<account>/<container>/<object> HTTP/1.1
>>>   Host: storage.swiftdrive.com
>>>   X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
>>>
>>> I did the same and make my GET request something like this
>>>
>>> ----------------------------------------------------------------------------------
>>> GET /v1.0/system:root/rootContainer/eventdata.root HTTP/1.1
>>> Host: swift.uppmax.se
>>> Authorization: AWS system:root:VTbBHyLrCdLnxClvd1bVFZcLpy8=
>>>
>>> ----------------------------------------------------------------------------------
>>>
>>> Not that the last line is empty right after the Authentication.  
>>> But it just hangs. no answer form the server. I try to change the  
>>> header to get it working but no success :-( . Try-4 is interesting.
>>>
>>> Following are my tries..
>>>
>>> Try -1
>>>
>>> ----------------------------------------------------------------------------------
>>> GET /v1.0/system:root/rootContainer/eventdata.root HTTP/1.1
>>> Host: swift.uppmax.se
>>> Authorization: AWS system:root:yR7OHVFGgsZ4xHJp7RKHv9CuNtY=
>>>
>>>
>>> ----------------------------------------------------------------------------------
>>> Now two empty line in the end. and I got the following response.
>>>
>>> HTTP/1.1 403 Forbidden
>>> Content-Type: text/xml; charset=UTF-8
>>> Content-Length: 124
>>> Date: Wed, 09 Nov 2011 11:47:47 GMT
>>>
>>>
>>> Try-2
>>>
>>> ----------------------------------------------------------------------------------
>>> GET /v1.0/root/rootContainer/eventdata.root HTTP/1.1
>>> Host: swift.uppmax.se
>>> Authorization: AWS system:root:R9She9vkYVXQszVMfDqaeTNtUhQ=
>>>
>>> ----------------------------------------------------------------------------------
>>> change account from system:root to root (I don't know why but just  
>>> want to try) ....
>>>
>>> HTTP/1.1 403 Forbidden
>>> Content-Type: text/xml; charset=UTF-8
>>> Content-Length: 124
>>> Date: Wed, 09 Nov 2011 11:47:47 GMT
>>>
>>>
>>> Try-3
>>>
>>> ----------------------------------------------------------------------------------
>>> GET /v1.0/system:root/rootContainer/eventdata.root HTTP/1.1
>>> Host: swift.uppmax.se
>>> Date: Wed, 09 Nov 2011 12:03:06 GMT
>>> Range: bytes=0-3
>>> Authorization: AWS system:root:pHhOqVriW4zNmBW9MO1a7rNhHjI=
>>>
>>>
>>> ----------------------------------------------------------------------------------
>>>
>>> HTTP/1.1 403 Forbidden
>>> Content-Type: text/xml; charset=UTF-8
>>> Content-Length: 124
>>> Date: Wed, 09 Nov 2011 11:47:47 GMT
>>>
>>>
>>> Try-4
>>>
>>> ----------------------------------------------------------------------------------
>>> GET /rootContainer/eventdata.root HTTP/1.1
>>> Host: swift.uppmax.se
>>> Date: Wed, 09 Nov 2011 12:04:57 GMT
>>> Range: bytes=0-3
>>> Authorization: AWS system:root:oQX68HKwnH1OnBJhTmHGz3cm4b4=
>>>
>>>
>>> ----------------------------------------------------------------------------------
>>> I have removed the version and the account details  and then at  
>>> least the request message get changed. No more forbidden response.  
>>> But now its "206 Partial Content" and after getting the headers   
>>> the read bytes are 0.
>>>
>>>
>>> HTTP/1.1 206 Partial Content
>>> n: 44
>>> line: Last-Modified: Tue, 01 Nov 2011 16:13:21 GMT
>>> n: 17
>>> line: Content-Length: 4
>>> n: 38
>>> line: Etag: f3e0c75e57766c5581a6978e2b70698f
>>> n: 38
>>> line: Content-Type: application/octet-stream
>>> n: 35
>>> line: Date: Wed, 09 Nov 2011 12:01:30 GMT
>>> n: 0
>>> line:
>>> n: 4
>>> line: root
>>> n: 0
>>> line:
>>>
>>> Then I send only HEAD request without version and account and that  
>>> runs successfully
>>>
>>> ------------------------------------------------------------------------------------------
>>> HEAD /rootContainer/eventdata.root HTTP/1.1
>>> Host: swift.uppmax.se
>>> Date: Wed, 09 Nov 2011 12:14:11 GMT
>>> Authorization: AWS system:root:dAWDu4I8SJyY02HEIirYejDWn2w=
>>>
>>>
>>> ------------------------------------------------------------------------------------------
>>>
>>> gDebug Header: HTTP/1.1 200 OK
>>> gDebug Header: Last-Modified: Tue, 01 Nov 2011 16:13:21 GMT
>>> gDebug Header: Content-Length: 13
>>> gDebug Header: Etag: f3e0c75e57766c5581a6978e2b70698f
>>> gDebug Header: Content-Type: text/plain
>>> gDebug Header: Date: Wed, 09 Nov 2011 12:10:45 GMT
>>>
>>>
>>>
>>> If I use command line tool everything is working fine. Can someone  
>>> please point out what is wrong or how should I modify things.
>>>
>>> Thanks.
>>>
>>>
>>> Salman Zubair Toor
>>> Ph.Lic. Scientific Computing
>>> Ph.D candidate
>>> Division of Scientific Computing
>>> Uppsala University, Sweden
>>> salman.toor at it.uu.se
>>>
>>>
>>>
>>> _______________________________________________
>>> Openstack-operators mailing list
>>> Openstack-operators at lists.openstack.org
>>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>>
>
> Salman Zubair Toor
> Ph.Lic. Scientific Computing
> Ph.D candidate
> Division of Scientific Computing
> Uppsala University, Sweden
> salman.toor at it.uu.se
>
>
>

Salman Zubair Toor
Ph.Lic. Scientific Computing
Ph.D candidate
Division of Scientific Computing
Uppsala University, Sweden
salman.toor at it.uu.se



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-operators/attachments/20111109/8b2bd7a6/attachment-0002.html>


More information about the Openstack-operators mailing list