Skip to main content

Configuration

In order to use a notebook with an ApertureDB instance, it is necessary to supply details about how to connect. Primarily, this consists of the host name, the user name, and the password. The recommended way to do this is with an ApertureDB Key, which puts all this data into an easy to manage string. Once you have your configuration, you can supply this information directly to Connector.Connector(), but it is usually better to store password information outside of your source code. A more convenient approach is to call CommonLibrary.create_connector().

create_connector() looks for configuration information in a number of places. Some of these try to find an existing configuration. To create a configuration manually, see adb config create.

create_connector() will look for connection information from its environment in the form of a key: stored in APERUTREDB_KEY. This string is offered as a convenience method to provide all connection information in one place. The correct contents of this string will depend on how you have set up your ApertureDB instance.

Getting Your APERTUREDB Key

If you created your ApertureDB instance using our self-service ApertureDB Cloud portal, then you can obtain a APERTUREDB KEY by clicking on the "Connect" button for your instance.

Connect button on Cloud

Scroll down to "Connect using Api Key" underneath 'Using Python SDK'. Next click the 'Generate Api Key' button.

API string in Cloud interface

Once the system has filled in your instance-specific API key, copy it, either with the copy button on the top right, or manually. If you copy by hand, make sure to copy the whole key: select any trailing '=' - they're required.

Storing Your APERTUREDB Key

One way to make your key available is by putting it into the APERTUREDB_KEY environment variable:

export `APERTUREDB_KEY='YOUR_KEY'

This approach might be useful when running scripts under Docker, as the environment variable can come from one of various possible stores of cloud secrets.