GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - valerytschopp/python-radosgw-admin: Ceph RADOS Gateway admin operations

BranchesTags
Open more actions menu

Latest commit

 

History

156 Commits
156 Commits

Folders and files

NameName
Last commit message
Last commit date
examples
examples
 
 
radosgw
radosgw
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
MANIFEST.in
MANIFEST.in
 
 
PYTHON_PYPI_PACKAGE.md
PYTHON_PYPI_PACKAGE.md
 
 
README.rst
README.rst
 
 
setup.cfg
setup.cfg
 
 
setup.py
setup.py
 
 

Repository files navigation

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='[email protected]')

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)

About

Ceph RADOS Gateway admin operations

Topics

cephceph-radosgwpippythonradosgwradosgwadminrgwrgwadmin

Resources

Readme
GPL-3.0 license
Activity

Stars

38 stars

Watchers

5 watching

Forks

22 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.