Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languageyml
titleLoad Data into Test Table
collapsetrue
databaseChangeLog:
  - changeSet:
      author: cps
      label: xnf-data-preload
      id: 14.1
      loadUpdateData:
        encoding: UTF-8
        file: 'changelog/db/changes/data/test_table.csv'
        onlyUpdate: 'false'
        primaryKey: 'id'
        quotchar: '"'
        separator: '|'
        tableName: 'test_table'


test table with data

Adding New Yang Resource

...


Loading data for Yang Resource

To load a yang resource, create a new yang resource csv file to load the data (as outlined above) in the following format 'yang_resource_@*data-of-creation*'

Code Block
languagebash
titleyang_resource@2021-12-13.csv
collapsetrue
name|content|checksum
dmi-registry@2021-12-13.yang|"module dmi-registry {

  yang-version 1.1;

  namespace \"org:onap:cps:ncmp\";

  prefix dmi-reg;

  organization \"Nordix Foundation\";

  contact \"rahul.tyagi@est.tech\";

  revision \"2021-12-13\" {
   description
   \"Added new list of public additonal properties for a Cm-Handle which are exposed to clients of the NCMP interface. \";
  }

  container dmi-registry {

    list cm-handles {

      key \"id\";

      leaf id {
        type string;
      }

      leaf dmi-service-name {
        type string;
      }

      leaf dmi-data-service-name {
        type string;
      }

      leaf dmi-model-service-name {
        type string;
      }

      list additional-properties {
        key \"name\";
        leaf name {
          type string;
        }
        leaf value {
          type string;
        }
      }
      list public-additional-properties {
        key \"name\";
        leaf name {
          type string;
        }
        leaf value {
          type string;
        }
      }
    }
  }
}
"|4899c384835ec48194ab5e3837549d32b844e02cfc81e9205234fa36354f3fe4


Note

Before adding the checksum in the file above, first generate the checksum within the yang_resource table following the step below

Generating Checksum For New Yang Resource

Run the following command to insert a new yang resource INTO THE 

Code Block
languagebash
collapsetrue
curl --location --request POST 'http://localhost:8080/cps/api/v1/dataspaces/*dataspacename*/schema-sets' --header 'Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE=' --form 'file=*PATH-TO-YANG-FILE*' --form 'schema-set-name='*NAME-OF-SCEHMA-SET-DEFINED-IN-YANG_RESOURCE*'

Rollback


Potential Issues