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