002bde41cfb0a5aa3f6c0de470abad4f1f47abc7
[sim/a1-interface.git] / near-rt-ric-simulator / api / STD_1.1.3 / STD_A1.yaml
1 openapi: 3.0.0
2 info:
3   title: 'A1-P Policy Management Service'
4   version: 1.1.3
5   description: |
6     API for Policy Management Service.
7     © 2019, O-RAN Alliance.
8     All rights reserved.
9 externalDocs:
10   description: 'ORAN-WG2.A1.AP-v01.01 A1 interface: Application protocol'
11   url: 'https://www.o-ran.org/specifications'
12 servers:
13   - url: '{apiRoot}/A1-P/v1'
14     variables:
15       apiRoot:
16         default: 'https://example.com'
17         description: 'apiRoot as defined in clause 4.2.1 in ORAN-WG2.A1.AP'
18 paths:
19   '/policies':
20     get:
21       operationId: a1.get_all_policy_identities
22       description: 'Get all policy identities'
23       tags:
24       - All Policy Identities
25       responses:
26         200:
27           description: 'Array of all policy identities'
28           content:
29             application/json:
30               schema:
31                 type: array
32                 items:
33                   "$ref": "#/components/schemas/PolicyId"
34                 minItems: 0
35         429:
36           "$ref": "#/components/responses/429-TooManyRequests"
37         503:
38           "$ref": "#/components/responses/503-ServiceUnavailable"
39
40   '/policies/{policyId}':
41     parameters:
42       - name: policyId
43         in: path
44         required: true
45         schema:
46           "$ref": "#/components/schemas/PolicyId"
47     put:
48       operationId: a1.put_policy
49       description: 'Create, or update, a policy'
50       tags:
51       - Individual Policy Object
52       parameters:
53         - name: notificationDestination
54           in: query
55           required: false
56           schema:
57             "$ref": "#/components/schemas/NotificationDestination"
58       requestBody:
59         required: true
60         content:
61           application/json:
62             schema:
63               "$ref": "#/components/schemas/PolicyObject"
64       responses:
65         200:
66           description: 'The policy was updated'
67           content:
68             application/json:
69               schema:
70                 "$ref": "#/components/schemas/PolicyObject"
71         201:
72           description: 'The policy was created'
73           content:
74             application/json:
75               schema:
76                 "$ref": "#/components/schemas/PolicyObject"
77           headers:
78             Location:
79               description: 'Contains the URI of the created policy'
80               required: true
81               schema:
82                 type: string
83
84         400:
85           "$ref": "#/components/responses/400-BadRequest"
86         409:
87           "$ref": "#/components/responses/409-Conflict"
88         429:
89           "$ref": "#/components/responses/429-TooManyRequests"
90         503:
91           "$ref": "#/components/responses/503-ServiceUnavailable"
92         507:
93           "$ref": "#/components/responses/507-InsufficientStorage"
94       callbacks:
95         policyStatusNotification:
96           '{$request.query.notificationDestination}':
97             post:
98               description: 'Notify about status changes for this policy'
99               requestBody:
100                 required: true
101                 content:
102                   application/json:
103                     schema:
104                       "$ref": "#/components/schemas/PolicyStatusObject"
105               responses:
106                 204:
107                   description: 'Notification received'
108     get:
109       operationId: a1.get_policy
110       description: 'Query a policy'
111       tags:
112       - Individual Policy Object
113       responses:
114         200:
115           description: 'The requested policy'
116           content:
117             application/json:
118               schema:
119                 "$ref": "#/components/schemas/PolicyObject"
120         404:
121           "$ref": "#/components/responses/404-NotFound"
122         409:
123           "$ref": "#/components/responses/409-Conflict"
124         429:
125           "$ref": "#/components/responses/429-TooManyRequests"
126         503:
127           "$ref": "#/components/responses/503-ServiceUnavailable"
128     delete:
129       operationId: a1.delete_policy
130       description: 'Delete a policy'
131       tags:
132       - Individual Policy Object
133       responses:
134         204:
135           description: 'The policy was deleted'
136         404:
137           "$ref": "#/components/responses/404-NotFound"
138         429:
139           "$ref": "#/components/responses/429-TooManyRequests"
140         503:
141           "$ref": "#/components/responses/503-ServiceUnavailable"
142
143   '/policies/{policyId}/status':
144     parameters:
145       - name: policyId
146         in: path
147         required: true
148         schema:
149           "$ref": "#/components/schemas/PolicyId"
150     get:
151       operationId: a1.get_policy_status
152       description: 'Query a policy status'
153       tags:
154       - Individual Policy Status Object
155       responses:
156         200:
157           description: 'The requested policy status'
158           content:
159             application/json:
160               schema:
161                 "$ref": "#/components/schemas/PolicyStatusObject"
162         404:
163           "$ref": "#/components/responses/404-NotFound"
164         409:
165           "$ref": "#/components/responses/409-Conflict"
166         429:
167           "$ref": "#/components/responses/429-TooManyRequests"
168         503:
169           "$ref": "#/components/responses/503-ServiceUnavailable"
170
171 components:
172   schemas:
173     #
174     # Representation objects
175     #
176     PolicyObject:
177       description: 'A generic policy object that can be used to transport any policy. Additionally, a policy shall be valid according to the schema of its specific policy type.'
178       type: object
179
180     PolicyStatusObject:
181       description: 'A generic policy status object that can be used to transport any policy status. Additionally, a policy status shall be valid according to the schema of its specific policy type.'
182       type: object
183
184     ProblemDetails:
185       description: 'A problem detail to carry details in a HTTP response according to RFC 7807'
186       type: object
187       properties:
188         type:
189           type: string
190         title:
191           type: string
192         status:
193           type: number
194         detail:
195           type: string
196         instance:
197           type: string
198
199     #
200     # Simple data types
201     #
202     NotificationDestination:
203       description: 'A complete callback URI defined according to IETF RFC 3986 where to send notifications'
204       type: string
205
206     PolicyId:
207       description: 'Policy identifier assigned by the A1-P Consumer when a policy is created'
208       type: string
209
210   responses:
211     400-BadRequest:
212       description: 'Object in payload not properly formulated or not related to the method'
213       content:
214         application/problem+json:
215           schema:
216             "$ref": "#/components/schemas/ProblemDetails"
217
218     404-NotFound:
219       description: 'No resource found at the URI'
220       content:
221         application/problem+json:
222           schema:
223             "$ref": "#/components/schemas/ProblemDetails"
224
225     405-MethodNotAllowed:
226       description: 'Method not allowed for the URI'
227       content:
228         application/problem+json:
229           schema:
230             "$ref": "#/components/schemas/ProblemDetails"
231
232     409-Conflict:
233       description: 'Request could not be processed in the current state of the resource'
234       content:
235         application/problem+json:
236           schema:
237             "$ref": "#/components/schemas/ProblemDetails"
238
239     429-TooManyRequests:
240       description: 'Too many requests have been sent in a given amount of time'
241       content:
242         application/problem+json:
243           schema:
244             "$ref": "#/components/schemas/ProblemDetails"
245
246     503-ServiceUnavailable:
247       description: 'The provider is currently unable to handle the request due to a temporary overload'
248       content:
249         application/problem+json:
250           schema:
251             "$ref": "#/components/schemas/ProblemDetails"
252
253     507-InsufficientStorage:
254       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'
255       content:
256         application/problem+json:
257           schema:
258             "$ref": "#/components/schemas/ProblemDetails"