Obtaining client to Ozone through session

See Amazon Boto3 documentation to create a session. https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html

Create a session
    session = boto3.session.Session()

Obtain s3 client to Ozone via session:

    s3_client = session.client(
        service_name='s3',
        aws_access_key_id='testuser/scm@EXAMPLE.COM',
        aws_secret_access_key='c261b6ecabf7d37d5f9ded654b1c724adac9bd9f13e247a235e567e8296d2999',
        endpoint_url='http://localhost:9878',
    )
    'endpoint_url' is pointing to Ozone s3 endpoint.

In our code sample below, we're demonstrating the usage of both s3 and s3_client.

There are multiple ways to configure Boto3 client credentials if you’re connecting to a secured cluster. In these cases, the above lines of passing ‘aws_access_key_id’ and ‘aws_secret_access_key’ when creating Ozone s3 client shall be skipped.

See Boto3 documentation for more information:

https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html