Merge "Limit max connections in DMI stub"
[cps.git] / docs / ncmp-cmhandle-querying.rst
index 5655d6c..529297d 100644 (file)
@@ -1,6 +1,6 @@
 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
 .. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2022 Nordix Foundation
+.. Copyright (C) 2022-2023 Nordix Foundation
 
 .. DO NOT CHANGE THIS LABEL FOR RELEASE NOTES - EVEN THOUGH IT GIVES A WARNING
 .. _cmhandlequerying:
@@ -36,6 +36,12 @@ Currently this endpoint allows three criteria to be query on:
 
 Not all request body combinations have been validated and as such request bodies which do not conform to the structure as documented here can produce results in which all CM Handles are returned.
 
+Casing conventions: 'camelCasing' and 'kebab-casing'
+----------------------------------------------------
+
+.. note::
+    By convention REST JSON return bodies use 'camelCasing'. By convention field names in yang modelled data use 'kebab-casing'. Therefore some inconsistencies can be seen in the JSON use in CPS REST interfaces. For CM Handle related endpoints we return data in 'camelCasing'. But for *cmHandleWithCpsPath*, the query is accessing yang modelled field names and as such needs to use 'kebab-casing'. Therefore the dmi-registry field names should be referenced when using the *cmHandleWithCpsPath* condition: :doc:`modeling`
+
 Request Body example using all available query criteria. This query would return all CM Handles which have the specified modules my-module-(1-3), have the specified properties of Color yellow, Shape circle, Size small and are in a sync state of ADVISED:
 
 .. code-block:: json
@@ -77,6 +83,14 @@ Request Body example using all available query criteria. This query would return
               "cpsPath": "//state[@cm-handle-state='ADVISED']"
             }
           ]
+        },
+        {
+          "conditionName": "cmHandleWithTrustLevel",
+          "conditionParameters": [
+            {
+              "trustLevel": "COMPLETE"
+            }
+          ]
         }
       ]
     }
@@ -152,4 +166,24 @@ The *cmHandleWithCpsPath* condition allows any data of the CM Handle to be queri
           ]
         }
       ]
+    }
+
+CM Handle with Trust Level
+--------------------------
+
+With the *cmHandleWithTrustLevel* condition, we can provide just one trust level. The CM handles returned will have this trust level. Providing more than one parameter causes unexpected results. Condition parameter name is not being validated.
+
+.. code-block:: json
+
+    {
+      "cmHandleQueryParameters": [
+        {
+          "conditionName": "cmHandleWithTrustLevel",
+          "conditionParameters": [
+            {
+              "trustLevel": "COMPLETE"
+            }
+          ]
+        }
+      ]
     }
\ No newline at end of file