channel
frequenz.client.base.channel ¤
Handling of gRPC channels.
Functions¤
frequenz.client.base.channel.parse_grpc_uri ¤
Create a grpclib client channel from a URI.
The URI must have the following format:
A few things to consider about URI components:
- If any other components are present in the URI, a
ValueError
is raised. - If the port is omitted, the
default_port
is used. - If a query parameter is passed many times, the last value is used.
- The only supported query parameter is
ssl
, which must be a boolean value and defaults tofalse
. - Boolean query parameters can be specified with the following values
(case-insensitive):
true
,1
,on
,false
,0
,off
.
PARAMETER | DESCRIPTION |
---|---|
uri |
The gRPC URI specifying the connection parameters.
TYPE:
|
default_port |
The default port number to use if the URI does not specify one.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Channel
|
A grpclib client channel object. |
RAISES | DESCRIPTION |
---|---|
ValueError
|
If the URI is invalid or contains unexpected components. |