File size: 476 Bytes
2abfccb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from petrel_client.client import Client
import hashlib


client = Client('conf/s3config.ini')
filename = 'cluster1:s3://my-bucket/object.111'
content = b'a' * 1024
print('put: key len:', len(filename), 'content len:', len(content))

client.put(filename, content, update_cache=True)
content, info = client.get_and_update(filename, enable_etag=True)

print('size:', len(content))

digest = hashlib.md5(content).hexdigest()
print('digest:', digest)

print('etag:', info['etag'])