add credential schema rng files
[sfa.git] / sfa / trust / top.rng
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">\r
3   <!--\r
4     \r
5     EMULAB-COPYRIGHT\r
6     Copyright (c) 2005-2007 University of Utah and the Flux Group.\r
7     All rights reserved.\r
8     \r
9   -->\r
10   <!--\r
11     \r
12     Definition of common data structures used for representing topologies -\r
13     shared between vtop (virtual topology) and ptop (physical topology)\r
14     formats.\r
15     \r
16   -->\r
17   <define name="NodeTypeSpec">\r
18     <a:documentation>Representation of a single node type</a:documentation>\r
19     <element name="node_type">\r
20       <interleave>\r
21         <attribute name="type_name">\r
22           <a:documentation>Name of the type - will almost certainly not be unique</a:documentation>\r
23         </attribute>\r
24         <attribute name="type_slots">\r
25           <a:documentation>How many virtual nodes of this type this physical node can\r
26 handle.</a:documentation>\r
27           <choice>\r
28             <data type="integer">\r
29               <param name="minInclusive">0</param>\r
30             </data>\r
31             <value>unlimited</value>\r
32           </choice>\r
33         </attribute>\r
34         <optional>\r
35           <attribute name="static">\r
36             <a:documentation>element unlimited { empty }?,\r
37 A flag that indicates that this physical node *always*\r
38 has this type - a node is only allowed to have one dynamic\r
39 (ie. not flagged as static) type at a time, but any number\r
40 of static types at a time\r
41 element static { empty }?</a:documentation>\r
42             <value>true</value>\r
43           </attribute>\r
44         </optional>\r
45         <ref name="NodeTypeContents"/>\r
46       </interleave>\r
47     </element>\r
48   </define>\r
49   <define name="NodeTypeContents">\r
50     <empty/>\r
51   </define>\r
52   <define name="LinkTypeSpec">\r
53     <a:documentation>Link types are currently just a siple string. They will almost certainly \r
54 have to get more complicated, for two reasons:\r
55     First, I want to allow virtual links to specify more than one type, so\r
56       that we can ask for links that are, say, 'ethernet or loopback'\r
57     Second, I want to have a lot more control over links that get mapped to\r
58       multi-hop paths\r
59 TODO: MAYBE this should be combined with NodeTypeSpec</a:documentation>\r
60     <element name="link_type">\r
61       <attribute name="type_name"/>\r
62     </element>\r
63   </define>\r
64   <define name="LinkEndPoints">\r
65     <a:documentation>A link has two endpoints. Right now, they are order\r
66 independent. But they might become order-dependant later.</a:documentation>\r
67     <element name="source_interface">\r
68       <a:documentation>First interface for this link</a:documentation>\r
69       <ref name="InterfaceSpec"/>\r
70     </element>\r
71     <element name="destination_interface">\r
72       <a:documentation>Second interface for this link</a:documentation>\r
73       <ref name="InterfaceSpec"/>\r
74     </element>\r
75   </define>\r
76   <define name="LinkCharacteristics">\r
77     <a:documentation>Link characterstics which affect traffic.\r
78 TODO: In the future, the bandwidth, latency, and packet loss will be\r
79 moved to features and/or properties</a:documentation>\r
80     <element name="bandwidth">\r
81       <a:documentation>Bandwidth of the link in kbps</a:documentation>\r
82       <data type="float">\r
83         <param name="minExclusive">0.0</param>\r
84       </data>\r
85     </element>\r
86     <element name="latency">\r
87       <a:documentation>Latency of the link in ms</a:documentation>\r
88       <data type="float">\r
89         <param name="minInclusive">0.0</param>\r
90       </data>\r
91     </element>\r
92     <element name="packet_loss">\r
93       <a:documentation>Static packet loss probability of the link as a fraction\r
94 (ie. 0.01 == 1%)</a:documentation>\r
95       <data type="float">\r
96         <param name="minInclusive">0.0</param>\r
97       </data>\r
98     </element>\r
99   </define>\r
100   <define name="FeatureDesireSpec">\r
101     <a:documentation>"Legacy" assign features and desires - will be phased out in favor of\r
102 properties</a:documentation>\r
103     <element name="fd">\r
104       <attribute name="fd_name">\r
105         <a:documentation>Name of this feature or desire\r
106 element fd_name { text },</a:documentation>\r
107       </attribute>\r
108       <attribute name="fd_weight">\r
109         <a:documentation>Weight assocated with the feature or desire\r
110 element fd_weight { xsd:float },</a:documentation>\r
111       </attribute>\r
112       <optional>\r
113         <attribute name="violatable">\r
114           <a:documentation>A flag indicating whether or not a failure to match the desire with a\r
115 a feature is a constraint violation\r
116 element violatable { empty }?,</a:documentation>\r
117           <value>true</value>\r
118         </attribute>\r
119       </optional>\r
120       <optional>\r
121         <choice>\r
122           <a:documentation>Type information expressed in features and desires</a:documentation>\r
123           <ref name="GlobalSpec"/>\r
124           <ref name="LocalSpec"/>\r
125         </choice>\r
126       </optional>\r
127     </element>\r
128   </define>\r
129   <define name="GlobalSpec">\r
130     <a:documentation>GlobalSpec = element global {\r
131         element operator { "OnceOnly" | "FirstFree" }\r
132 }</a:documentation>\r
133     <attribute name="global_operator">\r
134       <choice>\r
135         <value>OnceOnly</value>\r
136         <value>FirstFree</value>\r
137       </choice>\r
138     </attribute>\r
139   </define>\r
140   <define name="LocalSpec">\r
141     <a:documentation>LocalSpec = element local {\r
142         element operator { "+" }\r
143         attribute local_operator { "+" }\r
144 }</a:documentation>\r
145     <attribute name="local_operator">\r
146       <value>+</value>\r
147     </attribute>\r
148   </define>\r
149   <define name="InterfaceSpec">\r
150     <a:documentation>Interfaces\r
151 InterfaceSpec = element interface { InterfaceContents }</a:documentation>\r
152     <attribute name="node_name"/>\r
153     <attribute name="interface_name"/>\r
154     <optional>\r
155       <attribute name="physical_node_name"/>\r
156     </optional>\r
157     <optional>\r
158       <attribute name="physical_interface_name"/>\r
159     </optional>\r
160     <zeroOrMore>\r
161       <ref name="PropertySpec"/>\r
162     </zeroOrMore>\r
163   </define>\r
164   <define name="InterfaceContents">\r
165     <element name="node_name">\r
166       <a:documentation>Name of the node, which must match one of the nodes in this topology</a:documentation>\r
167       <text/>\r
168     </element>\r
169     <element name="interface_name">\r
170       <a:documentation>Name of the interface itself</a:documentation>\r
171       <text/>\r
172     </element>\r
173     <zeroOrMore>\r
174       <ref name="PropertySpec">\r
175         <a:documentation>Properties of the interface</a:documentation>\r
176       </ref>\r
177     </zeroOrMore>\r
178   </define>\r
179   <define name="PropertySpec">\r
180     <a:documentation>Properties - new: replacements for features and desires. Not yet implemented\r
181 in assign, and not yet fully fleshed out in this schema.</a:documentation>\r
182     <element name="property">\r
183       <element name="property_name">\r
184         <a:documentation>Name of this property</a:documentation>\r
185         <text/>\r
186       </element>\r
187       <element name="property_value">\r
188         <a:documentation>Value associated with this property\r
189 TODO: Add ranges and other types from rspec</a:documentation>\r
190         <choice>\r
191           <text/>\r
192           <data type="float"/>\r
193         </choice>\r
194       </element>\r
195       <element name="property_penalty">\r
196         <a:documentation>The penalty associated with this property</a:documentation>\r
197         <data type="float">\r
198           <param name="minInclusive">0.0</param>\r
199         </data>\r
200       </element>\r
201       <optional>\r
202         <element name="violatable">\r
203           <a:documentation>If this flag is present, not having the property is considered a violation</a:documentation>\r
204           <empty/>\r
205         </element>\r
206       </optional>\r
207       <optional>\r
208         <choice>\r
209           <a:documentation>TODO: Add more operators - equality, range test, etc\r
210 Flags for special types of operators</a:documentation>\r
211           <ref name="GlobalSpec"/>\r
212           <ref name="LocalSpec"/>\r
213         </choice>\r
214       </optional>\r
215     </element>\r
216   </define>\r
217 </grammar>\r