Uploaded image for project: 'Configuration Persistence Service'
  1. Configuration Persistence Service
  2. CPS-1044

dmi-service-name is not stored in the database when the generated client sends it with dmiPlugin=null

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Medium Medium
    • None
    • Jakarta Release
    • NCMP
    • None

      For communicating with NCMP we use a generated client which is generated from ncmp rest openapi yaml.

      Generated clients (generated with swagger or openapi) are sending the non set attributes as null value.

      In our case we do not want to send dmiPlugin during cmHandle registration, so the generated client will send the following:

      POST ncmp_url/ncmpInventory/v1/ch
      {
          "dmiPlugin": null,
          "dmiDataPlugin": "http://adapter:80",
          "dmiModelPlugin": "http://model-adapter:8080",
          "createdCmHandles": [{
              "cmHandle": "cmhandle_id",
              "cmHandleProperties": {
                  "subSystem":"subsystem_id_vdu",
                  "targetDnPrefix":"test_target_dn_prefix_vdu",
                  "targetNode":"test_target_node_vdu",
                  "nodeModelIdentity": "5357-291-544",
                  "neType": "vDU"
              }
          }]
      }

      In this case NCMP does not store dmi-service-name at all for that entry

      DB entry
      40906    /dmi-registry/cm-handles[@id='5CB8D844981161B97E5968727DEA225B']    {"id": "5CB8D844981161B97E5968727DEA225B", "dmi-data-service-name": "http://eric-eo-enm-adapter:80", "dmi-model-service-name": "http://eric-oss-enm-model-adapter:8080"}    2    144    2

       

      This problem exists since the following commits, before these an empty string was stored as the dmi-service-name:

      https://git.onap.org/cps/commit/?id=d042fcdae75be100f840b6313e078eab278d87ef

      https://git.onap.org/cps/commit/?id=d5bda8848a661465f214b0bf11211e63b272cfd6

      Previous DB entry before these commits

      40906    /dmi-registry/cm-handles[@id='5CB8D844981161B97E5968727DEA225B']    {"id": "5CB8D844981161B97E5968727DEA225B", "dmi-service-name": "", "dmi-data-service-name": "http://eric-eo-enm-adapter:80", "dmi-model-service-name": "http://eric-oss-enm-model-adapter:8080"}    2    144    2

       

      It would not be a big problem, but together with https://jira.onap.org/browse/CPS-1043 it causes an exception because NCMP wants to use this null dmi-service-name at CRUD operations

       

            dylanb95est dylanb95est
            csaba.eder csaba Eder
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: