Merge "Fix: Update OpenSSF Scorecard to RelEng reusable"
[cps.git] / cps-ncmp-rest / docs / openapi / ncmp-inventory.yml
1 #  ============LICENSE_START=======================================================
2 #  Copyright (C) 2021 Bell Canada
3 #  Modifications Copyright (C) 2021-2025 OpenInfra Foundation Europe. All rights reserved.
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 #  SPDX-License-Identifier: Apache-2.0
18 #  ============LICENSE_END=========================================================
19
20 updateDmiRegistration:
21   post:
22     description: Register a DMI Plugin with any new, updated or removed CM Handles.
23     tags:
24       - network-cm-proxy-inventory
25     summary: DMI notifies NCMP of new CM Handles
26     operationId: updateDmiPluginRegistration
27     requestBody:
28       required: true
29       content:
30         application/json:
31           schema:
32             $ref: 'components.yaml#/components/schemas/RestDmiPluginRegistration'
33     responses:
34       200:
35         $ref: 'components.yaml#/components/responses/NoContent'
36       400:
37         $ref: 'components.yaml#/components/responses/BadRequest'
38       403:
39         $ref: 'components.yaml#/components/responses/Forbidden'
40       500:
41         description: Partial or Complete failure. The error details are provided in the response body and all supported error codes are documented in the example.
42         content:
43           application/json:
44             schema:
45               $ref: 'components.yaml#/components/schemas/DmiPluginRegistrationErrorResponse'
46             example:
47               failedCreatedCmHandles: [
48                 {
49                   "cmHandle": "my-cm-handle-01",
50                   "errorCode": "00",
51                   "errorText": "Unknown error. <error-details>"
52                 },
53                 {
54                   "cmHandle": "my-cm-handle-02",
55                   "errorCode": "01",
56                   "errorText": "cm-handle already exists"
57                 },
58                 {
59                   "cmHandle": "my-cm-handle-03",
60                   "errorCode": "03",
61                   "errorText": "cm-handle has an invalid character(s) in id"
62                 }
63               ]
64               failedUpdatedCmHandles: [
65                 {
66                   "cmHandle": "my-cm-handle-01",
67                   "errorCode": "00",
68                   "errorText": "Unknown error. <error-details>"
69                 },
70                 {
71                   "cmHandle": "my-cm-handle-02",
72                   "errorCode": "02",
73                   "errorText": "cm-handle does not exist"
74                 },
75                 {
76                   "cmHandle": "my-cm-handle-03",
77                   "errorCode": "03",
78                   "errorText": "cm-handle has an invalid character(s) in id"
79                 }
80               ]
81               failedRemovedCmHandles: [
82                 {
83                   "cmHandle": "my-cm-handle-01",
84                   "errorCode": "00",
85                   "errorText": "Unknown error. <error-details>"
86                 },
87                 {
88                   "cmHandle": "my-cm-handle-02",
89                   "errorCode": "02",
90                   "errorText": "cm-handle does not exists"
91                 },
92                 {
93                   "cmHandle": "my-cm-handle-03",
94                   "errorCode": "03",
95                   "errorText": "cm-handle has an invalid character(s) in id"
96                 }
97               ]
98
99 getAllCmHandleReferencesForRegisteredDmi:
100   get:
101     description: Get all cm handle references for a registered DMI plugin
102     tags:
103       - network-cm-proxy-inventory
104     summary: Get all cm handle references for a registered DMI plugin (DMI plugin, DMI data plugin, DMI model plugin)
105     operationId: getAllCmHandleReferencesForRegisteredDmi
106     parameters:
107       - $ref: 'components.yaml#/components/parameters/dmiPluginIdentifierInQuery'
108       - $ref: 'components.yaml#/components/parameters/outputAlternateIdOptionInQuery'
109     responses:
110       200:
111         description: OK
112         content:
113           application/json:
114             schema:
115               type: array
116               items:
117                 type: string
118       403:
119         $ref: 'components.yaml#/components/responses/Forbidden'
120       500:
121         $ref: 'components.yaml#/components/responses/InternalServerError'
122
123 searchCmHandleIds:
124   post:
125     description: Query and get cm handle references for additional properties, public properties and registered DMI plugin (DMI plugin, DMI data plugin, DMI model plugin).
126     tags:
127       - network-cm-proxy-inventory
128     summary: Query for CM Handle IDs
129     operationId: searchCmHandleIds
130     parameters:
131       - $ref: 'components.yaml#/components/parameters/outputAlternateIdOptionInQuery'
132     requestBody:
133       required: true
134       content:
135         application/json:
136           schema:
137             $ref: 'components.yaml#/components/schemas/CmHandleQueryParameters'
138     responses:
139       200:
140         description: OK
141         content:
142           application/json:
143             schema:
144               type: array
145               items:
146                 type: string
147       403:
148         $ref: 'components.yaml#/components/responses/Forbidden'
149       500:
150         $ref: 'components.yaml#/components/responses/InternalServerError'
151
152 searchCmHandles:
153   post:
154     description: Execute cm handle query search and return a list of cm handle details. Any number of conditions can be applied. To be included in the result a cm-handle must fulfill ALL the conditions. An empty collection will be returned in the case that the cm handle does not match a condition. For more on cm handle query search please refer to <a href="https://docs.onap.org/projects/onap-cps/en/latest/ncmp-cmhandle-querying.html">cm handle query search Read the Docs</a>.<br/>By supplying a CPS Path it is possible to query on any data related to the cm handle. For more on CPS Path please refer to <a href="https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html">CPS Path Read the Docs</a>. The cm handle ancestor is automatically returned for this query.
155     tags:
156       - network-cm-proxy-inventory
157     summary: Query Cm Handles for a requested DMI Service
158     operationId: searchCmHandles
159     parameters:
160       - name: includeCmHandlePropertiesInQuery
161         in: query
162         description: Whether to include additional properties in the response.
163         required: false
164         schema:
165           type: boolean
166     requestBody:
167       required: true
168       content:
169         application/json:
170           schema:
171             $ref: 'components.yaml#/components/schemas/CmHandleQueryParameters'
172     responses:
173       200:
174         description: OK
175         content:
176           application/json:
177             schema:
178               type: array
179               items:
180                 $ref: 'components.yaml#/components/schemas/RestOutputCmHandle'
181       400:
182         $ref: 'components.yaml#/components/responses/BadRequest'
183       403:
184         $ref: 'components.yaml#/components/responses/Forbidden'
185       500:
186         $ref: 'components.yaml#/components/responses/InternalServerError'