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