a8ad8f2bcc6501a731a15e8340100dcc738e3174
[sfa.git] / sfa / trust / protogeni-rspec-common.rng
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <grammar 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) 2008 University of Utah and the Flux Group.\r
7     All rights reserved.\r
8     \r
9   -->\r
10   <!--\r
11     \r
12     Common definitions for advertisements, requests, and tickets\r
13     \r
14   -->\r
15   <include href="top.rng"/>\r
16   <define name="NodeSpec">\r
17     <element name="node">\r
18       <ref name="NodeContents"/>\r
19     </element>\r
20   </define>\r
21   <define name="LinkSpec">\r
22     <element name="link">\r
23       <ref name="LinkContents"/>\r
24     </element>\r
25   </define>\r
26   <define name="NodeContents">\r
27     <interleave>\r
28       <optional>\r
29         <!--\r
30           Each node has exactly one virtualization technology, which we simply\r
31           enumerate here\r
32         -->\r
33         <attribute name="virtualization_type">\r
34           <choice>\r
35             <value>raw</value>\r
36             <value>trellis-vserver</value>\r
37             <value>planetlab-vserver</value>\r
38             <value>emulab-vnode</value>\r
39             <value>bgpmux</value>\r
40           </choice>\r
41         </attribute>\r
42       </optional>\r
43       <optional>\r
44         <!--\r
45           Each node may be the subnode of (physically located within) another.\r
46           In advertisements, this is the URN of the other component.\r
47           In requests, this is the virtual_id of the other sliver.\r
48         -->\r
49         <element name="subnode_of">\r
50           <text/>\r
51         </element>\r
52       </optional>\r
53       <!-- Node type list -->\r
54       <ref name="NodeTypeList"/>\r
55       <zeroOrMore>\r
56         <!--\r
57           List of interfaces on this node. Interfaces are declared here. So\r
58           all information about a particular interface including types\r
59           belongs in the declaration. Other references to interfaces\r
60           should just uniquely identify them and refer back here.\r
61         -->\r
62         <element name="interface">\r
63           <ref name="InterfaceDecl"/>\r
64         </element>\r
65       </zeroOrMore>\r
66     </interleave>\r
67   </define>\r
68   <define name="LinkContents">\r
69     <interleave>\r
70       <optional>\r
71         <!--\r
72           Each link has exactly one virtualization technology, which we simply\r
73           enumerate here\r
74         -->\r
75         <attribute name="virtualization_type">\r
76           <choice>\r
77             <value>raw</value>\r
78             <value>trellis-vserver</value>\r
79             <value>planetlab-vserver</value>\r
80             <value>emulab-vnode</value>\r
81           </choice>\r
82         </attribute>\r
83       </optional>\r
84       <oneOrMore>\r
85         <!-- Link types -->\r
86         <ref name="LinkType"/>\r
87       </oneOrMore>\r
88       <zeroOrMore>\r
89         <!-- The interfaces which this link spans. -->\r
90         <element name="interface_ref">\r
91           <ref name="InterfaceRef"/>\r
92         </element>\r
93       </zeroOrMore>\r
94     </interleave>\r
95   </define>\r
96   <define name="NodeTypeList">\r
97     <oneOrMore>\r
98       <ref name="NodeTypeSpec"/>\r
99     </oneOrMore>\r
100   </define>\r
101   <define name="NodeTypeContents" combine="interleave">\r
102     <zeroOrMore>\r
103       <ref name="TypeField"/>\r
104     </zeroOrMore>\r
105   </define>\r
106   <define name="LinkType">\r
107     <element name="link_type">\r
108       <interleave>\r
109         <optional>\r
110           <attribute name="name"/>\r
111         </optional>\r
112         <optional>\r
113           <attribute name="type_name"/>\r
114         </optional>\r
115         <zeroOrMore>\r
116           <ref name="TypeField"/>\r
117         </zeroOrMore>\r
118       </interleave>\r
119     </element>\r
120   </define>\r
121   <define name="TypeField">\r
122     <element name="field">\r
123       <interleave>\r
124         <attribute name="key"/>\r
125         <attribute name="value"/>\r
126       </interleave>\r
127     </element>\r
128   </define>\r
129   <define name="VirtualName">\r
130     <attribute name="virtual_id"/>\r
131   </define>\r
132   <define name="ComponentName">\r
133     <interleave>\r
134       <optional>\r
135         <!--\r
136           This is the uuid of the aggregate that this node or link belongs\r
137           to. It is required in an advertisement.\r
138         -->\r
139         <attribute name="component_manager_uuid"/>\r
140       </optional>\r
141       <optional>\r
142         <attribute name="component_manager_urn"/>\r
143       </optional>\r
144       <optional>\r
145         <!-- User-readable name for the component -->\r
146         <attribute name="component_name"/>\r
147       </optional>\r
148       <optional>\r
149         <!-- The uuid of the physical component. -->\r
150         <attribute name="component_uuid"/>\r
151       </optional>\r
152       <optional>\r
153         <attribute name="component_urn"/>\r
154       </optional>\r
155     </interleave>\r
156   </define>\r
157   <define name="ComponentInterfaceDeclName">\r
158     <attribute name="component_id"/>\r
159   </define>\r
160   <define name="ComponentInterfaceRefName">\r
161     <interleave>\r
162       <optional>\r
163         <attribute name="component_node_uuid"/>\r
164       </optional>\r
165       <optional>\r
166         <attribute name="component_node_urn"/>\r
167       </optional>\r
168       <attribute name="component_interface_id"/>\r
169     </interleave>\r
170   </define>\r
171   <define name="InterfaceDecl">\r
172     <empty/>\r
173   </define>\r
174   <define name="InterfaceRef">\r
175     <empty/>\r
176   </define>\r
177   <define name="Location">\r
178     <element name="location">\r
179       <interleave>\r
180         <!-- The two-letter ISO 3166 code for the country the node is in. -->\r
181         <attribute name="country"/>\r
182         <optional>\r
183           <!--\r
184             Longitude and Latitude coordinates of the node using the\r
185             WGS 84 standard.\r
186           -->\r
187           <attribute name="longitude"/>\r
188         </optional>\r
189         <optional>\r
190           <attribute name="latitude"/>\r
191         </optional>\r
192       </interleave>\r
193     </element>\r
194   </define>\r
195   <define name="RSpec">\r
196     <element name="rspec">\r
197       <ref name="RSpecContents"/>\r
198     </element>\r
199   </define>\r
200   <define name="RSpecContents">\r
201     <interleave>\r
202       <optional>\r
203         <!--\r
204           When this RSpec was generated - optional, can be used for determining\r
205           staleness\r
206         -->\r
207         <attribute name="generated">\r
208           <data type="dateTime"/>\r
209         </attribute>\r
210       </optional>\r
211       <optional>\r
212         <!--\r
213           Who/what generated the rspec. This is purely informative and\r
214           should not be used for any policy consideration. The format is\r
215           not fixed.\r
216         -->\r
217         <attribute name="generated_by"/>\r
218       </optional>\r
219       <optional>\r
220         <!--\r
221           How long this rspec is valid - in the case of a ticket, this indicates\r
222           how long the holder may use the resources. For a resource request, it's\r
223           how long we want the resources. For an advertisement, it might be a hint\r
224           as to how long it's okay to cache this rspec.\r
225         -->\r
226         <attribute name="valid_until">\r
227           <data type="dateTime"/>\r
228         </attribute>\r
229       </optional>\r
230       <zeroOrMore>\r
231         <!-- One or more nodes/links -->\r
232         <ref name="NodeSpec"/>\r
233       </zeroOrMore>\r
234       <zeroOrMore>\r
235         <ref name="LinkSpec"/>\r
236       </zeroOrMore>\r
237     </interleave>\r
238   </define>\r
239 </grammar>\r