update link to upper-constraints.txt
[dcaegen2.git] / docs / sections / apis / pmsh_swagger.json
1 {
2   "swagger": "2.0",
3   "info": {
4     "title": "PM Subscription Handler Service",
5     "version": "2.0.0",
6     "description": "PM subscription handler enables control of performance management jobs on network functions in ONAP"
7   },
8   "consumes": [
9     "application/json"
10   ],
11   "produces": [
12     "application/json"
13   ],
14   "basePath": "/",
15   "schemes": [
16     "https",
17     "http"
18   ],
19   "paths": {
20     "/healthcheck": {
21       "get": {
22         "operationId": "mod.api.controller.status",
23         "tags": [
24           "HealthCheck"
25         ],
26         "description": "This is the health check endpoint. If this returns a 200, the server is alive.",
27         "responses": {
28           "200": {
29             "description": "Successful response",
30             "schema": {
31               "type": "object",
32               "properties": {
33                 "status": {
34                   "type": "string",
35                   "description": "Overall health of PMSH",
36                   "enum": [
37                     "healthy",
38                     "unhealthy"
39                   ]
40                 }
41               }
42             }
43           },
44           "503": {
45             "description": "The PMSH service is unavailable"
46           }
47         }
48       }
49     },
50     "/subscription": {
51       "post": {
52         "tags": [
53           "Subscription"
54         ],
55         "description": "Create a PM Subscription",
56         "operationId": "mod.api.controller.post_subscription",
57         "parameters": [
58           {
59             "in": "body",
60             "name": "body",
61             "required": true,
62             "schema": {
63               "$ref": "#/definitions/subscription"
64             }
65           }
66         ],
67         "responses": {
68           "201": {
69             "description": "Successfully created PM Subscription"
70           },
71           "400": {
72             "description": "Invalid input"
73           },
74           "409": {
75             "description": "Duplicate data"
76           }
77         }
78       },
79       "get": {
80         "description": "Get all the subscriptions from PMSH.",
81         "operationId": "mod.api.controller.get_subscriptions",
82         "tags": [
83           "Subscription"
84         ],
85         "responses": {
86           "200": {
87             "description": "OK; Array of subscriptions are returned else empty if not found",
88             "schema": {
89               "type": "array",
90               "items": {
91                 "$ref": "#/definitions/subscription"
92               }
93             }
94           },
95           "500": {
96             "description": "Exception occurred while querying database"
97           }
98         }
99       }
100     },
101     "/subscription/{subscription_name}": {
102       "get": {
103         "description": "Get the Subscription from PMSH specified by Name",
104         "operationId": "mod.api.controller.get_subscription_by_name",
105         "tags": [
106           "Subscription"
107         ],
108         "parameters": [
109           {
110             "name": "subscription_name",
111             "in": "path",
112             "required": true,
113             "description": "Name of the subscription",
114             "type": "string"
115           }
116         ],
117         "responses": {
118           "200": {
119             "description": "OK; Requested Subscription was returned",
120             "schema": {
121               "$ref": "#/definitions/subscription"
122             }
123           },
124           "404": {
125             "description": "Subscription with specified name not found"
126           },
127           "500": {
128             "description": "Exception occurred while querying database"
129           }
130         }
131       },
132       "delete": {
133         "description": "Deletes the Subscription from PMSH specified by Name",
134         "operationId": "mod.api.controller.delete_subscription_by_name",
135         "tags": [
136           "Subscription"
137         ],
138         "parameters": [
139           {
140             "name": "subscription_name",
141             "in": "path",
142             "required": true,
143             "description": "The name of the subscription to delete",
144             "type": "string"
145           }
146         ],
147         "responses": {
148           "204": {
149             "description": "Successfully deleted the subscription and returns NO Content"
150           },
151           "404": {
152             "description": "Subscription with the specified name not found"
153           },
154           "409": {
155             "description": "Subscription could not be deleted as it contains measurement groups with state UNLOCKED OR state change to LOCKED was under process"
156           },
157           "500": {
158             "description": "Exception occurred on the server"
159           }
160         }
161       }
162     },
163     "/subscription/{subscription_name}/nfFilter": {
164       "put": {
165         "description": "Update nfFilter for",
166         "tags": [
167           "Subscription"
168         ],
169         "parameters": [
170           {
171             "name": "subscription_name",
172             "in": "path",
173             "required": true,
174             "description": "Name of the subscription",
175             "type": "string"
176           },
177           {
178             "name": "body",
179             "in": "body",
180             "required": true,
181             "schema": {
182               "$ref": "#/definitions/nfFilter"
183             }
184           }
185         ],
186         "responses": {
187           "201": {
188             "description": "Successfully updated filter"
189           },
190           "400": {
191             "description": "Invalid input"
192           },
193           "409": {
194             "description": "Duplicate data"
195           }
196         }
197       }
198     },
199     "/subscription/{subscription_name}/measurementGroups/{measurement_group_name}": {
200       "get": {
201         "description": "Get the  measurement group and associated network functions from PMSH by using sub name and meas group name",
202         "operationId": "mod.api.controller.get_meas_group_with_nfs",
203         "tags": [
204           "measurement group"
205         ],
206         "parameters": [
207           {
208             "name": "subscription_name",
209             "in": "path",
210             "required": true,
211             "description": "Name of the subscription",
212             "type": "string"
213           },
214           {
215             "name": "measurement_group_name",
216             "in": "path",
217             "required": true,
218             "description": "Name of the measurement group name",
219             "type": "string"
220           }
221         ],
222         "responses": {
223           "200": {
224             "description": "OK; Received requested measurement group with associated NF's",
225             "schema": {
226               "$ref": "#/definitions/measGroupWithNFs"
227             }
228           },
229           "404": {
230             "description": "Measurement group with specified name not found"
231           },
232           "500": {
233             "description": "Exception occurred while querying database"
234           }
235         }
236       },
237       "post": {
238         "description": "Create a measurement group",
239         "tags": [
240           "measurement group"
241         ],
242         "parameters": [
243           {
244             "name": "subscription_name",
245             "in": "path",
246             "required": true,
247             "description": "Name of the subscription",
248             "type": "string"
249           },
250           {
251             "name": "measurement_group_name",
252             "in": "path",
253             "required": true,
254             "description": "Name of the measurement group name",
255             "type": "string"
256           },
257           {
258             "name": "body",
259             "in": "body",
260             "required": true,
261             "schema": {
262               "$ref": "#/definitions/measurementGroup"
263             }
264           }
265         ],
266         "responses": {
267           "201": {
268             "description": "Successfully created measurement group"
269           },
270           "400": {
271             "description": "Invalid input"
272           },
273           "409": {
274             "description": "Duplicate data"
275           }
276         }
277       },
278       "delete": {
279         "description": "Delete a measurement group",
280         "tags": [
281           "measurement group"
282         ],
283         "parameters": [
284           {
285             "name": "subscription_name",
286             "in": "path",
287             "required": true,
288             "description": "Name of the subscription",
289             "type": "string"
290           },
291           {
292             "name": "measurement_group_name",
293             "in": "path",
294             "required": true,
295             "description": "Name of the measurement group name",
296             "type": "string"
297           }
298         ],
299         "responses": {
300           "204": {
301             "description": "Successfully deleted the measurement group and returns NO Content"
302           },
303           "404": {
304             "description": "Measurement group with the specified name not found"
305           },
306           "409": {
307             "description": "Measurement  not deleted because state UNLOCKED OR state change to LOCKED was under process"
308           },
309           "500": {
310             "description": "Exception occurred on the server"
311           }
312         }
313       }
314     },
315     "/subscription/{subscription_name}/measurementGroups/{measurement_group_name}/{administrativeState}": {
316       "put": {
317         "description": "Update administrative state for a measurement group",
318         "tags": [
319           "measurement group"
320         ],
321         "parameters": [
322           {
323             "name": "subscription_name",
324             "in": "path",
325             "required": true,
326             "description": "Name of the subscription",
327             "type": "string"
328           },
329           {
330             "name": "measurement_group_name",
331             "in": "path",
332             "required": true,
333             "description": "Name of the measurement group name",
334             "type": "string"
335           },
336           {
337             "name": "administrativeState",
338             "in": "path",
339             "required": true,
340             "description": "New administrative state of measurement group",
341             "type": "string"
342           }
343         ],
344         "responses": {
345           "201": {
346             "description": "Successfully updated administrative state"
347           },
348           "400": {
349             "description": "Invalid input"
350           },
351           "409": {
352             "description": "Duplicate data"
353           }
354         }
355       }
356     }
357   },
358   "definitions": {
359     "subscription": {
360       "type": "object",
361       "properties": {
362         "subscription": {
363           "type": "object",
364           "properties": {
365             "subscriptionName": {
366               "type": "string"
367             },
368             "operationalPolicyName": {
369               "type": "string"
370             },
371             "controlLoopName": {
372               "type": "string"
373             },
374             "nfFilter": {
375               "$ref": "#/definitions/nfFilter"
376             },
377             "measurementGroups": {
378               "type": "array",
379               "minItems": 1,
380               "items": {
381                 "$ref": "#/definitions/measurementGroup"
382               }
383             }
384           },
385           "required": [
386             "subscriptionName",
387             "operationalPolicyName",
388             "nfFilter",
389             "measurementGroups"
390           ]
391         }
392       },
393       "required": [
394         "subscription"
395       ]
396     },
397     "nfFilter": {
398       "type": "object",
399       "description": "At least one valid filter value within nfFilter is required",
400       "additionalProperties": false,
401       "properties": {
402         "nfNames": {
403           "type": "array",
404           "items": {
405             "type": "string"
406           }
407         },
408         "modelInvariantIDs": {
409           "type": "array",
410           "items": {
411             "type": "string"
412           }
413         },
414         "modelVersionIDs": {
415           "type": "array",
416           "items": {
417             "type": "string"
418           }
419         },
420         "modelNames": {
421           "type": "array",
422           "items": {
423             "type": "string"
424           }
425         }
426       },
427       "required": [
428         "nfNames",
429         "modelInvariantIDs",
430         "modelVersionIDs",
431         "modelNames"
432       ]
433     },
434     "measurementGroup": {
435       "type": "object",
436       "properties": {
437         "measurementGroup": {
438           "type": "object",
439           "properties": {
440             "measurementGroupName": {
441               "type": "string"
442             },
443             "fileBasedGP": {
444               "type": "integer"
445             },
446             "fileLocation": {
447               "type": "string"
448             },
449             "administrativeState": {
450               "type": "string",
451               "enum": [
452                 "LOCKED",
453                 "UNLOCKED"
454               ]
455             },
456             "measurementTypes": {
457               "type": "array",
458               "minItems": 1,
459               "items": {
460                 "$ref": "#/definitions/measurementType"
461               }
462             },
463             "managedObjectDNsBasic": {
464               "type": "array",
465               "minItems": 1,
466               "items": {
467                 "$ref": "#/definitions/managedObjectDNs"
468               }
469             }
470           },
471           "allOf": [
472             {
473               "required": [
474                 "measurementGroupName",
475                 "fileBasedGP",
476                 "fileLocation",
477                 "administrativeState",
478                 "measurementTypes",
479                 "managedObjectDNsBasic"
480               ]
481             }
482           ]
483         }
484       },
485       "required": [
486         "measurementGroup"
487       ]
488     },
489     "measurementType": {
490       "type": "object",
491       "properties": {
492         "measurementType": {
493           "type": "string"
494         }
495       },
496       "required": [
497         "measurementType"
498       ]
499     },
500     "managedObjectDNs": {
501       "type": "object",
502       "properties": {
503         "DN": {
504           "type": "string"
505         }
506       },
507       "required": [
508         "DN"
509       ]
510     },
511     "measGroupWithNFs": {
512       "type": "object",
513       "properties": {
514         "subscriptionName": {
515           "type": "string"
516         },
517         "measurementGroupName": {
518           "type": "string"
519         },
520         "administrativeState": {
521           "type": "string",
522           "enum": [
523             "LOCKED",
524             "UNLOCKED"
525           ]
526         },
527         "fileBasedGP": {
528           "type": "integer"
529         },
530         "fileLocation": {
531           "type": "string"
532         },
533         "measurementTypes": {
534           "type": "array",
535           "minItems": 1,
536           "items": {
537             "$ref": "#/definitions/measurementType"
538           }
539         },
540         "managedObjectDNsBasic": {
541           "type": "array",
542           "minItems": 1,
543           "items": {
544             "$ref": "#/definitions/managedObjectDNs"
545           }
546         },
547         "network_functions": {
548           "type": "array",
549           "items": {
550             "type": "object",
551             "properties": {
552               "nfName": {
553                 "type": "string",
554                 "description": "Name of the Network Function"
555               },
556               "ipv4Address": {
557                 "type": "string",
558                 "description": "Address of the IPV4"
559               },
560               "ipv6Address": {
561                 "type": "string",
562                 "description": "Address of the IPV6"
563               },
564               "nfMgStatus": {
565                 "type": "string",
566                 "description": "status of network function for one meas group"
567               },
568               "modelInvariantId": {
569                 "type": "string",
570                 "description": "ID of the model invariant"
571               },
572               "modelVersionId": {
573                 "type": "string",
574                 "description": "ID of the model version"
575               },
576               "modelName": {
577                 "type": "string",
578                 "description": "Name of the model"
579               },
580               "sdncModelName": {
581                 "type": "string",
582                 "description": "Name of the sdnc model"
583               },
584               "sdncModelVersion": {
585                 "type": "string",
586                 "description": "Version of the sdnc model"
587               }
588             }
589           }
590         }
591       }
592     }
593   }
594 }