Enhancements of REST-based E2 subscription interface
[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.1
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
125   ActionDefinition:
126     type: object
127     description: E2SM Octet string. ActionDefinition is an OPTIONAL IE
128     properties:
129       OctetString:
130         type: string
131   SubsequentAction:
132     description: SubsequentAction is an OPTIONAL IE
133     type: object
134     required:
135       - SubsequentActionType
136       - TimeToWait
137     properties:
138       SubsequentActionType:
139         type: string
140         enum:
141           - continue
142           - wait
143       TimeToWait:
144         type: string
145         enum:
146           - zero
147           - w1ms
148           - w2ms
149           - w5ms
150           - w10ms
151           - w20ms
152           - w30ms
153           - w40ms
154           - w50ms
155           - w100ms
156           - w200ms
157           - w500ms
158           - w1s
159           - w2s
160           - w5s
161           - w10s
162           - w20s
163           - w60s
164   ActionToBeSetup:
165     type: object
166     required:
167       - ActionID
168       - ActionType
169     properties:
170       ActionID:
171         type: integer
172         minimum: 0
173         maximum: 255
174       ActionType:
175         type: string
176         enum:
177           - insert
178           - policy
179           - report
180       ActionDefinition:
181         $ref: '#/definitions/ActionDefinition'
182       SubsequentAction:
183         $ref: '#/definitions/SubsequentAction'
184   ActionsToBeSetup:
185     type: array
186     items:
187       $ref: '#/definitions/ActionToBeSetup'
188   EventTriggerDefinition:
189     type: object
190     description: E2SM Octet string
191     properties:
192       OctetString:
193         type: string
194   SubscriptionDetails:
195     type: object
196     required:
197       - EventTriggerList
198       - ActionToBeSetupList
199     properties:
200       EventTriggerList:
201         $ref: '#/definitions/EventTriggerDefinition'
202       ActionToBeSetupList:
203         $ref: '#/definitions/ActionsToBeSetup'
204   SubscriptionDetailsList:
205     type: array
206     items:
207       $ref: '#/definitions/SubscriptionDetails'
208   SubscriptionParams:
209     type: object
210     required:
211       - ClientEndpoint
212       - Meid
213       - RequestorId
214       - InstanceId
215       - RANFunctionID
216       - SubscriptionDetails
217     properties:
218       ClientEndpoint:
219         type: object
220         description: xApp service address and port
221         properties:
222           ServiceName:
223             description: >-
224               xApp service address name like
225               'service-ricxapp-xappname-http.ricxapp'
226             type: string
227           Port:
228             description: xApp service address port
229             type: integer
230             minimum: 0
231             maximum: 65535
232       Meid:
233         type: string
234       RequestorId:
235         type: integer
236         minimum: 0
237         maximum: 65535
238       InstanceId:
239         type: integer
240         minimum: 0
241         maximum: 65535
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       - RequestorId
264       - InstanceId
265       - ErrorCause
266     properties:
267       RequestorId:
268         type: integer
269         minimum: 0
270         maximum: 65535
271       InstanceId:
272         type: integer
273         minimum: 0
274         maximum: 65535
275       ErrorCause:
276         description: Empty string when no error.
277         type: string
278
279   SubscriptionData:
280     type: object
281     properties:
282       SubscriptionId:
283         type: integer
284       Meid:
285         type: string
286       Endpoint:
287         type: array
288         items:
289           type: string
290   SubscriptionList:
291     type: array
292     description: A list of subscriptions
293     items:
294        $ref: '#/definitions/SubscriptionData'