Update version number in container-tag for F Maintenance Release
[sim/a1-interface.git] / near-rt-ric-simulator / test / KAFKA_DISPATCHER / api / KAFKA_DISPATCHER_api.yaml
1 openapi: 3.0.0
2 info:
3   title: 'Kafka message dispatcher for A1 interface'
4   version: 0.0.1
5   description: |
6     Kafka message dispatcher server.
7   license:
8     name: Copyright (C) 2022 Nordix Foundation. Licensed under the Apache License.
9     url: http://www.apache.org/licenses/LICENSE-2.0
10 externalDocs:
11   description: 'RestFUL APIs that create and dispatch Kafka messages to Kafka brokers'
12   url: 'https://docs.o-ran-sc.org/projects/o-ran-sc-sim-a1-interface/en/latest/index.html'
13 servers:
14   - url: '{apiRoot}'
15     variables:
16       apiRoot:
17         default: 'https://example.com'
18 paths:
19   '/policytypetotopicmapping/{policyTypeId}':
20     parameters:
21       - name: policyTypeId
22         in: path
23         required: true
24         schema:
25           "$ref": "#/components/schemas/PolicyTypeId"
26     get:
27       operationId: dispatcher.get_policy_type_to_topic_mapping
28       description: 'Get the kafka request and response topic map corresponding to policy type'
29       tags:
30       - The mapping from policy type to kafka topic request and response object
31       responses:
32         200:
33           description: 'The policy type to topic map schemas'
34           content:
35             application/json:
36               schema:
37                 "$ref": "#/components/schemas/PolicyTypeToTopicMap"
38         404:
39           "$ref": "#/components/responses/404-NotFound"
40         429:
41           "$ref": "#/components/responses/429-TooManyRequests"
42         503:
43           "$ref": "#/components/responses/503-ServiceUnavailable"
44
45   '/policytypes/{policyTypeId}/kafkadispatcher/{policyId}':
46     parameters:
47       - name: policyTypeId
48         in: path
49         required: true
50         schema:
51           "$ref": "#/components/schemas/PolicyTypeId"
52       - name: policyId
53         in: path
54         required: true
55         schema:
56           "$ref": "#/components/schemas/A1PolicyId"
57     put:
58       operationId: dispatcher.put_policy
59       description: 'Dispatch create and update operation as kafka message to kafka cluster'
60       tags:
61       - Individual policy Object
62       requestBody:
63         required: true
64         content:
65           application/json:
66             schema:
67               "$ref": "#/components/schemas/A1PolicyObject"
68       responses:
69         200:
70           description: 'Create or update operation dispatched'
71         400:
72           "$ref": "#/components/responses/400-BadRequest"
73         408:
74           "$ref": "#/components/responses/408-RequestTimeout"
75         419:
76           "$ref": "#/components/responses/419-KafkaMessagePublishFailed"
77         429:
78           "$ref": "#/components/responses/429-TooManyRequests"
79         503:
80           "$ref": "#/components/responses/503-ServiceUnavailable"
81         507:
82           "$ref": "#/components/responses/507-InsufficientStorage"
83     delete:
84       operationId: dispatcher.delete_policy
85       description: 'Dispatch policy delete opertion as kafka message to kafka cluster'
86       responses:
87         200:
88           description: 'Delete operation dispatched'
89         408:
90           "$ref": "#/components/responses/408-RequestTimeout"
91         419:
92           "$ref": "#/components/responses/419-KafkaMessagePublishFailed"
93         429:
94           "$ref": "#/components/responses/429-TooManyRequests"
95         503:
96           "$ref": "#/components/responses/503-ServiceUnavailable"
97
98   '/policytypes/{policyTypeId}/kafkadispatcher/{policyId}/status':
99     parameters:
100       - name: policyTypeId
101         in: path
102         required: true
103         schema:
104           "$ref": "#/components/schemas/PolicyTypeId"
105       - name: policyId
106         in: path
107         required: true
108         schema:
109           "$ref": "#/components/schemas/A1PolicyId"
110     get:
111       operationId: dispatcher.get_policy_status
112       description: 'Dispatch policy status query opertion as kafka message to kafka cluster'
113       tags:
114       - Individual A1 Policy Status Object
115       responses:
116         200:
117           description: 'Query policy status operation dispatched'
118         429:
119           "$ref": "#/components/responses/429-TooManyRequests"
120         503:
121           "$ref": "#/components/responses/503-ServiceUnavailable"
122
123 components:
124   schemas:
125     #
126     # Representation objects
127     #
128     A1PolicyObject:
129       description: 'A generic policy object'
130       type: object
131
132     A1Policy:
133       description: 'A generic policy string'
134       type: string
135
136     PolicyTypeToTopicMap:
137       description: 'Request and response topic map for each policy type'
138       type: object
139       properties:
140         policy_type:
141           type: object
142           properties:
143             request_topic:
144               type: string
145               example: kafkatopicreq
146             response_topic:
147               type: string
148               example: kafkatopicres
149
150     ProblemDetails:
151       description: 'A problem detail to carry details in a HTTP response according to RFC 7807'
152       type: object
153       properties:
154         type:
155           type: string
156         title:
157           type: string
158         status:
159           type: number
160         detail:
161           type: string
162         instance:
163           type: string
164
165     #
166     # Simple data types
167     #
168     JsonSchema:
169       description: 'A JSON schema following http://json-schema.org/draft-07/schema'
170       type: object
171
172     A1PolicyId:
173       description: 'A1 policy identifier.'
174       type: string
175
176     PolicyTypeId:
177       description: 'Policy type identifier assigned by the A1-P Provider'
178       type: string
179
180   responses:
181     400-BadRequest:
182       description: 'A1 policy not properly formulated or not related to the method'
183       content:
184         application/problem+json:
185           schema:
186             "$ref": "#/components/schemas/ProblemDetails"
187
188     404-NotFound:
189       description: 'No resource found at the URI'
190       content:
191         application/problem+json:
192           schema:
193             "$ref": "#/components/schemas/ProblemDetails"
194
195     405-MethodNotAllowed:
196       description: 'Method not allowed for the URI'
197       content:
198         application/problem+json:
199           schema:
200             "$ref": "#/components/schemas/ProblemDetails"
201
202     408-RequestTimeout:
203       description: 'Request could not be processed in given amount of time'
204       content:
205         application/problem+json:
206           schema:
207             "$ref": "#/components/schemas/ProblemDetails"
208
209     409-Conflict:
210       description: 'Request could not be processed in the current state of the resource'
211       content:
212         application/problem+json:
213           schema:
214             "$ref": "#/components/schemas/ProblemDetails"
215
216     419-KafkaMessagePublishFailed:
217       description: 'Publishing the kafka message to the broker gets fail'
218       content:
219         application/problem+json:
220           schema:
221             "$ref": "#/components/schemas/ProblemDetails"
222
223     429-TooManyRequests:
224       description: 'Too many requests have been sent in a given amount of time'
225       content:
226         application/problem+json:
227           schema:
228             "$ref": "#/components/schemas/ProblemDetails"
229
230     503-ServiceUnavailable:
231       description: 'The provider is currently unable to handle the request due to a temporary overload'
232       content:
233         application/problem+json:
234           schema:
235             "$ref": "#/components/schemas/ProblemDetails"
236
237     507-InsufficientStorage:
238       description: 'The method could not be performed on the resource because the provider is unable to store the representation needed to successfully complete the request'
239       content:
240         application/problem+json:
241           schema:
242             "$ref": "#/components/schemas/ProblemDetails"