Subscription manager v0.10.0
[ric-plt/submgr.git] / api / routing_manager.yaml
1 #
2 #==================================================================================
3 #   Copyright (c) 2019 AT&T Intellectual Property.
4 #   Copyright (c) 2019 Nokia
5 #
6 #   Licensed under the Apache License, Version 2.0 (the "License");
7 #   you may not use this file except in compliance with the License.
8 #   You may obtain a copy of the License at
9 #
10 #       http://www.apache.org/licenses/LICENSE-2.0
11 #
12 #   Unless required by applicable law or agreed to in writing, software
13 #   distributed under the License is distributed on an "AS IS" BASIS,
14 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 #   See the License for the specific language governing permissions and
16 #   limitations under the License.
17 #==================================================================================
18 #
19 #
20 #   Abstract:   Routing Manager's RESTful API definition
21 #   Date:       28 August 2019
22 #
23 swagger: "2.0"
24 info:
25   title: Routing Manager
26   description: "This is the Swagger/OpenAPI 2.0 definition of Routing Manager's Northbound API."
27   version: "0.4.0"
28   license:
29     name: "Apache 2.0"
30     url: "http://www.apache.org/licenses/LICENSE-2.0.html"
31 host: "rtmgr"
32 basePath: "/ric/v1"
33 tags:
34 - name: "handle"
35   description: "Available handles"
36 #  externalDocs:
37 #    description: "Find out more"
38 #    url: "http://127.0.0.1"
39 - name: "health"
40   description: "Health of the system"
41 schemes:
42 #- "https"
43 - "http"
44 paths:
45   /health:
46     get:
47       tags:
48       - "health"
49       summary: "Retrive the health of Routing Manager"
50       description: "By performing a GET method on the health resource, the API caller is able to retrieve the health of Routing Manager"
51       operationId: "get_health"
52       consumes:
53       - "application/json"
54 #      - "application/yaml"
55       produces:
56       - "application/json"
57 #      - "application/yaml"
58       responses:
59         200:
60           description: "The health of the system"
61           schema:
62             "$ref": "#/definitions/health-status"
63   /handles:
64     get:
65       tags:
66       - "handle"
67       summary: "Placeholder for further usage"
68       description: "Placeholder for further usage."
69       operationId: "get_handles"
70       consumes:
71       - "application/json"
72 #      - "application/yaml"
73       produces:
74       - "application/json"
75 #      - "application/yaml"
76       responses:
77         200:
78           description: "Dummy response"
79   /handles/xapp-handle:
80     post:
81       tags:
82       - "handle"
83       summary: "Provide callback"
84       description: "By performing a POST method on the xapp-handle resource, the API caller is able to perform a callback on Routing Manager."
85       operationId: "provide_xapp_handle"
86       consumes:
87       - "application/json"
88 #      - "application/yaml"
89       produces:
90       - "application/json"
91 #      - "application/yaml"
92       parameters:
93       - in: "body"
94         name: "xapp-callback-data"
95         description: "xApp related callback data"
96         required: true
97         schema:
98           $ref: "#/definitions/xapp-callback-data"
99       responses:
100         400:
101           description: "Invalid data"
102         201:
103           description: "Callback received"
104   /handles/xapp-subscription-handle:
105     post:
106       tags:
107       - "handle"
108       summary: "API for updating about new xapp subscription"
109       description: "By performing a POST method on the xapp-subscription-handle resource, the API caller is able to update the Routing manager about the creation of new subscription by an Xapp instance."
110       operationId: "provide_xapp_subscription_handle"
111       consumes:
112       - "application/json"
113 #      - "application/yaml"
114       produces:
115       - "application/json"
116 #      - "application/yaml"
117       parameters:
118       - in: "body"
119         name: "xapp-subscription-data"
120         description: "xApp related subscription data"
121         required: true
122         schema:
123           $ref: "#/definitions/xapp-subscription-data"
124       responses:
125         400:
126           description: "Invalid data"
127         201:
128           description: "Xapp Subscription data received"
129     delete:
130       tags:
131       - "handle"
132       summary: "API for deleting an xapp subscription"
133       description: "By performing the delete operation on xapp-subscription-handle resource, the API caller will be able to update routing manager about the deletion of an xapp's subscription"
134       operationId: "delete_xapp_subscription_handle"
135       consumes:
136       - "application/json"
137       parameters:
138       - in: "body"
139         name: "xapp-subscription-data"
140         description: "xApp related subscription data"
141         required: true
142         schema:
143           $ref: "#/definitions/xapp-subscription-data"
144       responses:
145         204:
146           description: "Content not found"
147         200:
148           description: "Xapp Subscription deleted"
149   /handles/xapp-subscription-handle/{subscription_id}:
150     put:
151       tags:
152       - "handle"
153       summary: "API for updating the subscriber xApp list"
154       description: "By performing a PUT method on a xapp-subscription-handle/{subscription_id} resource, the API caller is able to update the Routing manager about the list of subscriber xApps related to the subscription denoted by the {subsription_id}."
155       operationId: "update_xapp_subscription_handle"
156       consumes:
157       - "application/json"
158 #      - "application/yaml"
159       produces:
160       - "application/json"
161 #      - "application/yaml"
162       parameters:
163         - in: path
164           name: subscription_id
165           required: true
166           type: integer
167           format: "uint16"
168           description: "Subscription ID"
169         - in: body
170           name: xapp-list
171           description: "xApp list"
172           required: true
173           schema:
174            $ref: "#/definitions/xapp-list"
175       responses:
176         400:
177           description: "Invalid data"
178         201:
179           description: "Xapp list received"
180   
181 definitions:
182   health-status:
183     type: "object"
184     properties:
185       status:
186         type: string
187         enum:
188         - healthy
189         - unhealthy
190   xapp-callback-data:
191     type: "object"
192     properties:
193       id:
194         type: "string"
195       event:
196         type: "string"
197       version:
198         type: "integer"
199         format: "int64"
200       xApps:
201         type: "string" #This should be a JSON object, array of xapps
202   xapp-subscription-data:
203     type: "object"
204     required:
205       - "address"
206       - "port"
207       - "subscription_id"
208     properties:
209       address:
210         type: "string" #This is the xapp instance hostname or ip address
211       port: #xapp instance port address
212         type: "integer"
213         format: "uint16"
214         minimum: 0
215         maximum: 65535
216       subscription_id: #subscription sequence number
217         type: "integer"
218         format: "int32"
219   xapp-list:
220     type: "array"
221     items:
222       $ref: '#/definitions/xapp-element'
223   xapp-element:
224     type: "object"
225     required:
226       - "address"
227       - "port"
228     properties:
229       address:
230         type: "string" #This is the xapp instance hostname or ip address
231       port: #xapp instance port address
232         type: "integer"
233         format: "uint16"
234         minimum: 0
235         maximum: 65535
236
237 externalDocs:
238   description: "Routing Manager"
239   url: "http://placeholder"
240
241