Commit 85777f5c authored by Jonathon Duerig's avatar Jonathon Duerig

Changed RSpec to allow Nodes and Links to be interleaved.

parent 12213ea4
......@@ -58,8 +58,6 @@ RSpec = element rspec {
# how long we want the resources. For an advertisement, it might be a hint
# as to how long it's okay to cache this rspec.
attribute valid_until { xsd:dateTime },
# One or more nodes
NodeSpec*,
# One or more links
LinkSpec*
# One or more nodes/links
(NodeSpec | LinkSpec)*
}
......@@ -45,10 +45,10 @@
<xs:element name="component_manager_URL" type="xs:anyURI"/>
<xs:element name="rspec">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="node"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="link"/>
</xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="node"/>
<xs:element ref="link"/>
</xs:choice>
<xs:attribute name="generated" use="required" type="xs:dateTime"/>
<xs:attribute name="valid_until" use="required" type="xs:dateTime"/>
</xs:complexType>
......
......@@ -47,10 +47,10 @@
<xs:element name="component_manager_URL" type="xs:anyURI"/>
<xs:element name="rspec">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="credential:node"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="credential:link"/>
</xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="credential:node"/>
<xs:element ref="credential:link"/>
</xs:choice>
<xs:attribute name="generated" use="required" type="xs:dateTime"/>
<xs:attribute name="valid_until" use="required" type="xs:dateTime"/>
</xs:complexType>
......
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.protogeni.net/resources/credential/0.1" xmlns:sig="http://www.w3.org/2000/09/xmldsig#" xmlns:credential="http://www.protogeni.net/resources/credential/0.1">
<xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="sig.xsd"/>
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
<!--
EMULAB-COPYRIGHT
......@@ -23,10 +25,10 @@
</xs:annotation>
</xs:element>
<xs:choice>
<xs:element ref="type_slots"/>
<xs:element ref="unlimited"/>
<xs:element ref="credential:type_slots"/>
<xs:element ref="credential:unlimited"/>
</xs:choice>
<xs:element minOccurs="0" ref="static"/>
<xs:element minOccurs="0" ref="credential:static"/>
</xs:sequence>
</xs:complexType>
</xs:element>
......@@ -43,30 +45,13 @@
<xs:element name="static">
<xs:complexType/>
</xs:element>
<xs:element name="node" type="NodeContents"/>
<xs:complexType name="NodeContents">
<xs:sequence>
<xs:group ref="NodeSpec.NodeType"/>
<xs:group ref="NodeFlagSpec">
<xs:annotation>
<xs:documentation>Legacy flags</xs:documentation>
</xs:annotation>
</xs:group>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="fd">
<xs:annotation>
<xs:documentation>Legacy features and desires</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="property"/>
</xs:sequence>
<xs:attribute name="name" use="required"/>
</xs:complexType>
<xs:element name="node" type="credential:NodeContents"/>
<xs:group name="NodeSpec.NodeType">
<xs:annotation>
<xs:documentation>A node can (by default) have one or more types</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="node_type"/>
<xs:element maxOccurs="unbounded" ref="credential:node_type"/>
</xs:sequence>
</xs:group>
<xs:element name="link_type">
......@@ -76,70 +61,24 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="link" type="LinkContents"/>
<xs:complexType name="LinkContents">
<xs:sequence>
<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">
<xs:annotation>
<xs:documentation>Properties of this link</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<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>
</xs:complexType>
<xs:element name="source_interface" type="InterfaceSpec"/>
<xs:element name="destination_interface" type="InterfaceSpec">
<xs:annotation>
<xs:documentation>Second interface for this link</xs:documentation>
</xs:annotation>
</xs:element>
<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 name="link">
<xs:complexType>
<xs:attributeGroup ref="credential:LinkContents"/>
</xs:complexType>
</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>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="link_type"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="credential:link_type"/>
</xs:sequence>
</xs:group>
<xs:element name="fd">
<xs:complexType>
<xs:sequence>
<xs:element ref="fd_name"/>
<xs:element ref="fd_weight"/>
<xs:element ref="credential:fd_name"/>
<xs:element ref="credential:fd_weight"/>
<xs:element minOccurs="0" name="violatable">
<xs:complexType/>
</xs:element>
......@@ -148,7 +87,7 @@
<xs:documentation>Type information expressed in features and desires</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element ref="global"/>
<xs:element ref="credential:global"/>
<xs:element name="operator">
<xs:simpleType>
<xs:restriction base="xs:token">
......@@ -159,7 +98,7 @@
</xs:element>
</xs:sequence>
<xs:sequence>
<xs:element ref="local"/>
<xs:element ref="credential:local"/>
<xs:element name="operator">
<xs:simpleType>
<xs:restriction base="xs:token">
......@@ -190,10 +129,10 @@
</xs:element>
<xs:group name="NodeFlagSpec">
<xs:sequence>
<xs:element minOccurs="0" ref="trivial_bandwidth"/>
<xs:element minOccurs="0" ref="subnode_of"/>
<xs:element minOccurs="0" ref="unique"/>
<xs:element minOccurs="0" ref="disallow_trivial_mix"/>
<xs:element minOccurs="0" ref="credential:trivial_bandwidth"/>
<xs:element minOccurs="0" ref="credential:subnode_of"/>
<xs:element minOccurs="0" ref="credential:unique"/>
<xs:element minOccurs="0" ref="credential:disallow_trivial_mix"/>
</xs:sequence>
</xs:group>
<xs:element name="trivial_bandwidth" type="xs:integer"/>
......@@ -204,40 +143,17 @@
<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>
<xs:element name="interface" type="InterfaceContents"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="InterfaceContents">
<xs:sequence>
<xs:element ref="node_name"/>
<xs:element name="interface" type="xs:string">
<xs:annotation>
<xs:documentation>Name of the interface itself</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="property">
<xs:annotation>
<xs:documentation>Properties of the interface</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<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 name="interface">
<xs:complexType>
<xs:attributeGroup ref="credential:InterfaceContents"/>
</xs:complexType>
</xs:element>
<xs:element name="property">
<xs:complexType>
<xs:sequence>
<xs:element ref="property_name"/>
<xs:element ref="property_value"/>
<xs:element ref="property_penalty"/>
<xs:element ref="credential:property_name"/>
<xs:element ref="credential:property_value"/>
<xs:element ref="credential:property_penalty"/>
<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>
......@@ -246,7 +162,7 @@
</xs:element>
<xs:choice minOccurs="0">
<xs:sequence>
<xs:element ref="global"/>
<xs:element ref="credential:global"/>
<xs:element name="operator">
<xs:simpleType>
<xs:restriction base="xs:token">
......@@ -257,7 +173,7 @@
</xs:element>
</xs:sequence>
<xs:sequence>
<xs:element ref="local"/>
<xs:element ref="credential:local"/>
<xs:element name="operator">
<xs:simpleType>
<xs:restriction base="xs:token">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment