-
Notifications
You must be signed in to change notification settings - Fork 1
/
oic.r.action.batchcreate.raml
312 lines (268 loc) · 8.92 KB
/
oic.r.action.batchcreate.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
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
#%RAML 0.8
# RAML for OCF Action.
# Resource type representing an Action which may be performed on a resource
# describes the action type, the mathod for invoking the action, and
# resource types which may be invoked in the payload
# Supports the update pattern, where oic.r.actuation is composed onto another
# resource, or the create pattern, where oic.r.action contains a
# collection of oic.r.actuation instances
title: OCF Action
version: 0.1
documentation:
- title: OCF Action
content: |
Parameters for invoking an Action on a resource
- title: Introduction
content: |
This resource type exposes properties that inform the client how to invoke
an action on the resource that uses oic.r.action
- title: Resource Design
content: |
This resource type may be used as standalone resource type or composed onto
the resources being actuated. It describes what the action does and how
to invoke it
The oic.if.r interface exposes the actuation controls for type, method,
and resource types
The oic.if.a interface optionally exposes the actuation resource if the
create pattern is being used
schemas:
- schema-baseline: !include schemas/oic.r.action.schema-baseline.json
- schema-ll: !include schemas/oic.r.action.schema-ll.json
- schema-r: !include schemas/oic.r.action.schema-r.json
- schema-a: !include schemas/oic.r.action.schema-a.json
- schema-b: !include schemas/oic.r.action.schema-b.json
- schema-bc: !include schemas/oic.r.action.schema-bc.json
traits:
- interface-baseline:
queryParameters:
if:
enum: ["oic.if.baseline"]
- interface-r:
queryParameters:
if:
enum: ["oic.if.r"]
- interface-a:
queryParameters:
if:
enum: ["oic.if.a"]
- interface-b:
queryParameters:
if:
enum: ["oic.if.b"]
- interface-ll:
queryParameters:
if:
enum: ["oic.if.ll"]
- interface-bc:
queryParameters:
if:
enum: ["oic.if.bc"]
/ActionBaselineURI:
description: |
The oic.if.baseline interface exposes a representation of
the links and the properties
displayName: Action Baseline
is: [ interface-baseline ]
get:
description: |
Retrieve on Baseline Interface
responses:
200:
body:
application/json:
schema: schema-baseline
example: |
{
"rt": ["oic.wk.col", "oic.r.action"],
"if": ["oic.if.baseline", "oic.if.b", "oic.if.ll", "oic.if.a", "oic.if.r"],
"rts": ["oic.r.actuation"],
"action.type": ["moveto", "level"],
"action.method": "oic.method.create",
"action.if": "oic.if.a",
"action.rts": ["oic.r.brightness", "oic.r.ramptime"],
"links": [
{
"href": "0000001c",
"rt": ["oic.r.actuation"],
"if": ["oic.if.rw", "oic.if.baseline"]
},
{
"href": "0000001d",
"rt": ["oic.r.actuation"],
"if": ["oic.if.rw", "oic.if.baseline"]
}
]
}
/ActionDescriptionURI:
description: |
The oic.if.r interface exposes a representation of static properties
displayName: Read Action static properties
is: [ interface-r ]
get:
description: |
Retrieve Action static properties
responses:
200:
description: "return the static properties describing the Action"
body:
application/json:
schema: schema-r
example: |
[
{
"action.type": ["moveto", "level"],
"action.method": "oic.method.create",
"action.if": "oic.if.bc",
"action.rts": ["oic.r.brightness", "oic.r.ramptime"]
}
]
/ActionBatchCreateURI:
description: |
The oic.if.bc interface allows invoking an action using batch create
THe payload is used to create a new actuation resource in the collection
displayName: Invoke Action using Create
is: [ interface-bc ]
post:
description: |
Invoke the action by creating an actuation
body:
application/json:
schema: schema-bc
example: |
[
{
"href": "0000001c",
"rt": ["oic.r.actuation"],
"if": ["oic.if.rw", "oic.if.r", "oic.if.baseline"],
"ins": "0000001c",
"rep": {
"rt": ["oic.r.actuation"],
"if": ["oic.if.rw", "oic.if.r", "oic.if.baseline"]
"actuation.progress": 0,
"actuation.status": "pending",
"actuation.payload": {
"brightness": 217,
"ramptime": 30
}
}
}
]
responses:
201:
description: Created
headers: {"Location": {"type": "string"}}
body:
application/json:
schema: schema-bc
example: |
[
{
"href": "0000001c",
"rt": ["oic.r.actuation"],
"if": ["oic.if.rw", "oic.if.r", "oic.if.baseline"],
"ins": "0000001c",
"rep": {
"rt": ["oic.r.actuation"],
"if": ["oic.if.rw", "oic.if.r", "oic.if.baseline"]
"actuation.progress": 0,
"actuation.status": "pending",
"actuation.payload": {
"brightness": 217,
"ramptime": 30
}
}
}
]
/ActionSimpleCreateURI:
description: |
The oic.if.a interface allows invoking an action using the create pattern
THe payload is used to create a new actuation resource in the collection
displayName: Invoke Action using Create
is: [ interface-a ]
post:
description: |
Invoke the action by creating an actuation
responses:
201:
description: Created
headers: {"Location": {"type": "string"}}
body:
application/json:
schema: schema-a
example: |
[
{
"brightness": 217,
"ramptime": 30
}
]
/ActionListBatchURI:
description: |
The oic.if.b interface exposes the list of actuations in batch format
displayName: Batch List of Actuations
is: [ interface-b ]
get:
description: |
List of Actuations in batch format
responses:
205:
description: Content returned
headers:
body:
application/json:
schema: schema-b
example: |
[
{
"href": "0000001c",
"rep":
{
"actuation.status": "completed",
"actuation.progress": "100"
"actuation.payload":
{
"brightness": 55,
"ramptime": 30
}
}
},
{
"href": "0000001d",
"rep":
{
"actuation.status": "completed",
"actuation.progress": "100"
"actuation.payload":
{
"brightness": 217,
"ramptime": 30
}
}
}
]
/ActionLinksURI:
description: |
The oic.if.ll interface exposes a representation of the links
displayName: Link List Representation
is: [ interface-ll ]
get:
description: |
Retrieve the list of pending, running, and completed actuations
responses:
200:
body:
application/json:
schema: schema-ll
example: |
[
{
"href": "0000001c",
"rt": ["oic.r.actuation"],
"if": ["oic.if.rw", "oic.if.baseline"]
},
{
"href": "0000001d",
"rt": ["oic.r.actuation"],
"if": ["oic.if.rw", "oic.if.baseline"]
}
]