commands
drunc.unified_shell.commands
Classes
Functions:
log_on_server(obj, text, target_server, severity, target, execute_along_path, execute_on_all_subsequent_children_in_path)
Log a message to the specified server.
This command allows you to send a log message to a specific server or to all servers in the system. You can specify the severity level of the log message.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj
|
ProcessManagerContext
|
The context object containing session information. |
required |
text
|
str
|
The log message text. |
required |
target_server
|
str
|
The server to send the log message to. Default is '' (all servers). |
required |
severity
|
str
|
The severity level of the log message. Default is 'INFO'. |
required |
Returns:
| Type | Description |
|---|---|
None
|
None |
Source code in drunc/unified_shell/commands.py
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | |
session_injector(f)
Decorator to inject the session name into the command function.
This is used to wrap the relevant unified shell commands, as the unified shell is intended to only operate a single session at a time, and the session name is stored in the context object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f
|
FC
|
The command function to wrap. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
FC |
FC
|
The wrapped command function with the session name injected. |
Source code in drunc/unified_shell/commands.py
start_shell(ctx, obj)
Start an interactive shell session.
This command stops batch mode and enters an interactive shell state, allowing you to execute commands interactively.
Source code in drunc/unified_shell/commands.py
terminate(ctx, obj, width)
Execute the process manager terminate command, but only do this for the current session