[PMSH] Schema definitions in Swagger Yaml File
[dcaegen2/services.git] / components / pm-subscription-handler / pmsh_service / mod / api / pmsh_swagger.yml
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