forked from OpenInterConnect/IoTDataModels
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConsumablesBaselineResURI.swagger.json
More file actions
515 lines (513 loc) · 23.1 KB
/
ConsumablesBaselineResURI.swagger.json
File metadata and controls
515 lines (513 loc) · 23.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
{
"swagger": "2.0",
"info": {
"title": "Consumables",
"version": "OCF-v1.0.0-20160620",
"license": {
"name": "copyright 2016-2017 Open Connectivity Foundation, Inc. All rights reserved.",
"x-description": "Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE Open Connectivity Foundation, INC. \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE OR WARRANTIES OF NON-INFRINGEMENT, ARE DISCLAIMED.\n IN NO EVENT SHALL THE Open Connectivity Foundation, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
}
},
"schemes": ["http"],
"consumes": ["application/json"],
"produces": ["application/json"],
"paths": {
"/ConsumablesLLResURI" : {
"get": {
"description": "This resource specifies things that can be consumed such as filter material, printer toner etc\nThe resource is a collection of instances of oic.r.consumable detailing the individual consumed items\nsupportedconsumables is the set of consumable types that this instance of the Resource supports\n",
"parameters": [
{"$ref": "#/parameters/interface-ll"}
],
"responses": {
"200": {
"description" : "",
"x-example":
[
{"href": "/myTonerBlackResURI", "rt": ["oic.r.consumable"], "if": ["oic.if.s","oic.if.baseline"], "eps": [{"ep": "coaps://[fe80::b1d6]:1122"}]},
{"href": "/myTonerCyanResURI", "rt": ["oic.r.consumable"], "if": ["oic.if.s","oic.if.baseline"], "eps": [{"ep": "coaps://[fe80::b1d6]:1122"}]},
{"href": "/myTonerMagentaResURI", "rt": ["oic.r.consumable"], "if": ["oic.if.s","oic.if.baseline"], "eps": [{"ep": "coaps://[fe80::b1d6]:1122"}]},
{"href": "/myTonerYellowResURI", "rt": ["oic.r.consumable"], "if": ["oic.if.s","oic.if.baseline"], "eps": [{"ep": "coaps://[fe80::b1d6]:1122"}]}
]
,
"schema": { "$ref": "#/definitions/consumables-ll" }
}
}
}
},
"/ConsumablesBaselineResURI" : {
"get": {
"description": "This resource specifies things that can be consumed such as filter material, printer toner etc\nThe resource is a collection of instances of oic.r.consumable detailing the individual consumed items\nsupportedconsumables is the set of consumable types that this instance of the Resource supports\n",
"parameters": [
{"$ref": "#/parameters/interface-baseline"}
],
"responses": {
"200": {
"description" : "",
"x-example":
{
"rt": ["oic.r.consumablecollection","oic.wk.col"],
"id": "unique_example_id",
"rts": ["oic.r.consumable","oic.r.value.conditional"],
"supportedconsumables": ["tonerBlack","tonerCyan","tonerMagenta","tonerYellow"],
"links": [
{"href": "/myTonerBlackResURI", "rt": ["oic.r.consumable"], "if": ["oic.if.s","oic.if.baseline"], "eps": [{"ep": "coaps://[fe80::b1d6]:1122"}]},
{"href": "/myTonerCyanResURI", "rt": ["oic.r.consumable"], "if": ["oic.if.s","oic.if.baseline"], "eps": [{"ep": "coaps://[fe80::b1d6]:1122"}]},
{"href": "/myTonerMagentaResURI", "rt": ["oic.r.consumable"], "if": ["oic.if.s","oic.if.baseline"], "eps": [{"ep": "coaps://[fe80::b1d6]:1122"}]},
{"href": "/myTonerYellowResURI", "rt": ["oic.r.consumable"], "if": ["oic.if.s","oic.if.baseline"], "eps": [{"ep": "coaps://[fe80::b1d6]:1122"}]}
]
}
,
"schema": { "$ref": "#/definitions/consumables" }
}
}
}
}
},
"parameters": {
"interface-ll" : {
"in" : "query",
"name" : "if",
"type" : "string",
"enum" : ["oic.if.ll"]
},
"interface-baseline" : {
"in" : "query",
"name" : "if",
"type" : "string",
"enum" : ["oic.if.baseline"]
}
},
"definitions": {
"consumables-ll" :
{
"allOf": [
{
"description": "All forms of links in a collection",
"oneOf": [
{
"description": "A set (array) of simple or individual OIC Links. In addition to properties required for an OIC Link, the identifier for that link in this set is also required",
"items": {
"properties": {
"anchor": {
"description": "This is used to override the context URI e.g. override the URI of the containing collection",
"format": "uri",
"maxLength": 256,
"type": "string"
},
"di": {
"description": "Unique identifier for device (UUID)",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
"type": "string"
},
"eps": {
"description": "the Endpoint information of the target Resource",
"items": {
"properties": {
"ep": {
"description": "URI with Transport Protocol Suites + Endpoint Locator as specified in 10.2.1",
"format": "uri",
"type": "string"
},
"pri": {
"description": "The priority among multiple Endpoints as specified in 10.2.3",
"minimum": 1,
"type": "integer"
}
},
"type": "object"
},
"type": "array"
},
"href": {
"description": "This is the target URI, it can be specified as a Relative Reference or fully-qualified URI. Relative Reference should be used along with the di parameter to make it unique.",
"format": "uri",
"maxLength": 256,
"type": "string"
},
"if": {
"description": "The interface set supported by this resource",
"items": {
"enum": [
"oic.if.baseline",
"oic.if.ll",
"oic.if.b",
"oic.if.rw",
"oic.if.r",
"oic.if.a",
"oic.if.s"
],
"type": "string"
},
"minItems": 1,
"type": "array"
},
"ins": {
"description": "The instance identifier for this web link in an array of web links - used in collections",
"oneOf": [
{
"description": "An ordinal number that is not repeated - must be unique in the collection context",
"type": "integer"
},
{
"description": "Any unique string including a URI",
"format": "uri",
"maxLength": 256,
"type": "string"
},
{
"description": "Unique identifier (UUID)",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
"type": "string"
}
]
},
"p": {
"description": "Specifies the framework policies on the Resource referenced by the target URI",
"properties": {
"bm": {
"description": "Specifies the framework policies on the Resource referenced by the target URI for e.g. observable and discoverable",
"type": "integer"
}
},
"required": [
"bm"
],
"type": "object"
},
"rel": {
"description": "The relation of the target URI referenced by the link to the context URI",
"oneOf": [
{
"default": [
"hosts"
],
"items": {
"maxLength": 64,
"type": "string"
},
"minItems": 1,
"type": "array"
},
{
"default": "hosts",
"maxLength": 64,
"type": "string"
}
]
},
"rt": {
"description": "Resource Type",
"items": {
"maxLength": 64,
"type": "string"
},
"minItems": 1,
"type": "array"
},
"title": {
"description": "A title for the link relation. Can be used by the UI to provide a context",
"maxLength": 64,
"type": "string"
},
"type": {
"default": "application/cbor",
"description": "A hint at the representation of the resource referenced by the target URI. This represents the media types that are used for both accepting and emitting",
"items": {
"maxLength": 64,
"type": "string"
},
"minItems": 1,
"type": "array"
}
},
"required": [
"href",
"rt",
"if"
],
"type": "object"
},
"type": "array"
}
]
}
]
}
,
"consumables" :
{
"allOf": [
{
"description": "A collection is a set (array) of tagged-link or set (array) of simple links along with additional properties to describe the collection itself",
"properties": {
"di": {
"description": "The device ID which is an UUIDv4 string; used for backward compatibility with Spec A definition of /oic/res",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
"type": "string"
},
"drel": {
"description": "When specified this is the default relationship to use when an OIC Link does not specify an explicit relationship with *rel* parameter",
"type": "string"
},
"id": {
"anyOf": [
{
"description": "A number that is unique to that collection; like an ordinal number that is not repeated",
"type": "integer"
},
{
"description": "A unique string that could be a hash or similarly unique",
"type": "string"
},
{
"description": "A unique string that could be a UUIDv4",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
"type": "string"
}
],
"description": "ID for the collection. Can be an value that is unique to the use context or a UUIDv4"
},
"links": {
"description": "All forms of links in a collection",
"oneOf": [
{
"description": "A set (array) of simple or individual OIC Links. In addition to properties required for an OIC Link, the identifier for that link in this set is also required",
"items": {
"properties": {
"anchor": {
"description": "This is used to override the context URI e.g. override the URI of the containing collection",
"format": "uri",
"maxLength": 256,
"type": "string"
},
"di": {
"description": "Unique identifier for device (UUID)",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
"type": "string"
},
"eps": {
"description": "the Endpoint information of the target Resource",
"items": {
"properties": {
"ep": {
"description": "URI with Transport Protocol Suites + Endpoint Locator as specified in 10.2.1",
"format": "uri",
"type": "string"
},
"pri": {
"description": "The priority among multiple Endpoints as specified in 10.2.3",
"minimum": 1,
"type": "integer"
}
},
"type": "object"
},
"type": "array"
},
"href": {
"description": "This is the target URI, it can be specified as a Relative Reference or fully-qualified URI. Relative Reference should be used along with the di parameter to make it unique.",
"format": "uri",
"maxLength": 256,
"type": "string"
},
"if": {
"description": "The interface set supported by this resource",
"items": {
"enum": [
"oic.if.baseline",
"oic.if.ll",
"oic.if.b",
"oic.if.rw",
"oic.if.r",
"oic.if.a",
"oic.if.s"
],
"type": "string"
},
"minItems": 1,
"type": "array"
},
"ins": {
"description": "The instance identifier for this web link in an array of web links - used in collections",
"oneOf": [
{
"description": "An ordinal number that is not repeated - must be unique in the collection context",
"type": "integer"
},
{
"description": "Any unique string including a URI",
"format": "uri",
"maxLength": 256,
"type": "string"
},
{
"description": "Unique identifier (UUID)",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
"type": "string"
}
]
},
"p": {
"description": "Specifies the framework policies on the Resource referenced by the target URI",
"properties": {
"bm": {
"description": "Specifies the framework policies on the Resource referenced by the target URI for e.g. observable and discoverable",
"type": "integer"
}
},
"required": [
"bm"
],
"type": "object"
},
"rel": {
"description": "The relation of the target URI referenced by the link to the context URI",
"oneOf": [
{
"default": [
"hosts"
],
"items": {
"maxLength": 64,
"type": "string"
},
"minItems": 1,
"type": "array"
},
{
"default": "hosts",
"maxLength": 64,
"type": "string"
}
]
},
"rt": {
"description": "Resource Type",
"items": {
"maxLength": 64,
"type": "string"
},
"minItems": 1,
"type": "array"
},
"title": {
"description": "A title for the link relation. Can be used by the UI to provide a context",
"maxLength": 64,
"type": "string"
},
"type": {
"default": "application/cbor",
"description": "A hint at the representation of the resource referenced by the target URI. This represents the media types that are used for both accepting and emitting",
"items": {
"maxLength": 64,
"type": "string"
},
"minItems": 1,
"type": "array"
}
},
"required": [
"href",
"rt",
"if"
],
"type": "object"
},
"type": "array"
}
]
},
"rts": {
"description": "Defines the list of allowable resource types (for Target and anchors) in links included in the collection; new links being created can only be from this list",
"items": {
"maxLength": 64,
"type": "string"
},
"minItems": 1,
"readOnly": true,
"type": "array"
}
},
"type": "object"
},
{
"properties": {
"id": {
"description": "Instance ID of this specific resource",
"maxLength": 64,
"readOnly": true,
"type": "string"
},
"if": {
"description": "The interface set supported by this resource",
"items": {
"enum": [
"oic.if.baseline",
"oic.if.ll",
"oic.if.b",
"oic.if.lb",
"oic.if.rw",
"oic.if.r",
"oic.if.a",
"oic.if.s"
],
"type": "string"
},
"minItems": 1,
"readOnly": true,
"type": "array"
},
"n": {
"description": "Friendly name of the resource",
"maxLength": 64,
"readOnly": true,
"type": "string"
},
"rt": {
"items": {
"enum": [
"oic.r.consumablecollection",
"oic.wk.col"
]
},
"maxItems": 2,
"minItems": 2,
"type": "array",
"uniqueItems": true
},
"rts": {
"items": {
"anyOf": [
{
"enum": [
"oic.r.consumable",
"oic.r.value.conditional"
]
},
{
"enum": [
"oic.r.consumable"
]
}
]
},
"maxItems": 2,
"minItems": 1,
"type": "array",
"uniqueItems": true
},
"supportedconsumables": {
"description": "Array of possible consumables the device measures.",
"items": {
"type": "string"
},
"readOnly": true,
"type": "array"
}
}
}
],
"type": "object"
}
}
}