Implement GET and /healthcheck
[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.9.0
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   '/ric/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
47           Until there are standard policy definitions that are defined OUTSIDE of the scope of xapps, this API will be *very underspecified*.
48           This is a known gap, do not despair.
49           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.
50           The return content is also specified as above (in the xapp manifest) in the message_sends_payload_schema field.
51
52
53           Eventually, we need concrete policy defintions that are decoupled from xapp, and then this API description will become more fully specified.
54       tags:
55         - A1 Mediator
56       operationId: a1.controller.put_handler
57       requestBody:
58         content:
59           application/json:
60             schema:
61               type: object
62
63
64       responses:
65         '200':
66           description: >
67             The downstream component responsible for implementing this policy replied with a good response. Check the manifest for response details.
68         '400':
69           description: >
70             Bad PUT body for this policyname
71         '404':
72           description: >
73             there is no policy with this name
74         '502':
75           description: >
76             The xapp that implements this policy replied, but the reply was a "failure", OR there was no status indicating success or failure.
77             This returns an object containing the reason, and the return payload.
78           content:
79             application/json:
80               schema:
81                 type: object
82                 properties:
83                   reason:
84                     type: string
85                     enum: [
86                         "NO STATUS",
87                         "BAD STATUS",
88                         "NOT JSON"
89                     ]
90                   return_payload:
91                     type: object
92
93         '504':
94           description: >
95             the downstream component responsible for handling this policy did not respond (in time)
96
97     get:
98       description: Get the current state/value of policyname
99       tags:
100         - A1 Mediator
101       operationId: a1.controller.get_handler
102       responses:
103         '200':
104           description: >
105             The downstream component responsible for implementing this policy replied with a good response. Check the manifest for response details.
106         '400':
107           description: >
108             The downstream component for implementing this policy does not support policy fetching.
109         '404':
110           description: >
111             there is no policy with this name
112         '504':
113           description: >
114             the downstream component responsible for handling this policy did not respond (in time)
115
116