diff options
author | Christian Breunig <christian@breunig.cc> | 2024-03-23 18:15:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-23 18:15:23 +0100 |
commit | 6e4cd53008429289773189432d0821c76f1ca3fd (patch) | |
tree | d60fc29a1a9acae080e948a8bf9c6f898e1e7159 /op-mode-definitions/container.xml.in | |
parent | a72102b89566451bce40beb1ffdb5d2bf0b1dcc2 (diff) | |
parent | d1181459e4397c9289b82eb39ff09769213d5a00 (diff) | |
download | vyos-1x-6e4cd53008429289773189432d0821c76f1ca3fd.tar.gz vyos-1x-6e4cd53008429289773189432d0821c76f1ca3fd.zip |
Merge pull request #3176 from vyos/mergify/bp/sagitta/pr-3171
op-mode: T6161: Show container details in JSON format (backport #3171)
Diffstat (limited to 'op-mode-definitions/container.xml.in')
-rw-r--r-- | op-mode-definitions/container.xml.in | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/op-mode-definitions/container.xml.in b/op-mode-definitions/container.xml.in index 4aa13e913..bb6f97b02 100644 --- a/op-mode-definitions/container.xml.in +++ b/op-mode-definitions/container.xml.in @@ -103,12 +103,28 @@ </properties> <command>sudo ${vyos_op_scripts_dir}/container.py show_container</command> <children> - <leafNode name="image"> + <node name="json"> + <properties> + <help>Show containers in JSON format</help> + </properties> + <!-- no admin check --> + <command>sudo ${vyos_op_scripts_dir}/container.py show_container --raw</command> + </node> + <node name="image"> <properties> <help>Show container image</help> </properties> <command>sudo ${vyos_op_scripts_dir}/container.py show_image</command> - </leafNode> + <children> + <node name="json"> + <properties> + <help>Show container image in JSON format</help> + </properties> + <!-- no admin check --> + <command>sudo ${vyos_op_scripts_dir}/container.py show_image --raw</command> + </node> + </children> + </node> <tagNode name="log"> <properties> <help>Show logs from a given container</help> @@ -116,14 +132,25 @@ <path>container name</path> </completionHelp> </properties> + <!-- no admin check --> <command>sudo podman logs --names "$4"</command> </tagNode> - <leafNode name="network"> + <node name="network"> <properties> <help>Show available container networks</help> </properties> + <!-- no admin check --> <command>sudo ${vyos_op_scripts_dir}/container.py show_network</command> - </leafNode> + <children> + <node name="json"> + <properties> + <help>Show available container networks in JSON format</help> + </properties> + <!-- no admin check --> + <command>sudo ${vyos_op_scripts_dir}/container.py show_network --raw</command> + </node> + </children> + </node> </children> </node> <node name="log"> |