Facing issue in get_case and set_case for xRAN 1.0.6 yang

Please find the below logs of confd_cmd operation.

confd_cmd -o -d -d -c ‘get_case “/performance-measurement-objects/rx-window-measurement-objects/” “object-unit-id”’
get_case “/performance-measurement-objects/rx-window-measurement-objects/” “object-unit-id”
TRACE Connected (maapi) to ConfD
TRACE MAAPI_LOAD_ALL_NS
TRACE MAAPI_LOAD_HASH_DB
TRACE Connected (cdb) to ConfD
TRACE CDB_NEW_SESSION --> CONFD_OK
TRACE Established new CDB session to ConfD
TRACE CDB_GET_CASE /performance-measurement-objects/rx-window-measurement-objectsDEBUG item does not exist - No case selected and no default
–> CONFD_ERR
FAILED: cdb_get_case(cs, argv[1], &val, argv[0]), Error: item does not exist (1): No case selected and no default, in function do_cdb_get_case, line 343

confd_cmd -o -d -d -c ‘set_case “/performance-measurement-objects/rx-window-measurement-objects” “object-unit-id” “RU”’
set_case “/performance-measurement-objects/rx-window-measurement-objects” “object-unit-id” “RU”
TRACE Connected (cdb) to ConfD
TRACE CDB_NEW_SESSION --> CONFD_OK
TRACE Established new CDB session to ConfD
TRACE CDB_SET_CASE /performance-measurement-objects/rx-window-measurement-objectsDEBUG badly formatted or nonexistent path - Not a cdb operational data path
–> CONFD_ERR
FAILED: cdb_set_case(cs, argv[1], argv[2], argv[0]), Error: badly formatted or nonexistent path (8): Not a cdb operational data path, in function do_cdb_set_case, line 484

confd_cmd -o -d -d -c ‘set_case “/performance-measurement-objects/rx-window-measurement-objects{RX_TOTAL}” “object-unit-id” “RU”’
set_case “/performance-measurement-objects/rx-window-measurement-objects{RX_TOTAL}” “object-unit-id” “RU”
TRACE Connected (cdb) to ConfD
TRACE CDB_NEW_SESSION --> CONFD_OK
TRACE Established new CDB session to ConfD
TRACE CDB_SET_CASE /performance-measurement-objects/rx-window-measurement-objects{RX_TOTAL}DEBUG badly formatted or nonexistent path - Not a cdb operational data path
–> CONFD_ERR
FAILED: cdb_set_case(cs, argv[1], argv[2], argv[0]), Error: badly formatted or nonexistent path (8): Not a cdb operational data path, in function do_cdb_set_case, line 484

Looking at the O-RAN specification, it seems like you are trying to get and set a list entry using cdb_get_case() and cdb_set_case() using the confd_cmd tool. This will of course not work.

I would have used confd_load tool to read the list and confd_cmd “mcreate” and “mset” to create list entries.

$ pwd
/Users/tailf/misc/ORAN-WG4.MP-YANGs-v01.00
$ yanger -f tree ./Common-Models/Operations/o-ran-performance-management.yang --tree-path /performance-measurement-objects/rx-window-measurement-objects --path Common-Models/Interfaces:Common-Models/Sync:Common-Models/System:Imported-Models:RU-Specific-Models/Interfaces:RU-Specific-Models/Operations:RU-Specific-Models/Radio
module: o-ran-performance-management
  +--rw performance-measurement-objects
     +--rw rx-window-measurement-objects* [measurement-object]
        +--rw measurement-object            enumeration
        +--rw active?                       boolean
        +--rw object-unit?                  enumeration
        +--rw report-info?                  enumeration
        +--ro (object-unit-id)?
           +--:(RU)
           |  +--ro name?                   -> /hw:hardware/component/name
           |  +--ro count                   uint64
           +--:(TRANSPORT)
           |  +--ro tr-measured-result* []
           |     +--ro name?    -> /o-ran-elements:processing-elements/ru-elements/name
           |     +--ro count    uint64
           +--:(EAXC_ID)
              +--ro eaxc-measured-result* []
                 +--ro eaxc-id?          uint16
                 +--ro count             uint64
                 +--ro transport-name?   -> /o-ran-elements:processing-elements/ru-elements/name

