Further enhancements
[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   SubscriptionDetail:
195     type: object
196     required:
197       - RequestorId
198       - InstanceId
199       - EventTriggers
200       - ActionToBeSetupList
201     properties:
202       RequestorId:
203         type: integer
204         minimum: 0
205         maximum: 65535
206       InstanceId:
207         type: integer
208         minimum: 0
209         maximum: 65535
210       EventTriggers:
211         $ref: '#/definitions/EventTriggerDefinition'
212       ActionToBeSetupList:
213         $ref: '#/definitions/ActionsToBeSetup'
214   SubscriptionDetailsList:
215     type: array
216     items:
217       $ref: '#/definitions/SubscriptionDetail'
218   SubscriptionParams:
219     type: object
220     required:
221       - ClientEndpoint
222       - Meid
223       - RANFunctionID
224       - SubscriptionDetails
225     properties:
226       ClientEndpoint:
227         type: object
228         description: xApp service address and port
229         properties:
230           Host:
231             description: >-
232               xApp service address name like 'service-ricxapp-xappname-http.ricxapp'
233             type: string
234           HTTPPort:
235             description: xApp HTTP service address port
236             type: integer
237             minimum: 0
238             maximum: 65535
239           RMRPort:
240             description: xApp RMR service address port
241             type: integer
242             minimum: 0
243             maximum: 65535
244       Meid:
245         type: string
246       RANFunctionID:
247         type: integer
248         minimum: 0
249         maximum: 4095
250       SubscriptionDetails:
251         $ref: '#/definitions/SubscriptionDetailsList'
252   SubscriptionResponse:
253     type: object
254     required:
255       - SubscriptionId
256       - SubscriptionInstances
257     properties:
258       SubscriptionId:
259         type: string
260       SubscriptionInstances:
261         type: array
262         items:
263           $ref: '#/definitions/SubscriptionInstance'
264   SubscriptionInstance:
265     type: object
266     required:
267       - RequestorId
268       - InstanceId
269       - ErrorCause
270     properties:
271       RequestorId:
272         type: integer
273         minimum: 0
274         maximum: 65535
275       InstanceId:
276         type: integer
277         minimum: 0
278         maximum: 65535
279       ErrorCause:
280         description: Empty string when no error.
281         type: string
282   SubscriptionData:
283     type: object
284     properties:
285       SubscriptionId:
286         type: integer
287       Meid:
288         type: string
289       ClientEndpoint:
290         type: array
291         items:
292           type: string
293       SubscriptionInstances:
294         type: array
295         items:
296           $ref: '#/definitions/SubscriptionInstance'
297   SubscriptionList:
298     type: array
299     description: A list of subscriptions
300     items:
301        $ref: '#/definitions/SubscriptionData'