Re: Anybody gotten boto3 and ceph RGW working?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Here is the error I get:

 

# python3 boto3_test.py

Traceback (most recent call last):

  File "boto3_test.py", line 15, in <module>

    for bucket in s3.list_buckets():

  File "/jump/software/rhel7/python36_botocore-1.4.85/lib/python3.6/site-packages/botocore/client.py", line 251, in _api_call

    return self._make_api_call(operation_name, kwargs)

  File "/jump/software/rhel7/python36_botocore-1.4.85/lib/python3.6/site-packages/botocore/client.py", line 526, in _make_api_call

    operation_model, request_dict)

  File "/jump/software/rhel7/python36_botocore-1.4.85/lib/python3.6/site-packages/botocore/endpoint.py", line 141, in make_request

    return self._send_request(request_dict, operation_model)

  File "/jump/software/rhel7/python36_botocore-1.4.85/lib/python3.6/site-packages/botocore/endpoint.py", line 170, in _send_request

    success_response, exception):

  File "/jump/software/rhel7/python36_botocore-1.4.85/lib/python3.6/site-packages/botocore/endpoint.py", line 249, in _needs_retry

    caught_exception=caught_exception, request_dict=request_dict)

  File "/jump/software/rhel7/python36_botocore-1.4.85/lib/python3.6/site-packages/botocore/hooks.py", line 227, in emit

    return self._emit(event_name, kwargs)

  File "/jump/software/rhel7/python36_botocore-1.4.85/lib/python3.6/site-packages/botocore/hooks.py", line 210, in _emit

    response = handler(**kwargs)

  File "/jump/software/rhel7/python36_botocore-1.4.85/lib/python3.6/site-packages/botocore/retryhandler.py", line 183, in __call__

    if self._checker(attempts, response, caught_exception):

  File "/jump/software/rhel7/python36_botocore-1.4.85/lib/python3.6/site-packages/botocore/retryhandler.py", line 251, in __call__

    caught_exception)

  File "/jump/software/rhel7/python36_botocore-1.4.85/lib/python3.6/site-packages/botocore/retryhandler.py", line 269, in _should_retry

    return self._checker(attempt_number, response, caught_exception)

  File "/jump/software/rhel7/python36_botocore-1.4.85/lib/python3.6/site-packages/botocore/retryhandler.py", line 317, in __call__

    caught_exception)

  File "/jump/software/rhel7/python36_botocore-1.4.85/lib/python3.6/site-packages/botocore/retryhandler.py", line 223, in __call__

    attempt_number, caught_exception)

  File "/jump/software/rhel7/python36_botocore-1.4.85/lib/python3.6/site-packages/botocore/retryhandler.py", line 359, in _check_caught_exception

    raise caught_exception

  File "/jump/software/rhel7/python36_botocore-1.4.85/lib/python3.6/site-packages/botocore/endpoint.py", line 204, in _get_response

    proxies=self.proxies, timeout=self.timeout)

  File "/jump/software/rhel7/python36_botocore-1.4.85/lib/python3.6/site-packages/botocore/vendored/requests/sessions.py", line 573, in send

    r = adapter.send(request, **kwargs)

  File "/jump/software/rhel7/python36_botocore-1.4.85/lib/python3.6/site-packages/botocore/vendored/requests/adapters.py", line 370, in send

    timeout=timeout

  File "/jump/software/rhel7/python36_botocore-1.4.85/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py", line 544, in urlopen

    body=body, headers=headers)

  File "/jump/software/rhel7/python36_botocore-1.4.85/lib/python3.6/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py", line 349, in _make_request

    conn.request(method, url, **httplib_request_kw)

  File "/jump/software/rhel7/Python-3.6.0/lib/python3.6/http/client.py", line 1239, in request

    self._send_request(method, url, body, headers, encode_chunked)

TypeError: _send_request() takes 5 positional arguments but 6 were given

 

Here is the simple code:

import boto3

 

access_key = "<access key>"

secret_key = "<secret key>"

gateway = "http://carf-ceph-osd15"

 

s3 = boto3.client('s3', 'us-east-1',

        aws_access_key_id=access_key,

        aws_secret_access_key=secret_key,

        endpoint_url=gateway,

        use_ssl=False

       )

        # config=boto3.session.Config(signature_version='s3v2')

 

for bucket in s3.list_buckets():

    for key in bucket.objects.all():

        print(key.key)

 

Thanks in advance for any help!!

-Bryan

 

-----Original Message-----
From: Abhishek Lekshmanan [mailto:abhishek@xxxxxxxx]
Sent: Wednesday, August 23, 2017 4:07 AM
To: Bryan Banister <bbanister@xxxxxxxxxxxxxxx>; ceph-users@xxxxxxxxxxxxxx
Subject: Re: [ceph-users] Anybody gotten boto3 and ceph RGW working?

 

Note: External Email

-------------------------------------------------

 

Bryan Banister <bbanister@xxxxxxxxxxxxxxx> writes:

 

> Hello,

> 

> I have the boto python API working with our ceph cluster but haven't figured out a way to get boto3 to communicate yet to our RGWs.  Anybody have a simple example?

 

I just use the client interface as described in

http://boto3.readthedocs.io/en/latest/reference/services/s3.html

 

so something like::

 

s3 = boto3.client('s3','us-east-1', endpoint_url='http://<rgw>',

                       aws_access_key_id = 'access',

                       aws_secret_access_key = 'secret')

 

s3.create_bucket(Bucket='foobar')

s3.put_object(Bucket='foobar',Key='foo',Body='foo')

 

--

Abhishek Lekshmanan

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton,

HRB 21284 (AG Nürnberg)




Note: This email is for the confidential use of the named addressee(s) only and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you are hereby notified that any review, dissemination or copying of this email is strictly prohibited, and to please notify the sender immediately and destroy this email and any attachments. Email transmission cannot be guaranteed to be secure or error-free. The Company, therefore, does not make any guarantees as to the completeness or accuracy of this email or any attachments. This email is for informational purposes only and does not constitute a recommendation, offer, request or solicitation of any kind to buy, sell, subscribe, redeem or perform any type of transaction of a financial product.
_______________________________________________
ceph-users mailing list
ceph-users@xxxxxxxxxxxxxx
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com

[Index of Archives]     [Information on CEPH]     [Linux Filesystem Development]     [Ceph Development]     [Ceph Large]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [xfs]


  Powered by Linux