REST API: use byte array for E2SM event trigger
[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.2
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       SubscriptionDetails:
247         $ref: '#/definitions/SubscriptionDetailsList'
248   SubscriptionResponse:
249     type: object
250     required:
251       - SubscriptionId
252       - SubscriptionInstances
253     properties:
254       SubscriptionId:
255         type: string
256       SubscriptionInstances:
257         type: array
258         items:
259           $ref: '#/definitions/SubscriptionInstance'
260   SubscriptionInstance:
261     type: object
262     required:
263       - XappEventInstanceId
264       - E2EventInstanceId
265       - ErrorCause
266     properties:
267       XappEventInstanceId:
268         type: integer
269         minimum: 0
270         maximum: 65535
271       E2EventInstanceId:
272         type: integer
273         minimum: 0
274         maximum: 65535
275       ErrorCause:
276         description: Empty string when no error.
277         type: string
278   SubscriptionData:
279     type: object
280     properties:
281       SubscriptionId:
282         type: integer
283       Meid:
284         type: string
285       ClientEndpoint:
286         type: array
287         items:
288           type: string
289       SubscriptionInstances:
290         type: array
291         items:
292           $ref: '#/definitions/SubscriptionInstance'
293   SubscriptionList:
294     type: array
295     description: A list of subscriptions
296     items:
297       $ref: '#/definitions/SubscriptionData'