Connecting to the Boto3 Client Interface

Prev Next

To connect to the low-level client interface, use Boto3’s client() method. You must pass your VAST Cluster S3 credentials and other configurations as parameters with hardcoded values. This is the only way to specify a VAST Cluster VIP as the S3 endpoint.

The following example imports the boto module and instantiates a client with the minimum configuration needed for connecting the client to your VAST Cluster S3 account over an HTTP connection:

import boto3
s3_client = boto3.client(
    's3',
     use_ssl=False,
     endpoint_url=<ENDPOINT-URL>    
     aws_access_key_id=<ACCESS-KEY>,
     aws_secret_access_key=<SECRET-KEY>
     region_name=<REGION>
     config=boto3.session.Config(
          signature_version='s3v4'
          s3={'addressing_style': 'path'}
    
     )
)

in which:

  • <ENDPOINT-URL> can be any of the cluster's Virtual IPs, prefixed by http://. For example, http://198.51.100.255, in which 198.51.100.255 is one of the cluster's VIPs.

    Note

    To retrieve the cluster's virtual lPs:

    • In the VAST Web UI, from the left navigation  menu choose Network Access -> Virtual IPs to open the Virtual IPs page. It shows you which virtual IPs are configured on each CNode.

  • <ACCESS-KEY> and <SECRET-KEY> are your S3 key pair.

  • <REGION> can be any string. It is required if signature_version=S3v4.

For HTTPS Connection

For an HTTPS connection, pass parameters as follows in the client() call:

  • Enable HTTPS by setting use_ssl=True instead of use_ssl=False .

  • If the default certificate trust store does not recognize the signer of the installed certificate, you can use the verify parameter to specify a non default path to the certificate trust store. If you're using a self signed certificate, you can point this to the certificate itself. For example:

    verify="path/to/client/cert.pem"
  • Alternatively, you can use the verify parameter to disable verification:

    verify=False