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, override_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 override_env_vars parameter.
config_file_strict:boolIf true, will error on unrecognized keys.
override_env_vars:Mapping[str, str] | NoneThe environment to use for loading and overrides. If not provided, the current process's environment is used. To use a specific set of environment variables, provide them here. To disable environment variable loading, set disable_env to true.
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.