Skip to content

How create bucket for riak-cs? #549

@Konstantin74R

Description

@Konstantin74R

I'm use riak-python-client 2.7.0. for riak kv 2.1.1 and riak-cs 2.1.0.
I created bucket using protocol pbc, but s3cmd don't see them.
Bucket exists in Riak KV and my script show me them.
How can i create s3 bucket using riak python client and pbc protocol?

my source code

### Connection options

set_protocol = 'pbc' 
set_host = '10.32.101.72'
set_pb_port = 8087
set_nodes = [{'host':'10.32.101.72', 'pb_port':8087}]

### create connection
myclient = riak.RiakClient(protocol = set_protocol, host = set_host, http_port = set_pb_port, nodes = set_nodes)

### Get list buckets
print(myclient.get_buckets())

### create bucket
mybucket = myclient.bucket('new_bucket')

### Get list key in bucket
print(myclient.get_keys(mybucket))

### insert data to new bucket
obj = riak.RiakObject(myclient, mybucket, 'test_key' )
obj.data = 'asdfasdfasdf'
obj.store()

print(mybucket.get_keys())

fetched1 = mybucket.get('test_key')
print(fetched1.data)'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions