64f19d8244146f7e0dc41dfb26e68be8e954a665
[nonrtric.git] / r-app-catalogue / api / rac-api.json
1 {
2     "openapi": "3.0.0",
3     "info": {
4         "title": "rAPP Catalogue API",
5         "description": "The Non RT-RIC Service Catalogue provides a way for services to register themselves for other services to discover.",
6         "version": "1.0.0"
7     },
8     "servers": [
9         {
10             "url": "/"
11         }
12     ],
13     "paths": {
14         "/services": {
15             "get": {
16                 "summary": "Services",
17                 "deprecated": false,
18                 "operationId": "getServices",
19                 "responses": {
20                     "200": {
21                         "description": "Services",
22                         "content": {
23                             "application/json": {
24                                 "schema": {
25                                     "type": "array",
26                                     "items": {
27                                         "$ref": "#/components/schemas/service"
28                                     }
29                                 }
30                             }
31                         }
32                     }
33                 },
34                 "tags": [
35                     "rAPP Catalogue API"
36                 ]
37             }
38         },
39         "/services/{serviceName}": {
40             "get": {
41                 "summary": "Individual Service",
42                 "deprecated": false,
43                 "operationId": "getIndividualService",
44                 "responses": {
45                     "200": {
46                         "description": "Service",
47                         "content": {
48                             "application/json": {
49                                 "schema": {
50                                     "$ref": "#/components/schemas/service"
51                                 }
52                             }
53                         }
54                     },
55                     "404": {
56                         "description": "Service is not found",
57                         "content": {
58                             "application/json": {
59                                 "schema": {
60                                     "$ref": "#/components/schemas/error_information"
61                                 }
62                             }
63                         }
64                     }
65                 },
66                 "parameters": [
67                     {
68                         "in": "path",
69                         "name": "serviceName",
70                         "description": "serviceName",
71                         "schema": {
72                             "type": "string"
73                         },
74                         "required": true,
75                         "example": "DroneIdentifier"
76                     }
77                 ],
78                 "tags": [
79                     "rAPP Catalogue API"
80                 ]
81             },
82             "put": {
83                 "summary": "Create or update a Service",
84                 "deprecated": false,
85                 "operationId": "putIndividualService",
86                 "responses": {
87                     "200": {
88                         "description": "Service updated"
89                     },
90                     "201": {
91                         "description": "Service created",
92                         "headers": {
93                             "Location": {
94                                 "schema": {
95                                     "type": "string"
96                                 },
97                                 "description": "URL to the created Service"
98                             }
99                         }
100                     },
101                     "400": {
102                         "description": "Provided service is not correct",
103                         "content": {
104                             "application/json": {
105                                 "schema": {
106                                     "$ref": "#/components/schemas/error_information"
107                                 },
108                                 "example": {
109                                     "detail": "Service is missing required property: version",
110                                     "status": 400
111                                 }
112                             }
113                         }
114                     }
115                 },
116                 "parameters": [
117                     {
118                         "name": "serviceName",
119                         "in": "path",
120                         "required": true,
121                         "schema": {
122                             "type": "string"
123                         },
124                         "example": "DroneIdentifier"
125                     }
126                 ],
127                 "requestBody": {
128                     "description": "Service to create/update",
129                     "required": true,
130                     "content": {
131                         "application/json": {
132                             "schema": {
133                                 "$ref": "#/components/schemas/inputService"
134                             }
135                         }
136                     }
137                 },
138                 "tags": [
139                     "rAPP Catalogue API"
140                 ]
141             },
142             "delete": {
143                 "summary": "Remove a Service from the catalogue",
144                 "deprecated": false,
145                 "operationId": "deleteIndividualService",
146                 "responses": {
147                     "204": {
148                         "description": "Service deleted"
149                     }
150                 },
151                 "parameters": [
152                     {
153                         "name": "serviceName",
154                         "in": "path",
155                         "required": true,
156                         "schema": {
157                             "type": "string"
158                         },
159                         "example": "DroneIdentifier"
160                     }
161                 ],
162                 "tags": [
163                     "rAPP Catalogue API"
164                 ]
165             }
166         }
167     },
168     "components": {
169         "schemas": {
170             "inputService": {
171                 "description": "A Service to register",
172                 "type": "object",
173                 "title": "inputService",
174                 "required": [
175                     "version"
176                 ],
177                 "properties": {
178                     "version": {
179                         "description": "Version of the Service",
180                         "type": "string",
181                         "example": "1.0.0"
182                     },
183                     "display_name": {
184                         "description": "Display name for the Service",
185                         "type": "string",
186                         "example": "Drone Identifier"
187                     },
188                     "description": {
189                         "description": "Description of the Service",
190                         "type": "string",
191                         "example": "Detects if a UE is a drone"
192                     }
193                 }
194             },
195             "service": {
196                 "description": "A Service",
197                 "type": "object",
198                 "title": "service",
199                 "required": [
200                     "name",
201                     "version",
202                     "registrationDate"
203                 ],
204                 "properties": {
205                     "name": {
206                         "description": "Unique identifier of the Service",
207                         "type": "string",
208                         "example": "DroneIdentifier"
209                     },
210                     "version": {
211                         "description": "Version of the Service",
212                         "type": "string",
213                         "example": "1.0.0"
214                     },
215                     "display_name": {
216                         "description": "Display name for the Service",
217                         "type": "string",
218                         "example": "Drone Identifier"
219                     },
220                     "description": {
221                         "description": "Description of the Service",
222                         "type": "string",
223                         "example": "Detects if a UE is a drone"
224                     },
225                     "registrationDate": {
226                         "description": "Date when the Service was registered in the catalogue",
227                         "type": "string",
228                         "example": "2020-11-03"
229                     }
230                 }
231             },
232             "error_information": {
233                 "description": "Problem as defined in https://tools.ietf.org/html/rfc7807",
234                 "type": "object",
235                 "title": "error_information",
236                 "properties": {
237                     "detail": {
238                         "description": "A human-readable explanation specific to this occurrence of the problem.",
239                         "type": "string",
240                         "example": "Service not found"
241                     },
242                     "status": {
243                         "format": "int32",
244                         "description": "The HTTP status code for this occurrence of the problem.",
245                         "type": "integer",
246                         "example": 404
247                     }
248                 }
249             }
250         }
251     }
252 }