ncw / swift

Go language interface to Swift / Openstack Object Storage / Rackspace cloud files (golang)
MIT License
310 stars 107 forks source link

Support status 429 for OVH Cloud Archive #140

Closed jeremy-clerc closed 5 years ago

jeremy-clerc commented 5 years ago

Hello,

Thank you for your work on this library.

OVH operates a slightly derived version of the Swift API for its Cloud Archive product.

Objects are not directly available, the first request triggers the object unsealing, and until it is unsealed, OVH will return a status 429 with a Retry-After header which indicates when the object will be available. https://docs.ovh.com/gb/en/storage/pca/api/#get-object

I have two changes to propose:

  1. Treat 429 as an objectError, known in objectErrorMap, so it can be compared
  2. Always return the headers, even when the status is not part of objectErrorMap

I have prepared the changes https://github.com/ncw/swift/compare/master...jeremy-clerc:handle_ovh_unfreeze?expand=1, if you think it is a good idea, I will create the pull request.

Thanks

ncw commented 5 years ago

I see we've been working on the same thing!

Please send in your PR :-)

I have an improvement on your 2. which I'll merge after.