Merge "Fix boto syntax"

This commit is contained in:
Jenkins 2017-02-01 15:32:19 +00:00 committed by Gerrit Code Review
commit b8792c726e

View File

@ -78,15 +78,38 @@ To set up your client, ensure you are using the ec2 credentials, which
can be downloaded from the API Endpoints tab of the dashboard. The host can be downloaded from the API Endpoints tab of the dashboard. The host
should also point to the Object Storage node's hostname. It also will should also point to the Object Storage node's hostname. It also will
have to use the old-style calling format, and not the hostname-based have to use the old-style calling format, and not the hostname-based
container format. Here is an example client setup using the Python boto container format. Here are two examples of client setup using both Python
library on a locally installed all-in-one Object Storage installation. boto_ library (version 2.45.0) and boto3_(version 1.4.4) library on a locally
installed all-in-one Object Storage installation.
.. code-block:: python .. code-block:: python
connection = boto.s3.Connection( # Connection using boto library
connection = boto.s3.connection.S3Connection(
aws_access_key_id='a7811544507ebaf6c9a7a8804f47ea1c', aws_access_key_id='a7811544507ebaf6c9a7a8804f47ea1c',
aws_secret_access_key='a7d8e981-e296-d2ba-cb3b-db7dd23159bd', aws_secret_access_key='a7d8e981-e296-d2ba-cb3b-db7dd23159bd',
port=8080, port=8080,
host='127.0.0.1', host='127.0.0.1',
is_secure=False, is_secure=False)
calling_format=boto.s3.connection.OrdinaryCallingFormat())
# Connection using boto3 library
# Create a low-level service client
s3_client = boto3.client(
's3',
aws_access_key_id='a7811544507ebaf6c9a7a8804f47ea1c',
aws_secret_access_key='a7d8e981-e296-d2ba-cb3b-db7dd23159bd',
endpoint_url='http://127.0.0.1:8080'
)
# Create a resource service client
s3_resource = boto3.resource(
's3',
aws_access_key_id='a7811544507ebaf6c9a7a8804f47ea1c',
aws_secret_access_key='a7d8e981-e296-d2ba-cb3b-db7dd23159bd',
endpoint_url='http://127.0.0.1:8080'
)
.. _boto: https://github.com/boto/boto
.. _boto3: https://github.com/boto/boto3/