forked from openconnectivityfoundation/core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
oic.wk.atomicmeasurement.raml
179 lines (155 loc) · 5.28 KB
/
oic.wk.atomicmeasurement.raml
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
#%RAML 0.8
#RAML for Atomic Measurement.
#
title: Atomic Measurement
version: 1.0
documentation:
- title: OCF Copyright
content: Copyright (c) 2018 Open Connectivity Foundation, Inc. All rights reserved.
- title: OCF License
content: !include LICENSE.md
- title: OCF Disclaimer
content: !include DISCLAIMER.md
- title: Atomic Measurement
content: |
Atomic Measurement is a specialization of the collection design pattern to insure
that the linked resources are only accessed together.
Atomic Measurement exposes properties of linked resources only through the oic.if.b interface,
thus ensuring that all of the items are accessed "atomically" in the batch.
- title: Resource Design
content: |
The Atomic Measurement resource is specified as three Base URIs, one
for each interface which is supported by the Atomic Measurement.
These three URIs are defined as the same URI path, only distinguished
by the different query parameter traits.
schemas:
- baseline: !include schemas/oic.collection-schema.json
- batch-retrieve: !include schemas/oic.collection.batch-retrieve-schema.json
- links: !include schemas/oic.collection.linkslist-schema.json
traits:
- interface-all:
queryParameters:
if:
enum: ["oic.if.b", "oic.if.ll", "oic.if.baseline"]
- interface-baseline:
queryParameters:
if:
enum: ["oic.if.baseline"]
- interface-b:
queryParameters:
if:
enum: ["oic.if.b"]
- interface-ll:
queryParameters:
if:
enum: ["oic.if.ll"]
/AtomicMeasurementResURI?if=oic.if.baseline:
description: |
The oic.if.baseline interface exposes a representation of the links and
the common properties of the Atomic Measurement resource.
displayName: Atomic Measurement
is: [ interface-baseline ]
get:
description: |
Retrieve on Baseline Interface
responses:
200:
body:
application/json:
schema: baseline
example: |
{
"rt": ["oic.wk.atomicmeasurement"],
"if": ["oic.if.b", "oic.if.ll", "oic.if.baseline"],
"rts": [ "oic.r.temperature", "oic.r.body.location.temperature", "oic.r.time.stamp" ],
"rts-m": [ "oic.r.temperature", "oic.r.body.location.temperature", "oic.r.time.stamp" ],
"links": [
{
"href": "temperature",
"rt": ["oic.r.temperature"],
"if": ["oic.if.s", "oic.if.baseline"]
},
{
"href": "bodylocation",
"rt": ["oic.r.body.location.temperature"],
"if": ["oic.if.s", "oic.if.baseline"]
},
{
"href": "timestamp",
"rt": ["oic.r.time.stamp"],
"if": ["oic.if.s", "oic.if.baseline"]
}
]
}
/AtomicMeasurementResURI?if=oic.if.b:
description: |
The oic.if.b interface returns data items retrieved from resources pointed to by the links.
displayName: Atomic Measurement
is: [ interface-b ]
get:
description: |
Retrieve the data elements of the Atomic Measurement using the OCF Batch Interface
responses:
200:
description: |
Normal response, no errors, all properties are returned correctly
body:
application/json:
schema: batch-retrieve
example: |
[
{
"href": "temperature",
"rep":
{
"temperature": 38,
"units": "C",
"range": [25, 45]
}
},
{
"href": "bodylocation",
"rep":
{
"bloc": "ear"
}
},
{
"href": "timestamp",
"rep":
{
"timestamp": "2007-04-05T14:30+09:00"
}
}
]
/AtomicMeasurementResURI?if=oic.if.ll:
description: |
The oic.if.ll interface exposes a representation of the links
displayName: Atomic Measurement
is: [ interface-ll ]
get:
description: |
Retrieve on Link List Interface
responses:
200:
body:
application/json:
schema: links
example: |
[
{
"href": "temperature",
"rt": ["oic.r.temperature"],
"if": ["oic.if.s", "oic.if.baseline"]
},
{
"href": "bodylocation",
"rt": ["oic.r.body.location.temperature"],
"if": ["oic.if.s", "oic.if.baseline"]
},
{
"href": "timestamp",
"rt": ["oic.r.time.stamp"],
"if": ["oic.if.s", "oic.if.baseline"]
}
]