Improving searching for policy types - A1 Jakarta

The querying for supported policy types is enhanced so that an application can get a list of all policy types that are compatible with a given version.
This means added query parameters for GET types.

Simplified exception handling.

Issue-ID: CCSDK-3495
Signed-off-by: PatrikBuhr <patrik.buhr@est.tech>
Change-Id: Iedc2267e4fe2b5e2c17d688e315893c354379930
diff --git a/docs/offeredapis/swagger/pms-api.json b/docs/offeredapis/swagger/pms-api.json
index 95bc658..de01472 100644
--- a/docs/offeredapis/swagger/pms-api.json
+++ b/docs/offeredapis/swagger/pms-api.json
@@ -13,7 +13,7 @@
                     "format": "int32",
                     "description": "The HTTP status code generated by the origin server for this occurrence of the problem. ",
                     "type": "integer",
-                    "example": 503
+                    "example": 404
                 }
             }
         },
@@ -280,7 +280,7 @@
                     "type": "boolean"
                 },
                 "service_id": {
-                    "description": "the name of the service owning the policy",
+                    "description": "the identity of the service owning the policy",
                     "type": "string"
                 },
                 "policy_data": {
@@ -341,11 +341,11 @@
     "openapi": "3.0.1",
     "paths": {
         "/policy_types": {"get": {
-            "summary": "Query policy type names",
+            "summary": "Query policy type identities",
             "operationId": "getPolicyTypes",
             "responses": {
                 "200": {
-                    "description": "Policy type names",
+                    "description": "Policy type identities",
                     "content": {"*/*": {"schema": {
                         "type": "array",
                         "items": {"type": "string"}
@@ -384,21 +384,28 @@
                     "schema": {"type": "string"},
                     "in": "query",
                     "name": "policytype_id",
-                    "description": "The identity of the policy type to get policies for.",
+                    "description": "Select policies with a given type identity.",
                     "required": false
                 },
                 {
                     "schema": {"type": "string"},
                     "in": "query",
                     "name": "ric_id",
-                    "description": "The identity of the Near-RT RIC to get policies for.",
+                    "description": "Select policies for a given Near-RT RIC identity.",
                     "required": false
                 },
                 {
                     "schema": {"type": "string"},
                     "in": "query",
                     "name": "service_id",
-                    "description": "The identity of the service to get policies for.",
+                    "description": "Select policies owned by a given service.",
+                    "required": false
+                },
+                {
+                    "schema": {"type": "string"},
+                    "in": "query",
+                    "name": "type_name",
+                    "description": "Select policies of a given type name (type identity has the format <typename_version>)",
                     "required": false
                 }
             ],
@@ -507,13 +514,36 @@
                     "content": {"application/json": {"schema": {"$ref": "#/components/schemas/error_information"}}}
                 }
             },
-            "parameters": [{
-                "schema": {"type": "string"},
-                "in": "query",
-                "name": "ric_id",
-                "description": "The identity of the Near-RT RIC to get types for.",
-                "required": false
-            }],
+            "parameters": [
+                {
+                    "schema": {"type": "string"},
+                    "in": "query",
+                    "name": "ric_id",
+                    "description": "Select types for the given Near-RT RIC identity.",
+                    "required": false
+                },
+                {
+                    "schema": {"type": "string"},
+                    "in": "query",
+                    "name": "type_name",
+                    "description": "Select types with the given type name (type identity has the format <typename_version>)",
+                    "required": false
+                },
+                {
+                    "schema": {"type": "string"},
+                    "in": "query",
+                    "name": "regexp",
+                    "description": "Select types with type identity that matches a regular expression.",
+                    "required": false
+                },
+                {
+                    "schema": {"type": "string"},
+                    "in": "query",
+                    "name": "compatible_with_version",
+                    "description": "Select types that are compatible with the given version. This parameter is only applicable in conjunction with type_name. As an example version 1.9.1 is compatible with 1.0.0 but not the other way around.",
+                    "required": false
+                }
+            ],
             "tags": ["A1 Policy Management"]
         }},
         "/a1-policy/v2/policies/{policy_id}": {
@@ -1098,21 +1128,28 @@
                         "schema": {"type": "string"},
                         "in": "query",
                         "name": "policytype_id",
-                        "description": "The identity of the policy type to get policies for.",
+                        "description": "Select policies of a given policy type identity.",
                         "required": false
                     },
                     {
                         "schema": {"type": "string"},
                         "in": "query",
                         "name": "ric_id",
-                        "description": "The identity of the Near-RT RIC to get policies for.",
+                        "description": "Select policies of a given Near-RT RIC identity.",
                         "required": false
                     },
                     {
                         "schema": {"type": "string"},
                         "in": "query",
                         "name": "service_id",
-                        "description": "The identity of the service to get policies for.",
+                        "description": "Select policies owned by a given service.",
+                        "required": false
+                    },
+                    {
+                        "schema": {"type": "string"},
+                        "in": "query",
+                        "name": "type_name",
+                        "description": "Select policies of types with the given type name (type identity has the format <typename_version>)",
                         "required": false
                     }
                 ],
diff --git a/docs/offeredapis/swagger/pms-api.yaml b/docs/offeredapis/swagger/pms-api.yaml
index b144403..6d62b0c 100644
--- a/docs/offeredapis/swagger/pms-api.yaml
+++ b/docs/offeredapis/swagger/pms-api.yaml
@@ -40,7 +40,7 @@
     get:
       tags:
       - A1 Policy Management V1.0
-      summary: Query policy type names
+      summary: Query policy type identities
       operationId: getPolicyTypes
       parameters:
       - name: ric
@@ -53,7 +53,7 @@
           type: string
       responses:
         200:
-          description: Policy type names
+          description: Policy type identities
           content:
             '*/*':
               schema:
@@ -78,7 +78,7 @@
       parameters:
       - name: policytype_id
         in: query
-        description: The identity of the policy type to get policies for.
+        description: Select policies with a given type identity.
         required: false
         style: form
         explode: true
@@ -86,7 +86,7 @@
           type: string
       - name: ric_id
         in: query
-        description: The identity of the Near-RT RIC to get policies for.
+        description: Select policies for a given Near-RT RIC identity.
         required: false
         style: form
         explode: true
@@ -94,7 +94,16 @@
           type: string
       - name: service_id
         in: query
-        description: The identity of the service to get policies for.
+        description: Select policies owned by a given service.
+        required: false
+        style: form
+        explode: true
+        schema:
+          type: string
+      - name: type_name
+        in: query
+        description: Select policies of a given type name (type identity has the format
+          <typename_version>)
         required: false
         style: form
         explode: true
@@ -232,7 +241,34 @@
       parameters:
       - name: ric_id
         in: query
-        description: The identity of the Near-RT RIC to get types for.
+        description: Select types for the given Near-RT RIC identity.
+        required: false
+        style: form
+        explode: true
+        schema:
+          type: string
+      - name: type_name
+        in: query
+        description: Select types with the given type name (type identity has the
+          format <typename_version>)
+        required: false
+        style: form
+        explode: true
+        schema:
+          type: string
+      - name: regexp
+        in: query
+        description: Select types with type identity that matches a regular expression.
+        required: false
+        style: form
+        explode: true
+        schema:
+          type: string
+      - name: compatible_with_version
+        in: query
+        description: Select types that are compatible with the given version. This
+          parameter is only applicable in conjunction with type_name. As an example
+          version 1.9.1 is compatible with 1.0.0 but not the other way around.
         required: false
         style: form
         explode: true
@@ -956,7 +992,7 @@
       parameters:
       - name: policytype_id
         in: query
-        description: The identity of the policy type to get policies for.
+        description: Select policies of a given policy type identity.
         required: false
         style: form
         explode: true
@@ -964,7 +1000,7 @@
           type: string
       - name: ric_id
         in: query
-        description: The identity of the Near-RT RIC to get policies for.
+        description: Select policies of a given Near-RT RIC identity.
         required: false
         style: form
         explode: true
@@ -972,7 +1008,16 @@
           type: string
       - name: service_id
         in: query
-        description: The identity of the service to get policies for.
+        description: Select policies owned by a given service.
+        required: false
+        style: form
+        explode: true
+        schema:
+          type: string
+      - name: type_name
+        in: query
+        description: Select policies of types with the given type name (type identity
+          has the format <typename_version>)
         required: false
         style: form
         explode: true
@@ -1153,7 +1198,7 @@
           description: 'The HTTP status code generated by the origin server for this
             occurrence of the problem. '
           format: int32
-          example: 503
+          example: 404
       description: Problem as defined in https://tools.ietf.org/html/rfc7807
     void:
       type: object
@@ -1374,7 +1419,7 @@
             false.
         service_id:
           type: string
-          description: the name of the service owning the policy
+          description: the identity of the service owning the policy
         policy_data:
           type: object
           description: the configuration of the policy