c2e1be0d8b5ccdc5249638524eba8d0037c0b7ed
[ric-plt/xapp-frame.git] / api / xapp_rest_api.yaml
1 swagger: '2.0'
2 info:
3   description: This is the initial REST API for RIC subscription
4   version: 0.0.4
5   title: RIC subscription
6   license:
7     name: Apache 2.0
8     url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
9 host: hostname
10 basePath: /ric/v1
11 schemes:
12   - http
13 paths:
14   /config:
15     get:
16       summary: Returns the configuration of all xapps
17       tags:
18         - xapp
19       operationId: getXappConfigList
20       produces:
21         - application/json
22         - application/xml
23       responses:
24         '200':
25           description: successful query of xApp config
26           schema:
27             $ref: '#/definitions/XappConfigList'
28         '500':
29           description: Internal error
30   /subscriptions:
31     get:
32       summary: Returns list of subscriptions
33       tags:
34         - common
35       operationId: getAllSubscriptions
36       produces:
37         - application/json
38       responses:
39         '200':
40           description: successful query of subscriptions
41           schema:
42             $ref: '#/definitions/SubscriptionList'
43         '500':
44           description: Internal error
45     post:
46       tags:
47         - common
48       operationId: Subscribe
49       summary: Subscribe a list of X2AP event triggers to receive messages sent by RAN
50       consumes:
51         - application/json
52       produces:
53         - application/json
54       parameters:
55         - name: SubscriptionParams
56           in: body
57           description: Subscription parameters
58           schema:
59             $ref: '#/definitions/SubscriptionParams'
60       responses:
61         '201':
62           description: Subscription successfully created
63           schema:
64             $ref: '#/definitions/SubscriptionResponse'
65         '400':
66           description: Not Found
67         '404':
68           description: Invalid input
69         '500':
70           description: Internal error
71         '503':
72           description: Service Unavailable
73   '/subscriptions/{subscriptionId}':
74     delete:
75       tags:
76         - common
77       summary: Unsubscribe X2AP events from Subscription Manager
78       operationId: Unsubscribe
79       consumes:
80         - application/json
81       produces:
82         - application/json
83       parameters:
84         - name: subscriptionId
85           in: path
86           description: The subscriptionId received in the Subscription Response
87           required: true
88           type: string
89       responses:
90         '204':
91           description: Operation done successfully
92         '400':
93           description: Invalid subscriptionId supplied
94         '500':
95           description: Internal error
96 definitions:
97   ConfigMetadata:
98     type: object
99     required:
100       - xappName
101       - configType
102     properties:
103       xappName:
104         type: string
105         description: Name of the xApp
106       configType:
107         type: string
108         description: The type of the content
109         enum:
110           - json
111           - xml
112           - other
113   XAppConfig:
114     type: object
115     required:
116       - metadata
117       - config
118     properties:
119       metadata:
120         $ref: '#/definitions/ConfigMetadata'
121       config:
122         type: object
123         description: Configuration in JSON format
124   XappConfigList:
125     type: array
126     items:
127       $ref: '#/definitions/XAppConfig'
128   ActionDefinition:
129     type: array
130     description: E2SM byte array. ActionDefinition is an OPTIONAL IE
131     items:
132       type: integer
133   SubsequentAction:
134     description: SubsequentAction is an OPTIONAL IE
135     type: object
136     required:
137       - SubsequentActionType
138       - TimeToWait
139     properties:
140       SubsequentActionType:
141         type: string
142         enum:
143           - continue
144           - wait
145       TimeToWait:
146         type: string
147         enum:
148           - zero
149           - w1ms
150           - w2ms
151           - w5ms
152           - w10ms
153           - w20ms
154           - w30ms
155           - w40ms
156           - w50ms
157           - w100ms
158           - w200ms
159           - w500ms
160           - w1s
161           - w2s
162           - w5s
163           - w10s
164           - w20s
165           - w60s
166   ActionToBeSetup:
167     type: object
168     required:
169       - ActionID
170       - ActionType
171     properties:
172       ActionID:
173         type: integer
174         minimum: 0
175         maximum: 255
176       ActionType:
177         type: string
178         enum:
179           - insert
180           - policy
181           - report
182       ActionDefinition:
183         $ref: '#/definitions/ActionDefinition'
184       SubsequentAction:
185         $ref: '#/definitions/SubsequentAction'
186   ActionsToBeSetup:
187     type: array
188     items:
189       $ref: '#/definitions/ActionToBeSetup'
190   EventTriggerDefinition:
191     type: array
192     description: E2SM byte array
193     items:
194       type: integer
195   SubscriptionDetail:
196     type: object
197     required:
198       - XappEventInstanceId
199       - EventTriggers
200       - ActionToBeSetupList
201     properties:
202       XappEventInstanceId:
203         type: integer
204         minimum: 0
205         maximum: 65535
206       EventTriggers:
207         $ref: '#/definitions/EventTriggerDefinition'
208       ActionToBeSetupList:
209         $ref: '#/definitions/ActionsToBeSetup'
210   SubscriptionDetailsList:
211     type: array
212     items:
213       $ref: '#/definitions/SubscriptionDetail'
214   SubscriptionParams:
215     type: object
216     required:
217       - ClientEndpoint
218       - Meid
219       - RANFunctionID
220       - SubscriptionDetails
221     properties:
222       SubscriptionId:
223        type: string
224        description: Optional subscription ID (Submgr allocates if not given)
225       ClientEndpoint:
226         type: object
227         description: xApp service address and port
228         properties:
229           Host:
230             description: >-
231               xApp service address name like
232               'service-ricxapp-xappname-http.ricxapp'
233             type: string
234           HTTPPort:
235             description: xApp HTTP service address port
236             type: integer
237             minimum: 0
238             maximum: 65535
239           RMRPort:
240             description: xApp RMR service address port
241             type: integer
242             minimum: 0
243             maximum: 65535
244       Meid:
245         type: string
246       RANFunctionID:
247         type: integer
248         minimum: 0
249         maximum: 4095
250       E2SubscriptionDirectives:
251         description: Optional. If not set Submgr uses its default values
252         type: object
253         properties:
254           E2TimeoutTimerValue:
255             description: How long time response is waited from E2 node
256             type: integer
257             minimum: 1
258             maximum: 10
259           E2RetryCount:
260             description: How many times E2 subscription request is retried
261             type: integer
262             minimum: 0
263             maximum: 10
264           RMRRoutingNeeded:
265             description: Subscription needs RMR route from E2Term to xApp 
266             type: boolean
267       SubscriptionDetails:
268         $ref: '#/definitions/SubscriptionDetailsList'
269   SubscriptionResponse:
270     type: object
271     required:
272       - SubscriptionId
273       - SubscriptionInstances
274     properties:
275       SubscriptionId:
276         type: string
277       SubscriptionInstances:
278         type: array
279         items:
280           $ref: '#/definitions/SubscriptionInstance'
281   SubscriptionInstance:
282     type: object
283     required:
284       - XappEventInstanceId
285       - E2EventInstanceId
286     properties:
287       XappEventInstanceId:
288         type: integer
289         minimum: 0
290         maximum: 65535
291       E2EventInstanceId:
292         type: integer
293         minimum: 0
294         maximum: 65535
295       ErrorCause:
296         description: Descriptive error cause. Empty string when no error.
297         type: string
298       ErrorSource:
299         description: Source of error cause.
300         type: string
301         enum: [SUBMGR, RTMGR, DBAAS, ASN1, E2Node]
302       TimeoutType:
303         description: Type timeout. xApp should retry if timeout occurs.
304         type: string
305         enum: [E2-Timeout, RTMGR-Timeout, DBAAS-Timeout]
306   SubscriptionData:
307     type: object
308     properties:
309       SubscriptionId:
310         type: integer
311       Meid:
312         type: string
313       ClientEndpoint:
314         type: array
315         items:
316           type: string
317       SubscriptionInstances:
318         type: array
319         items:
320           $ref: '#/definitions/SubscriptionInstance'
321   SubscriptionList:
322     type: array
323     description: A list of subscriptions
324     items:
325       $ref: '#/definitions/SubscriptionData'