summaryrefslogtreecommitdiff
path: root/op-mode-definitions
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2024-02-08 16:11:50 +0000
committerGitHub <noreply@github.com>2024-02-08 16:11:50 +0000
commit632c9d9f3d52e2c9571018553b5b45d9a3fe6ffd (patch)
tree0034b94a17e45192995749ed73b08054d2187b8d /op-mode-definitions
parent98c6434e7433e6a0aa1034b39c9130d390bbe591 (diff)
parentb76e4c808c954dcf498b510aaa9c8d6c91850991 (diff)
downloadvyos-1x-632c9d9f3d52e2c9571018553b5b45d9a3fe6ffd.tar.gz
vyos-1x-632c9d9f3d52e2c9571018553b5b45d9a3fe6ffd.zip
Merge pull request #2507 from erkin/image-tools
op-mode: T4038: Python rewrite of image tools
Diffstat (limited to 'op-mode-definitions')
-rw-r--r--op-mode-definitions/file.xml.in86
1 files changed, 86 insertions, 0 deletions
diff --git a/op-mode-definitions/file.xml.in b/op-mode-definitions/file.xml.in
new file mode 100644
index 000000000..549b9ad92
--- /dev/null
+++ b/op-mode-definitions/file.xml.in
@@ -0,0 +1,86 @@
+<?xml version="1.0"?>
+<interfaceDefinition>
+ <node name="show">
+ <children>
+ <tagNode name="file">
+ <properties>
+ <help>Show the contents of a file, a directory or an image</help>
+ <completionHelp><imagePath/></completionHelp>
+ </properties>
+ <command>sudo ${vyos_op_scripts_dir}/file.py --show $3</command>
+ </tagNode>
+ </children>
+ </node>
+ <node name="copy">
+ <properties>
+ <help>Copy an object</help>
+ </properties>
+ <children>
+ <tagNode name="file">
+ <properties>
+ <help>Copy a file or a directory</help>
+ <completionHelp><imagePath/></completionHelp>
+ </properties>
+ <children>
+ <tagNode name="to">
+ <properties>
+ <help>Destination path</help>
+ <completionHelp><imagePath/></completionHelp>
+ </properties>
+ <command>sudo ${vyos_op_scripts_dir}/file.py --copy $3 $5
+ </command>
+ </tagNode>
+ </children>
+ </tagNode>
+ </children>
+ </node>
+ <node name="delete">
+ <properties>
+ <help>Delete an object</help>
+ </properties>
+ <children>
+ <tagNode name="file">
+ <properties>
+ <help>Delete a local file, possibly from an image</help>
+ <completionHelp><imagePath/></completionHelp>
+ </properties>
+ <command>sudo ${vyos_op_scripts_dir}/file.py --delete $3</command>
+ </tagNode>
+ </children>
+ </node>
+ <node name="clone">
+ <properties>
+ <help>Clone an object</help>
+ </properties>
+ <children>
+ <node name="system">
+ <properties>
+ <help>Clone a system object</help>
+ </properties>
+ <children>
+ <tagNode name="config">
+ <properties>
+ <help>Clone the current system configuration to an image</help>
+ <completionHelp>
+ <script>${vyos_completion_dir}/list_images.py --no-running</script>
+ </completionHelp>
+ </properties>
+ <command>sudo ${vyos_op_scripts_dir}/file.py --clone $4</command>
+ <children>
+ <tagNode name="from">
+ <properties>
+ <help>Clone system configuration from an image to another one</help>
+ <completionHelp>
+ <list>running</list>
+ <script>${vyos_completion_dir}/list_images.py</script>
+ </completionHelp>
+ </properties>
+ <command>sudo ${vyos_op_scripts_dir}/file.py --clone-from $6 $4</command>
+ </tagNode>
+ </children>
+ </tagNode>
+ </children>
+ </node>
+ </children>
+ </node>
+</interfaceDefinition>