Merge "Fix boto syntax"
This commit is contained in:
commit
b8792c726e
@ -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
|
||||
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
|
||||
container format. Here is an example client setup using the Python boto
|
||||
library on a locally installed all-in-one Object Storage installation.
|
||||
container format. Here are two examples of client setup using both Python
|
||||
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
|
||||
|
||||
connection = boto.s3.Connection(
|
||||
# Connection using boto library
|
||||
connection = boto.s3.connection.S3Connection(
|
||||
aws_access_key_id='a7811544507ebaf6c9a7a8804f47ea1c',
|
||||
aws_secret_access_key='a7d8e981-e296-d2ba-cb3b-db7dd23159bd',
|
||||
port=8080,
|
||||
host='127.0.0.1',
|
||||
is_secure=False,
|
||||
calling_format=boto.s3.connection.OrdinaryCallingFormat())
|
||||
is_secure=False)
|
||||
|
||||
# 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/
|
||||
|
Loading…
Reference in New Issue
Block a user