How to get choice elements…

I see Mr. Sankalp is using get_case confd command…

Could you please specify the ./confd_cmd to fetch object-unit-id entry ?

Thanks for clarifying. There seems to be a bug with “cdb_set_case” when the “choice” statement contains “config false” and is located inside something that is “config true”.

You can use MAAPI instead with the advantage that all CDB operational datastore changes are done in the “CDB oper transaction” are set then you apply them avoiding reads in-between your writes:

$ confd_cmd -dd -c 'mcreate /performance-measurement-objects/rx-window-measurement-objects{RX_TOTAL}; mset "/performance-measurement-objects/rx-window-measurement-objects{RX_TOTAL}/name" "my-hw-component-name"; mset "/performance-measurement-objects/rx-window-measurement-objects{RX_TOTAL}/count" 54321'
mcreate "/performance-measurement-objects/rx-window-measurement-objects{RX_TOTAL}" ; mset "/performance-measurement-objects/rx-window-measurement-objects{RX_TOTAL}/name" "my-hw-component-name" ; mset "/performance-measurement-objects/rx-window-measurement-objects{RX_TOTAL}/count" "54321"
TRACE Connected (maapi) to ConfD
TRACE MAAPI_START_USER_SESSION  --> CONFD_OK
TRACE MAAPI_START_TRANS  --> CONFD_OK
TRACE MAAPI_CREATE /performance-measurement-objects/rx-window-measurement-objects{RX_TOTAL} --> CONFD_OK
TRACE MAAPI_SET_ELEM2 /performance-measurement-objects/rx-window-measurement-objects{RX_TOTAL}/name --> CONFD_OK
TRACE MAAPI_SET_ELEM2 /performance-measurement-objects/rx-window-measurement-objects{RX_TOTAL}/count --> CONFD_OK
TRACE MAAPI_APPLY_TRANS  --> CONFD_OK
TRACE MAAPI_STOP_TRANS  --> CONFD_OK
TRACE MAAPI_END_USER_SESSION  --> CONFD_OK

$ confd_load -dd -o -F p -p /performance-measurement-objects
TRACE Connected (maapi) to ConfD
starting user session ctxt=system user=system groups=[system]
TRACE MAAPI_START_USER_SESSION  --> CONFD_OK
TRACE MAAPI_START_TRANS  --> CONFD_OK
TRACE MAAPI_SAVE_CONFIG  --> CONFD_OK
TRACE Connected (stream) to ConfD
<config xmlns="http://tail-f.com/ns/config/1.0">
  <performance-measurement-objects xmlns="http://tail-f.com/ns/example/dhcpd">
    <rx-window-measurement-objects>
      <measurement-object>RX_TOTAL</measurement-object>
      <name>my-hw-component-name</name>
      <count>54321</count>
    </rx-window-measurement-objects>
  </performance-measurement-objects>
TRACE MAAPI_SAVE_CONFIG_RESULT  --> CONFD_OK
</config>
TRACE MAAPI_END_USER_SESSION  --> CONFD_OK

$ confd_cmd -dd -c 'mget_case /performance-measurement-objects/rx-window-measurement-objects{RX_TOTAL} object-unit-id'
mget_case "/performance-measurement-objects/rx-window-measurement-objects{RX_TOTAL}" "object-unit-id"
TRACE Connected (maapi) to ConfD
TRACE MAAPI_LOAD_ALL_NS
TRACE MAAPI_LOAD_MNS_MAPS
TRACE MAAPI_LOAD_HASH_DB
TRACE Connected (maapi) to ConfD
TRACE MAAPI_START_USER_SESSION  --> CONFD_OK
TRACE MAAPI_START_TRANS  --> CONFD_OK
TRACE MAAPI_GET_CASE /performance-measurement-objects/rx-window-measurement-objects{RX_TOTAL} --> CONFD_OK
RU
TRACE MAAPI_APPLY_TRANS  --> CONFD_OK
TRACE MAAPI_STOP_TRANS  --> CONFD_OK
TRACE MAAPI_END_USER_SESSION  --> CONFD_OK