Uploaded image for project: 'Common Controller SDK'
  1. Common Controller SDK
  2. CCSDK-1344

GR-API Fails to Send a JSON Object to CDS API

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Highest
    • Resolution: Done
    • Dublin Release
    • Dublin Release
    • None
    • None

    Description

      Currently the JSON Template is markign all the variable parameters as string even for a json object which is causing cds microservices to fail. Since there is no capability to convert jsonString to JSON object in Dublin release, the plan is to rework the DG to pass a JSON payload using Yang Schema implementation: 

       

      Here is the proposal: 

       

       

       

      from Janani B to everyone:

      {

          "cds-workflow:actionIdentifiers":

      {         "mode": "sync",         "blueprintName": "baseconfiguration",         "blueprintVersion": "1.0.0",         "actionName": "assign-activate"     }

      ,

          "cds-workflow:payload": {

              "template-prefix": "vDNS-test",

              "resource-assignment-request": {

                  "resource-assignment-properties":

      {                 "service-instance-id": "1234",                 "vnf-id": "3526",                 "customer-name": "htipl",                 "subscriber-name": "huawei"             }

              }

          },

          "cds-workflow:commonHeader":

      {         "subRequestId": "sub-123456-1000",         "requestId": "123456-1000",         "originatorId": "SDNC_DG"     }

      }

      from KAPIL SINGAL to everyone:

      I think that's what we need

      from Janani B to everyone:

      Yeah this works.

      from Janani B to everyone:

      module cds-workflow {

          yang-version 1.1;

          namespace "cds:workflow:rest";

          prefix "cds";

       

          revision "2019-05-21";

       

          container workflow {

              container commonHeader {

                  leaf originatorId

      {                 type string;             }

                  leaf requestId

      {                 type string;             }

                  leaf subRequestId {                 type string;             }

              }

              container actionIdentifiers {

                  leaf blueprintName

      {                 type string;             }

                  leaf blueprintVersion {                 type string;             }

                  leaf actionName

      {                 type string;             }

                  leaf mode {                 type string;             }

              }

              container payload {

                  leaf-list template-prefix {                 type string;             }

                  container resource-assignment-request

      {                 anyxml resource-assignment-properties;             }

              }

          }

      }

       

      from Janani B to everyone:

            ctx.setAttribute(pre1 + "originatorId", "SDNC_DG");

              ctx.setAttribute(pre1 + "requestId", "123456-1000");

              ctx.setAttribute(pre1 + "subRequestId", "sub-123456-1000");

              ctx.setAttribute(pre2 + "blueprintName", "baseconfiguration");

              ctx.setAttribute(pre2 + "blueprintVersion", "1.0.0");

              ctx.setAttribute(pre2 + "actionName", "assign-activate");

              ctx.setAttribute(pre2 + "mode", "sync");

              ctx.setAttribute(pre + "payload." +

                                       "template-prefix", "vDNS-test");

              ctx.setAttribute(pre + "payload.resource-assignment-request.resource-assignment-properties",

                               "

      {\n" +                                  "\"service-instance-id\": \"1234\",\n" +                                  "\"vnf-id\": \"3526\",\n" +                                  "\"customer-name\": \"htipl\",\n" +                                  "\"subscriber-name\": \"huawei\"\n" +                                  "}

      ");

      from Janani B to everyone:

              String pre1 = pre + "commonHeader.";

              String pre2 = pre + "actionIdentifiers.";

      from Rodrigo to everyone:

      Hi all, I have to leave for another meeting. please let me know of the conclusion. Thanks.

      from Janani B to everyone:

      {

      "cds-workflow:actionIdentifiers":

      { "mode": "sync", "blueprintName": "baseconfiguration", "blueprintVersion": "1.0.0", "actionName": "assign-activate" }

      ,

      "cds-workflow:payload": {

      "template-prefix": "vDNS-test",

      "resource-assignment-request": {

      "resource-assignment-properties":

      { "service-instance-id": "1234", "vnf-id": "3526", "customer-name": "htipl", "subscriber-name": "huawei" }

      }

      },

      "cds-workflow:commonHeader":

      { "subRequestId": "sub-123456-1000", "requestId": "123456-1000", "originatorId": "SDNC_DG" }

      }

      from Janani B to everyone:

      ctx.setAttribute(pre1 + "originatorId", "SDNC_DG");

      ctx.setAttribute(pre1 + "requestId", "123456-1000");

      ctx.setAttribute(pre1 + "subRequestId", "sub-123456-1000");

      ctx.setAttribute(pre2 + "blueprintName", "baseconfiguration");

      ctx.setAttribute(pre2 + "blueprintVersion", "1.0.0");

      ctx.setAttribute(pre2 + "actionName", "assign-activate");

      ctx.setAttribute(pre2 + "mode", "sync");

      ctx.setAttribute(pre + "payload." +

      "template-prefix", "vDNS-test");

      ctx.setAttribute(pre + "payload.resource-assignment-request.resource-assignment-properties",

      "

      {\n" + "\"service-instance-id\": \"1234\",\n" + "\"vnf-id\": \"3526\",\n" + "\"customer-name\": \"htipl\",\n" + "\"subscriber-name\": \"huawei\"\n" + "}

      ");

       

       

       

       

       

      • *2 Current Issue: * @kapil_singal , @steve.siani @adetalhouet , @brinda.santh 
        1. The input and defaults are not being processed by the blueprint processor. 
        2. The non-processed variable are being returned as NULL but should be returned as $variable

      See Abdel's logs below from SDNC
       

      • !http://onap-integration.eastus.cloudapp.azure.com:3000/avatar/Yuriy.Malakov?_dc=0!Yuriy.Malakov Owner 5:35 PM
         
        File Uploaded: sdnc-logs.zip  
         
      • !http://onap-integration.eastus.cloudapp.azure.com:3000/avatar/Yuriy.Malakov?_dc=0!Yuriy.Malakov Owner 5:36 PM  

      aseaudi 4:46 PM - *Resource-Accumulator Returns null response for input and default entries
      "cloud_env" : null,
      "demo_artifacts_version" : null,
      "vpg_int_pktgen_private_ip_0" : null,
      "install_script_version" : null,
      "pub_key" : null,
      "int_private_net_id" : null,
      "vf-module-model-customization-uuid" : null,
      "onap_private_net_id" : null,
      "onap_private_subnet_id" : null,
      "pktgen_private_net_cidr" : "192.168.20.0/24",
      "vdns_int_private_ip_0" : null,
      "vdns_onap_private_ip_0" : null,
      "vlb_int_pktgen_private_ip_0" : null,
      "vlb_onap_private_ip_0" : null,
      "vpg_onap_private_ip_0" : null,
      "int_pktgen_private_net_id" : null,
      "int_private_subnet_id" : null,
      "public_net_id" : null,
      "onap_private_net_cidr" : "10.0.0.0/8",
      "sec_group" : null,
      "service-instance-id" : null,
      "vlb_int_private_ip_0" : null,
      "vlb_private_net_cidr" : "192.168.10.0/24",
      "vnf-id" : null,
      "vnf-model-customization-uuid" : null,
      "vnf-name" : null

      assign workflow resource-assignment input value ({"template-prefix":["vdns-vnf"],"resource-assignment-properties":"

      {\"image_name\":\"Ubuntu 14.04\",\"onap_private_net_id\":\"olc-private\",\"flavor_name\":\"[s1.cw|http://s1.cw/].small-1\",\"onap_private_subnet_id\":\"olc-private\",\"install_script_version\":\"1.5.0-SNAPSHOT\",\"demo_artifacts_version\":\"1.5.0-SNAPSHOT\",\"sec-group\":\"olc-open\",\"cloud_env\":\"openstack\",\"pub_key\":\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwj7uJMyKiP1ogEsZv5kKDFw9mFNhxI+woR3Tuv8vjfNnqdB1GfSnvTFyNbdpyNdR8BlljkiZ1SlwJLEkvPk0HpOoSVVek/QmBeGC7mxyRcpMB2cNQwjXGfsVrforddXOnOkj+zx1aNdVGMc52Js3pex8B/L00H68kOcwP26BI1o77Uh+AxjOkIEGs+wlWNUmXabLDCH8l8IJk9mCTruKEN9KNj4NRZcaNC+XOz42SyHV9RT3N6efp31FqKzo8Ko63QirvKEEBSOAf9VlJ7mFMrGIGH37AP3JJfFYEHDdOA3N64ZpJLa39y25EWwGZNlWpO/GW5bNjTME04dl4eRyd\",\"service-instance-id\":\"4d18ffed-d606-475a-b576-6d394221f1aa\",\"vnf-model-customization-uuid\":\"6409e9d9-a469-4546-a7b4-e508ecc1e77f\",\"vnf-id\":\"90bf2a1f-ef08-4d27-9b62-48e7b23dfb15\",\"aic-cloud-region\":\"fr1\"}

      "})

      Yuriy.Malakov 4:51 PM *Resource Accumulator Expected Response

      *"cloud_env" : openstack,*
      *"demo_artifacts_version" : 1.5.0-SNAPSHOT,*
      "vpg_int_pktgen_private_ip_0" : null,
      *"install_script_version" : 1.5.0-SNAPSHOT,*
      *"pub_key" : ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwj7uJMyKiP1ogEsZv5kKDFw9mFNhxI+woR3Tuv8vjfNnqdB1GfSnvTFyNbdpyNdR8BlljkiZ1SlwJLEkvPk0HpOoSVVek/QmBeGC7mxyRcpMB2cNQwjXGfsVrforddXOnOkj+zx1aNdVGMc52Js3pex8B/L00H68kOcwP26BI1o77Uh+AxjOkIEGs+wlWNUmXabLDCH8l8IJk9mCTruKEN9KNj4NRZcaNC+XOz42SyHV9RT3N6efp31FqKzo8Ko63QirvKEEBSOAf9VlJ7mFMrGIGH37AP3JJfFYEHDdOA3N64ZpJLa39y25EWwGZNlWpO/GW5bNjTME04dl4eRyd*
      int_private_net_id" : null,
      "vf-module-model-customization-uuid" : null,
      *"onap_private_net_id" : olc-private,*
      *"onap_private_subnet_id" : olc-private,*
      "pktgen_private_net_cidr" : "192.168.20.0/24",
      "vdns_int_private_ip_0" : null,
      "vdns_onap_private_ip_0" : null,
      "vlb_int_pktgen_private_ip_0" : null,
      "vlb_onap_private_ip_0" : null,
      "vpg_onap_private_ip_0" : null,
      "int_pktgen_private_net_id" : null,
      "int_private_subnet_id" : null,
      "public_net_id" : null,
      "onap_private_net_cidr" : "10.0.0.0/8",
      "sec_group" : olc-open,
      *"service-instance-id" : 4d18ffed-d606-475a-b576-6d394221f1aa,*
      *"vlb_int_private_ip_0" : null,
      "vlb_private_net_cidr" : "192.168.10.0/24",
      *"vnf-id" : 90bf2a1f-ef08-4d27-9b62-48e7b23dfb15*,
      *"vnf-model-customization-uuid" : 6409e9d9-a469-4546-a7b4-e508ecc1e77f,*
      "vnf-name" : null

      NOTE: Run this script to load all the DD in CDS Blueprint MS from your computer. Update the External IP of your onap. 
      #!/bin/bash
      l=`jq '.|length' dd.json`
      echo "Found $l Dictionary Difinition Entries"
      i=0
      while [ $i -lt $l ]
      do
      echo "i = $i"
      d=`jq ".[$i]" dd.json`
      echo $d
      curl '*84.39.39.116:30497/*resourcedictionary/save' -v -X POST -H 'Content-type: application/json' -d"$d"
      sleep 1
      echo "*****************************************"
      i=$(( $i + 1 ))
      done

      Attachments

        1. dd UPDATES IN cds ui with processor-db.rar
          3 kB
          Yuriy Malakov
        2. SDNC_BUG_FIX_logs.txt
          11 kB
          Janani B

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              janani Janani B
              ym9479 Yuriy Malakov
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: