python rados网关管理api
rgwadmin的Python项目详细描述
rgwadmin
rgwadmin是一个访问ceph对象存储管理api的python库。
http://docs.ceph.com/docs/master/radosgw/adminops/
API示例用法
fromrgwadminimportRGWAdminrgw=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)
用户示例用法
fromrgwadminimportRGWAdmin,RGWUserRGWAdmin.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 bytesu.user_quota.enabled=Trueu.save()u.delete()
要求
rgwadmin需要以下python包:
如果运行的是python<;2.7,则需要集合的后台端口 订购信息技术。
此外,还需要有一个Ceph对象存储 实例的用户在 要访问的API。见 Ceph Object Storage页了解更多信息 信息。
兼容性
不同版本的ceph-radosgw的api随着时间的推移而改变。而我们 尽可能多的版本兼容ceph-radosgw 随着时间的推移出现的一些问题。我们只考虑LTS版本,但是 这些是我们测试过的。
- 1.0.5<;=萤火虫
- 1.0.6>;萤火虫/锤子
- 1.1>;锤子
- 1.1.5>;宝石
安装
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