[PMSH] Schema definitions in Swagger Yaml File 84/124484/3
authorraviteja.karumuri <raviteja.karumuri@est.tech>
Mon, 23 Aug 2021 15:19:33 +0000 (16:19 +0100)
committerraviteja.karumuri <raviteja.karumuri@est.tech>
Tue, 5 Oct 2021 15:25:08 +0000 (16:25 +0100)
Issue-ID: DCAEGEN2-2889

Signed-off-by: raviteja.karumuri <raviteja.karumuri@est.tech>
Change-Id: I15ae36c8f55a708be25eb56dc6b9812c3feec822

components/pm-subscription-handler/Changelog.md
components/pm-subscription-handler/pmsh_service/mod/api/pmsh_swagger.yml

index 3112ac5..f98d2b8 100755 (executable)
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
 ## [2.0.0]
 ### Changed
 * Updated PMSH app configuration, simplified existing config (DCAEGEN2-2814)
+* Created Schema definitions in swagger file according to the new structure (DCAEGEN2-2889)
 
 ## [1.3.2]
 ### Changed
index 58e6a78..2a6137c 100644 (file)
@@ -1,5 +1,5 @@
 # ============LICENSE_START=======================================================
-#  Copyright (C) 2020 Nordix Foundation.
+#  Copyright (C) 2020-2021 Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 swagger: "2.0"
 info:
   title: PM Subscription Handler Service
-  version: "1.1.0"
+  version: "2.0.0"
   description: PM subscription handler enables control of performance management jobs on network functions in ONAP
 produces:
   - "application/json"
 basePath: "/"
 schemes:
   - https
+  - http
 # Paths supported by the server application
 paths:
   /subscriptions:
@@ -87,3 +88,109 @@ paths:
                 enum: [healthy, unhealthy]
         503:
           description: the pmsh service is unavailable
+
+definitions:
+  subscription:
+    type: object
+    properties:
+      subscription:
+        type: object
+        properties:
+          subscriptionName:
+            type: string
+          operationalPolicyName:
+            type: string
+          controlLoopName:
+            type: string
+          nfFilter:
+            $ref: "#/definitions/nfFilter"
+          measurementGroups:
+            type: array
+            minItems: 1
+            items:
+              $ref: "#/definitions/measurementGroup"
+        required:
+          - subscriptionName
+          - operationalPolicyName
+          - nfFilter
+          - measurementGroups
+    required:
+      - subscription
+
+  nfFilter:
+    type: object
+    minProperties: 1
+    additionalProperties: false
+    properties:
+      nfNames:
+        type: array
+        minItems: 1
+        items:
+          type: string
+      modelInvariantIDs:
+        type: array
+        minItems: 1
+        items:
+          type: string
+      modelVersionIDs:
+        type: array
+        minItems: 1
+        items:
+          type: string
+      modelNames:
+        type: array
+        minItems: 1
+        items:
+          type: string
+
+  measurementGroup:
+    type: object
+    properties:
+      measurementGroup:
+        type: object
+        properties:
+          measurementGroupName:
+            type: string
+          fileBasedGP:
+            type: integer
+          fileLocation:
+            type: string
+          administrativeState:
+            type: string
+            enum: [LOCKED, UNLOCKED]
+          measurementTypes:
+            type: array
+            minItems: 1
+            items:
+              $ref: "#/definitions/measurementType"
+          managedObjectDNsBasic:
+            type: array
+            minItems: 1
+            items:
+              $ref: "#/definitions/managedObjectDNs"
+        allOf:
+          - required:
+              - measurementGroupName
+              - fileBasedGP
+              - fileLocation
+              - administrativeState
+              - measurementTypes
+              - managedObjectDNsBasic
+    required:
+      - measurementGroup
+
+  measurementType:
+    type: object
+    properties:
+      measurementType:
+        type: string
+    required:
+      - measurementType
+
+  managedObjectDNs:
+    type: object
+    properties:
+      DN:
+        type: string
+    required:
+      - DN