diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-12-31 07:35:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-31 07:35:39 +0100 |
commit | ede589d61889ecafc767a9aa52da5327012867e5 (patch) | |
tree | 05939302892e1310c1b0855601369132618cce3c /op-mode-definitions/container.xml.in | |
parent | 1b5bb6cb9424c09e09bbeec8314ccf4e9c83bd98 (diff) | |
parent | 0c8b53e6f7a94e914a7815328bbd16c0b3943d40 (diff) | |
download | vyos-1x-ede589d61889ecafc767a9aa52da5327012867e5.tar.gz vyos-1x-ede589d61889ecafc767a9aa52da5327012867e5.zip |
Merge pull request #1731 from c-po/t578-container-backport
container: T578: backport podman from 1.4 development branch (equuleus)
Diffstat (limited to 'op-mode-definitions/container.xml.in')
-rw-r--r-- | op-mode-definitions/container.xml.in | 176 |
1 files changed, 176 insertions, 0 deletions
diff --git a/op-mode-definitions/container.xml.in b/op-mode-definitions/container.xml.in new file mode 100644 index 000000000..786bd66d3 --- /dev/null +++ b/op-mode-definitions/container.xml.in @@ -0,0 +1,176 @@ +<?xml version="1.0"?> +<interfaceDefinition> + <node name="add"> + <children> + <node name="container"> + <properties> + <help>Add container image</help> + </properties> + <children> + <tagNode name="image"> + <properties> + <help>Pull a new image for container</help> + </properties> + <command>sudo podman image pull "${4}"</command> + </tagNode> + </children> + </node> + </children> + </node> + <node name="connect"> + <children> + <tagNode name="container"> + <properties> + <help>Attach to a running container</help> + <completionHelp> + <path>container name</path> + </completionHelp> + </properties> + <command>sudo podman exec --interactive --tty "$3" /bin/sh</command> + </tagNode> + </children> + </node> + <node name="delete"> + <children> + <node name="container"> + <properties> + <help>Delete container image</help> + </properties> + <children> + <tagNode name="image"> + <properties> + <help>Delete container image</help> + <completionHelp> + <script>sudo podman image ls -q</script> + </completionHelp> + </properties> + <command>sudo podman image rm --force "${4}"</command> + </tagNode> + </children> + </node> + </children> + </node> + <node name="generate"> + <children> + <node name="container"> + <properties> + <help>Generate Container Image</help> + </properties> + <children> + <tagNode name="image"> + <properties> + <help>Name of container image (tag)</help> + </properties> + <children> + <tagNode name="path"> + <properties> + <help>Path to Dockerfile</help> + <completionHelp> + <list><filename></list> + </completionHelp> + </properties> + <command>sudo podman build --net host --layers --force-rm --tag "$4" $6</command> + </tagNode> + </children> + </tagNode> + </children> + </node> + </children> + </node> + <node name="monitor"> + <children> + <node name="log"> + <children> + <tagNode name="container"> + <properties> + <help>Monitor last lines of container logs</help> + <completionHelp> + <path>container name</path> + </completionHelp> + </properties> + <command>sudo podman logs --follow --names "$4"</command> + </tagNode> + </children> + </node> + </children> + </node> + <node name="show"> + <children> + <node name="container"> + <properties> + <help>Show containers</help> + </properties> + <command>sudo ${vyos_op_scripts_dir}/container.py show_container</command> + <children> + <leafNode name="image"> + <properties> + <help>Show container image</help> + </properties> + <command>sudo ${vyos_op_scripts_dir}/container.py show_image</command> + </leafNode> + <tagNode name="log"> + <properties> + <help>Show logs from a given container</help> + <completionHelp> + <path>container name</path> + </completionHelp> + </properties> + <command>sudo podman logs --names "$4"</command> + </tagNode> + <leafNode name="network"> + <properties> + <help>Show available container networks</help> + </properties> + <command>sudo ${vyos_op_scripts_dir}/container.py show_network</command> + </leafNode> + </children> + </node> + <node name="log"> + <children> + <tagNode name="container"> + <properties> + <help>Show logs from a given container</help> + <completionHelp> + <path>container name</path> + </completionHelp> + </properties> + <command>sudo podman logs --names "$4"</command> + </tagNode> + </children> + </node> + </children> + </node> + <node name="restart"> + <children> + <tagNode name="container"> + <properties> + <help>Restart a given container</help> + <completionHelp> + <path>container name</path> + </completionHelp> + </properties> + <command>sudo ${vyos_op_scripts_dir}/container.py restart --name="$3"</command> + </tagNode> + </children> + </node> + <node name="update"> + <children> + <node name="container"> + <properties> + <help>Update a container image</help> + </properties> + <children> + <tagNode name="image"> + <properties> + <help>Update container image</help> + <completionHelp> + <path>container name</path> + </completionHelp> + </properties> + <command>if cli-shell-api existsActive container name "$4"; then sudo podman pull $(cli-shell-api returnActiveValue container name "$4" image); else echo "Container $4 does not exist"; fi</command> + </tagNode> + </children> + </node> + </children> + </node> +</interfaceDefinition> |