occi-core 4.1.3 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. data/.gitignore +1 -0
  2. data/Gemfile +8 -0
  3. data/README.md +49 -17
  4. data/lib/occi/collection.rb +37 -21
  5. data/lib/occi/core/action.rb +5 -5
  6. data/lib/occi/core/action_instance.rb +45 -3
  7. data/lib/occi/core/actions.rb +2 -1
  8. data/lib/occi/core/attributes.rb +253 -73
  9. data/lib/occi/core/categories.rb +1 -0
  10. data/lib/occi/core/category.rb +25 -8
  11. data/lib/occi/core/entities.rb +1 -0
  12. data/lib/occi/core/entity.rb +51 -74
  13. data/lib/occi/core/kind.rb +15 -11
  14. data/lib/occi/core/kinds.rb +1 -1
  15. data/lib/occi/core/link.rb +14 -15
  16. data/lib/occi/core/links.rb +1 -1
  17. data/lib/occi/core/mixin.rb +5 -5
  18. data/lib/occi/core/mixins.rb +2 -2
  19. data/lib/occi/core/properties.rb +90 -12
  20. data/lib/occi/core/resource.rb +7 -3
  21. data/lib/occi/core/resources.rb +2 -2
  22. data/lib/occi/errors/attribute_definitions_converted_error.rb +5 -0
  23. data/lib/occi/errors/attribute_missing_error.rb +5 -0
  24. data/lib/occi/errors/attribute_name_invalid_error.rb +5 -0
  25. data/lib/occi/errors/attribute_not_defined_error.rb +5 -0
  26. data/lib/occi/errors/attribute_property_type_error.rb +5 -0
  27. data/lib/occi/errors/attribute_type_error.rb +5 -0
  28. data/lib/occi/errors/kind_not_defined_error.rb +5 -0
  29. data/lib/occi/errors/parser_input_error.rb +5 -0
  30. data/lib/occi/errors/parser_type_error.rb +5 -0
  31. data/lib/occi/errors.rb +1 -0
  32. data/lib/occi/extensions/hashie.rb +25 -0
  33. data/lib/occi/helpers/comparators/action_instance.rb +22 -0
  34. data/lib/occi/helpers/comparators/attributes.rb +22 -0
  35. data/lib/occi/helpers/comparators/categories.rb +22 -0
  36. data/lib/occi/helpers/comparators/category.rb +22 -0
  37. data/lib/occi/helpers/comparators/collection.rb +40 -0
  38. data/lib/occi/helpers/comparators/entities.rb +22 -0
  39. data/lib/occi/helpers/comparators/entity.rb +22 -0
  40. data/lib/occi/helpers/comparators/properties.rb +26 -0
  41. data/lib/occi/helpers/comparators.rb +1 -0
  42. data/lib/occi/infrastructure/compute.rb +11 -9
  43. data/lib/occi/infrastructure/network.rb +27 -27
  44. data/lib/occi/infrastructure/networkinterface.rb +22 -23
  45. data/lib/occi/infrastructure/os_tpl.rb +1 -1
  46. data/lib/occi/infrastructure/resource_tpl.rb +1 -1
  47. data/lib/occi/infrastructure/storage.rb +7 -6
  48. data/lib/occi/infrastructure/storagelink.rb +4 -4
  49. data/lib/occi/log.rb +13 -10
  50. data/lib/occi/model.rb +9 -8
  51. data/lib/occi/parser/json.rb +11 -9
  52. data/lib/occi/parser/ova.rb +12 -6
  53. data/lib/occi/parser/ovf.rb +173 -116
  54. data/lib/occi/parser/text/constants.rb +87 -0
  55. data/lib/occi/parser/text.rb +161 -200
  56. data/lib/occi/parser/xml.rb +10 -8
  57. data/lib/occi/parser.rb +100 -50
  58. data/lib/occi/settings.rb +2 -1
  59. data/lib/occi/version.rb +1 -1
  60. data/lib/occi-core.rb +6 -4
  61. data/occi-core.gemspec +0 -7
  62. data/spec/occi/collection_samples/collection1.json +1 -0
  63. data/spec/occi/collection_samples/directory2/collection2.json +1 -0
  64. data/spec/occi/collection_spec.rb +961 -31
  65. data/spec/occi/core/action_instance_spec.rb +317 -0
  66. data/spec/occi/core/action_spec.rb +71 -0
  67. data/spec/occi/core/attributes_spec.rb +582 -27
  68. data/spec/occi/core/category_spec.rb +194 -18
  69. data/spec/occi/core/entities_spec.rb +96 -0
  70. data/spec/occi/core/entity_spec.rb +317 -28
  71. data/spec/occi/core/kind_spec.rb +127 -16
  72. data/spec/occi/core/link_spec.rb +35 -0
  73. data/spec/occi/core/links_spec.rb +130 -0
  74. data/spec/occi/core/mixins_spec.rb +107 -0
  75. data/spec/occi/core/properties_spec.rb +167 -0
  76. data/spec/occi/core/resource_spec.rb +23 -9
  77. data/spec/occi/core_spec.rb +12 -0
  78. data/spec/occi/infrastructure/compute_spec.rb +218 -18
  79. data/spec/occi/infrastructure/network_spec.rb +96 -0
  80. data/spec/occi/infrastructure/networkinterface_spec.rb +96 -0
  81. data/spec/occi/infrastructure/storage_spec.rb +33 -0
  82. data/spec/occi/infrastructure/storagelink_spec.rb +45 -0
  83. data/spec/occi/log_spec.rb +104 -1
  84. data/spec/occi/model_spec.rb +251 -39
  85. data/spec/occi/{test.json → parser/json_samples/test.json} +0 -0
  86. data/spec/occi/parser/ova_samples/test.dump +0 -0
  87. data/spec/occi/{test.ova → parser/ova_samples/test.ova} +0 -0
  88. data/spec/occi/parser/ovf_samples/test.dump +0 -0
  89. data/spec/occi/{test.ovf → parser/ovf_samples/test.ovf} +0 -0
  90. data/spec/occi/parser/text_samples/occi_categories.dump +0 -0
  91. data/spec/occi/parser/text_samples/occi_categories.text +2 -0
  92. data/spec/occi/parser/text_samples/occi_compute_rocci_server.dump +0 -0
  93. data/spec/occi/parser/text_samples/occi_compute_rocci_server.resource.dump +0 -0
  94. data/spec/occi/parser/text_samples/occi_compute_rocci_server.text +10 -0
  95. data/spec/occi/parser/text_samples/occi_link_resource_instance.dump +0 -0
  96. data/spec/occi/parser/text_samples/occi_link_resource_instance.text +7 -0
  97. data/spec/occi/parser/text_samples/occi_link_simple.dump +0 -0
  98. data/spec/occi/parser/text_samples/occi_link_simple.link_string.dump +0 -0
  99. data/spec/occi/parser/text_samples/occi_link_simple.text +1 -0
  100. data/spec/occi/parser/text_samples/occi_link_w_attributes.dump +0 -0
  101. data/spec/occi/parser/text_samples/occi_link_w_attributes.text +7 -0
  102. data/spec/occi/parser/text_samples/occi_link_w_category.dump +0 -0
  103. data/spec/occi/parser/text_samples/occi_link_w_category.text +3 -0
  104. data/spec/occi/parser/text_samples/occi_model_rocci_server.dump +0 -0
  105. data/spec/occi/parser/text_samples/occi_model_rocci_server.text +51 -0
  106. data/spec/occi/parser/text_samples/occi_network_rocci_server.dump +0 -0
  107. data/spec/occi/parser/text_samples/occi_network_rocci_server.resource.dump +0 -0
  108. data/spec/occi/parser/text_samples/occi_network_rocci_server.text +11 -0
  109. data/spec/occi/parser/text_samples/occi_resource_w_attributes.dump +0 -0
  110. data/spec/occi/parser/text_samples/occi_resource_w_attributes.text +11 -0
  111. data/spec/occi/parser/text_samples/occi_resource_w_inline_links.dump +0 -0
  112. data/spec/occi/parser/text_samples/occi_resource_w_inline_links.text +16 -0
  113. data/spec/occi/parser/text_samples/occi_resource_w_inline_links_only.dump +0 -0
  114. data/spec/occi/parser/text_samples/occi_resource_w_inline_links_only.text +13 -0
  115. data/spec/occi/parser/text_samples/occi_storage_rocci_server.dump +0 -0
  116. data/spec/occi/parser/text_samples/occi_storage_rocci_server.resource.dump +0 -0
  117. data/spec/occi/parser/text_samples/occi_storage_rocci_server.text +9 -0
  118. data/spec/occi/parser/text_spec.rb +274 -78
  119. data/spec/occi/parser/xml_samples/test.xml +352 -0
  120. data/spec/occi/parser_spec.rb +255 -104
  121. data/spec/occi-core_spec.rb +31 -0
  122. data/spec/spec_helper.rb +6 -2
  123. metadata +110 -111
  124. checksums.yaml +0 -7
  125. data/spec/occi/core/attribute_spec.rb +0 -0
