OVH Community, your new community space.

Hubic API command line and wrapper for swift

08-07-2014, 08:59 AM

Where did you find this authentication method, with the oauthid hidden value. I do not find any documentation on it.


02-12-2014, 01:04 PM
Hi gifad,

Ok, I understand your request.
I already wanted to catch such swift/openstack errors.

As soon as I get sthg working, I'll update the thread.

02-12-2014, 11:27 AM
http 408 errors are of course in openstack requests;
this is "normal" (at least usual) hubic behaviour :
try copy or move a folder in the web app with firebug console activated, and you will see the details.
the web app silently retries any 408 or 5xx errors up to 3 times before showing error message...

NB: you should remove libxml2 references from README too...

I found a console log showing the 408 error from a basic curl request :
$ export OBJECT="relative/path/to/file.ext"
$ curl --request PUT -i \
    -H "X-Auth-Token: xxxxxxyyyyyyyyyyyyyyyyyyyyyyyyyy" \
    -H "X-Copy-From: /default/$OLDPATH/$OBJECT" \
    -H "Content-Length: 0" \$NEWPATH/$OBJECT

HTTP/1.1 408 Request Timeoutyyyyyyyyyyyyyyyyyyyyyyyyyy" \
Content-Length: 116
Content-Type: text/html; charset=UTF-8
X-Trans-Id: tx0ea5de4b0c534fdab11c0c78e4a5228e
Date: Sun, 26 Jan 2014 15:05:02 GMT

Request Timeout

The server has waited too long for the request to be sent by the client.


02-12-2014, 08:54 AM
Hi gifad,

Thanks for reporting these issues.
I fixed both 'libxml2' import and hubic refresh token on OS refresh token.

I also add an option to force OS refresh token.

By the way, when did you get the http timeout 408 error. Is it on when requesting the hubic API or the OpenStack ?

02-11-2014, 09:43 PM
Hello again,

found a small issue in :
when os_auth_token is expired, access_token has likely expired too
this is not checked, so the credentials request fails

adding these lines before line 421 fixed the issue
                # check access_token expired
                if self.token_expire <= time():
                    print "-- Access token has expired, try to renew it"

02-10-2014, 09:49 PM

The last version does not use libxml2 anymore, so line 20 :
import libxml2
can be removed (libxml2 is a pain to install, if you have no root access...)

anyway, the app works fine, thanks a lot !

I just miss a way to catch the (numerous) hubic http error 408 (Timeout), in order to retry the command...


02-10-2014, 10:39 AM
I updated the app.

Thanks for reporting the issue.

02-08-2014, 03:24 PM
I think the error is because your float config values are being initialised with None instead of a valid float value.

02-08-2014, 03:04 PM
Thanks! Any idea why I'm getting this error:

Exception AttributeError: "hubic instance has no attribute 'client_id'" in > ignored

01-29-2014, 10:50 AM

I wrote a python script to access the hubic API through the command line. It can also be used as a wrapper for the swift client.
The idea is to be able to request Hubic API directly from command line. The script is able to perform hubic oauth on its own.

$ ./ --get /account
If you're is interested, everything is available at github :