ceph-request工具箱开发的示例代码

这篇文章将为大家详细讲解有关ceph-request工具箱开发的示例代码,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。


INSTALL

python setup.py install

HOW

ceph-request --help

create bucket named yuliyang

ceph-request -c ceph-request.cfg -m put -r '/yuliyang'

delete bucket named yuliyang

ceph-request -c ceph-request.cfg -m delete -r '/yuliyang'

upload file

ceph-request -c ceph-request.cfg -m put -r '/yuliyang/object1' --file 1.txt

upload file from content

ceph-request -c ceph-request.cfg -m put -r '/yuliyang/object1' --content "this is content for object1"

delete object

ceph-request -c ceph-request.cfg -m delete -r '/yuliyang/object1'

get location of bucket named yuliyang

ceph-request -c ceph-request.cfg -m get -r '/yuliyang?location'

get acl of bucket yuliyang

ceph-request -c ceph-request.cfg -m get -r '/yuliyang?acl'

set acl for bucket yuliyang

ceph-request -c ceph-request.cfg -m put -r '/yuliyang?acl' --content '<?xml version="1.0" encoding="UTF-8"?><AccessControlPolicy xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Owner><ID>admin</ID><DisplayName>admin</DisplayName></Owner><AccessControlList><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"><ID>admin</ID><DisplayName>admin</DisplayName></Grantee><Permission>READ</Permission></Grant></AccessControlList></AccessControlPolicy>'

关于“ceph-request工具箱开发的示例代码”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。