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.
| Class 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 | None = None, *, 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:str | None | 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 override_env_vars parameter. |
configbool | If true, will error on unrecognized keys. |
overrideMapping[ | The 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 | |
ClientConfigProfile | The client configuration profile. |