top.xsd 9.6 KB
Newer Older
1
<?xml version="1.0" encoding="UTF-8"?>
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
  <!--
    
    EMULAB-COPYRIGHT
    Copyright (c) 2005-2007 University of Utah and the Flux Group.
    All rights reserved.
    
  -->
  <!--
    
    Definition of common data structures used for representing topologies -
    shared between vtop (virtual topology) and ptop (physical topology)
    formats.
    
  -->
17
  <xs:element name="node_type">
18 19
    <xs:complexType>
      <xs:sequence>
20 21 22 23 24 25
        <xs:element name="type_name" type="xs:string">
          <xs:annotation>
            <xs:documentation>Name of the type - will almost certainly not be unique</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:choice>
26 27
          <xs:element ref="type_slots"/>
          <xs:element ref="unlimited"/>
28
        </xs:choice>
29
        <xs:element minOccurs="0" ref="static"/>
30 31 32
      </xs:sequence>
    </xs:complexType>
  </xs:element>
33 34 35 36 37 38 39 40 41 42 43 44 45
  <xs:element name="type_slots">
    <xs:simpleType>
      <xs:restriction base="xs:integer">
        <xs:minInclusive value="1"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>
  <xs:element name="unlimited">
    <xs:complexType/>
  </xs:element>
  <xs:element name="static">
    <xs:complexType/>
  </xs:element>
46
  <xs:element name="node">
47 48
    <xs:complexType>
      <xs:sequence>
49 50
        <xs:group ref="NodeSpec.NodeType"/>
        <xs:group ref="NodeFlagSpec">
51 52 53 54
          <xs:annotation>
            <xs:documentation>Legacy flags</xs:documentation>
          </xs:annotation>
        </xs:group>
55
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="fd">
56 57 58 59
          <xs:annotation>
            <xs:documentation>Legacy features and desires</xs:documentation>
          </xs:annotation>
        </xs:element>
60
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="property"/>
61 62 63 64 65
      </xs:sequence>
      <xs:attribute name="name" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:group name="NodeSpec.NodeType">
66
    <xs:annotation>
67
      <xs:documentation>A node can (by default) have one or more types</xs:documentation>
68
    </xs:annotation>
69
    <xs:sequence>
70
      <xs:element maxOccurs="unbounded" ref="node_type"/>
71 72 73
    </xs:sequence>
  </xs:group>
  <xs:element name="link_type">
74 75
    <xs:complexType>
      <xs:sequence>
76
        <xs:element name="type_name" type="xs:string"/>
77 78 79
      </xs:sequence>
    </xs:complexType>
  </xs:element>
80
  <xs:element name="link">
81 82
    <xs:complexType>
      <xs:sequence>
83 84 85 86 87 88 89
        <xs:element ref="source_interface"/>
        <xs:element ref="destination_interface"/>
        <xs:element ref="bandwidth"/>
        <xs:element ref="latency"/>
        <xs:element ref="packet_loss"/>
        <xs:group ref="LinkSpec.LinkType"/>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="property">
90 91 92 93
          <xs:annotation>
            <xs:documentation>Properties of this link</xs:documentation>
          </xs:annotation>
        </xs:element>
94
      </xs:sequence>
95 96 97 98 99
      <xs:attribute name="name" use="required">
        <xs:annotation>
          <xs:documentation>Name of the link - must be unique in the top</xs:documentation>
        </xs:annotation>
      </xs:attribute>
100 101
    </xs:complexType>
  </xs:element>
102 103
  <xs:element name="source_interface" type="InterfaceSpec"/>
  <xs:element name="destination_interface" type="InterfaceSpec">
104
    <xs:annotation>
105
      <xs:documentation>Second interface for this link</xs:documentation>
106 107
    </xs:annotation>
  </xs:element>
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
  <xs:element name="bandwidth">
    <xs:simpleType>
      <xs:restriction base="xs:float">
        <xs:minExclusive value="0.0"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>
  <xs:element name="latency">
    <xs:annotation>
      <xs:documentation>Latency of the link in ms</xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:float">
        <xs:minInclusive value="0.0"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>
  <xs:element name="packet_loss">
    <xs:simpleType>
      <xs:restriction base="xs:float">
        <xs:minInclusive value="0.0"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>
  <xs:group name="LinkSpec.LinkType">
    <xs:annotation>
      <xs:documentation>A link can (by default) have zero or more types</xs:documentation>
    </xs:annotation>
    <xs:sequence>
137
      <xs:element minOccurs="0" maxOccurs="unbounded" ref="link_type"/>
138 139 140
    </xs:sequence>
  </xs:group>
  <xs:element name="fd">
141 142
    <xs:complexType>
      <xs:sequence>
143 144
        <xs:element ref="fd_name"/>
        <xs:element ref="fd_weight"/>
145 146 147 148 149 150 151 152
        <xs:element minOccurs="0" name="violatable">
          <xs:complexType/>
        </xs:element>
        <xs:choice minOccurs="0">
          <xs:annotation>
            <xs:documentation>Type information expressed in features and desires</xs:documentation>
          </xs:annotation>
          <xs:sequence>
