run_show_command
Execute a CLI show command on a Juniper device and retrieve output in text, JSON, or XML format.
Instructions
Run a CLI show command on the device and return output.
Args: hostname: Target device hostname (must exist in config.ini) command: CLI command to execute (e.g., "show bgp summary") output_format: Output format — "text" (default), "json", or "xml". Note: pipe stages (| match, | last, | count, etc.) are silently dropped regardless of output_format — PyEZ's Device.cli() sends the command over NETCONF RPC, which JunOS does not pipe-process. Run the command without pipes; for line filtering, use run_show_command_batch's grep_pattern argument instead (works for a single host too — pass a one-element hostnames list). That workaround always fetches text output internally, so it cannot be combined with output_format="json"/"xml" — for structured output you must filter the result client-side instead. config_path: Path to config.ini (empty string uses default search)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | ||
| hostname | Yes | ||
| config_path | No | ||
| output_format | No | text |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |