Add optional subscription ID
[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       SubscriptionId:
227         type: string
228         description: Optional subscription ID (Submgr allocates if not given)
229       ClientEndpoint:
230         type: object
231         description: xApp service address and port
232         properties:
233           Host:
234             description: >-
235               xApp service address name like 'service-ricxapp-xappname-http.ricxapp'
236             type: string
237           HTTPPort:
238             description: xApp HTTP service address port
239             type: integer
240             minimum: 0
241             maximum: 65535
242           RMRPort:
243             description: xApp RMR service address port
244             type: integer
245             minimum: 0
246             maximum: 65535
247       Meid:
248         type: string
249       RANFunctionID:
250         type: integer
251         minimum: 0
252         maximum: 4095
253       SubscriptionDetails:
254         $ref: '#/definitions/SubscriptionDetailsList'
255   SubscriptionResponse:
256     type: object
257     required:
258       - SubscriptionId
259       - SubscriptionInstances
260     properties:
261       SubscriptionId:
262         type: string
263       SubscriptionInstances:
264         type: array
265         items:
266           $ref: '#/definitions/SubscriptionInstance'
267   SubscriptionInstance:
268     type: object
269     required:
270       - RequestorId
271       - InstanceId
272       - ErrorCause
273     properties:
274       RequestorId:
275         type: integer
276         minimum: 0
277         maximum: 65535
278       InstanceId:
279         type: integer
280         minimum: 0
281         maximum: 65535
282       ErrorCause:
283         description: Empty string when no error.
284         type: string
285   SubscriptionData:
286     type: object
287     properties:
288       SubscriptionId:
289         type: integer
290       Meid:
291         type: string
292       ClientEndpoint:
293         type: array
294         items:
295           type: string
296       SubscriptionInstances:
297         type: array
298         items:
299           $ref: '#/definitions/SubscriptionInstance'
300   SubscriptionList:
301     type: array
302     description: A list of subscriptions
303     items:
304        $ref: '#/definitions/SubscriptionData'