Skip to main content

Python Rados 网关管理 API

项目描述

rgwadmin

文件状态

rgwadmin 是一个 Python 库,用于访问 Ceph 对象存储管理 API。

http://docs.ceph.com/docs/master/radosgw/adminops/

API 示例用法

from rgwadmin import RGWAdmin

rgw = RGWAdmin(access_key='XXX', secret_key='XXX', server='obj.example.com')
rgw.create_user(
    uid='liam',
    display_name='Liam Monahan',
    email='liam@umiacs.umd.edu',
    user_caps='usage=read, write; users=read',
    max_buckets=1000)
rgw.set_user_quota(
    uid='liam',
    quota_type='user',
    max_size_kb=1024*1024,
    enabled=True)
rgw.remove_user(uid='liam', purge_data=True)

用户示例用法

from rgwadmin import RGWAdmin, RGWUser

RGWAdmin.connect(access_key='XXX', secret_key='XXX', server='obj.example.com')
u = RGWUser.create(user_id='test', display_name='Test User')
u.user_quota.size = 1024 * 1024  # in bytes
u.user_quota.enabled = True
u.save()
u.delete()

要求

rgwadmin 需要以下 Python 包:

此外,您需要拥有一个Ceph对象存储实例,该实例的用户对您要访问的 API 部分具有适当的上限(功能)。有关详细信息,请参阅 Ceph 对象存储页面。

兼容性

rgwadmin 实现了所有记录在案的 Admin API 操作或最新版本的 Ceph。我们也实施了一些未记录的...

安装

pip install rgwadmin

执照

rgwadmin - a Python interface to the Rados Gateway Admin API
Copyright (C) 2015  UMIACS

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

Email:
    github@umiacs.umd.edu

下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

rgwadmin-2.3.1.tar.gz (26.2 kB 查看哈希

已上传 source

内置分布

rgwadmin-2.3.1-py3-none-any.whl (20.7 kB 查看哈希

已上传 py3