JUnit test cases for updated APIs.
[platform/upstream/iotivity.git] / service / simulator / unittests / SimulatorTest / ramls / oic.r.light.raml
1 #%RAML 0.8
2 title: OICLight
3 version: v1.0-20150910
4 schemas:
5   - OICLight:         !include oic.r.light.json
6     OICLightError:    !include oic.r.light-error.json
7 traits:
8   - interface:
9       queryParameters:
10         if:
11           enum: ["oic.if.a"]
12
13 /oic/r/light:
14   description: |
15     Resource to be exposed by any OIC Device that can act as Light.
16   displayName: OIC Light
17   is: [ interface ] # valid for all methods
18
19   get:
20     responses:
21       200:
22         body:
23           application/json:
24             schema:  |
25               {
26                   "id": "http://openinterconnect.org/schemas/oic.r.light#",
27                   "$schema": "http://json-schema.org/schema#",
28                   "title": "OIC Light",
29                   "$ref": "#/definitions/oic.r.light",
30                   "definitions": {
31                   "oic.r.light": {
32                   "type": "object",
33                   "properties": {
34                       "rt": {
35                       "type": "string",
36                       "description": "Description about resource type",
37                       "default": "oic.r.light"
38                   },
39                   "if": {
40                       "type": "string",
41                       "description": "Interface supported",
42                       "default": "oic.if.baseline"
43                   },
44                   "n": {
45                       "type": "string",
46                       "description": "Readonly, Human friendly name",
47                       "default": "OIC Light"
48                   },
49                   "power": {
50                       "type": "boolean",
51                       "description": "Light status",
52                       "default": false,
53                       "enum": [true,false]
54                   },
55                   "intensity": {
56                       "type": "integer",
57                       "description": "brightness of the light",
58                       "default": 10,
59                       "minimum": 10,
60                       "maximum": 20
61                   }
62                   }
63                   }
64                 },      
65                 "required": [ "rt","if","power" ]
66               }
67   post:
68     body:
69       application/json:
70         schema: OICLight
71     responses:
72       200:
73         body:
74           application/json:
75             schema: OICLight
76       403:
77         description: |
78           This response is generated by the OIC Server when the client sends:
79             An update with an out of range property value for intensity.
80           The server responds with the range property illustrating the error.
81         body:
82           application/json:
83             schema: OICLightError
84   put:
85     body:
86       application/json:
87         schema: OICLight
88     responses:
89       200:
90         body:
91           application/json:
92             schema: OICLight
93       403:
94         description: |
95           This response is generated by the OIC Server when the client sends:
96             An update with an out of range property value for intensity.
97           The server responds with the range property illustrating the error.
98         body:
99           application/json:
100             schema:  |
101               {
102                   "id": "http://openinterconnect.org/schemas/oic.r.light-error#",
103                   "$schema": "http://json-schema.org/draft-04/schema#",
104                   "title": "OIC Light",
105                   "$ref": "#/definitions/oic.r.light",
106                   "definitions": {
107                   "oic.r.light": {
108                   "type": "object",
109                   "properties": {
110                       "rt": {
111                           "type": "string",
112                           "description": "Description about resource type",
113                           "default": "oic.r.light"
114                       },
115                       "if": {
116                           "type": "string",
117                           "description": "Interface supported",
118                           "default": "oic.if.baseline"
119                       },
120                       "n": {
121                           "type": "string",
122                           "description": "Readonly, Human friendly name",
123                           "default": "OIC Light Error"
124                       },
125                       "intensity":  {
126                           "type": "integer",
127                           "description": "ReadOnly, Comma separated min,max values for intensity on this device",
128                           "default": "10,20"
129                       }
130                     }
131                   }
132                 }
133               }