Advertisement
Guest User

radosgw + swift Temporary-Url

a guest
Feb 11th, 2015
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. ---- step I do -----
  2. swift post -m "Temp-Url-Key:1234"
  3. ./gen_url.py
  4. wget http://10.1.30.120/swift/v1/toto/toto?temp_url_sig=fded5ce05ba6dac9b3bfd74da779c6a165a93430&temp_url_expires=1423752265
  5.  
  6. ----- gen_url.py ---------
  7.  
  8. #!/usr/bin/env python
  9. # -*- coding: utf-8 -*-
  10.  
  11. import hmac
  12. from hashlib import sha1
  13. from time import time
  14. method = 'GET'
  15. duration_in_seconds = 60*60*24
  16. expires = int(time() + duration_in_seconds)
  17. path = '/v1/toto/toto'
  18. key = '1234'
  19. hmac_body = '%s\n%s\n%s' % (method, expires, path)
  20. sig = hmac.new(key, hmac_body, sha1).hexdigest()
  21. s = 'http://10.1.30.120/swift{path}?temp_url_sig={sig}&temp_url_expires={expires}'
  22. url = s.format(host='10.1.30.120', path=path, sig=sig, expires=expires)
  23.  
  24. print url
  25.  
  26. ----------- rados lspools ----------------
  27. .rgw.root
  28. .rgw.control
  29. .rgw
  30. .rgw.gc
  31. .users.uid
  32. .rgw.buckets.index
  33. .rgw.buckets
  34. .log
  35. .rgw.buckets.extra
  36. .intent-log
  37. .usage
  38. .users
  39. .users.email
  40. .users.swift
  41.  
  42. -------- ceph.conf ----------
  43. [client.radosgw.gateway]
  44. host = my_host
  45. rgw dns name = my_fulyqualied_host_name
  46. keyring = /etc/ceph/ceph.client.radosgw.keyring
  47. rgw socket path = /var/run/ceph/ceph.radosgw.gateway.fastcgi.sock
  48. log file = /var/log/radosgw/client.radosgw.osd0.log
  49. rgw print continue = false
  50. rgw enable ops log = true
  51. debug rgw = 20
  52. rgw keystone url = http://10.1.30.100:5000
  53. rgw keystone admin token = mytoken_is_there
  54. rgw keystone accepted roles = admim _member_
  55. rgw keystone token cache size = 500
  56. rgw keystone revocation interval = 300
  57. nss db path = /var/lib/ceph/nss
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement