sysrepo 5.1.0
YANG-based system repository for all-around configuration management.
Loading...
Searching...
No Matches
private_candidate.h
Go to the documentation of this file.
1
16
17#ifndef SYSREPO_PRIVATE_CANDIDATE_H_
18#define SYSREPO_PRIVATE_CANDIDATE_H_
19
20#include <libyang/libyang.h>
21
22#include "sysrepo.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
39
57
66typedef struct {
67 struct lyd_node *run_diff;
68 struct lyd_node *pc_diff;
71
79
102int sr_pc_create_ds(sr_session_ctx_t *session, uint32_t subscription_opts, sr_subscription_ctx_t **subscription,
103 sr_priv_cand_t **private_candidate_ds);
104
114
121
137int sr_pc_update(sr_session_ctx_t *session, sr_priv_cand_t *private_candidate_ds, sr_pc_conflict_resolution_t conflict_resolution,
138 sr_pc_conflict_set_t **conflict_set);
139
154int sr_pc_commit(sr_session_ctx_t *session, sr_priv_cand_t *private_candidate_ds, sr_pc_conflict_set_t **conflict_set);
155
168int sr_pc_edit_config(sr_session_ctx_t *session, sr_priv_cand_t *private_candidate_ds, const struct lyd_node *edit,
169 const char *default_operation);
170
186int sr_pc_get_data(sr_session_ctx_t *session, const char *xpath, uint32_t max_depth, const uint32_t opts,
187 const sr_priv_cand_t *private_candidate_ds, sr_data_t **data);
188
199void sr_pc_discard_changes(sr_priv_cand_t *private_candidate_ds);
200
211int sr_pc_backup_privcand(sr_session_ctx_t *session, sr_priv_cand_t *privcand, sr_priv_cand_t **privcand_backup);
212
221void sr_pc_restore_privcand(sr_priv_cand_t *privcand_target, sr_priv_cand_t *privcand_backup);
222
231int sr_pc_validate(sr_session_ctx_t *session, const char *module_name, const sr_priv_cand_t *privcand);
232
244int sr_pc_replace_trg_config(sr_session_ctx_t *session, sr_priv_cand_t *privcand, const char *module_name,
245 const struct lyd_node *src_config);
246
247#ifdef __cplusplus
248}
249#endif
250
251#endif /* SYSREPO_PRIVATE_CANDIDATE_H_ */
Structure that safely wraps libyang data and prevents unexpected context changes.
struct sr_subscription_ctx_s sr_subscription_ctx_t
Sysrepo subscription context returned from sr_*_subscribe calls, it is supposed to be released by the...
int sr_pc_backup_privcand(sr_session_ctx_t *session, sr_priv_cand_t *privcand, sr_priv_cand_t **privcand_backup)
Make a backup copy of the private candidate datastore structure.
int sr_pc_create_ds(sr_session_ctx_t *session, uint32_t subscription_opts, sr_subscription_ctx_t **subscription, sr_priv_cand_t **private_candidate_ds)
Creates a private candidate datastore structure.
struct lyd_node * pc_diff
int sr_pc_replace_trg_config(sr_session_ctx_t *session, sr_priv_cand_t *privcand, const char *module_name, const struct lyd_node *src_config)
Replaces private candidate datastore with the contents of another conventional datastore.
void sr_pc_restore_privcand(sr_priv_cand_t *privcand_target, sr_priv_cand_t *privcand_backup)
Replaces the content of private candidate structure with the content of another private candidate str...
sr_pc_conflict_type_t type
int sr_pc_commit(sr_session_ctx_t *session, sr_priv_cand_t *private_candidate_ds, sr_pc_conflict_set_t **conflict_set)
Performs <commit> operation on private candidate datastore.
void sr_pc_free_conflicts(sr_pc_conflict_set_t *conflict_set)
Remove and free all conflict data.
void sr_pc_discard_changes(sr_priv_cand_t *private_candidate_ds)
Performs <discard-changes> operation on private candidate datastore.
sr_pc_conflict_type_t
Types of conflicts that may occur during private candidate datastore <update>.
@ SR_PC_CONFLICT_LEAFLIST_ORDER
@ SR_PC_CONFLICT_VALUE_CHANGE
@ SR_PC_CONFLICT_LIST_ENTRY
@ SR_PC_CONFLICT_LEAFLIST_ITEM
@ SR_PC_CONFLICT_LEAF_EXISTENCE
@ SR_PC_CONFLICT_PRESENCE_CONTAINER
@ SR_PC_CONFLICT_LIST_ORDER
struct lyd_node * run_diff
sr_pc_conflict_resolution_t
Strategies for resolving configuration conflicts when merging candidate and running datastores.
@ SR_PC_REVERT_ON_CONFLICT
@ SR_PC_PREFER_CANDIDATE
@ SR_PC_PREFER_RUNNING
int sr_pc_get_data(sr_session_ctx_t *session, const char *xpath, uint32_t max_depth, const uint32_t opts, const sr_priv_cand_t *private_candidate_ds, sr_data_t **data)
Retrieve a tree whose root nodes match the provided XPath. Data are represented as libyang subtrees.
sr_pc_conflict_info_t * conflicts
int sr_pc_destroy_ds(sr_session_ctx_t *session, sr_priv_cand_t *privcand)
Destroys the private candidate datastore structure.
int sr_pc_edit_config(sr_session_ctx_t *session, sr_priv_cand_t *private_candidate_ds, const struct lyd_node *edit, const char *default_operation)
Performs <edit-config> operation on private candidate datastore.
int sr_pc_update(sr_session_ctx_t *session, sr_priv_cand_t *private_candidate_ds, sr_pc_conflict_resolution_t conflict_resolution, sr_pc_conflict_set_t **conflict_set)
Performs <update> operation on private candidate datastore.
int sr_pc_validate(sr_session_ctx_t *session, const char *module_name, const sr_priv_cand_t *privcand)
Perform the validation of private candidate datastore.
Structure representing a set of detected conflicts between the running and private candidate datastor...
Stores information about conflicts.
public API sysrepo header
struct sr_session_ctx_s sr_session_ctx_t
Sysrepo session on a connection.
struct sr_priv_cand_s sr_priv_cand_t
Private candidate datastore context.