Commit 17659ffc authored by Robert Ricci's avatar Robert Ricci

Split up the RSpec into two files: The "-common" file contains all

the real definitions. The 'top level' file basically just contains the
namespace declaration and defines the start symbol.

The point of this is so that we can easily "include" the rspec schema
in other files.
parent dfc25bce
#
# EMULAB-COPYRIGHT
# Copyright (c) 2008 University of Utah and the Flux Group.
# All rights reserved.
#
#
# Simple prototype of an RSpec, to be used by ProtoGENI
#
include "../../assign/top.rnc" {
# Add some more stuff to nodes
NodeSpec &=
# 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
# endpoints.)
attribute uuid { text },
attribute name { text }?,
# Each node has exactly one virtualization technology, which we simply
# enumerate here
attribute virtualization_type { "raw" | "trellis-vserver" |
"planetlab-vserver" | "emulab-vnode" }?,
# 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 }? }
LinkSpec &=
# 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 }?
InterfaceSpec &=
# 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 }?
RSpec = element rspec {
# TODO: Include something about who generated this rspec?
# When this RSpec was generated - optional, can be used for determining
# staleness
attribute generated { xsd:dateTime },
# How long this rspec is valid - in the case of a ticket, this indicates
# how long the holder may use the resources. For a resource request, it's
# 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*
}
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns:top="http://emulab.net/resources/top/0.2">
<xs:import namespace="http://emulab.net/resources/top/0.2" schemaLocation="top.xsd"/>
<!--
EMULAB-COPYRIGHT
Copyright (c) 2008 University of Utah and the Flux Group.
All rights reserved.
-->
<!--
Simple prototype of an RSpec, to be used by ProtoGENI
-->
<!-- Add some more stuff to nodes -->
<xs:group name="NodeSpec">
<xs:sequence>
<xs:element minOccurs="0" ref="avaiable"/>
</xs:sequence>
</xs:group>
<xs:element name="avaiable" type="xs:boolean"/>
<xs:attributeGroup name="NodeSpec">
<xs:attribute name="uuid" use="required"/>
<xs:attribute name="name"/>
<xs:attribute name="virtualization_type">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="raw"/>
<xs:enumeration value="trellis-vserver"/>
<xs:enumeration value="planetlab-vserver"/>
<xs:enumeration value="emulab-vnode"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:attributeGroup>
<xs:element name="rspec">
<xs:complexType>
<xs:sequence>
<xs:group minOccurs="0" maxOccurs="unbounded" ref="NodeSpec"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="top:link"/>
</xs:sequence>
<xs:attribute name="generated" use="required" type="xs:dateTime"/>
<xs:attribute name="valid_until" use="required" type="xs:dateTime"/>
<xs:attribute name="uuid"/>
<xs:attribute name="name"/>
<xs:attribute name="virtualization_type">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="raw"/>
<xs:enumeration value="trellis-vserver"/>
<xs:enumeration value="planetlab-vserver"/>
<xs:enumeration value="emulab-vnode"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="uuid"/>
<xs:attribute name="name"/>
</xs:complexType>
</xs:element>
</xs:schema>
......@@ -6,57 +6,12 @@
#
# Simple prototype of an RSpec, to be used by ProtoGENI
# Some decisions to make:
# Right now, requests, etc. all are part of the same schema - is
# this right?
# Just a wrapper around the 'common' rpsec patterns, so that we don't have
# to define a start symbol in that file (so that it can easily be referenced
# by others.)
#
default namespace = "http://www.protogeni.net/resources/rspec/0.1"
include "../../assign/top.rnc" {
# Add some more stuff to nodes
NodeSpec &=
# 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
# endpoints.)
attribute uuid { text },
attribute name { text }?,
# Each node has exactly one virtualization technology, which we simply
# enumerate here
attribute virtualization_type { "raw" | "trellis-vserver" |
"planetlab-vserver" | "emulab-vnode" }?,
# 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 }? }
LinkSpec &=
# 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 }?
InterfaceSpec &=
# 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 }?
include "protogeni-rspec-common.rnc"
start = element rspec {
# TODO: Include something about who generated this rspec?
# When this RSpec was generated - optional, can be used for determining
# staleness
attribute generated { xsd:dateTime },
# How long this rspec is valid - in the case of a ticket, this indicates
# how long the holder may use the resources. For a resource request, it's
# 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*
}
start = RSpec
......@@ -9,56 +9,12 @@
<!--
Simple prototype of an RSpec, to be used by ProtoGENI
Some decisions to make:
Right now, requests, etc. all are part of the same schema - is
this right?
Just a wrapper around the 'common' rpsec patterns, so that we don't have
to define a start symbol in that file (so that it can easily be referenced
by others.)
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.protogeni.net/resources/rspec/0.1" xmlns:rspec="http://www.protogeni.net/resources/rspec/0.1" xmlns:top="http://emulab.net/resources/top/0.2">
<xs:include schemaLocation="protogeni-rspec-common.xsd"/>
<xs:import namespace="http://emulab.net/resources/top/0.2" schemaLocation="top.xsd"/>
<!-- Add some more stuff to nodes -->
<xs:group name="NodeSpec">
<xs:sequence>
<xs:element minOccurs="0" ref="rspec:avaiable"/>
</xs:sequence>
</xs:group>
<xs:element name="avaiable" type="xs:boolean"/>
<xs:attributeGroup name="NodeSpec">
<xs:attribute name="uuid" use="required"/>
<xs:attribute name="name"/>
<xs:attribute name="virtualization_type">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="raw"/>
<xs:enumeration value="trellis-vserver"/>
<xs:enumeration value="planetlab-vserver"/>
<xs:enumeration value="emulab-vnode"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:attributeGroup>
<xs:element name="rspec">
<xs:complexType>
<xs:sequence>
<xs:group minOccurs="0" maxOccurs="unbounded" ref="rspec:NodeSpec"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="top:link"/>
</xs:sequence>
<xs:attribute name="generated" use="required" type="xs:dateTime"/>
<xs:attribute name="valid_until" use="required" type="xs:dateTime"/>
<xs:attribute name="uuid"/>
<xs:attribute name="name"/>
<xs:attribute name="virtualization_type">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="raw"/>
<xs:enumeration value="trellis-vserver"/>
<xs:enumeration value="planetlab-vserver"/>
<xs:enumeration value="emulab-vnode"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="uuid"/>
<xs:attribute name="name"/>
</xs:complexType>
</xs:element>
</xs:schema>
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