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/

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

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: radosgw-admin-1.5.0.tar.gz
  • Upload date:
  • Size: 22.8 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.5.0.tar.gz
Algorithm Hash digest
SHA256 54003bfe4692d766292729e12fa8750194a0a04f57bf66a35c1f953f1305f578
MD5 776f4e7d9fe1809d981b203d615dea8b
BLAKE2b-256 e364d5201f94807793d7e38de23dcbb1f991f54013140ffbb9a31270062f4bdd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: radosgw_admin-1.5.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/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.5.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8edf469d989e7dfc94c0ba7e37c2901591bd5c660e31cffe6c943de50df153a0
MD5 a658c91a95f67f18f381804589699e5b
BLAKE2b-256 38903ec8d7e34c48834846e9261064004a507e22f034e0900d775d7fb568cbed

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