Include content type in a1 api. Not a change, no version bumps.
[ric-plt/a1.git] / a1 / openapi.yaml
1 # ==================================================================================
2 #       Copyright (c) 2019 Nokia
3 #       Copyright (c) 2018-2019 AT&T Intellectual Property.
4 #
5 #   Licensed under the Apache License, Version 2.0 (the "License");
6 #   you may not use this file except in compliance with the License.
7 #   You may obtain a copy of the License at
8 #
9 #          http://www.apache.org/licenses/LICENSE-2.0
10 #
11 #   Unless required by applicable law or agreed to in writing, software
12 #   distributed under the License is distributed on an "AS IS" BASIS,
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 #   See the License for the specific language governing permissions and
15 #   limitations under the License.
16 # ==================================================================================
17 openapi: 3.0.0
18 info:
19   version: 0.10.3
20   title: RIC A1
21 paths:
22   '/a1-p/healthcheck':
23     get:
24       description: >
25         perform a healthcheck on a1
26       tags:
27         - A1 Mediator
28       operationId: a1.controller.healthcheck_handler
29       responses:
30         200:
31           description: >
32             a1 is healthy. Anything other than a 200 should be considered a1 as failing
33
34   '/a1-p/policies/{policyname}':
35     parameters:
36       - name: policyname
37         in: path
38         description: the name of the policy to retrieve or replace
39         required: true
40         schema:
41           type: string
42     put:
43       description: >
44           Replace the current operation of policyname with the new parameters (replaces the current policy with the new one specified here).
45
46           Until there are standard policy definitions that are defined OUTSIDE of the scope of xapps, this API will be *very underspecified*.
47           This is a known gap, do not despair.
48           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.
49           The return content is also specified as above (in the xapp manifest) in the message_sends_payload_schema field.
50
51           Eventually, we need concrete policy defintions that are decoupled from xapp, and then this API description will become more fully specified.
52       tags:
53         - A1 Mediator
54       operationId: a1.controller.put_handler
55       requestBody:
56         content:
57           application/json:
58             schema:
59               type: object
60
61
62       responses:
63         '200':
64           description: >
65             The downstream component responsible for implementing this policy replied with a good response. Check the manifest for response details.
66         '400':
67           description: >
68             Bad PUT body for this policyname
69         '404':
70           description: >
71             there is no policy with this name
72         '502':
73           description: >
74             The xapp that implements this policy replied, but the reply was a "failure", OR there was no status indicating success or failure.
75             This returns an object containing the reason, and the return payload.
76           content:
77             application/json:
78               schema:
79                 type: object
80                 properties:
81                   reason:
82                     type: string
83                     enum: [
84                         "NO STATUS",
85                         "BAD STATUS",
86                         "NOT JSON"
87                     ]
88                   return_payload:
89                     type: object
90
91         '504':
92           description: >
93             the downstream component responsible for handling this policy did not respond (in time)
94
95     get:
96       description: Get the current state/value of policyname
97       tags:
98         - A1 Mediator
99       operationId: a1.controller.get_handler
100       responses:
101         '200':
102           description: >
103             The downstream component responsible for implementing this policy replied with a good response. Check the manifest for response details.
104           content:
105             application/json:
106               schema:
107                 type: object
108         '400':
109           description: >
110             The downstream component for implementing this policy does not support policy fetching.
111         '404':
112           description: >
113             there is no policy with this name
114         '504':
115           description: >
116             the downstream component responsible for handling this policy did not respond (in time)
117
118