3725c6b9efb2524e3659a79e2da7bf8a7c4abf58
[contrib/iotivity.git] / service / simulator / java / eclipse-plugin / ServiceProviderPlugin / resource / Light / simple-light.raml
1 #%RAML 0.8
2 title: Simple Light
3 version: v1.0-20150910
4 schemas:
5   - LightSchema: !include simple-light.json
6     LightSchemaError: !include simple-light-error.json
7
8 /sample/light:
9   description: Resource to be exposed by any Simple Device that can act as Light.
10   displayName: Simple Light
11   get:
12     responses:
13       200:
14         body:
15           application/json:
16             schema: LightSchema
17             example: |
18               {
19                 "resourceType": "sample.light",
20                 "power":  "off"
21               }
22   put:
23     body:
24       application/json:
25         schema: LightSchema
26         example: |
27           {
28             "power":  "off",
29             "intensity": 5
30           }
31     responses:
32       200:
33         body:
34           application/json:
35             schema: LightSchema
36             example: |
37               {
38                 "power":  "off",
39                 "intensity": 5
40               }
41       403:
42         description: |
43           This response is generated by the Server when the client sends:
44             An update with an out of range property value for intensity.
45           The server responds with the range property illustrating the error.
46         body:
47           application/json:
48             schema: LightSchemaError
49             example: |
50               {
51                 "range":  "1,20"
52               }
53   post:
54     body:
55       application/json:
56         schema: LightSchema
57         example: |
58           {
59             "power":  "off"
60           }
61     responses:
62       200:
63         body:
64           application/json:
65             schema: LightSchema
66             example: |
67               {
68                 "power":  "off"
69               }
70       403:
71         description: |
72           This response is generated by the Server when the client sends:
73             An update with an out of range property value for intensity.
74           The server responds with the range property illustrating the error.
75         body:
76           application/json:
77             schema: LightSchemaError
78             example: |
79               {
80                 "range":  "1,20"
81               }