summaryrefslogtreecommitdiff
path: root/op-mode-definitions
diff options
context:
space:
mode:
authorerkin <me@erkin.party>2023-11-20 08:01:59 +0300
committererkin <me@erkin.party>2024-01-25 17:38:55 +0300
commitb76e4c808c954dcf498b510aaa9c8d6c91850991 (patch)
tree00ce70d54f94ec03e42c34458404c8bc7220b658 /op-mode-definitions
parent59b432b97e361f3f5670302f51881ee596afe2f8 (diff)
downloadvyos-1x-b76e4c808c954dcf498b510aaa9c8d6c91850991.tar.gz
vyos-1x-b76e4c808c954dcf498b510aaa9c8d6c91850991.zip
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>