Commit 5929e134 authored by Jonathon Duerig's avatar Jonathon Duerig

Fixed top.rnc and protogeni-rspec-common.rnc so that the latter includes the former correctly. T

hings are now implemented entirely using redefinition rather than &= which turned out to be flak
y. Added a new test xml file to exercise the node, link, and interface parts of the schema.
parent 4ff21871
......@@ -65,27 +65,36 @@ LinkSpec = element link { LinkContents }
LinkContents =
## Name of the link - must be unique in the top
attribute name { text },
## First interface for this link - links are assumed to be
## symmetric, so the order of the interfaces does not currently
## matter
## The two interfaces which form the endpoints of this link.
LinkEndPoints,
## The characteristics (bandwidth, latency, loss) which affect traffic.
LinkCharacteristics,
## Type of this link - we use a named pattern here (defined below), so
## that it can be overriden in the virtual topology schema, where you are
## only allowed to have one
LinkSpec.LinkType,
## Properties of this link
PropertySpec*
## A link has two endpoints. Right now, they are order
## independent. But they might become order-dependant later.
LinkEndPoints =
## First interface for this link
element source_interface { InterfaceSpec },
## Second interface for this link
element destination_interface { InterfaceSpec },
## TODO: In the future, the bandwidth, latency, and packet loss will be
## moved to features and/or properties
element destination_interface { InterfaceSpec }
## Link characterstics which affect traffic.
## TODO: In the future, the bandwidth, latency, and packet loss will be
## moved to features and/or properties
LinkCharacteristics =
## Bandwidth of the link in kbps
element bandwidth { xsd:float { minExclusive = "0.0" } },
## Latency of the link in ms
element latency { xsd:float { minInclusive = "0.0" } },
## Static packet loss probability of the link as a fraction
## (ie. 0.01 == 1%)
element packet_loss { xsd:float { minInclusive = "0.0" } },
## Type of this link - we use a named pattern here (defined below), so
## that it can be overriden in the virtual topology schema, where you are
## only allowed to have one
LinkSpec.LinkType,
## Properties of this link
PropertySpec*
element packet_loss { xsd:float { minInclusive = "0.0" } }
## A link can (by default) have zero or more types
LinkSpec.LinkType = LinkTypeSpec*
......
......@@ -10,7 +10,7 @@
include "../../assign/top.rnc" {
# Add some more stuff to nodes
NodeContents &=
NodeContents =
# Semantic change - the 'name' of a (physical) node is now
# solely for human-readability. It's the UUID, which we add here,
# that is the "true" identifier (ie. used in identifying link
......@@ -21,27 +21,36 @@ include "../../assign/top.rnc" {
# enumerate here
attribute virtualization_type { "raw" | "trellis-vserver" |
"planetlab-vserver" | "emulab-vnode" }?,
NodeSpec.NodeType,
# Inidicate whether or not this node is available - the idea is that a
# full dump of the static physical topology will not include this, but
# that we can later get updates that include only this attribute (and a
# UUID) Just binary for now - probably will include more things, such
# as a number of "free slots", later
element avaiable { xsd:boolean }?,
element available { xsd:boolean }?,
# Optionally, include the URL for this component's CM
CMURLSpec?
LinkContents &=
LinkContents =
# Semantic change - the 'name' of a (physical) link is now
# solely for human-readability. It's the UUID, which we add here,
# that is the "true" identifier.
attribute uuid { text },
attribute name { text }?
attribute name { text }?,
LinkEndPoints,
## The characteristics (bandwidth, latency, loss) which affect traffic.
LinkCharacteristics,
## Type of this link - we use a named pattern here (defined below), so
## that it can be overriden in the virtual topology schema, where you are
## only allowed to have one
LinkSpec.LinkType
# TODO: Might add a URL for the CM for a link in the future
InterfaceContents &=
InterfaceContents =
# Semantic change - the 'name' in an interface is solely for human
# readability. It's the UUID that is used to uniquely identify a
# node.
attribute node_uuid { text },
attribute node_name { text }?
element node_uuid { text },
element node_name { text }?,
element interface { text }
}
## How to contact a component manager. In the future, could include information
......
......@@ -16,7 +16,8 @@
<!-- Add some more stuff to nodes -->
<xs:complexType name="NodeContents">
<xs:sequence>
<xs:element minOccurs="0" ref="avaiable"/>
<xs:group ref="NodeSpec.NodeType"/>
<xs:element minOccurs="0" ref="available"/>
<xs:element minOccurs="0" ref="component_manager_URL"/>
</xs:sequence>
<xs:attribute name="uuid" use="required"/>
......@@ -32,16 +33,32 @@
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:element name="avaiable" type="xs:boolean"/>
<xs:attributeGroup name="LinkContents">
<xs:element name="available" type="xs:boolean"/>
<xs:complexType name="LinkContents">
<xs:sequence>
<xs:group ref="LinkEndPoints"/>
<xs:group ref="LinkCharacteristics">
<xs:annotation>
<xs:documentation>The characteristics (bandwidth, latency, loss) which affect traffic.</xs:documentation>
</xs:annotation>
</xs:group>
<xs:group ref="LinkSpec.LinkType"/>
</xs:sequence>
<xs:attribute name="uuid" use="required"/>
<xs:attribute name="name"/>
</xs:attributeGroup>
</xs:complexType>
<!-- TODO: Might add a URL for the CM for a link in the future -->
<xs:attributeGroup name="InterfaceContents">
<xs:attribute name="node_uuid" use="required"/>
<xs:attribute name="node_name"/>
</xs:attributeGroup>
<xs:complexType name="InterfaceContents">
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="node_uuid"/>
<xs:element ref="node_name"/>
</xs:choice>
<xs:element name="interface" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="node_uuid" type="xs:string"/>
<xs:element name="node_name" type="xs:string"/>
<xs:element name="component_manager_URL" type="xs:anyURI"/>
<xs:element name="rspec">
<xs:complexType>
......
......@@ -18,7 +18,8 @@
<!-- Add some more stuff to nodes -->
<xs:complexType name="NodeContents">
<xs:sequence>
<xs:element minOccurs="0" ref="credential:avaiable"/>
<xs:group ref="credential:NodeSpec.NodeType"/>
<xs:element minOccurs="0" ref="credential:available"/>
<xs:element minOccurs="0" ref="credential:component_manager_URL"/>
</xs:sequence>
<xs:attribute name="uuid" use="required"/>
......@@ -34,16 +35,30 @@
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:element name="avaiable" type="xs:boolean"/>
<xs:attributeGroup name="LinkContents">
<xs:element name="available" type="xs:boolean"/>
<xs:complexType name="LinkContents">
<xs:sequence>
<xs:group ref="credential:LinkEndPoints"/>
<xs:group ref="credential:LinkCharacteristics">
<xs:annotation>
<xs:documentation>The characteristics (bandwidth, latency, loss) which affect traffic.</xs:documentation>
</xs:annotation>
</xs:group>
<xs:group ref="credential:LinkSpec.LinkType"/>
</xs:sequence>
<xs:attribute name="uuid" use="required"/>
<xs:attribute name="name"/>
</xs:attributeGroup>
</xs:complexType>
<!-- TODO: Might add a URL for the CM for a link in the future -->
<xs:attributeGroup name="InterfaceContents">
<xs:attribute name="node_uuid" use="required"/>
<xs:attribute name="node_name"/>
</xs:attributeGroup>
<xs:complexType name="InterfaceContents">
<xs:sequence>
<xs:element ref="credential:node_uuid"/>
<xs:element minOccurs="0" ref="credential:node_name"/>
<xs:element name="interface" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="node_uuid" type="xs:string"/>
<xs:element name="node_name" type="xs:string"/>
<xs:element name="component_manager_URL" type="xs:anyURI"/>
<xs:element name="rspec">
<xs:complexType>
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<signed-credential xmlns="http://www.protogeni.net/resources/credential/0.1" xmlns:sig="http://www.w3.org/2000/09/xmldsig#">
<credential xml:id="ref1">
<type>capability</type>
<serial>3</serial>
<owner_uuid>0b2eb97e-ed30-11db-96cb-001143e453fe</owner_uuid>
<this_uuid>3e1948fe-ed30-11db-96cb-001143e453fe</this_uuid>
<ticket>
<can_delegate>false</can_delegate>
<redeem_before>2008-04-08T01:01:01</redeem_before>
<rspec generated="2008-04-08T01:01:01" valid_until="2009-04-08T01:01:01">
<node uuid="foo" name="foo-name">
<node_type>
<type_name>foobar</type_name>
<unlimited/>
</node_type>
<available>0</available>
<component_manager_URL>http://www.example.com</component_manager_URL>
</node>
<node uuid="bar">
<node_type>
<type_name>barfoo</type_name>
<type_slots>3</type_slots>
</node_type>
</node>
<link uuid="foobar">
<source_interface><interface>
<node_uuid>foo</node_uuid>
<node_name>foo-name</node_name>
<interface>eth0</interface>
</interface></source_interface>
<destination_interface><interface>
<node_uuid>bar</node_uuid>
<interface>fxp2</interface>
</interface></destination_interface>
<bandwidth>100000</bandwidth>
<latency>1.5</latency>
<packet_loss>0</packet_loss>
<link_type>
<type_name>100Mbit</type_name>
</link_type>
<link_type>
<type_name>wired</type_name>
</link_type>
</link>
</rspec>
</ticket>
</credential>
<signatures>
<sig:Signature>foobar</sig:Signature>
</signatures>
</signed-credential>
......@@ -61,10 +61,56 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="link">
<xs:complexType>
<xs:attributeGroup ref="credential:LinkContents"/>
</xs:complexType>
<xs:element name="link" type="credential:LinkContents"/>
<xs:group name="LinkEndPoints">
<xs:sequence>
<xs:element ref="credential:source_interface"/>
<xs:element ref="credential:destination_interface"/>
</xs:sequence>
</xs:group>
<xs:element name="source_interface" type="credential:InterfaceSpec">
<xs:annotation>
<xs:documentation>First interface for this link</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="destination_interface" type="credential:InterfaceSpec">
<xs:annotation>
<xs:documentation>Second interface for this link</xs:documentation>
</xs:annotation>
</xs:element>
<xs:group name="LinkCharacteristics">
<xs:sequence>
<xs:element ref="credential:bandwidth"/>
<xs:element ref="credential:latency"/>
<xs:element ref="credential: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:simpleType>
<xs:restriction base="xs:float">
<xs:minInclusive value="0.0"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:group name="LinkSpec.LinkType">
<xs:annotation>
......@@ -143,11 +189,14 @@
<xs:element name="disallow_trivial_mix">
<xs:complexType/>
</xs:element>
<xs:element name="interface">
<xs:complexType>
<xs:attributeGroup ref="credential:InterfaceContents"/>
</xs:complexType>
</xs:element>
<xs:complexType name="InterfaceSpec">
<xs:annotation>
<xs:documentation>Interfaces</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="interface" type="credential:InterfaceContents"/>
</xs:sequence>
</xs:complexType>
<xs:element name="property">
<xs:complexType>
<xs:sequence>
......
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