Fix Sonar complains
[oam/nf-oam-adopter.git] / ves-nf-oam-adopter / ves-nf-oam-adopter-app / docs / api / swagger / openapi.yaml
1 #  ============LICENSE_START=======================================================
2 #  Copyright © 2021 AT&T Intellectual Property. All rights reserved.
3 #  ================================================================================
4 #  Licensed under the Apache License, Version 2.0 (the "License");
5 #  you may not use this file except in compliance with the License.
6 #  You may obtain a copy of the License at
7 #
8 #        http://www.apache.org/licenses/LICENSE-2.0
9 #  Unless required by applicable law or agreed to in writing, software
10 #  distributed under the License is distributed on an "AS IS" BASIS,
11 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 #  See the License for the specific language governing permissions and
13 #  limitations under the License.
14 #
15 #  SPDX-License-Identifier: Apache-2.0
16 #  ============LICENSE_END=========================================================
17 openapi: 3.0.3
18 info:
19   title: O-RAN OAM Adopter PM Manager
20   description: API for O-RAN OAM Adopter PM Manager service.
21   version: "1.0.0"
22   license:
23     name: "Apache 2.0"
24     url: "http://www.apache.org/licenses/LICENSE-2.0"
25
26 servers:
27   - url: https://example.io/v1
28
29 security:
30   - BasicAuth: []
31
32 paths:
33   /:
34     get:
35       tags:
36         - controller
37       summary: Read all adapters host address
38       description: Returns a list of adapters host address
39       operationId: getAllAdapters
40       responses:
41         '200':
42           description: Successfully returned a list of adapters host address
43           content:
44             application/json:
45               schema:
46                 type: array
47                 items:
48                   type: string
49         '400':
50           $ref: '#/components/responses/BadRequest'
51         '401':
52           $ref: '#/components/responses/Unauthorized'
53
54   /adapter/{host}:
55     delete:
56       tags:
57         - controller
58       description: Delete an adapter by host address
59       operationId: removeAdapter
60       parameters:
61         - name: host
62           in: path
63           required: true
64           schema:
65             type: string
66
67       responses:
68         '200':
69           $ref: '#/components/responses/Success'
70         '400':
71           $ref: '#/components/responses/BadRequest'
72         '401':
73           $ref: '#/components/responses/Unauthorized'
74         '404':
75           $ref: '#/components/responses/NotFound'
76
77   /adapter:
78     post:
79       tags:
80         - controller
81       description: create an adapter instance
82       operationId: addAdapter
83       requestBody:
84         required: true
85         content:
86           application/json:
87             schema:
88               $ref: '#/components/schemas/Adapter'
89       responses:
90         '200':
91           $ref: '#/components/responses/Success'
92         '400':
93           $ref: '#/components/responses/BadRequest'
94         '401':
95           $ref: '#/components/responses/Unauthorized'
96
97 components:
98   schemas:
99     ErrorMessage:
100       type: object
101       title: Error
102       properties:
103         status:
104           type: string
105         message:
106           type: string
107
108     Adapter:
109       type: object
110       properties:
111         host:
112           type: string
113         mechId:
114           type: object
115           properties:
116             username:
117               type: string
118             password:
119               type: string
120           required:
121             - username
122             - password
123       required:
124         - host
125         - mechId
126
127   responses:
128     Success:
129       description: Succesfully excecuted
130     BadRequest:
131       description: Invalid request
132       content:
133         application/json:
134           schema:
135             $ref: '#/components/schemas/ErrorMessage'
136     Unauthorized:
137       description: Unhautorized request
138       content:
139         application/json:
140           schema:
141             $ref: '#/components/schemas/ErrorMessage'
142     NotFound:
143       description: Not Found
144       content:
145         application/json:
146           schema:
147             $ref: '#/components/schemas/ErrorMessage'
148