valerytschopp / python-radosgw-admin Goto Github PK
View Code? Open in Web Editor NEWCeph RADOS Gateway admin operations
License: GNU General Public License v3.0
Ceph RADOS Gateway admin operations
License: GNU General Public License v3.0
Hi,
Thanks for making this client library, I'm finding it immensely useful.
I'm having an issue modifying caps for a given user post-creation. It seems fine to create a user with a set of caps but post-creation doesn't seem to work. Looking at the logs in RGW it doesn't seem to be complaining about anything. Not sure if it's an issue with RGW or the library.
for example:
testuser2 = rgwadmin.create_user('testuser2',
display_name='A test user',
email='[email protected]')
testuser2.update(display_name='Second test user', user_caps='buckets=*')
The request returns 200 and the RGW logs all look good.
Keen to know if you've seen this issue.
Thanks
Hi,
I developed a script based on your library to extract stats from all buckets via rgw.get_bucket(stats=True)
.
It was working fine until today. Now I get None
back.
I think it comes from the large number of buckets (+2500) because when I use the CLI radosgw-admin bucket stats
, I get a response containing all the stats of my all buckets.
So I did an rgw.get_buckets()
followed by a for loop on each bucket to retrieve the stats but the processing time is infinitely longer.
Is there a solution to get all stats of all bucket with one request only please ?
Thanks
Hi!
I need to send requests for rados gateway behind a http proxy and I'm applying the following settings on my connector:
# -*- coding: utf-8 -*-
#!/usr/bin/env python3
from radosgw.connection import RadosGWAdminConnection
rgwadmin = RadosGWAdminConnection(host="rados_gateway_server",
access_key="ACCESS_KEY",
secret_key="SECRET_KEY",
proxy="http_proxy_server",
proxy_port=3128,
proxy_user="http_proxy_user",
proxy_pass="http_proxy_pass",
debug=True)
users = rgwadmin.get_users()
for u in users:
print(f"Username: {u.display_name}")
print(f"User ID: {u.user_id}")
I'm getting the error bellow:
2020-10-22 17:00:53,855 boto [DEBUG]:http_request:method:(GET) protocol:(https) host(rados_gateway) port(443) path(https://rados_gateway/admin/metadata/user?format=json) params({'format': 'json'}) headers({}) body()
2020-10-22 17:00:53,855 boto [DEBUG]:Method: GET
2020-10-22 17:00:53,856 boto [DEBUG]:Path: https://rados_gateway/admin/metadata/user?format=json
2020-10-22 17:00:53,856 boto [DEBUG]:Data:
2020-10-22 17:00:53,856 boto [DEBUG]:Headers: {}
2020-10-22 17:00:53,856 boto [DEBUG]:Host: rados_gateway
2020-10-22 17:00:53,856 boto [DEBUG]:Port: 443
2020-10-22 17:00:53,856 boto [DEBUG]:Params: {'format': 'json'}
2020-10-22 17:00:53,856 boto [DEBUG]:establishing HTTPS connection: host=rados_gateway, kwargs={'timeout': 30, 'port': 443}
2020-10-22 17:00:53,860 boto [DEBUG]:Proxy connection: CONNECT rados_gateway:443 HTTP/1.0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/python/venv/lib/python3.7/site-packages/radosgw/connection.py", line 162, in get_users
response = self.make_request('GET', path='/metadata/user', query_params=params)
File "/opt/python/venv/lib/python3.7/site-packages/radosgw/connection.py", line 120, in make_request
retry_handler=retry_handler)
File "/opt/python/venv/lib/python3.7/site-packages/boto/connection.py", line 913, in _mexe
self.is_secure)
File "/opt/python/venv/lib/python3.7/site-packages/boto/connection.py", line 705, in get_http_connection
return self.new_http_connection(host, port, is_secure)
File "/opt/python/venv/lib/python3.7/site-packages/boto/connection.py", line 747, in new_http_connection
connection = self.proxy_ssl(host, is_secure and 443 or 80)
File "/opt/python/venv/lib/python3.7/site-packages/boto/connection.py", line 796, in proxy_ssl
sock.sendall("CONNECT %s HTTP/1.0\r\n" % host)
TypeError: a bytes-like object is required, not 'str'
What's gone wrong? Can you help me?
Tks!
I'll have to return with the specific Ceph/RadowGW version, but get_users
breaks here due to key_dict
not having an access_key
property.
My dicts have only secret_key
and user
.
Hi,
I found the code did not support python3, do you have a plan for supporting python3 ?
Thanks.
Line 360 of connection.py
makes this library only work with Python 2 due to the it's check for type unicode
which was renamed to str
in Python 3. Could we update this please?
File "/Users/c81298/.local/share/virtualenvs/symphony-s3-xs1SLCJ5/lib/python3.6/site-packages/radosgw/connection.py", line 360, in get_buckets
if isinstance(body_json[0], unicode) or isinstance(body_json[0], str):
NameError: name 'unicode' is not defined
I noticed this library can create users and it can do various admin operations on buckets, it can't create buckets. Also I noticed this operation is not on https://docs.ceph.com/docs/nautilus/radosgw/adminops/ . Likely it's not there because it's part of the standard S3 API already which makes sense.
For completeness though, would this still be a useful call to add?
Hi,
Many thanks for this useful library.
I was wondering if you have any plans to switch to using boto3
: boto
is at this point no longer properly maintained and bugs are no longer being addressed or pull requests merged.
I am hit for example by this bug, which affects me with python-radosgw-admin, as I try to connect to an endpoint with self-signed certificates. I can get around it with the https_connection_factory
hack, but it's not pretty...
There is an error in: python-radosgw-admin/radosgw/connection.py
In line 101 you are using the variable "query" which does not exist..
I think you forgot to init this variable in line 97:
urlencode(query_params)
should be:
query = urlencode(query_params)
Not going to bother creating a new pull request , i think it's a hot fix sort of bug
There are a couple references to subusers in the code, but none of them supply a function to create, delete, or rekey a subuser.
Could you please do a minor release on the merged commits on master
branch, especially on Python PyPI? Thank you.
the correct argument is “max_buckets“,there is a ”s“ at the end;
I use the command " python radosgw-admin-example.py --hostname=172.16.154.* -a C3H********** -s gEl4uaoGWDd3oH78kCo***********
" but I get message"ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)“. I have cofigured the ssl for my apache .
How can I fix the problem?
It would be nice, if support for user stats could be added.
CLI command: radosgw-admin user stats --uid=xxxx --sync-stats
I think we should use 'tenant$user_id' as uid if tenant is not empty
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.