diff options
author | Daniil Baturin <daniil@vyos.io> | 2024-03-23 17:32:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-23 17:32:48 +0100 |
commit | 91cd3ea5908f4f0ed8e3d9a91138479e08fc34b3 (patch) | |
tree | fdf92a718883df9f6cc587505b1a736d25691630 | |
parent | 51ca65bade91d37419ac6fb3ba774cc27a3bcb65 (diff) | |
parent | b5d10d11fc8535a95df1fce2ddb0a2a08567fa77 (diff) | |
download | vyos-1x-91cd3ea5908f4f0ed8e3d9a91138479e08fc34b3.tar.gz vyos-1x-91cd3ea5908f4f0ed8e3d9a91138479e08fc34b3.zip |
Merge pull request #3171 from p3lim/T6161
op-mode: T6161: Show container details in JSON format
-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"> |