update link to upper-constraints.txt
[dcaegen2.git] / docs / sections / apis / pmsh_swagger.yml
1 # ============LICENSE_START=======================================================
2 #  Copyright (C) 2020-2022 Nordix Foundation.
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 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16 # SPDX-License-Identifier: Apache-2.0
17 # ============LICENSE_END=========================================================
18
19 swagger: "2.0"
20 info:
21   title: PM Subscription Handler Service
22   version: "2.0.0"
23   description: PM subscription handler enables control of performance management jobs on network functions in ONAP
24 consumes:
25   - "application/json"
26 produces:
27   - "application/json"
28 basePath: "/"
29 schemes:
30   - https
31   - http
32 # Paths supported by the server application
33 paths:
34   /healthcheck:
35     get:
36       operationId: mod.api.controller.status
37       tags:
38         - "HealthCheck"
39       description: >-
40         This is the health check endpoint. If this returns a 200, the server is alive.
41       responses:
42         200:
43           description: Successful response
44           schema:
45             type: object
46             properties:
47               status:
48                 type: string
49                 description: Overall health of PMSH
50                 enum: [healthy, unhealthy]
51         503:
52           description: The PMSH service is unavailable
53
54   /subscription:
55     post:
56       tags:
57         - "Subscription"
58       description: >-
59         Create a PM Subscription
60       operationId: mod.api.controller.post_subscription
61       parameters:
62         - in: "body"
63           name: "body"
64           required: true
65           schema:
66             $ref: "#/definitions/subscription"
67       responses:
68         201:
69           description: Successfully created PM Subscription
70         409:
71           description: Duplicate data
72         400:
73           description: Invalid input
74
75     get:
76       description: Get all the subscriptions from PMSH.
77       operationId: mod.api.controller.get_subscriptions
78       tags:
79         - "Subscription"
80       responses:
81         200:
82           description: OK; Array of subscriptions are returned else empty if not found
83           schema:
84             type: array
85             items:
86               $ref: "#/definitions/subscription"
87         500:
88           description: Exception occurred while querying database
89
90   /subscription/{subscription_name}:
91     get:
92       description: Get the Subscription from PMSH specified by Name
93       operationId: mod.api.controller.get_subscription_by_name
94       tags:
95         - "Subscription"
96       parameters:
97         - name: subscription_name
98           in: path
99           required: true
100           description: Name of the subscription
101           type: string
102       responses:
103         200:
104           description: OK; Requested Subscription was returned
105           schema:
106             $ref : "#/definitions/subscription"
107         404:
108           description: Subscription with specified name not found
109         500:
110           description: Exception occurred while querying database
111
112     delete:
113       description: Deletes the Subscription from PMSH specified by Name
114       operationId: mod.api.controller.delete_subscription_by_name
115       tags:
116         - "Subscription"
117       parameters:
118         - name: subscription_name
119           in: path
120           required: true
121           description: The name of the subscription to delete
122           type: string
123       responses:
124         204:
125           description: Successfully deleted the subscription and returns NO Content
126         404:
127           description: Subscription with the specified name not found
128         409:
129           description: Subscription could not be deleted as it contains measurement groups
130             with state UNLOCKED OR state change to LOCKED was under process
131         500:
132           description: Exception occurred on the server
133
134   /subscription/{subscription_name}/nfFilter:
135     put:
136       description: Update nfFilter for
137       tags:
138         - "Subscription"
139       parameters:
140         - name: subscription_name
141           in: path
142           required: true
143           description: Name of the subscription
144           type: string
145         - name: "body"
146           in: "body"
147           required: true
148           schema:
149             $ref: "#/definitions/nfFilter"
150       responses:
151         201:
152           description: Successfully updated filter
153         409:
154           description: Duplicate data
155         400:
156           description: Invalid input
157
158
159   /subscription/{subscription_name}/measurementGroups/{measurement_group_name}:
160     get:
161       description: Get the  measurement group and associated network functions
162         from PMSH by using sub name and meas group name
163       operationId: mod.api.controller.get_meas_group_with_nfs
164       tags:
165         - "measurement group"
166       parameters:
167         - name : subscription_name
168           in: path
169           required: true
170           description: Name of the subscription
171           type: string
172         - name: measurement_group_name
173           in: path
174           required: true
175           description: Name of the measurement group name
176           type: string
177       responses:
178         200:
179           description: OK; Received requested measurement group with associated NF's
180           schema:
181             $ref : "#/definitions/measGroupWithNFs"
182         404:
183           description: Measurement group with specified name not found
184         500:
185           description: Exception occurred while querying database
186
187     post:
188       description: Create a measurement group
189       tags:
190         - "measurement group"
191       parameters:
192         - name : subscription_name
193           in: path
194           required: true
195           description: Name of the subscription
196           type: string
197         - name: measurement_group_name
198           in: path
199           required: true
200           description: Name of the measurement group name
201           type: string
202         - name : "body"
203           in: "body"
204           required: true
205           schema:
206             $ref: "#/definitions/measurementGroup"
207       responses:
208         201:
209           description: Successfully created measurement group
210         409:
211           description: Duplicate data
212         400:
213           description: Invalid input
214
215     delete:
216       description: Delete a measurement group
217       tags:
218         - "measurement group"
219       parameters:
220         - name : subscription_name
221           in: path
222           required: true
223           description: Name of the subscription
224           type: string
225         - name: measurement_group_name
226           in: path
227           required: true
228           description: Name of the measurement group name
229           type: string
230       responses:
231         204:
232           description: Successfully deleted the measurement group and returns NO Content
233         404:
234           description: Measurement group with the specified name not found
235         409:
236           description: Measurement  not deleted because state UNLOCKED OR state change to LOCKED was under process
237         500:
238           description: Exception occurred on the server
239
240   /subscription/{subscription_name}/measurementGroups/{measurement_group_name}/{administrativeState}:
241     put:
242       description: Update administrative state for a measurement group
243       tags:
244         - "measurement group"
245       parameters:
246         - name: subscription_name
247           in: path
248           required: true
249           description: Name of the subscription
250           type: string
251         - name: measurement_group_name
252           in: path
253           required: true
254           description: Name of the measurement group name
255           type: string
256         - name: administrativeState
257           in: path
258           required: true
259           description: New administrative state of measurement group
260           type: string
261       responses:
262         201:
263           description: Successfully updated administrative state
264         409:
265           description: Duplicate data
266         400:
267           description: Invalid input
268
269 definitions:
270   subscription:
271     type: object
272     properties:
273       subscription:
274         type: object
275         properties:
276           subscriptionName:
277             type: string
278           operationalPolicyName:
279             type: string
280           controlLoopName:
281             type: string
282           nfFilter:
283             $ref: "#/definitions/nfFilter"
284           measurementGroups:
285             type: array
286             minItems: 1
287             items:
288               $ref: "#/definitions/measurementGroup"
289         required:
290           - subscriptionName
291           - operationalPolicyName
292           - nfFilter
293           - measurementGroups
294     required:
295       - subscription
296
297   nfFilter:
298     type: object
299     description: "At least one valid filter value within nfFilter is required"
300     additionalProperties: false
301     properties:
302       nfNames:
303         type: array
304         items:
305           type: string
306       modelInvariantIDs:
307         type: array
308         items:
309           type: string
310       modelVersionIDs:
311         type: array
312         items:
313           type: string
314       modelNames:
315         type: array
316         items:
317           type: string
318     required:
319       - nfNames
320       - modelInvariantIDs
321       - modelVersionIDs
322       - modelNames
323
324   measurementGroup:
325     type: object
326     properties:
327       measurementGroup:
328         type: object
329         properties:
330           measurementGroupName:
331             type: string
332           fileBasedGP:
333             type: integer
334           fileLocation:
335             type: string
336           administrativeState:
337             type: string
338             enum: [LOCKED, UNLOCKED]
339           measurementTypes:
340             type: array
341             minItems: 1
342             items:
343               $ref: "#/definitions/measurementType"
344           managedObjectDNsBasic:
345             type: array
346             minItems: 1
347             items:
348               $ref: "#/definitions/managedObjectDNs"
349         allOf:
350           - required:
351               - measurementGroupName
352               - fileBasedGP
353               - fileLocation
354               - administrativeState
355               - measurementTypes
356               - managedObjectDNsBasic
357     required:
358       - measurementGroup
359
360   measurementType:
361     type: object
362     properties:
363       measurementType:
364         type: string
365     required:
366       - measurementType
367
368   managedObjectDNs:
369     type: object
370     properties:
371       DN:
372         type: string
373     required:
374       - DN
375
376   measGroupWithNFs:
377     type: object
378     properties:
379       subscriptionName:
380         type: string
381       measurementGroupName:
382         type: string
383       administrativeState:
384         type: string
385         enum: [ LOCKED, UNLOCKED ]
386       fileBasedGP:
387         type: integer
388       fileLocation:
389         type: string
390       measurementTypes:
391         type: array
392         minItems: 1
393         items:
394           $ref: "#/definitions/measurementType"
395       managedObjectDNsBasic:
396         type: array
397         minItems: 1
398         items:
399           $ref: "#/definitions/managedObjectDNs"
400       network_functions:
401         type: array
402         items:
403           type: object
404           properties:
405             nfName:
406               type: string
407               description: Name of the Network Function
408             ipv4Address:
409               type: string
410               description: Address of the IPV4
411             ipv6Address:
412               type: string
413               description: Address of the IPV6
414             nfMgStatus:
415               type: string
416               description: status of network function for one meas group
417             modelInvariantId:
418               type: string
419               description: ID of the model invariant
420             modelVersionId:
421               type: string
422               description: ID of the model version
423             modelName:
424               type: string
425               description: Name of the model
426             sdncModelName:
427               type: string
428               description: Name of the sdnc model
429             sdncModelVersion:
430               type: string
431               description: Version of the sdnc model