Project

General

Profile

Documentation #16574

[rgw] hammer bucket object versions

Added by Vladislav Odintsov over 1 year ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
documentation
Target version:
-
Start date:
07/01/2016
Due date:
% Done:

0%

Tags:
Backport:
Reviewed:
Affected Versions:
Release:
hammer

Description

I see in the documentation, that in hammer bucket object versioning is unsupported.
http://docs.ceph.com/docs/hammer/radosgw/s3/#features-support

But, if I use boto with hammer-based ceph s3 cluster, it seems, that it works:

import boto.s3.connection
conn = boto.s3.connection.S3Connection(aws_access_key_id=access_key,

... aws_secret_access_key=secret_key,
... host=host, port=port,
... validate_certs=validate_certs,
... is_secure=is_secure, debug=debug,
... suppress_consec_slashes=suppress_consec_slashes,
... calling_format=boto.s3.connection.OrdinaryCallingFormat()
... )

bucket = conn.create_bucket("test_bucket2")
bucket.configure_versioning(True)
key = bucket.new_key("versioned_object")
key.set_contents_from_string("Version 1")

9

key.set_contents_from_string("Version 2")

9

for k in bucket.list_versions('versioned_object'):

... k.version_id
...
u'2cCJJQBE7XHz7OSxk3ZvH6DNh5Q6vOi'
u'I51r-J5NpQ44TZI.iRwyukBZ5NOyriO'

for k in bucket.list_versions('versioned_object'):

... k.get_contents_as_string()
...
'Version 2'
'Version 1'

bucket.get_key('versioned_object').get_contents_as_string()

'Version 2'

bucket.copy_key(new_key_name='versioned_object', src_bucket_name='test_bucket2', src_key_name='versioned_object', src_version_id='I51r-J5NpQ44TZI.iRwyukBZ5NOyriO')

<Key: test_bucket2,versioned_object>

bucket.get_key('versioned_object').get_contents_as_string()

'Version 1'‚Äč

list(bucket.list_versions('versioned_object'))

[<Key: test_bucket2,versioned_object>, <Key: test_bucket2,versioned_object>, <Key: test_bucket2,versioned_object>]

Orit Wasserman <> Tue 21-Jun-16 12:57 CEPH
To: Odintsov Vladislav;
Cc: ;

This looks like a documentation error

Orit

Also available in: Atom PDF