Swagger API 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.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         - "query"
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   /subscriptions/report:
46     post:
47       tags:
48       - "report"
49       summary: Subscribe a list of X2AP event triggers to receive "REPORT" messages sent by RAN or Subscribe to receive the content of gNB NRT table in REPORT message sent by RAN
50       operationId: subscribeReport
51       consumes:
52         - application/json
53       produces:
54         - application/json
55       parameters:
56         - name: ReportParams
57           in: body
58           description: Subscription report parameters
59           schema:
60             $ref: '#/definitions/ReportParams'
61       responses:
62         '201':
63           description: Subscription successfully created
64           schema:
65             $ref: '#/definitions/SubscriptionResponse'
66         '400':
67           description: Invalid input
68         '500':
69           description: Internal error
70   /subscriptions/policy:
71     post:
72       tags:
73       - "policy"
74       summary: Subscribe and send "POLICY" message to RAN to execute a specific POLICY during call processing in RAN after each occurrence of a defined SUBSCRIPTION
75       operationId: subscribePolicy
76       consumes:
77         - application/json
78       produces:
79         - application/json
80       parameters:
81         - name: PolicyParams
82           in: body
83           description: Subscription policy parameters
84           schema:
85             $ref: '#/definitions/PolicyParams'
86       responses:
87         '201':
88           description: Subscription successfully created
89           schema:
90             $ref: '#/definitions/SubscriptionResponse'
91         '400':
92           description: Invalid input
93         '500':
94           description: Internal error
95   /subscriptions/{subscriptionId}:
96     delete:
97       tags:
98       - "common"
99       summary: Unsubscribe X2AP events from Subscription Manager
100       operationId: Unsubscribe
101       consumes:
102         - application/json
103       produces:
104         - application/json
105       parameters:
106         - name: subscriptionId
107           in: path
108           description: The subscriptionId received in the Subscription Response
109           required: true
110           type: string
111       responses:
112         '204':
113           description: Operation done successfully
114         '400':
115           description: Invalid subscriptionId supplied
116         '500':
117           description: Internal error
118 definitions:
119   ConfigMetadata:
120     type: object
121     required:
122       - xappName
123       - configType
124     properties:
125       xappName:
126         type: string
127         description: Name of the xApp
128       configType:
129         type: string
130         description: The type of the content
131         enum:
132         - json
133         - xml
134         - other
135   XAppConfig:
136     type: object
137     required:
138       - metadata
139       - config
140     properties:
141       metadata:
142         $ref: '#/definitions/ConfigMetadata'
143       config:
144         type: object
145         description: Configuration in JSON format
146   XappConfigList:
147     type: array
148     items:
149       $ref: '#/definitions/XAppConfig'
150   SubscriptionType:
151     type: string
152     enum:
153       - insert
154       - policy
155       - report
156   ReportParams:
157     type: object
158     required:
159       - RANFunctionID
160       - ClientEndpoint
161       - EventTriggers
162     properties:
163       Meid:
164         type: string
165       RANFunctionID:
166         type: integer
167       ClientEndpoint:
168         type: string
169       EventTriggers:
170         $ref: '#/definitions/EventTriggerList'
171       ReportActionDefinitions:
172         $ref: '#/definitions/ReportActionDefinition'
173   EventTrigger:
174     type: object
175     properties:
176       InterfaceDirection:
177         type: integer
178       ProcedureCode:
179         type: integer
180       TypeOfMessage:
181         type: integer
182       TriggerNature:
183         type: string
184         enum:
185           - now
186           - on change
187       PlmnId:
188         type: string
189       ENBId:
190         type: string
191   EventTriggerList:
192     type: array
193     items:
194       $ref: '#/definitions/EventTrigger'
195   ActionParameters:
196     type: object
197     required:
198       - ActionParameterID
199       - ActionParameterValue
200     properties:
201       ActionParameterID:
202         type: integer
203       ActionParameterValue:
204         type: boolean
205   Format1ActionDefinition:
206     type: object
207     required:
208       - StyleID
209       - ActionParameters
210     properties:
211       StyleID:
212         type: integer
213       ActionParameters:
214         type: array
215         items:
216           $ref: '#/definitions/ActionParameters'
217   ReportActionDefinition:
218     type: object
219     properties:
220       ActionDefinitionFormat1:
221         $ref: '#/definitions/Format1ActionDefinition'
222   PolicyParams:
223     type: object
224     required:
225       - Meid
226       - RANFunctionID
227       - ClientEndpoint
228       - EventTriggers
229       - PolicyActionDefinitions
230     properties:
231       Meid:
232         type: string
233       RANFunctionID:
234         type: integer
235       ClientEndpoint:
236         type: string
237       EventTriggers:
238         $ref: '#/definitions/EventTriggerList'
239       PolicyActionDefinitions:
240         $ref: '#/definitions/PolicyActionDefinition'
241   PolicyActionDefinition:
242     type: object
243     properties:
244       ActionDefinitionFormat2:
245         $ref: '#/definitions/Format2ActionDefinition'
246   Format2ActionDefinition:
247     type: object
248     required:
249       - RANUeGroupParameters
250     properties:
251       RANUeGroupParameters:
252         type: array
253         items:
254           $ref: '#/definitions/RANUeGroupList'
255   RANUeGroupList:
256     type: object
257     required:
258       - RANUeGroupID
259       - RANUeGroupDefinition
260       - RANImperativePolicy
261     properties:
262       RANUeGroupID:
263         type: integer
264       RANUeGroupDefinition:
265         $ref: '#/definitions/RANUeGroupParams'
266       RANImperativePolicy:
267         $ref: '#/definitions/ImperativePolicyDefinition'
268   RANUeGroupParams:
269     type: object
270     required:
271       - RANParameterID
272       - RANParameterValue
273     properties:
274       RANParameterID:
275         type: integer
276       RANParameterTestCondition:
277         type: string
278         enum:
279           - equal
280           - greaterthan
281           - lessthan
282           - contains
283           - present
284       RANParameterValue:
285         type: integer
286   ImperativePolicyDefinition:
287     type: object
288     required:
289       - PolicyParameterID
290       - PolicyParameterValue
291     properties:
292       PolicyParameterID:
293         type: integer
294       PolicyParameterValue:
295         type: integer
296   SubscriptionInstance:
297     type: object
298     required:
299       - RequestorId
300       - InstanceId
301     properties:
302       RequestorId:
303         type: integer
304       InstanceId:
305         type: integer
306   SubscriptionResponse:
307     type: object
308     required:
309       - SubscriptionId
310       - SubscriptionInstances
311     properties:
312       SubscriptionId:
313         type: string
314       SubscriptionInstances:
315         type: array
316         items:
317           $ref: '#/definitions/SubscriptionInstance'
318   SubscriptionData:
319     type: object
320     properties:
321       SubscriptionId:
322         type: integer
323       Meid:
324         type: string
325       Endpoint:
326         type: array
327         items:
328           type: string
329   SubscriptionList:
330     type: array
331     description: A list of subscriptions
332     items:
333        $ref: '#/definitions/SubscriptionData'