Skip to main content

Ceph RADOS Gateway (rgw) 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).

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.

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.7.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.7.0-py2.py3-none-any.whl (25.3 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: radosgw-admin-1.7.0.tar.gz
  • Upload date:
  • Size: 22.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

File hashes

Hashes for radosgw-admin-1.7.0.tar.gz
Algorithm Hash digest
SHA256 251eefae7d69c602554dba482ee2c42109afbb10defd6a3df0d1e52e78e559fe
MD5 97d12e0c88a5fa19d7aa250bf1e13f6c
BLAKE2b-256 a3b9716ea17b93d6aad121eb86889fb44ab666212c7ce48b4a3773a8f3849111

See more details on using hashes here.

File details

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

File metadata

  • Download URL: radosgw_admin-1.7.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 25.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

File hashes

Hashes for radosgw_admin-1.7.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 49da032b1990fc8039ade5de5ccd470704ee16b9c8ef070b2ea95c35ffb7abfe
MD5 85f49b2a26ca73bef250d8dce06aa9e9
BLAKE2b-256 f95f59a902b16d0f257ac9fe3065d7fba3b03ed07fc7065612a01e4b70647861

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