summaryrefslogtreecommitdiff
path: root/test/data/interface_definition_sample.xml
blob: c5458ffc0a8fdf7cad8f8e4220869a0c8de3aaa7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?xml version="1.0"?>
<interfaceDefinition>
  <node name="system">
    <children>
      <node name="login" owner="login">
        <children>
          <tagNode name="user">
            <properties>
              <keepChildOrder/>
              <help>User name</help>
              <constraint>
                <regex>[a-zA-Z][a-zA-Z0-9\-]+</regex>
              </constraint>
              <constraintErrorMessage>User name must start with a letter and consist of letters and digits</constraintErrorMessage>
            </properties>
            <children>
              <leafNode name="full-name">
                <properties>
                  <help>User full name</help>
                </properties>
              </leafNode>
            </children>
          </tagNode>
          <leafNode name="password">
            <properties>
              <help>A password</help>
              <secret/>
            </properties>
          </leafNode>
        </children>
      </node>
      <leafNode name="host-name">
        <properties>
          <constraint>
            <regex>[a-zA-Z][a-zA-Z0-9\-]</regex>
          </constraint>
        </properties>
      </leafNode>
      <leafNode name="ntp-server">
        <properties>
          <help>NTP server address</help>
          <multi/>
        </properties>
      </leafNode>
      <node name="options">
        <children>
          <leafNode name="reboot-on-panic">
            <properties>
              <help>Reboot automatically if kernel panic occurs</help>
              <valueless/>
            </properties>
          </leafNode>
          <leafNode name="enable-dangerous-features">
            <properties>
              <help>Enable dangerous features</help>
              <hidden/>
            </properties>
          </leafNode>
        </children>
      </node>
    </children>
  </node>
  <node name="interfaces">
    <children>
      <tagNode name="ethernet">
        <properties>
          <!-- no constraint, for testing if tag nodes with invalid characters in names
               are detected -->
        </properties>
        <children>
          <leafNode name="disable">
            <properties>
              <valueless/>
            </properties>
          </leafNode>
        </children>
      </tagNode>
    </children>
  </node>
</interfaceDefinition>