summaryrefslogtreecommitdiff
path: root/op-mode-definitions
diff options
context:
space:
mode:
authorl0crian1 <ryan.claridge13@gmail.com>2025-04-20 20:54:10 -0400
committerl0crian1 <ryan.claridge13@gmail.com>2025-04-20 20:54:10 -0400
commite4a4d7f5ae2ef67c3142266337c2bfdea92e122e (patch)
tree23f68b6dc70c1bf7648f1224798a2cedb100dbea /op-mode-definitions
parent63e2ac54a920b164a474f924d6aad597a73b454b (diff)
downloadvyos-1x-e4a4d7f5ae2ef67c3142266337c2bfdea92e122e.tar.gz
vyos-1x-e4a4d7f5ae2ef67c3142266337c2bfdea92e122e.zip
t7268: Add op-mode command for show all interfaces on system
Created op-mode script per request Commands added: show interfaces kernel show interfaces kernel detail show interfaces kernel json show interfaces kernel <interface> show interfaces kernel <interface> detail show interfaces kernel <interface> json
Diffstat (limited to 'op-mode-definitions')
-rw-r--r--op-mode-definitions/show-interfaces.xml.in22
1 files changed, 18 insertions, 4 deletions
diff --git a/op-mode-definitions/show-interfaces.xml.in b/op-mode-definitions/show-interfaces.xml.in
index 126ce6311..b68aa8e1c 100644
--- a/op-mode-definitions/show-interfaces.xml.in
+++ b/op-mode-definitions/show-interfaces.xml.in
@@ -32,13 +32,21 @@
<script>ip -j link show | jq -r '.[].ifname'</script>
</completionHelp>
</properties>
- <command>sudo ip -s link show dev $4</command>
+ <command>${vyos_op_scripts_dir}/interfaces.py show_kernel --intf-name=$4</command>
+ <children>
+ <leafNode name="detail">
+ <properties>
+ <help>Show system interface in JSON format</help>
+ </properties>
+ <command>${vyos_op_scripts_dir}/interfaces.py show_kernel --intf-name=$4 --detail</command>
+ </leafNode>
+ </children>
<children>
<leafNode name="json">
<properties>
<help>Show system interface in JSON format</help>
</properties>
- <command>ip -j -s -d link show dev $4</command>
+ <command>${vyos_op_scripts_dir}/interfaces.py show_kernel --intf-name=$4 --raw</command>
</leafNode>
</children>
</tagNode>
@@ -46,13 +54,19 @@
<properties>
<help>Show all interfaces on this system</help>
</properties>
- <command>sudo ip -s link show</command>
+ <command>${vyos_op_scripts_dir}/interfaces.py show_kernel</command>
<children>
+ <leafNode name="detail">
+ <properties>
+ <help>Show all interfaces in JSON format</help>
+ </properties>
+ <command>${vyos_op_scripts_dir}/interfaces.py show_kernel --detail</command>
+ </leafNode>
<leafNode name="json">
<properties>
<help>Show all interfaces in JSON format</help>
</properties>
- <command>ip -j -s -d link show</command>
+ <command>${vyos_op_scripts_dir}/interfaces.py show_kernel --raw</command>
</leafNode>
</children>
</node>