Skip to contentSkip to conversation

hammer bucket object versions

rgw Odintsov Vladislav 2 participants 2 messages Jun 20, 2016 – Jun 21, 2016 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi all,

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:

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

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()

... )

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

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

9

Quoted 1 line
Quoted 1 line
Quoted 1 line

key.set_contents_from_string("Version 2")

9

Quoted 1 line
Quoted 1 line
Quoted 1 line

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

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

Quoted 1 line
Quoted 1 line
Quoted 1 line

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

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

Quoted 1 line
Quoted 1 line
Quoted 1 line

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

'Version 2'

Quoted 1 line
Quoted 1 line
Quoted 1 line

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>

Quoted 1 line
Quoted 1 line
Quoted 1 line

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

'Version 1'​

Quoted 1 line
Quoted 1 line
Quoted 1 line

list(bucket.list_versions('versioned_object'))

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

I'd like to clarify, is it non-production ready in hammer, or it's a documentation error?​

Regards,

Vladislav Odintsov

#2 lore raw

This looks like a documentation error

Orit

Quoted 48 lines · Odintsov Vladislav

Hi all,

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:

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

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()

... )

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

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

9

Quoted 1 line
Quoted 1 line
Quoted 1 line

key.set_contents_from_string("Version 2")

9

Quoted 1 line
Quoted 1 line
Quoted 1 line

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

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

Quoted 1 line
Quoted 1 line
Quoted 1 line

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

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

Quoted 1 line
Quoted 1 line
Quoted 1 line

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

'Version 2'

Quoted 1 line
Quoted 1 line
Quoted 1 line

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>

Quoted 1 line
Quoted 1 line
Quoted 1 line

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

'Version 1'

Quoted 1 line
Quoted 1 line
Quoted 1 line

list(bucket.list_versions('versioned_object'))

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

I'd like to clarify, is it non-production ready in hammer, or it's a documentation error?

Regards,

Vladislav Odintsov