Subscription REST interface update
[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.3
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: Invalid input
67         '500':
68           description: Internal error
69   '/subscriptions/{subscriptionId}':
70     delete:
71       tags:
72         - common
73       summary: Unsubscribe X2AP events from Subscription Manager
74       operationId: Unsubscribe
75       consumes:
76         - application/json
77       produces:
78         - application/json
79       parameters:
80         - name: subscriptionId
81           in: path
82           description: The subscriptionId received in the Subscription Response
83           required: true
84           type: string
85       responses:
86         '204':
87           description: Operation done successfully
88         '400':
89           description: Invalid subscriptionId supplied
90         '500':
91           description: Internal error
92 definitions:
93   ConfigMetadata:
94     type: object
95     required:
96       - xappName
97       - configType
98     properties:
99       xappName:
100         type: string
101         description: Name of the xApp
102       configType:
103         type: string
104         description: The type of the content
105         enum:
106           - json
107           - xml
108           - other
109   XAppConfig:
110     type: object
111     required:
112       - metadata
113       - config
114     properties:
115       metadata:
116         $ref: '#/definitions/ConfigMetadata'
117       config:
118         type: object
119         description: Configuration in JSON format
120   XappConfigList:
121     type: array
122     items:
123       $ref: '#/definitions/XAppConfig'
124   ActionDefinition:
125     type: array
126     description: E2SM byte array. ActionDefinition is an OPTIONAL IE
127     items:
128       type: integer
129   SubsequentAction:
130     description: SubsequentAction is an OPTIONAL IE
131     type: object
132     required:
133       - SubsequentActionType
134       - TimeToWait
135     properties:
136       SubsequentActionType:
137         type: string
138         enum:
139           - continue
140           - wait
141       TimeToWait:
142         type: string
143         enum:
144           - zero
145           - w1ms
146           - w2ms
147           - w5ms
148           - w10ms
149           - w20ms
150           - w30ms
151           - w40ms
152           - w50ms
153           - w100ms
154           - w200ms
155           - w500ms
156           - w1s
157           - w2s
158           - w5s
159           - w10s
160           - w20s
161           - w60s
162   ActionToBeSetup:
163     type: object
164     required:
165       - ActionID
166       - ActionType
167     properties:
168       ActionID:
169         type: integer
170         minimum: 0
171         maximum: 255
172       ActionType:
173         type: string
174         enum:
175           - insert
176           - policy
177           - report
178       ActionDefinition:
179         $ref: '#/definitions/ActionDefinition'
180       SubsequentAction:
181         $ref: '#/definitions/SubsequentAction'
182   ActionsToBeSetup:
183     type: array
184     items:
185       $ref: '#/definitions/ActionToBeSetup'
186   EventTriggerDefinition:
187     type: array
188     description: E2SM byte array
189     items:
190       type: integer
191   SubscriptionDetail:
192     type: object
193     required:
194       - XappEventInstanceId
195       - EventTriggers
196       - ActionToBeSetupList
197     properties:
198       XappEventInstanceId:
199         type: integer
200         minimum: 0
201         maximum: 65535
202       EventTriggers:
203         $ref: '#/definitions/EventTriggerDefinition'
204       ActionToBeSetupList:
205         $ref: '#/definitions/ActionsToBeSetup'
206   SubscriptionDetailsList:
207     type: array
208     items:
209       $ref: '#/definitions/SubscriptionDetail'
210   SubscriptionParams:
211     type: object
212     required:
213       - ClientEndpoint
214       - Meid
215       - RANFunctionID
216       - SubscriptionDetails
217     properties:
218       SubscriptionId:
219        type: string
220        description: Optional subscription ID (Submgr allocates if not given)
221       ClientEndpoint:
222         type: object
223         description: xApp service address and port
224         properties:
225           Host:
226             description: >-
227               xApp service address name like
228               'service-ricxapp-xappname-http.ricxapp'
229             type: string
230           HTTPPort:
231             description: xApp HTTP service address port
232             type: integer
233             minimum: 0
234             maximum: 65535
235           RMRPort:
236             description: xApp RMR service address port
237             type: integer
238             minimum: 0
239             maximum: 65535
240       Meid:
241         type: string
242       RANFunctionID:
243         type: integer
244         minimum: 0
245         maximum: 4095
246       E2SubscriptionDirectives:
247         type: object
248         properties:
249           E2TimeoutTimerValue:
250             description: How long time response is waited from E2 node
251             type: integer
252             default: 2
253             minimum: 1
254             maximum: 10
255           E2RetryCount:
256             description: How many times E2 subscription request is retried
257             type: integer
258             default: 2
259             minimum: 0
260             maximum: 10
261           RMRRoutingNeeded:
262             description: Subscription needs RMR route from E2Term to xApp 
263             type: boolean
264             default: True
265       SubscriptionDetails:
266         $ref: '#/definitions/SubscriptionDetailsList'
267   SubscriptionResponse:
268     type: object
269     required:
270       - SubscriptionId
271       - SubscriptionInstances
272     properties:
273       SubscriptionId:
274         type: string
275       SubscriptionInstances:
276         type: array
277         items:
278           $ref: '#/definitions/SubscriptionInstance'
279   SubscriptionInstance:
280     type: object
281     required:
282       - XappEventInstanceId
283       - E2EventInstanceId
284       - ErrorCause
285       - ErrorSource
286       - TimeoutType
287     properties:
288       XappEventInstanceId:
289         type: integer
290         minimum: 0
291         maximum: 65535
292       E2EventInstanceId:
293         type: integer
294         minimum: 0
295         maximum: 65535
296       RejectCause:
297         description: Reason for REST subscription rejection.
298         type: string
299         default: None
300         enum:
301         - None
302         - REST-subscription-ongoing         # xApp should retry after delay
303         - REST-subscription-delete-ongoing  # xApp should retry after delay
304         - Invalid-REST-request-message
305         - REST-subscription-with-given-id-does-not-exist
306         - E2-interface-down
307         - Other
308       ErrorCause:
309         description: Descriptive error cause. Empty string when no error.
310         type: string
311         default: ''
312       ErrorSource:
313         description: Source of error cause.
314         type: string
315         default: None
316         enum: [None, SUBMGR, RTMGR, DBAAS, ASN1, E2Node]
317       TimeoutType:
318         description: Type timeout. xApp should retry if timeout occours.
319         type: string
320         default: None
321         enum: [None, E2-Timeout, RTMGR-Timeout, DBAAS-Timeout]
322   SubscriptionData:
323     type: object
324     properties:
325       SubscriptionId:
326         type: integer
327       Meid:
328         type: string
329       ClientEndpoint:
330         type: array
331         items:
332           type: string
333       SubscriptionInstances:
334         type: array
335         items:
336           $ref: '#/definitions/SubscriptionInstance'
337   SubscriptionList:
338     type: array
339     description: A list of subscriptions
340     items:
341       $ref: '#/definitions/SubscriptionData'