python-radosgw-admin
Python REST API for the Ceph RADOS Gateway (radosgw) admin operations
http://docs.ceph.com/docs/master/radosgw/adminops/
NOTICE: The library support Ceph version >= 10.2 (Jewel).
Changes
Version 1.6: Support for Ceph Hammer or older have been dropped.
Version 1.7: Functions get_buckets() and get_users() returns an iterator, not a list anymore.
Version 1.7.1: Function get_uids() added.
Version 1.7.2: Functions get_policy(bucket, object=None, ...) and delete_usage() added. Function set_quota(...) returns None.
Requirement
boto
Installation
The package is available on https://pypi.python.org/pypi/radosgw-admin. To install it use pip:
pip install radosgw-admin
Or clone this repository and install it locally:
python setup.py install
Configuration of the admin user
To create or modify a bucket/user in radosgw, the admin user require the following read,write capabilities (caps):
"caps": [
{ "type": "buckets",
"perm": "*" },
{ "type": "usage",
"perm": "read" },
{ "type": "metadata",
"perm": "read" },
{ "type": "users",
"perm": "*" }
]
You can use the radosgw-admin command to add capabilities to an existing user:
radosgw-admin caps add --uid <USER_ID> --caps "buckets=read,write" radosgw-admin caps add --uid <USER_ID> --caps "users=read,write"
Examples
See the example in examples/radosgw-admin-example.py
Here is a simple example:
import radosgw
rgwadmin = radosgw.connection.RadosGWAdminConnection(host='hostname.example.org',
access_key='<ADMIN_ACCESS_KEY>',
secret_key='<ADMIN_SECRET_KEY>')
# user operations
testuser2 = rgwadmin.create_user('testuser2',
display_name='A test user',
email='testuser2@example.org')
testuser2.update(display_name='Second test user', suspended=True)
testuser1 = rgwadmin.get_user('testuser1')
# bucket operations
buckets = rgwadmin.get_buckets()
for bucket in buckets:
print(bucket)
testuser1_buckets = testuser1.get_buckets()
for bucket in testuser1_buckets:
# transfer buckets to testuser2
rgwadmin.link_bucket(bucket.name, bucket.id, testuser2.id)
Metadata
Release files for radosgw-admin 1.7.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| radosgw-admin-1.7.2.tar.gz | 23.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| radosgw_admin-1.7.2-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 49.3 kB
Release files / radosgw-admin-1.7.2.tar.gz
| Download URL | radosgw-admin-1.7.2.tar.gz |
|---|---|
| Size | 23.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ac05f78ec41caaef4209f90932b857704aa031017bf31faa7f30ec0d7fc80471
|
|
BLAKE2b-256 checksum How to use checksums |
42a7b147fb5faac7f3c832652a599110c6c6764577f2ac5429a18d73b4440491
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5
|
Release files / radosgw_admin-1.7.2-py2.py3-none-any.whl
| Download URL | radosgw_admin-1.7.2-py2.py3-none-any.whl |
|---|---|
| Size | 25.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
c22ade8e75397717a37ffa9277be2658d2e71c09942eac8eb9d5807a751abf30
|
|
BLAKE2b-256 checksum How to use checksums |
899bf6fdc067eccd61f1147e778327a8ffd0052c28d3a57dd79b8465bd28b364
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5
|