summaryrefslogtreecommitdiff
path: root/op-mode-definitions
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-09-22 06:17:22 +0200
committerGitHub <noreply@github.com>2023-09-22 06:17:22 +0200
commit7253377e754ed8bc95cbe59840ed3a70c6945b93 (patch)
tree333128015588c810cee417b756c4468a6c4cb302 /op-mode-definitions
parenta4aad112042b5bb4988468a5af871f5a81a851e5 (diff)
parent2d3f3297b575f88662495e14a7c7324ff73b6bfc (diff)
downloadvyos-1x-7253377e754ed8bc95cbe59840ed3a70c6945b93.tar.gz
vyos-1x-7253377e754ed8bc95cbe59840ed3a70c6945b93.zip
Merge pull request #2298 from jestabro/disk-by-id
smoketest: T5607: support getting SCSI device by drive-id
Diffstat (limited to 'op-mode-definitions')
-rw-r--r--op-mode-definitions/disks.xml.in20
-rw-r--r--op-mode-definitions/raid.xml.in69
2 files changed, 89 insertions, 0 deletions
diff --git a/op-mode-definitions/disks.xml.in b/op-mode-definitions/disks.xml.in
index 117ac5065..8a1e2c86f 100644
--- a/op-mode-definitions/disks.xml.in
+++ b/op-mode-definitions/disks.xml.in
@@ -5,6 +5,26 @@
<help>Format a device</help>
</properties>
<children>
+ <node name="by-id">
+ <properties>
+ <help>Find disk by ending of id string</help>
+ </properties>
+ <children>
+ <tagNode name="disk">
+ <properties>
+ <help>Format a disk drive</help>
+ </properties>
+ <children>
+ <tagNode name="like">
+ <properties>
+ <help>Format this disk the same as another disk</help>
+ </properties>
+ <command>sudo ${vyos_op_scripts_dir}/format_disk.py --by-id --target $4 --proto $6</command>
+ </tagNode>
+ </children>
+ </tagNode>
+ </children>
+ </node>
<tagNode name="disk">
<properties>
<help>Format a disk drive</help>
diff --git a/op-mode-definitions/raid.xml.in b/op-mode-definitions/raid.xml.in
new file mode 100644
index 000000000..5d0c9ef3d
--- /dev/null
+++ b/op-mode-definitions/raid.xml.in
@@ -0,0 +1,69 @@
+<?xml version="1.0"?>
+<interfaceDefinition>
+ <node name="add">
+ <children>
+ <tagNode name="raid">
+ <properties>
+ <help>Add a RAID set element</help>
+ <completionHelp>
+ <script>${vyos_completion_dir}/list_raidset.sh</script>
+ </completionHelp>
+ </properties>
+ <children>
+ <node name="by-id">
+ <properties>
+ <help>Add a member by disk id to a RAID set</help>
+ </properties>
+ <children>
+ <tagNode name="member">
+ <properties>
+ <help>Add a member to a RAID set</help>
+ </properties>
+ <command>sudo ${vyos_op_scripts_dir}/raid.py add --raid-set-name $3 --by-id --member $6</command>
+ </tagNode>
+ </children>
+ </node>
+ <tagNode name="member">
+ <properties>
+ <help>Add a member to a RAID set</help>
+ </properties>
+ <command>sudo ${vyos_op_scripts_dir}/raid.py add --raid-set-name $3 --member $5</command>
+ </tagNode>
+ </children>
+ </tagNode>
+ </children>
+ </node>
+ <node name="delete">
+ <children>
+ <tagNode name="raid">
+ <properties>
+ <help>Add a RAID set element</help>
+ <completionHelp>
+ <script>${vyos_completion_dir}/list_raidset.sh</script>
+ </completionHelp>
+ </properties>
+ <children>
+ <node name="by-id">
+ <properties>
+ <help>Add a member by disk id to a RAID set</help>
+ </properties>
+ <children>
+ <tagNode name="member">
+ <properties>
+ <help>Add a member to a RAID set</help>
+ </properties>
+ <command>sudo ${vyos_op_scripts_dir}/raid.py delete --raid-set-name $3 --by-id --member $6</command>
+ </tagNode>
+ </children>
+ </node>
+ <tagNode name="member">
+ <properties>
+ <help>Add a member to a RAID set</help>
+ </properties>
+ <command>sudo ${vyos_op_scripts_dir}/raid.py delete --raid-set-name $3 --member $5</command>
+ </tagNode>
+ </children>
+ </tagNode>
+ </children>
+ </node>
+</interfaceDefinition>