Hi there ,
I have a yang file with the following entry
module lldp {
leaf enable {
type empty;
}
}
I can see this keypath when I do
$ confd --cdb-debug-dump /path/to/confd/cdb-dir
...
/lldp:lldp/enable
...
and I can also read it during runtime, using
$ confd_load -oFc -p /lldp:lldp/enable
lldp
enable
exit
But, since the type of the lead lldp contains type empty
in the lldp.yang file, we cannot set/change it’s value. According to the https://datatracker.ietf.org/doc/html/rfc6020#section-9.11, where it states “The empty built-in type represents a leaf that does not have any value, it conveys information by its presence or absence.”
I can enable this element through confd_cli
using lldp [enable]
and disable it using no lldp [enable]
(yes the “enable” keyword can be omitted).
But I want to be able to do the same operation through the use of “confd_cmd” and/or “maapi” executables (in linux cli).
I can see that the entry is present using maapi_exists
$ confd_cmd -dd -o -c "maapi_exists /lldp:lldp/enable"
maapi_exists "/lldp:lldp/enable"
TRACE Connected (maapi) to ConfD
TRACE MAAPI_START_USER_SESSION --> CONFD_OK
TRACE MAAPI_START_TRANS --> CONFD_OK
TRACE MAAPI_EXISTS /lldp:lldp/enable --> CONFD_OK
yes
TRACE MAAPI_APPLY_TRANS --> CONFD_OK
TRACE MAAPI_STOP_TRANS --> CONFD_OK
TRACE MAAPI_END_USER_SESSION --> CONFD_OK
But when I try to delete the node it fails using “delete” and maapi_delete" subcommands:
$ confd_cmd -dd -o -c "delete /lldp:lldp/enable"
maapi_delete "/lldp:lldp/enable"
TRACE Connected (maapi) to ConfD
TRACE MAAPI_START_USER_SESSION --> CONFD_OK
TRACE MAAPI_START_TRANS --> CONFD_OK
TRACE MAAPI_DELETE /lldp:lldp/enableDEBUG item is not writable -
--> CONFD_ERR
FAILED: maapi_delete(ms, mtid, argv[0]), Error: item is not writable (4): , in function do_maapi_delete, line 1506
$ confd_cmd -dd -o -c "maapi_delete lldp:lldp/enable"
delete "/lldp:lldp/enable"
TRACE Connected (cdb) to ConfD
TRACE CDB_NEW_SESSION --> CONFD_OK
TRACE Established new CDB session to ConfD
TRACE CDB_DELETE /lldp:lldp/enableDEBUG badly formatted or nonexistent path - Not a cdb operational data path
--> CONFD_ERR
FAILED: cdb_delete(cs, argv[0]), Error: badly formatted or nonexistent path (8): Not a cdb operational data path, in function do_cdb_delete, line 536
How can I delete and recreate this node? Can it be done through confd_cmd and/or maapi? Somehow else perhaps ?
Ultimately I want to add a clispec that defines a different convention to enable/disable this feature and call internally (through confd_cmd presumably) the same [no] lldp [enable]
confd_cli commands. How can I do that ?
Thank you in advance for your help