153
            <xs:element ref="global"/>
154 155 156 157 158 159 160 161 162 163
            <xs:element name="operator">
              <xs:simpleType>
                <xs:restriction base="xs:token">
                  <xs:enumeration value="OnceOnly"/>
                  <xs:enumeration value="FirstFree"/>
                </xs:restriction>
              </xs:simpleType>
            </xs:element>
          </xs:sequence>
          <xs:sequence>
164
            <xs:element ref="local"/>
165 166 167 168 169 170 171 172 173
            <xs:element name="operator">
              <xs:simpleType>
                <xs:restriction base="xs:token">
                  <xs:enumeration value="+"/>
                </xs:restriction>
              </xs:simpleType>
            </xs:element>
          </xs:sequence>
        </xs:choice>
174 175 176
      </xs:sequence>
    </xs:complexType>
  </xs:element>
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
  <xs:element name="fd_name" type="xs:string">
    <xs:annotation>
      <xs:documentation>Name of this feature or desire</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="fd_weight" type="xs:float">
    <xs:annotation>
      <xs:documentation>Weight assocated with the feature or desire</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="global">
    <xs:complexType/>
  </xs:element>
  <xs:element name="local">
    <xs:complexType/>
  </xs:element>
  <xs:group name="NodeFlagSpec">
    <xs:sequence>
195
      <xs:element minOccurs="0" ref="trivial_bandwidth"/>
196 197 198
      <xs:element minOccurs="0" ref="subnode_of"/>
      <xs:element minOccurs="0" ref="unique"/>
      <xs:element minOccurs="0" ref="disallow_trivial_mix"/>
199 200 201 202 203
    </xs:sequence>
  </xs:group>
  <xs:element name="trivial_bandwidth" type="xs:integer"/>
  <xs:element name="subnode_of" type="xs:string"/>
  <xs:element name="unique">
204 205
    <xs:complexType/>
  </xs:element>
206 207 208 209 210 211 212 213
  <xs:element name="disallow_trivial_mix">
    <xs:complexType/>
  </xs:element>
  <xs:complexType name="InterfaceSpec">
    <xs:annotation>
      <xs:documentation>Interfaces</xs:documentation>
    </xs:annotation>
    <xs:sequence>
214
      <xs:element ref="interface"/>
215 216 217
    </xs:sequence>
  </xs:complexType>
  <xs:element name="interface">
218 219
    <xs:complexType>
      <xs:sequence>
220
        <xs:element ref="node_name"/>
221 222 223 224 225
        <xs:element name="interface" type="xs:string">
          <xs:annotation>
            <xs:documentation>Name of the interface itself</xs:documentation>
          </xs:annotation>
        </xs:element>
226
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="property">
227 228 229 230
          <xs:annotation>
            <xs:documentation>Properties of the interface</xs:documentation>
          </xs:annotation>
        </xs:element>
231 232 233
      </xs:sequence>
    </xs:complexType>
  </xs:element>
234 235 236 237 238 239 240 241
  <xs:element name="node_name" type="xs:string">
    <xs:annotation>
      <xs:documentation>Name of the node, which must match one of the nodes in this topology</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="property">
    <xs:complexType>
      <xs:sequence>
242 243 244
        <xs:element ref="property_name"/>
        <xs:element ref="property_value"/>
        <xs:element ref="property_penalty"/>
245 246 247 248 249 250 251 252
        <xs:element minOccurs="0" name="violatable">
          <xs:annotation>
            <xs:documentation>If this flag is present, not having the property is considered a violation</xs:documentation>
          </xs:annotation>
          <xs:complexType/>
        </xs:element>
        <xs:choice minOccurs="0">
          <xs:sequence>
253
            <xs:element ref="global"/>
254 255 256 257 258 259 260 261 262 263
            <xs:element name="operator">
              <xs:simpleType>
                <xs:restriction base="xs:token">
                  <xs:enumeration value="OnceOnly"/>
                  <xs:enumeration value="FirstFree"/>
                </xs:restriction>
              </xs:simpleType>
            </xs:element>
          </xs:sequence>
          <xs:sequence>
264
            <xs:element ref="local"/>
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284
            <xs:element name="operator">
              <xs:simpleType>
                <xs:restriction base="xs:token">
                  <xs:enumeration value="="/>
                  <xs:enumeration value="+"/>
                </xs:restriction>
              </xs:simpleType>
            </xs:element>
          </xs:sequence>
        </xs:choice>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="property_name" type="xs:string">
    <xs:annotation>
      <xs:documentation>Name of this property</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="property_value" type="xs:string"/>
  <xs:element name="property_penalty">
285
    <xs:annotation>
286
      <xs:documentation>The penalty associated with this property</xs:documentation>
287
    </xs:annotation>
288 289 290 291 292
    <xs:simpleType>
      <xs:restriction base="xs:float">
        <xs:minInclusive value="0.0"/>
      </xs:restriction>
    </xs:simpleType>
293 294
  </xs:element>
</xs:schema>