Update version number in container-tag for F Maintenance Release
[sim/a1-interface.git] / near-rt-ric-simulator / test / EXT_SRV / api / EXT_SRV_api.yaml
1 openapi: 3.0.0
2 info:
3   title: 'External Server for A1 simulator'
4   version: 0.0.1
5   description: |
6     External test server.
7     © 2022, O-RAN Alliance.
8     All rights reserved.
9   license:
10     name: Copyright (C) 2022 Nordix Foundation. Licensed under the Apache License.
11     url: http://www.apache.org/licenses/LICENSE-2.0
12 externalDocs:
13   description: 'An external server building CRUD RestFUL APIs which is provisioned by A1 simulator. It will be a refrence point for the callouts'
14   url: 'https://docs.o-ran-sc.org/projects/o-ran-sc-sim-a1-interface/en/latest/EXT_SRV_api.html'
15 servers:
16   - url: '{apiRoot}'
17     variables:
18       apiRoot:
19         default: 'http://www.example.com'
20 paths:
21   '/a1policies':
22     get:
23       operationId: server.get_all_a1_policies
24       description: 'Get all a1 policies'
25       tags:
26       - All a1policies
27       responses:
28         200:
29           description: 'Array of all a1 policies'
30           content:
31             application/json:
32               schema:
33                 type: array
34                 items:
35                   "$ref": "#/components/schemas/A1PolicyObject"
36                 minItems: 0
37         429:
38           "$ref": "#/components/responses/429-TooManyRequests"
39         503:
40           "$ref": "#/components/responses/503-ServiceUnavailable"
41   '/a1policy/{a1policyId}':
42     parameters:
43       - name: a1policyId
44         in: path
45         required: true
46         schema:
47           "$ref": "#/components/schemas/A1PolicyId"
48     get:
49       operationId: server.get_a1_policy
50       description: 'Query for an A1 policy'
51       tags:
52       - Single A1 Policy Object
53       responses:
54         200:
55           description: 'The requested A1 policy object'
56           content:
57             application/json:
58               schema:
59                 "$ref": "#/components/schemas/A1PolicyObject"
60         404:
61           "$ref": "#/components/responses/404-NotFound"
62         409:
63           "$ref": "#/components/responses/409-Conflict"
64         429:
65           "$ref": "#/components/responses/429-TooManyRequests"
66         503:
67           "$ref": "#/components/responses/503-ServiceUnavailable"
68     put:
69       operationId: server.put_a1_policy
70       description: 'Create an A1 policy'
71       tags:
72       - Individual A1 policy Object
73       requestBody:
74         required: true
75         content:
76           application/json:
77             schema:
78               "$ref": "#/components/schemas/A1PolicyObject"
79       responses:
80         200:
81           description: 'The A1 policy was updated'
82           content:
83             application/json:
84               schema:
85                 "$ref": "#/components/schemas/A1PolicyObject"
86         201:
87           description: 'The A1 policy was created'
88           content:
89             application/json:
90               schema:
91                 "$ref": "#/components/schemas/A1PolicyObject"
92           headers:
93             Location:
94               description: 'Contains the URI of the created A1 policy'
95               required: true
96               schema:
97                 type: string
98         400:
99           "$ref": "#/components/responses/400-BadRequest"
100         409:
101           "$ref": "#/components/responses/409-Conflict"
102         429:
103           "$ref": "#/components/responses/429-TooManyRequests"
104         503:
105           "$ref": "#/components/responses/503-ServiceUnavailable"
106         507:
107           "$ref": "#/components/responses/507-InsufficientStorage"
108
109     delete:
110       operationId: server.delete_a1_policy
111       description: 'Delete an A1 policy'
112       tags:
113       - Individual a1policy Object
114       responses:
115         204:
116           description: 'The A1 policy was deleted'
117         404:
118           "$ref": "#/components/responses/404-NotFound"
119         429:
120           "$ref": "#/components/responses/429-TooManyRequests"
121         503:
122           "$ref": "#/components/responses/503-ServiceUnavailable"
123
124 components:
125   schemas:
126     #
127     # Representation objects
128     #
129     A1PolicyObject:
130       title: 'Title'
131       description: 'A generic A1 policy object'
132       type: object
133
134     ProblemDetails:
135       description: 'A problem detail to carry details in a HTTP response according to RFC 7807'
136       type: object
137       properties:
138         type:
139           type: string
140         title:
141           type: string
142         status:
143           type: number
144         detail:
145           type: string
146         instance:
147           type: string
148
149     #
150     # Simple data types
151     #
152     JsonSchema:
153       description: 'A JSON schema following http://json-schema.org/draft-07/schema'
154       type: object
155
156     A1PolicyId:
157       description: 'A1 policy identifier.'
158       type: string
159
160   responses:
161     400-BadRequest:
162       description: 'A1 policy not properly formulated or not related to the method'
163       content:
164         application/problem+json:
165           schema:
166             "$ref": "#/components/schemas/ProblemDetails"
167
168     404-NotFound:
169       description: 'No resource found at the URI'
170       content:
171         application/problem+json:
172           schema:
173             "$ref": "#/components/schemas/ProblemDetails"
174
175     405-MethodNotAllowed:
176       description: 'Method not allowed for the URI'
177       content:
178         application/problem+json:
179           schema:
180             "$ref": "#/components/schemas/ProblemDetails"
181
182     409-Conflict:
183       description: 'Request could not be processed in the current state of the resource'
184       content:
185         application/problem+json:
186           schema:
187             "$ref": "#/components/schemas/ProblemDetails"
188
189     429-TooManyRequests:
190       description: 'Too many requests have been sent in a given amount of time'
191       content:
192         application/problem+json:
193           schema:
194             "$ref": "#/components/schemas/ProblemDetails"
195
196     503-ServiceUnavailable:
197       description: 'The provider is currently unable to handle the request due to a temporary overload'
198       content:
199         application/problem+json:
200           schema:
201             "$ref": "#/components/schemas/ProblemDetails"
202
203     507-InsufficientStorage:
204       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'
205       content:
206         application/problem+json:
207           schema:
208             "$ref": "#/components/schemas/ProblemDetails"