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