Integrate EPSDK-FW library for auth and users
[portal/ric-dashboard.git] / a1-med-client / src / main / resources / a1_mediator_0.4.0.yaml
1 # ========================LICENSE_START=================================
2 # O-RAN-SC
3 # %%
4 # Copyright (C) 2019 AT&T Intellectual Property and 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 # ========================LICENSE_END===================================
18 openapi: 3.0.0
19 info:
20   version: 0.4.0
21   title: RIC A1
22 paths:
23   '/ric/policies/{policyname}':
24     parameters:
25       - name: policyname
26         in: path
27         description: the name of the policy to retrieve or replace
28         required: true
29         schema:
30           type: string
31     put:
32       description: >
33           Replace the current operation of policyname with the new parameters (replaces the current policy with the new one specified here).
34
35
36           Until there are standard policy definitions that are defined OUTSIDE of the scope of xapps, this API will be *very underspecified*.
37           This is a known gap, do not despair.
38           The PUT body is specified, *currently* in the xapp manifest that implements this policy; the caller should refer to the message_receives_payload_schema field to make this request.
39           The return content is also specified as above (in the xapp manifest) in the message_sends_payload_schema field.
40
41
42           Eventually, we need concrete policy defintions that are decoupled from xapp, and then this API description will become more fully specified.
43       tags:
44         - A1 Mediator
45       operationId: a1.controller.put_handler
46       requestBody:
47         content:
48           application/json:
49             schema:
50               type: object
51
52
53       responses:
54         '200':
55           description: >
56             The downstream component responsible for implementing this policy replied with a good response. Check the manifest for response details.
57         '400':
58           description: >
59             Bad PUT body for this policyname
60         '404':
61           description: >
62             there is no policy with this name
63         '502':
64           description: >
65             The xapp that implements this policy replied, but the reply was a "failure", OR there was no status indicating success or failure.
66             This returns an object containing the reason, and the return payload.
67           content:
68             application/json:
69               schema:
70                 type: object
71                 properties:
72                   reason:
73                     type: string
74                     enum: [
75                         "NO STATUS",
76                         "BAD STATUS",
77                         "NOT JSON"
78                     ]
79                   return_payload:
80                     type: object
81
82         '504':
83           description: >
84             the downstream component responsible for handling this policy did not respond (in time)
85
86     get:
87       description: Get the current state/value of policyname
88       tags:
89         - A1 Mediator
90       operationId: a1.controller.get_handler
91       responses:
92         '200':
93           description: >
94             policy state successfully retrieved.
95             TODO, what describes the format returned here?
96             content:
97               application/json:
98                 schema:
99                   type: object
100         '404':
101           description: there is no policy with this name
102