Skip to main content

Ceph RADOS Gateway admin operations REST API

Project description

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). Support for Ceph Hammer or older have been dropped starting with version 1.6.0 of the library.

Requirement

  • boto

Installation

https://img.shields.io/pypi/v/radosgw-admin.svg

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

radosgw-admin-1.6.0.tar.gz (22.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

radosgw_admin-1.6.0-py2.py3-none-any.whl (25.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file radosgw-admin-1.6.0.tar.gz.

File metadata

  • Download URL: radosgw-admin-1.6.0.tar.gz
  • Upload date:
  • Size: 22.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/2.7.15

File hashes

Hashes for radosgw-admin-1.6.0.tar.gz
Algorithm Hash digest
SHA256 7cc72880057af4e0ff5c51c056585ffe603babe4e60f29d6de6493c891990ddc
MD5 b7bbfe49d7e1d80bb3296d7317175cef
BLAKE2b-256 d82b490eb4102213cedc2a19fc73a5fae7e8220392b64426e0bc9cc74e06d49b

See more details on using hashes here.

File details

Details for the file radosgw_admin-1.6.0-py2.py3-none-any.whl.

File metadata

  • Download URL: radosgw_admin-1.6.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 25.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/2.7.15

File hashes

Hashes for radosgw_admin-1.6.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 57d2d68c54ab0a81c4a66dfbbe5b1c97f29e9e904b62654532e6f37aaa87d02b
MD5 1ab830a799147e366dded502ac84b81a
BLAKE2b-256 1d5839d5e57b35a20cd3a36bf32687aff9eff0c81e2f63d41d966ad2c67821ef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page