373fc7af04e7a7b67fd9778b3162e85110905b62
[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       parameters:
86         - name: subscriptionId
87           in: path
88           description: The subscriptionId received in the Subscription Response
89           required: true
90           type: string
91       responses:
92         '204':
93           description: Operation done successfully
94         '400':
95           description: Invalid subscriptionId supplied
96         '500':
97           description: Internal error
98 definitions:
99   SubscriptionType:
100     type: string
101     enum:
102       - insert
103       - policy
104       - report
105   ReportParams:
106     type: object
107     required:
108       - RANFunctionID
109       - ClientEndpoint
110       - EventTriggers
111     properties:
112       Meid:
113         type: string
114       RANFunctionID:
115         type: integer
116       ClientEndpoint:
117         type: string
118       EventTriggers:
119         $ref: '#/definitions/EventTriggerList'
120       ReportActionDefinitions:
121         $ref: '#/definitions/ReportActionDefinition'
122   EventTrigger:
123     type: object
124     properties:
125       InterfaceDirection:
126         type: integer
127       ProcedureCode:
128         type: integer
129       TypeOfMessage:
130         type: integer
131       TriggerNature:
132         type: string
133         enum:
134           - now
135           - on change
136       PlmnId:
137         type: string
138       ENBId:
139         type: string
140   EventTriggerList:
141     type: array
142     items:
143       $ref: '#/definitions/EventTrigger'
144   ActionParameters:
145     type: object
146     required:
147       - ActionParameterID
148       - ActionParameterValue
149     properties:
150       ActionParameterID:
151         type: integer
152       ActionParameterValue:
153         type: boolean
154   Format1ActionDefinition:
155     type: object
156     required:
157       - StyleID
158       - ActionParameters
159     properties:
160       StyleID:
161         type: integer
162       ActionParameters:
163         type: array
164         items:
165           $ref: '#/definitions/ActionParameters'
166   ReportActionDefinition:
167     type: object
168     properties:
169       ActionDefinitionFormat1:
170         $ref: '#/definitions/Format1ActionDefinition'
171   PolicyParams:
172     type: object
173     required:
174       - Meid
175       - RANFunctionID
176       - ClientEndpoint
177       - EventTriggers
178       - PolicyActionDefinitions
179     properties:
180       Meid:
181         type: string
182       RANFunctionID:
183         type: integer
184       ClientEndpoint:
185         type: string
186       EventTriggers:
187         $ref: '#/definitions/EventTriggerList'
188       PolicyActionDefinitions:
189         $ref: '#/definitions/PolicyActionDefinition'
190   PolicyActionDefinition:
191     type: object
192     properties:
193       ActionDefinitionFormat2:
194         $ref: '#/definitions/Format2ActionDefinition'
195   Format2ActionDefinition:
196     type: object
197     required:
198       - RANUeGroupParameters
199     properties:
200       RANUeGroupParameters:
201         type: array
202         items:
203           $ref: '#/definitions/RANUeGroupList'
204   RANUeGroupList:
205     type: object
206     required:
207       - RANUeGroupID
208       - RANUeGroupDefinition
209       - RANImperativePolicy
210     properties:
211       RANUeGroupID:
212         type: integer
213       RANUeGroupDefinition:
214         $ref: '#/definitions/RANUeGroupParams'
215       RANImperativePolicy:
216         $ref: '#/definitions/ImperativePolicyDefinition'
217   RANUeGroupParams:
218     type: object
219     required:
220       - RANParameterID
221       - RANParameterValue
222     properties:
223       RANParameterID:
224         type: integer
225       RANParameterTestCondition:
226         type: string
227         enum:
228           - equal
229           - greaterthan
230           - lessthan
231           - contains
232           - present
233       RANParameterValue:
234         type: integer
235   ImperativePolicyDefinition:
236     type: object
237     required:
238       - PolicyParameterID
239       - PolicyParameterValue
240     properties:
241       PolicyParameterID:
242         type: integer
243       PolicyParameterValue:
244         type: integer
245   SubscriptionResponseItem:
246     type: object
247     required:
248       - SubscriptionId
249       - RequestorId
250       - InstanceId
251     properties:
252       SubscriptionId:
253         type: string
254       RequestorId:
255         type: integer
256       InstanceId:
257         type: integer
258   SubscriptionResponse:
259     type: array
260     items:
261       $ref: '#/definitions/SubscriptionResponseItem'
262   SubscriptionData:
263     type: object
264     properties:
265       SubscriptionId:
266         type: integer
267       Meid:
268         type: string
269       Endpoint:
270         type: array
271         items:
272           type: string
273   SubscriptionList:
274     type: array
275     description: A list of subscriptions
276     items:
277        $ref: '#/definitions/SubscriptionData'