OnyxConfig
Class for storing information required to connect/authenticate with Onyx.
__init__(domain, token=None, username=None, password=None)
¶
Initialise a config.
This object stores information required to connect and authenticate with Onyx.
A domain must be provided, alongside an API token and/or the username + password.
PARAMETER | DESCRIPTION |
---|---|
domain |
Domain for connecting to Onyx.
TYPE:
|
token |
Token for authenticating with Onyx.
TYPE:
|
username |
Username for authenticating with Onyx.
TYPE:
|
password |
Password for authenticating with Onyx.
TYPE:
|
Examples:
Create a config using environment variables for the domain and an API token:
import os
from onyx import OnyxConfig, OnyxEnv
config = OnyxConfig(
domain=os.environ[OnyxEnv.DOMAIN],
token=os.environ[OnyxEnv.TOKEN],
)
Or using environment variables for the domain and login credentials: