Configuration

class optimeering_beta.Configuration(host='https://beta.optimeering.com', api_auth_url=None, *, api_key=None, token=None, retries=None, debug=None)

This class is used to configure the OptimeeringClient.

Parameters:
  • host – API host url.

  • api_auth_url – URL for Authentication. Defaults to api://{host}/.default

  • retries – Number of retries for API requests. Also supports a urllib Retry object. See the urlib docs

  • api_key – API Key to use for Authentication.

  • token – Token to use for Authentication. Only use this when you don’t want to have the OptimeeringClient retrieve a token.

Example:

>>> from optimeering_beta import Configuration, OptimeeringClient
>>> configuration = Configuration(host="https://beta.optimeering.com")
API Key Example:

>>> from optimeering_beta import Configuration, OptimeeringClient
>>> configuration = Configuration(host="https://beta.optimeering.com", api_key="your api key")
Token Example:

>>> from optimeering_beta import Configuration, OptimeeringClient
>>> configuration = Configuration(host="https://beta.optimeering.com", token="your token")
logger

Logging Settings

logger_stream_handler

Log stream handler

logger_file_handler

Log file handler

verify_ssl

SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server.

ssl_ca_cert

Set this to customize the certificate file to verify the peer.

cert_file

client certificate file

key_file

client key file

assert_hostname

Set this to True/False to enable/disable SSL hostname verification.

tls_server_name

SSL/TLS Server Name Indication (SNI) Set this to the SNI value expected by the server.

connection_pool_maxsize

urllib3 connection pool’s maximum number of connections saved per pool. urllib3 uses 1 connection as default value, but this is not the best value when you are making a lot of possibly parallel requests to the same host, which is often the case here. cpu_count * 5 is used as default value to increase performance.

proxy

Proxy URL

proxy_headers

Proxy headers

retries

Adding retries to override urllib3 default value 3

socket_options

Options to pass down to the underlying urllib3 socket

datetime_format

datetime format

date_format

date format

classmethod set_default(default)

Set default instance of configuration.

It stores default configuration, which can be returned by get_default_copy method.

Parameters:

default – object of Configuration

classmethod get_default_copy()

Deprecated. Please use get_default instead.

Deprecated. Please use get_default instead.

Returns:

The configuration object.

classmethod get_default()

Return the default configuration.

This method returns newly created, based on default constructor, object of Configuration class or returns a copy of default configuration.

Returns:

The configuration object.

property logger_file

Debug file location

property debug

Debug status

property logger_format

Log format

to_debug_report()

Gets the essential information for debugging.

Returns:

The report for debugging.