vtop-top.xsd 10.6 KB
Newer Older
1 2 3 4
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://emulab.net/resources/vtop/0.2" xmlns:vtop="http://emulab.net/resources/vtop/0.2">
  <!--
    
Robert Ricci's avatar
Robert Ricci committed
5
    Copyright (c) 2005-2010 University of Utah and the Flux Group.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
    
    {{{EMULAB-LICENSE
    
    This file is part of the Emulab network testbed software.
    
    This file is free software: you can redistribute it and/or modify it
    under the terms of the GNU Affero General Public License as published by
    the Free Software Foundation, either version 3 of the License, or (at
    your option) any later version.
    
    This file is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
    License for more details.
    
    You should have received a copy of the GNU Affero General Public License
    along with this file.  If not, see <http://www.gnu.org/licenses/>.
    
    }}}
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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 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 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305
    
  -->
  <!--
    
    Definition of common data structures used for representing topologies -
    shared between vtop (virtual topology) and ptop (physical topology)
    formats.
    
  -->
  <xs:element name="node_type">
    <xs:complexType>
      <xs:attribute name="type_name" use="required">
        <xs:annotation>
          <xs:documentation>Name of the type - will almost certainly not be unique</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="type_slots" use="required">
        <xs:annotation>
          <xs:documentation>How many virtual nodes of this type this physical node can
handle.</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:union>
            <xs:simpleType>
              <xs:restriction base="xs:integer">
                <xs:minInclusive value="0"/>
              </xs:restriction>
            </xs:simpleType>
            <xs:simpleType>
              <xs:restriction base="xs:token">
                <xs:enumeration value="unlimited"/>
              </xs:restriction>
            </xs:simpleType>
          </xs:union>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="static">
        <xs:annotation>
          <xs:documentation>element unlimited { empty }?,
A flag that indicates that this physical node *always*
has this type - a node is only allowed to have one dynamic
(ie. not flagged as static) type at a time, but any number
of static types at a time
element static { empty }?</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="true"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="link_type">
    <xs:complexType>
      <xs:attribute name="type_name" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:group name="LinkEndPoints">
    <xs:annotation>
      <xs:documentation>A link has two endpoints. Right now, they are order
independent. But they might become order-dependant later.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element ref="vtop:source_interface"/>
      <xs:element ref="vtop:destination_interface"/>
    </xs:sequence>
  </xs:group>
  <xs:element name="source_interface" type="vtop:InterfaceSpec">
    <xs:annotation>
      <xs:documentation>First interface for this link</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="destination_interface" type="vtop:InterfaceSpec">
    <xs:annotation>
      <xs:documentation>Second interface for this link</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:group name="LinkCharacteristics">
    <xs:annotation>
      <xs:documentation>Link characterstics which affect traffic.
TODO: In the future, the bandwidth, latency, and packet loss will be
moved to features and/or properties</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element ref="vtop:bandwidth"/>
      <xs:element ref="vtop:latency"/>
      <xs:element ref="vtop:packet_loss"/>
    </xs:sequence>
  </xs:group>
  <xs:element name="bandwidth">
    <xs:annotation>
      <xs:documentation>Bandwidth of the link in kbps</xs:documentation>
    </xs:annotation>
    <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:annotation>
      <xs:documentation>Static packet loss probability of the link as a fraction
(ie. 0.01 == 1%)</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="fd">
    <xs:complexType>
      <xs:attribute name="fd_name" use="required">
        <xs:annotation>
          <xs:documentation>Name of this feature or desire
element fd_name { text },</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="fd_weight" use="required">
        <xs:annotation>
          <xs:documentation>Weight assocated with the feature or desire
element fd_weight { xsd:float },</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="violatable">
        <xs:annotation>
          <xs:documentation>A flag indicating whether or not a failure to match the desire with a
a feature is a constraint violation
element violatable { empty }?,</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="true"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="global_operator">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="OnceOnly"/>
            <xs:enumeration value="FirstFree"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="local_operator">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="+"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:attributeGroup name="GlobalSpec">
    <xs:annotation>
      <xs:documentation>GlobalSpec = element global {
	element operator { "OnceOnly" | "FirstFree" }
}</xs:documentation>
    </xs:annotation>
    <xs:attribute name="global_operator" use="required">
      <xs:simpleType>
        <xs:restriction base="xs:token">
          <xs:enumeration value="OnceOnly"/>
          <xs:enumeration value="FirstFree"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:attributeGroup>
  <xs:attributeGroup name="LocalSpec">
    <xs:annotation>
      <xs:documentation>LocalSpec = element local {
	element operator { "+" }
	attribute local_operator { "+" }
}</xs:documentation>
    </xs:annotation>
    <xs:attribute name="local_operator" use="required">
      <xs:simpleType>
        <xs:restriction base="xs:token">
          <xs:enumeration value="+"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:attributeGroup>
  <xs:complexType name="InterfaceSpec">
    <xs:annotation>
      <xs:documentation>Interfaces
InterfaceSpec = element interface { InterfaceContents }</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" ref="vtop:property"/>
    </xs:sequence>
    <xs:attribute name="node_name" use="required"/>
    <xs:attribute name="interface_name" use="required"/>
    <xs:attribute name="physical_node_name"/>
    <xs:attribute name="physical_interface_name"/>
  </xs:complexType>
  <xs:group name="InterfaceContents">
    <xs:sequence>
      <xs:element ref="vtop:node_name"/>
      <xs:element ref="vtop:interface_name"/>
      <xs:element minOccurs="0" maxOccurs="unbounded" ref="vtop:property">
        <xs:annotation>
          <xs:documentation>Properties of the interface</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:group>
  <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="interface_name" type="xs:string">
    <xs:annotation>
      <xs:documentation>Name of the interface itself</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="property">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="vtop:property_name"/>
        <xs:element ref="vtop:property_value"/>
        <xs:element ref="vtop:property_penalty"/>
        <xs:element minOccurs="0" ref="vtop:violatable"/>
      </xs:sequence>
      <xs:attribute name="global_operator">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="OnceOnly"/>
            <xs:enumeration value="FirstFree"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="local_operator">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="+"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </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:annotation>
      <xs:documentation>Value associated with this property
TODO: Add ranges and other types from rspec</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="property_penalty">
    <xs:annotation>
      <xs:documentation>The penalty associated with this property</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="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:schema>