from boto.s3.connection import S3Connection
conn = S3Connection('****', '****', host='s3.eu-geo.objectstorage.softlayer.net')
mybucket = conn.get_bucket('mybucket')
退货
/anaconda3/lib/python3.6/site-packages/boto/s3/connection.py in head_bucket(self, bucket_name, headers)
551 err.error_code = 'NoSuchBucket'
552 err.error_message = 'The specified bucket does not exist'
--> 553 raise err
554 else:
555 raise self.provider.storage_response_error(
S3ResponseError: S3ResponseError: 404 Not Found
但是,如果我尝试创建存储桶:
conn.create_bucket('mybucket')
S3CreateError: S3CreateError: 409 Conflict
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Error><Code>BucketAlreadyExists</Code><Message>Container mybucket exists</Message><Resource>/mybucket/</Resource><RequestId>****</RequestId><httpStatusCode>409</httpStatusCode></Error>