Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# coding=utf-8
import requests
from requests_toolbelt.utils import dump
host = '192.168.10.147:8081'
cmd = '/auth/1.0'
url = 'http://%s%s' % (host,cmd)
user = 'yuliyang:swift'
key = '65axGyxsx9kQPLiUlUb6hax7D7uEA90tTm1yaCmi'
headers = {'x-auth-key':key,'x-auth-user':user}
response = requests.get(url,headers=headers)
X_Auth_Token = response.headers['X-Auth-Token']
cmd = '/swift/v1/bucket1'
url = 'http://%s%s' % (host,cmd)
headers = {'x-auth-token':X_Auth_Token}
response = requests.delete(url,headers=headers)
data = dump.dump_all(response)
print(data.decode('utf-8'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.