rgwadmin.rgw

class rgwadmin.rgw.RGWAdmin(access_key, secret_key, server, admin='admin', response='json', ca_bundle=None, secure=True, verify=True, timeout=None, pool_connections=False)[source]
metadata_types = ['user', 'bucket', 'bucket.instance']
classmethod connect(**kwargs)[source]

Establish a new connection to RGWAdmin

Only one connection can be active in any single process

classmethod set_connection(connection: rgwadmin.rgw.RGWAdmin)[source]

Set a connection for the RGWAdmin session to use.

classmethod get_connection() → rgwadmin.rgw.RGWAdmin[source]

Return the RGWAdmin connection that was set

get_base_url() → str[source]

Return a base URL. I.e. https://ceph.server

request(method, request, headers: Optional[Dict[KT, VT]] = None, data=None)[source]
get_metadata(metadata_type, key=None, max_entries=None, marker=None, headers=None)[source]

Returns a JSON object representation of the metadata

put_metadata(metadata_type, key, json_string)[source]
set_metadata(metadata_type, key, json_string)
delete_metadata(metadata_type, key)[source]
lock_metadata(metadata_type, key, lock_id, length)[source]
unlock_metadata(metadata_type: str, key, lock_id)[source]
get_user(uid: Optional[str] = None, access_key: Optional[str] = None, stats=False, sync=False)[source]
get_users()[source]
create_user(uid, display_name, email=None, key_type='s3', access_key=None, secret_key=None, user_caps=None, generate_key=True, max_buckets=None, suspended=False)[source]
get_usage(uid=None, start=None, end=None, show_entries=False, show_summary=False)[source]
trim_usage(uid=None, start=None, end=None, remove_all=False)[source]
modify_user(uid, display_name=None, email=None, key_type='s3', access_key=None, secret_key=None, user_caps=None, generate_key=False, max_buckets=None, suspended=None)[source]
get_quota(uid, quota_type)[source]
get_user_quota(uid)[source]
get_user_bucket_quota(uid)[source]

Return the quota set on every bucket owned/created by a user

set_user_quota(uid, quota_type, max_size_kb=None, max_objects=None, enabled=None)[source]

Set quotas on users and buckets owned by users

If quota_type is user, then the quota applies to the user. If quota_type is bucket, then the quota applies to buckets owned by the specified uid.

If you want to set a quota on an individual bucket, then use set_bucket_quota() instead.

set_bucket_quota(uid, bucket, max_size_kb=None, max_objects=None, enabled=None)[source]

Set the quota on an individual bucket

remove_user(uid, purge_data=False)[source]
create_subuser(uid, subuser=None, secret_key=None, access_key=None, key_type=None, access=None, generate_secret=False)[source]
modify_subuser(uid, subuser, secret=None, key_type='swift', access=None, generate_secret=False)[source]
remove_subuser(uid, subuser, purge_keys=True)[source]
create_key(uid, subuser=None, key_type='s3', access_key=None, secret_key=None, generate_key=True)[source]
remove_key(access_key, key_type=None, uid=None, subuser=None)[source]
get_buckets()[source]

Returns a list of all buckets in the radosgw

get_bucket(bucket=None, uid=None, stats=False)[source]
check_bucket_index(bucket, check_objects=False, fix=False)[source]
remove_bucket(bucket, purge_objects=False)[source]
remove_object(bucket, object_name)[source]
get_policy(bucket, object_name=None)[source]
add_capability(uid, user_caps)[source]
remove_capability(uid, user_caps)[source]
get_bucket_instances()[source]

Returns a list of all bucket instances in the radosgw

static parse_rados_datestring(s)[source]
static gen_secret_key(size=40, chars='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')[source]