diff options
| author | Igor Ryzhov <iryzhov@nfware.com> | 2023-10-06 15:01:16 +0300 |
|---|---|---|
| committer | Igor Ryzhov <iryzhov@nfware.com> | 2024-01-11 15:06:53 +0200 |
| commit | 3c2598a26ff01fc712d61233a6a627fdfa1a7b77 (patch) | |
| tree | 9b3ba850ffe7b13c1ce1d4c27d9846dd7d951364 /lib/vty.c | |
| parent | 76e4eb84dd815ddee7d7e46bb5a2635bfe2501f5 (diff) | |
mgmt, lib: differentiate DELETE and REMOVE operations
Currently, there's a single operation type which doesn't return error
if the object doesn't exists. To be compatible with NETCONF/RESTCONF,
we should support differentiate between DELETE (fails when object
doesn't exist) and REMOVE (doesn't fail if the object doesn't exist).
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'lib/vty.c')
| -rw-r--r-- | lib/vty.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -3996,11 +3996,16 @@ int vty_mgmt_send_config_data(struct vty *vty, const char *xpath_base, mgmt_yang_cfg_data_req_init(&cfg_req[indx]); cfg_req[indx].data = &cfg_data[indx]; switch (vty->cfg_changes[indx].operation) { - case NB_OP_DESTROY: + case NB_OP_DELETE: cfg_req[indx].req_type = MGMTD__CFG_DATA_REQ_TYPE__DELETE_DATA; break; + case NB_OP_DESTROY: + cfg_req[indx].req_type = + MGMTD__CFG_DATA_REQ_TYPE__REMOVE_DATA; + break; + case NB_OP_CREATE_EXCL: cfg_req[indx].req_type = MGMTD__CFG_DATA_REQ_TYPE__CREATE_DATA; |
