class documentation

Represents a client configuration profile.

This class holds the configuration as loaded from a file or environment. See to_connect_config to transform the profile to ClientConnectConfig, which can be used to create a client.

Warning

Experimental API.

Static Method from_dict Create a ClientConfigProfile from a dictionary.
Static Method load Load a single client profile from given sources, applying env overrides.
Method to_client_connect_config Create a ClientConnectConfig from this profile.
Method to_dict Convert to a dictionary that can be used for TOML serialization.
Class Variable address Client address.
Class Variable api_key Client API key.
Class Variable grpc_meta gRPC metadata.
Class Variable namespace Client namespace.
Class Variable tls TLS configuration.

Create a ClientConfigProfile from a dictionary.

@staticmethod
def load(profile: str = 'default', *, config_source: DataSource | None = None, disable_file: bool = False, disable_env: bool = False, config_file_strict: bool = False, env_vars: Mapping[str, str] | None = None) -> ClientConfigProfile: (source)

Load a single client profile from given sources, applying env overrides.

To get a ClientConnectConfig, use the to_client_connect_config method on the returned profile.

Parameters
profile:strProfile to load from the config.
config_source:DataSource | NoneIf present, this is used as the configuration source instead of default file locations. This can be a path to the file or the string/byte contents of the file.
disable_file:boolIf true, file loading is disabled. This is only used when config_source is not present.
disable_env:boolIf true, environment variable loading and overriding is disabled. This takes precedence over the env_vars parameter.
config_file_strict:boolIf true, will error on unrecognized keys.
env_vars:Mapping[str, str] | NoneThe environment to use for loading and overrides. If not provided, environment variables are not used for overrides. To use the current process's environment, os.environ can be passed explicitly.
Returns
ClientConfigProfileThe client configuration profile.
def to_client_connect_config(self) -> ClientConnectConfig: (source)

Create a ClientConnectConfig from this profile.

Convert to a dictionary that can be used for TOML serialization.

address: str | None = (source)

Client address.

api_key: str | None = (source)

Client API key.

gRPC metadata.

namespace: str | None = (source)

Client namespace.

TLS configuration.