Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How create bucket for riak-cs? #549

Open
Konstantin74R opened this issue Oct 3, 2022 · 0 comments
Open

How create bucket for riak-cs? #549

Konstantin74R opened this issue Oct 3, 2022 · 0 comments

Comments

@Konstantin74R
Copy link

Konstantin74R commented Oct 3, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant