Update REST API spec
[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: object
126     description: E2SM Octet string. ActionDefinition is an OPTIONAL IE
127     properties:
128       OctetString:
129         type: string
130   SubsequentAction:
131     description: SubsequentAction is an OPTIONAL IE
132     type: object
133     required:
134       - SubsequentActionType
135       - TimeToWait
136     properties:
137       SubsequentActionType:
138         type: string
139         enum:
140           - continue
141           - wait
142       TimeToWait:
143         type: string
144         enum:
145           - zero
146           - w1ms
147           - w2ms
148           - w5ms
149           - w10ms
150           - w20ms
151           - w30ms
152           - w40ms
153           - w50ms
154           - w100ms
155           - w200ms
156           - w500ms
157           - w1s
158           - w2s
159           - w5s
160           - w10s
161           - w20s
162           - w60s
163   ActionToBeSetup:
164     type: object
165     required:
166       - ActionID
167       - ActionType
168     properties:
169       ActionID:
170         type: integer
171         minimum: 0
172         maximum: 255
173       ActionType:
174         type: string
175         enum:
176           - insert
177           - policy
178           - report
179       ActionDefinition:
180         $ref: '#/definitions/ActionDefinition'
181       SubsequentAction:
182         $ref: '#/definitions/SubsequentAction'
183   ActionsToBeSetup:
184     type: array
185     items:
186       $ref: '#/definitions/ActionToBeSetup'
187   EventTriggerDefinition:
188     type: object
189     description: E2SM Octet string
190     properties:
191       OctetString:
192         type: string
193   SubscriptionDetail:
194     type: object
195     required:
196       - XappEventInstanceId
197       - EventTriggers
198       - ActionToBeSetupList
199     properties:
200       XappEventInstanceId:
201         type: integer
202         minimum: 0
203         maximum: 65535
204       EventTriggers:
205         $ref: '#/definitions/EventTriggerDefinition'
206       ActionToBeSetupList:
207         $ref: '#/definitions/ActionsToBeSetup'
208   SubscriptionDetailsList:
209     type: array
210     items:
211       $ref: '#/definitions/SubscriptionDetail'
212   SubscriptionParams:
213     type: object
214     required:
215       - ClientEndpoint
216       - Meid
217       - RANFunctionID
218       - SubscriptionDetails
219     properties:
220       SubscriptionId:
221        type: string
222        description: Optional subscription ID (Submgr allocates if not given)
223       ClientEndpoint:
224         type: object
225         description: xApp service address and port
226         properties:
227           Host:
228             description: >-
229               xApp service address name like
230               'service-ricxapp-xappname-http.ricxapp'
231             type: string
232           HTTPPort:
233             description: xApp HTTP service address port
234             type: integer
235             minimum: 0
236             maximum: 65535
237           RMRPort:
238             description: xApp RMR service address port
239             type: integer
240             minimum: 0
241             maximum: 65535
242       Meid:
243         type: string
244       RANFunctionID:
245         type: integer
246         minimum: 0
247         maximum: 4095
248       SubscriptionDetails:
249         $ref: '#/definitions/SubscriptionDetailsList'
250   SubscriptionResponse:
251     type: object
252     required:
253       - SubscriptionId
254       - SubscriptionInstances
255     properties:
256       SubscriptionId:
257         type: string
258       SubscriptionInstances:
259         type: array
260         items:
261           $ref: '#/definitions/SubscriptionInstance'
262   SubscriptionInstance:
263     type: object
264     required:
265       - XappEventInstanceId
266       - E2EventInstanceId
267       - ErrorCause
268     properties:
269       XappEventInstanceId:
270         type: integer
271         minimum: 0
272         maximum: 65535
273       E2EventInstanceId:
274         type: integer
275         minimum: 0
276         maximum: 65535
277       ErrorCause:
278         description: Empty string when no error.
279         type: string
280   SubscriptionData:
281     type: object
282     properties:
283       SubscriptionId:
284         type: integer
285       Meid:
286         type: string
287       ClientEndpoint:
288         type: array
289         items:
290           type: string
291       SubscriptionInstances:
292         type: array
293         items:
294           $ref: '#/definitions/SubscriptionInstance'
295   SubscriptionList:
296     type: array
297     description: A list of subscriptions
298     items:
299       $ref: '#/definitions/SubscriptionData'