grpc_child
drunc.controller.children_interface.grpc_child
Classes
gRCPChildConfHandler
gRPCChildNode(name, configuration, uri, connectivity_service, init_token=None)
Bases: ChildNode
Source code in drunc/controller/children_interface/grpc_child.py
Methods:
check_connection()
Probe child connectivity and retry once after reconnecting if needed.
Use the describe endpoint to check if the child is reachable. If not, the node attempts to resolve a fresh endpoint from the connectivity service, rebuild the gRPC channel, and retry the probe once.
Returns:
| Type | Description |
|---|---|
bool
|
True if the child is reachable either immediately or after a successful |
bool
|
reconnection attempt, otherwise False. |
Source code in drunc/controller/children_interface/grpc_child.py
handle_child_grpc_error(error)
Handle gRPC errors from sending commands to the child controller.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
error
|
RpcError
|
The gRPC error to handle. |
required |
Source code in drunc/controller/children_interface/grpc_child.py
log_on_server(text, severity='INFO', target='', execute_along_path=False, execute_on_all_subsequent_children_in_path=True)
Log a message on the server with the specified severity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The message to log. |
required |
severity
|
str
|
The severity level of the log message (default: "INFO"). |
'INFO'
|
target
|
str
|
The target for the log message (default: ""). |
''
|
execute_along_path
|
bool
|
Whether to execute along the path (default: False). |
False
|
execute_on_all_subsequent_children_in_path
|
bool
|
Whether to execute on all subsequent children in the path (default: True). |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
LogOnServerResponse |
LogOnServerResponse
|
The response from the server after logging the message. |