make_grpc_client(config)Aliases:
make_clientingrpcclientnamespace
Description:
Creates GrpcClient object.
Args:
-
config: Python dictionary with client configuration. The accepted format is:{ "address": <IP address of the serving>, "port": <Port number used by the gRPC interface of the server>, "tls_config": { "client_key_path": <Path to client key file>, "client_cert_path": <Path to client certificate file>, "server_cert_path": <Path to server certificate file> } }With following types accepted:
Key Value type address string port integer client_key_path string client_cert_path string server_cert_path string The minimal config must contain
addressandport.
Returns:
GrpcClient object
Raises:
ValueError, TypeError: if provided config is invalid.
Examples:
Create minimal GrpcClient:
config = {
"address": "localhost",
"port": 9000
}
client = make_grpc_client(config)Create GrpcClient with TLS:
config = {
"address": "localhost",
"port": 9000,
"tls_config": {
"client_key_path": "/opt/tls/client.key",
"client_cert_path": "/opt/tls/client.crt",
"server_cert_path": "/opt/tls/server.crt"
}
}
client = make_grpc_client(config)