@@ -0,0 +1,352 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <occi:extension xmlns:occi="http://schemas.ogf.org/occi"
3
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
4
+ scheme="http://schemas.ogf.org/occi/infrastructure" name="infrastructure" >
5
+ <!--
6
+ Compute Resource
7
+ -->
8
+ <occi:kind term="compute" title="Compute Resource" >
9
+ <xsd:annotation>
10
+ <xsd:documentation xml:lang="en" >Information processing resources.</xsd:documentation>
11
+ </xsd:annotation>
12
+ <occi:related scheme="http://schemas.ogf.org/occi/core" term="resource" />
13
+ <occi:attribute name="occi.compute.architecture" mutable="true" >
14
+ <xsd:annotation>
15
+ <xsd:documentation xml:lang="en" >CPU architecture of the instance</xsd:documentation>
16
+ </xsd:annotation>
17
+ <xsd:simpleType>
18
+ <xsd:restriction base="xsd:string" >
19
+ <xsd:enumeration name="x86" />
20
+ <xsd:enumeration name="x64" />
21
+ </xsd:restriction>
22
+ </xsd:simpleType>
23
+ </occi:attribute>
24
+ <occi:attribute name="occi.compute.cores" type="xsd:integer" >
25
+ <xsd:annotation>
26
+ <xsd:documentation xml:lang="en" >Number of CPU cores assigned to the instance</xsd:documentation>
27
+ </xsd:annotation>
28
+ </occi:attribute>
29
+ <occi:attribute name="occi.compute.hostname" type="xsd:string" >
30
+ <xsd:annotation>
31
+ <xsd:documentation xml:lang="en" >Fully qualified DNS hostname for the instance</xsd:documentation>
32
+ </xsd:annotation>
33
+ </occi:attribute>
34
+ <occi:attribute name="occi.compute.speed" type="xsd:float" >
35
+ <xsd:annotation>
36
+ <xsd:documentation xml:lang="en" >CPU clock frequency (speed) in gigahertz</xsd:documentation>
37
+ </xsd:annotation>
38
+ </occi:attribute>
39
+ <occi:attribute name="occi.compute.memory" type="xsd:float" >
40
+ <xsd:annotation>
41
+ <xsd:documentation xml:lang="en" >Maximum RAM in gigabytes allocated to the instance</xsd:documentation>
42
+ </xsd:annotation>
43
+ </occi:attribute>
44
+ <occi:attribute name="occi.compute.state" mutable="false" use="required" >
45
+ <xsd:annotation>
46
+ <xsd:documentation xml:lang="en" >Current state of the instance</xsd:documentation>
47
+ </xsd:annotation>
48
+ <xsd:simpleType>
49
+ <xsd:restriction base="xsd:string" >
50
+ <xsd:enumeration name="active" />
51
+ <xsd:enumeration name="inactive" />
52
+ </xsd:restriction>
53
+ </xsd:simpleType>
54
+ </occi:attribute>
55
+ <occi:action scheme="./compute/action" term="start" />
56
+ <occi:action scheme="./compute/action" term="stop" >
57
+ <occi:attribute name="method" >
58
+ <xsd:simpleType>
59
+ <xsd:restriction base="xsd:string" >
60
+ <xsd:enumeration name="graceful" />
61
+ <xsd:enumeration name="acpioff" />
62
+ <xsd:enumeration name="poweroff" />
63
+ </xsd:restriction>
64
+ </xsd:simpleType>
65
+ </occi:attribute>
66
+ </occi:action>
67
+ <occi:action scheme="./compute/action" term="restart" >
68
+ <occi:attribute name="method" >
69
+ <xsd:simpleType>
70
+ <xsd:restriction base="xsd:string" >
71
+ <xsd:enumeration name="graceful" />
72
+ <xsd:enumeration name="warm" />
73
+ <xsd:enumeration name="cold" />
74
+ </xsd:restriction>
75
+ </xsd:simpleType>
76
+ </occi:attribute>
77
+ </occi:action>
78
+ <occi:action scheme="./compute/action" term="suspend" >
79
+ <occi:attribute name="method" >
80
+ <xsd:simpleType>
81
+ <xsd:restriction base="xsd:string" >
82
+ <xsd:enumeration name="hibernate" />
83
+ <xsd:enumeration name="suspend" />
84
+ </xsd:restriction>
85
+ </xsd:simpleType>
86
+ </occi:attribute>
87
+ </occi:action>
88
+ </occi:kind>
89
+ <!--
90
+ Storage Resource
91
+ -->
92
+ <occi:kind term="storage" title="Storage Resource" >
93
+ <xsd:annotation>
94
+ <xsd:documentation xml:lang="en" >Information recording resources.</xsd:documentation>
95
+ </xsd:annotation>
96
+ <occi:related scheme="http://schemas.ogf.org/occi/core" term="resource" />
97
+ <occi:attribute name="occi.storage.size" type="xsd:float" use="required" >
98
+ <xsd:annotation>
99
+ <xsd:documentation xml:lang="en" >Storage size in gigabytes of the instance.</xsd:documentation>
100
+ </xsd:annotation>
101
+ </occi:attribute>
102
+ <occi:attribute name="occi.storage.state" mutable="false" use="required" >
103
+ <xsd:annotation>
104
+ <xsd:documentation xml:lang="en" >Current status of the instance</xsd:documentation>
105
+ </xsd:annotation>
106
+ <xsd:simpleType>
107
+ <xsd:restriction base="xsd:string" >
108
+ <xsd:enumeration name="online" />
109
+ <xsd:enumeration name="offline" />
110
+ <xsd:enumeration name="backup" />
111
+ <xsd:enumeration name="snapshot" />
112
+ <xsd:enumeration name="resize" />
113
+ <xsd:enumeration name="degraded" />
114
+ </xsd:restriction>
115
+ </xsd:simpleType>
116
+ </occi:attribute>
117
+ <occi:action scheme="./storage/action" term="online" />
118
+ <occi:action scheme="./storage/action" term="offline" />
119
+ <occi:action scheme="./storage/action" term="backup" />
120
+ <occi:action scheme="./storage/action" term="snapshot" />
121
+ <occi:action scheme="./storage/action" term="resize" >
122
+ <occi:attribute name="size" type="xsd:float" >
123
+ <xsd:annotation>
124
+ <xsd:documentation xml:lang="en" >gigabytes</xsd:documentation>
125
+ </xsd:annotation>
126
+ </occi:attribute>
127
+ </occi:action>
128
+ </occi:kind>
129
+ <!--
130
+ StorageLink Link
131
+ -->
132
+ <occi:kind term="storagelink" title="StorageLink Link" >
133
+ <occi:related scheme="http://schemas.ogf.org/occi/core" term="link" />
134
+ <occi:attribute name="occi.storagelink.deviceid" use="required" type="xsd:string" >
135
+ <xsd:annotation>
136
+ <xsd:documentation xml:lang="en" >
137
+ Device identifier as defined by the OCCI service provider.
138
+ </xsd:documentation>
139
+ </xsd:annotation>
140
+ </occi:attribute>
141
+ <occi:attribute name="occi.storagelink.mountpoint" type="xsd:string" >
142
+ <xsd:annotation>
143
+ <xsd:documentation xml:lang="en" >
144
+ Point to where the storage is mounted in the guest OS.
145
+ </xsd:documentation>
146
+ </xsd:annotation>
147
+ </occi:attribute>
148
+ <occi:attribute name="occi.storagelink.state" use="required" mutable="false" >
149
+ <xsd:annotation>
150
+ <xsd:documentation xml:lang="en" >
151
+ Current status of the instance.
152
+ </xsd:documentation>
153
+ </xsd:annotation>
154
+ <xsd:simpleType>
155
+ <xsd:restriction base="xsd:string" >
156
+ <xsd:enumeration name="active" />
157
+ <xsd:enumeration name="inactive" />
158
+ </xsd:restriction>
159
+ </xsd:simpleType>
160
+ </occi:attribute>
161
+ </occi:kind>
162
+ <!--
163
+ Network
164
+ -->
165
+ <occi:kind term="network" title="Network Resource" >
166
+ <xsd:annotation>
167
+ <xsd:documentation xml:lang="en" >
168
+ Interconnection resoruce and represents a L2 networking
169
+ resource. This is complimented by the IPNetwork Mixin.
170
+ </xsd:documentation>
171
+ </xsd:annotation>
172
+ <occi:related scheme="http://schemas.ogf.org/occi/core" term="resource" />
173
+ <occi:attribute name="occi.network.vlan" mutable="true" >
174
+ <xsd:simpleType>
175
+ <xsd:restriction base="xsd:integer" >
176
+ <xsd:minInclusive value="0" />
177
+ <xsd:maxInclusive value="4095" />
178
+ </xsd:restriction>
179
+ </xsd:simpleType>
180
+ <xsd:annotation>
181
+ <xsd:documentation xml:lang="en" >802.1q VLAN identifier (e.g 343)</xsd:documentation>
182
+ </xsd:annotation>
183
+ </occi:attribute>
184
+ <occi:attribute name="occi.network.label" mutable="true" type="xsd:string" >
185
+ <xsd:annotation>
186
+ <xsd:documentation xml:lang="en" >Tag based VLANs (e.g. external-dmz)</xsd:documentation>
187
+ </xsd:annotation>
188
+ </occi:attribute>
189
+ <occi:attribute name="occi.network.state" mutable="false" use="required" >
190
+ <xsd:annotation>
191
+ <xsd:documentation xml:lang="en" >Current state of the instance</xsd:documentation>
192
+ </xsd:annotation>
193
+ <xsd:simpleType>
194
+ <xsd:restriction base="xsd:string" >
195
+ <xsd:enumeration name="active" />
196
+ <xsd:enumeration name="inactive" />
197
+ </xsd:restriction>
198
+ </xsd:simpleType>
199
+ </occi:attribute>
200
+ <occi:action scheme="./network/action" term="up" />
201
+ <occi:action scheme="./network/action" term="down" />
202
+ </occi:kind>
203
+ <!--
204
+ NetworkInterface Link
205
+ -->
206
+ <occi:kind term="networkinterface" title="NetworkInterface Link" >
207
+ <occi:related scheme="http://schemas.ogf.org/occi/core" term="link" />
208
+ <occi:attribute name="occi.networkinterface.interface" mutable="false" type="xsd:string" use="required" >
209
+ <xsd:annotation>
210
+ <xsd:documentation xml:lang="en" >
211
+ Identifier that relates the link to the link's device
212
+ interface.
213
+ </xsd:documentation>
214
+ </xsd:annotation>
215
+ </occi:attribute>
216
+ <occi:attribute name="occi.networkinterface.mac" type="occi:mac802" use="required" >
217
+ <xsd:annotation>
218
+ <xsd:documentation xml:lang="en" >
219
+ MAC address associated with the link's device interface.
220
+ </xsd:documentation>
221
+ </xsd:annotation>
222
+ </occi:attribute>
223
+ <occi:attribute name="occi.networkinterface.state" mutable="false" use="required" >
224
+ <xsd:annotation>
225
+ <xsd:documentation xml:lang="en" >Current status of the instance.</xsd:documentation>
226
+ </xsd:annotation>
227
+ <xsd:simpleType>
228
+ <xsd:restriction base="xsd:string" >
229
+ <xsd:enumeration name="active" />
230
+ <xsd:enumeration name="inactive" />
231
+ </xsd:restriction>
232
+ </xsd:simpleType>
233
+ </occi:attribute>
234
+ </occi:kind>
235
+ <!--
236
+ IP Networking Mixin
237
+ -->
238
+ <occi:mixin term="ipnetwork" title="IP Networking Mixin" scheme="./network" >
239
+ <xsd:annotation>
240
+ <xsd:documentation xml:lang="en" >
241
+ IPNetworking Mixin is defined in order to support L3/L4 capabilities
242
+ </xsd:documentation>
243
+ </xsd:annotation>
244
+ <occi:attribute name="occi.network.address" type="occi:cidr" >
245
+ <xsd:annotation>
246
+ <xsd:documentation xml:lang="en" >
247
+ Internet Protocol (IP) network address (e.g. 192.168.0.1/24, fc00::/7)
248
+ </xsd:documentation>
249
+ </xsd:annotation>
250
+ </occi:attribute>
251
+ <occi:attribute name="occi.network.gateway" type="occi:ip" >
252
+ <xsd:annotation>
253
+ <xsd:documentation xml:lang="en" >
254
+ Internet Protocol (IP) network address (e.g. 192.168.0.1, fc00::/7)
255
+ </xsd:documentation>
256
+ </xsd:annotation>
257
+ </occi:attribute>
258
+ <occi:attribute name="occi.network.allocation" use="required" >
259
+ <xsd:annotation>
260
+ <xsd:documentation xml:lang="en" >
261
+ Address allocation mechanism, 'dynamic' e.g. uses the
262
+ dynamic host configuration protocol, 'static' e.g. uses
263
+ user supplied static network configurations.
264
+ </xsd:documentation>
265
+ </xsd:annotation>
266
+ <xsd:simpleType>
267
+ <xsd:restriction base="xsd:string" >
268
+ <xsd:enumeration name="dynamic" />
269
+ <xsd:enumeration name="static" />
270
+ </xsd:restriction>
271
+ </xsd:simpleType>
272
+ </occi:attribute>
273
+ </occi:mixin>
274
+ <!--
275
+ IP NetworkInterface Mixin
276
+ -->
277
+ <occi:mixin term="ipnetworkinterface" title="IP Network Interface Mixin" scheme="./networkinterface" >
278
+ <xsd:annotation>
279
+ <xsd:documentation xml:lang="en" >
280
+ IPNetworkInterface mixin is described in order for
281
+ NetworkInterface to support L3/L4 capabilities (e.g. IP, TCP
282
+ etc.).
283
+ </xsd:documentation>
284
+ </xsd:annotation>
285
+ <occi:attribute name="occi.networkinterface.address" type="occi:cidr" use="required" >
286
+ <xsd:annotation>
287
+ <xsd:documentation xml:lang="en" >
288
+ Internet Procotol (IP) network address (e.g. 192.168.0.1/24,
289
+ fc00::/7) of the link.
290
+ </xsd:documentation>
291
+ </xsd:annotation>
292
+ </occi:attribute>
293
+ <occi:attribute name="occi.networkinterface.gateway" type="occi:ip">
294
+ <xsd:annotation>
295
+ <xsd:documentation xml:lang="en" >
296
+ Internet Protocol (IP) network address (e.g. 192.168.0.1/24, fc00::/7)
297
+ </xsd:documentation>
298
+ </xsd:annotation>
299
+ </occi:attribute>
300
+ <occi:attribute name="occi.networkinterface.allocation" use="required" >
301
+ <xsd:annotation>
302
+ <xsd:documentation xml:lang="en" >
303
+ Address mechanism, 'dynamic' e.g. uses the
304
+ dynamic host configuration protocol, 'static' e.g. uses
305
+ user supplied static network configurations.
306
+ </xsd:documentation>
307
+ </xsd:annotation>
308
+ <xsd:simpleType>
309
+ <xsd:restriction base="xsd:string" >
310
+ <xsd:enumeration name="dynamic" />
311
+ <xsd:enumeration name="static" />
312
+ </xsd:restriction>
313
+ </xsd:simpleType>
314
+ </occi:attribute>
315
+ </occi:mixin>
316
+ <!--
317
+ OS template
318
+ -->
319
+ <occi:mixin term="os_tpl" title="OS Template" />
320
+ <!--
321
+ Resource template
322
+ -->
323
+ <occi:mixin term="resource_tpl" title="Resoruce template" />
324
+ <!--
325
+ Attribute Types
326
+ -->
327
+ <xsd:simpleType name="ip">
328
+ <xsd:annotation>
329
+ <xsd:documentation xml:lang="en">
330
+ The datatype denoting a string corresponding to a IPv4 or IPv6 address.
331
+ </xsd:documentation>
332
+ </xsd:annotation>
333
+ <xsd:restriction base="xsd:string">
334
+ <xsd:pattern value="(((([1-9]?\d|1\d{2}|2[0-4]\d|25[0-5])\.){3}([1-9]?\d|1\d{2}|2[0-4]\d|25[0-5]))|((([\da-fA-F]{1,4})|(\:))\:){7}(([\da-fA-F]{1,4})|(\:))))"/>
335
+ </xsd:restriction>
336
+ </xsd:simpleType>
337
+ <xsd:simpleType name="cidr" >
338
+ <xsd:annotation>
339
+ <xsd:documentation xml:lang="en">
340
+ The datatype denoting a string corresponding to a CIDR block.
341
+ </xsd:documentation>
342
+ </xsd:annotation>
343
+ <xsd:restriction base="xsd:string">
344
+ <xsd:pattern value="(((([1-9]?\d|1\d{2}|2[0-4]\d|25[0-5])\.){3}([1-9]?\d|1\d{2}|2[0-4]\d|25[0-5])\/(\d|[1-2]\d|3[0-2]))|((([\da-fA-F]{0,4})|(\:))\:){7}(([\da-fA-F]{0,4})|(\:)))\/([1-9]?\d|1[01]\d|12[0-8])))"/>
345
+ </xsd:restriction>
346
+ </xsd:simpleType>
347
+ <xsd:simpleType name="mac802" >
348
+ <xsd:restriction base="xsd:string" >
349
+ <xsd:pattern value="[\da-fA-F]{2}(\:[\da-fA-F]){5}" />
350
+ </xsd:restriction>
351
+ </xsd:simpleType>
352
+ </occi:extension>