I use the RGW python API but never succeeded.

test-ceph.py:
#!/usr/bin/python
# Filename: test-ceph.py
import boto
import boto.s3.connection
access_key = 'TJLN5IDXXXXXXXXXXXX'
secret_key = 'EcaCMS1\/4b3\/AAM50QXXXXXXXXXXXXXXXX'


conn = boto.connect_s3(
        aws_access_key_id = access_key,
        aws_secret_access_key = secret_key,
        host = '1.1.1.1',
        #is_secure=False,               # uncommmnt if you are not using ssl
        calling_format = boto.s3.connection.OrdinaryCallingFormat(),
        )


bucket = conn.create_bucket('mybucket');


for bucket in conn.get_all_buckets():
        print "{name}\t{created}".format(
                name = bucket.name,
                created = bucket.creation_date,
        )


----------------------------------------------------------
[root@CentOS-6 ~]# ./test-ceph.py
Traceback (most recent call last):
  File "./test-ceph.py", line 16, in <module>
    bucket = conn.create_bucket('mybucket');
  File "/usr/lib/python2.6/site-packages/boto/s3/connection.py", line 590, in 
create_bucket
    response.status, response.reason, body)
boto.exception.S3ResponseError: S3ResponseError: 405 Method Not Allowed
None


What's the possible reason?
Thanks!
_______________________________________________
ceph-users mailing list
[email protected]
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com

Reply via email to