class documentation
class ClientConfigProfile: (source)
Constructors: ClientConfigProfile.from_dict(d)
, ClientConfigProfile.load(profile, config_source, disable_file, disable_env, config_file_strict, ...)
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 |
Create a ClientConfigProfile from a dictionary. |
Static Method | load |
Load a single client profile from given sources, applying env overrides. |
Method | to |
Create a ClientConnectConfig from this profile. |
Method | to |
Convert to a dictionary that can be used for TOML serialization. |
Class Variable | address |
Client address. |
Class Variable | api |
Client API key. |
Class Variable | grpc |
gRPC metadata. |
Class Variable | namespace |
Client namespace. |
Class Variable | tls |
TLS configuration. |
@staticmethod
def load(profile:
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:str | Profile to load from the config. |
configDataSource | None | If 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. |
disablebool | If true, file loading is disabled. This is only used when config_source is not present. |
disablebool | If true, environment variable loading and overriding is disabled. This takes precedence over the env_vars parameter. |
configbool | If true, will error on unrecognized keys. |
envMapping[ | The 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 | |
ClientConfigProfile | The client configuration profile. |