summaryrefslogtreecommitdiff
path: root/lib/northbound.h
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2024-03-03 21:40:16 +0200
committerIgor Ryzhov <iryzhov@nfware.com>2024-03-26 17:00:15 +0200
commit1196d947d3f2241897ec5037d7db0519ad27a6ea (patch)
tree43b23854208035d43190ca33c451edfe3f2ff8cd /lib/northbound.h
parent73e0b7a198c8a2f483af2140e116e53df1e5cb5d (diff)
mgmtd: add support for native 'edit' operation
This operation basically implements support for RESTCONF operations. It receives an xpath and a data tree in JSON/XML format, instead of a list of (xpath, value) tuples as required by the current protobuf interface. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'lib/northbound.h')
-rw-r--r--lib/northbound.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/lib/northbound.h b/lib/northbound.h
index 5be111cf0a..15a4999943 100644
--- a/lib/northbound.h
+++ b/lib/northbound.h
@@ -1005,6 +1005,44 @@ extern int nb_candidate_edit(struct nb_config *candidate,
const struct yang_data *data);
/*
+ * Edit a candidate configuration. Value is given as JSON/XML.
+ *
+ * candidate
+ * Candidate configuration to edit.
+ *
+ * operation
+ * Operation to apply.
+ *
+ * format
+ * LYD_FORMAT of the value.
+ *
+ * xpath
+ * XPath of the configuration node being edited.
+ * For create, it must be the parent.
+ *
+ * data
+ * New data tree for the node.
+ *
+ * xpath_created
+ * XPath of the created node if operation is "create".
+ *
+ * errmsg
+ * Buffer to store human-readable error message in case of error.
+ *
+ * errmsg_len
+ * Size of errmsg.
+ *
+ * Returns:
+ * - NB_OK on success.
+ * - NB_ERR for other errors.
+ */
+extern int nb_candidate_edit_tree(struct nb_config *candidate,
+ enum nb_operation operation,
+ LYD_FORMAT format, const char *xpath,
+ const char *data, char *xpath_created,
+ char *errmsg, size_t errmsg_len);
+
+/*
* Create diff for configuration.
*
* dnode