sysrepo
2.12.0
YANG-based system repository for all-around configuration management.
|
Functions | |
int | sr_rpc_send (sr_session_ctx_t *session, const char *path, const sr_val_t *input, const size_t input_cnt, uint32_t timeout_ms, sr_val_t **output, size_t *output_cnt) |
Send an RPC/action and wait for the result. Data are represented as sr_val_t structures. More... | |
int | sr_rpc_send_tree (sr_session_ctx_t *session, struct lyd_node *input, uint32_t timeout_ms, sr_data_t **output) |
Send an RPC/action and wait for the result. Data are represented as libyang subtrees. More... | |
int | sr_rpc_subscribe (sr_session_ctx_t *session, const char *xpath, sr_rpc_cb callback, void *private_data, uint32_t priority, sr_subscr_options_t opts, sr_subscription_ctx_t **subscription) |
Subscribe for the delivery of an RPC/action. Data are represented as sr_val_t structures. More... | |
int | sr_rpc_subscribe_tree (sr_session_ctx_t *session, const char *xpath, sr_rpc_tree_cb callback, void *private_data, uint32_t priority, sr_subscr_options_t opts, sr_subscription_ctx_t **subscription) |
Subscribe for the delivery of an RPC/action. Data are represented as libyang subtrees. More... | |
typedef int(* | sr_rpc_cb )(sr_session_ctx_t *session, uint32_t sub_id, const char *xpath, const sr_val_t *input, const size_t input_cnt, sr_event_t event, uint32_t request_id, sr_val_t **output, size_t *output_cnt, void *private_data) |
Callback to be called for the delivery of an RPC/action. Data are represented as sr_val_t structures. More... | |
typedef int(* | sr_rpc_tree_cb )(sr_session_ctx_t *session, uint32_t sub_id, const char *op_path, const struct lyd_node *input, sr_event_t event, uint32_t request_id, struct lyd_node *output, void *private_data) |
Callback to be called for the delivery of an RPC/action. Data are represented as libyang subtrees. More... | |
typedef int(* sr_rpc_cb)(sr_session_ctx_t *session, uint32_t sub_id, const char *xpath, const sr_val_t *input, const size_t input_cnt, sr_event_t event, uint32_t request_id, sr_val_t **output, size_t *output_cnt, void *private_data) |
Callback to be called for the delivery of an RPC/action. Data are represented as sr_val_t structures.
[in] | session | Implicit session (do not stop) with information about event originator session IDs. |
[in] | sub_id | Subscription ID. |
[in] | xpath | Full operation xpath identifying the exact RPC/action executed. |
[in] | input | Array of input parameters. |
[in] | input_cnt | Number of input parameters. |
[in] | event | Type of the callback event that has occurred. |
[in] | request_id | Request ID unique for the specific op_path . |
[out] | output | Array of output parameters. Should be allocated on heap, will be freed by sysrepo after sending of the RPC response. |
[out] | output_cnt | Number of output parameters. |
[in] | private_data | Private context opaque to sysrepo, as passed to sr_rpc_subscribe call. |
Definition at line 571 of file sysrepo_types.h.
typedef int(* sr_rpc_tree_cb)(sr_session_ctx_t *session, uint32_t sub_id, const char *op_path, const struct lyd_node *input, sr_event_t event, uint32_t request_id, struct lyd_node *output, void *private_data) |
Callback to be called for the delivery of an RPC/action. Data are represented as libyang subtrees.
[in] | session | Implicit session (do not stop) with information about the event originator session IDs. |
[in] | sub_id | Subscription ID. |
[in] | op_path | Simple operation path identifying the RPC/action. |
[in] | input | Data tree of input parameters. Always points to the RPC/action itself, even for nested operations. |
[in] | event | Type of the callback event that has occurred. |
[in] | request_id | Request ID unique for the specific op_path . |
[out] | output | Data tree for appending any output parameters, the operation root node is provided.. |
[in] | private_data | Private context opaque to sysrepo, as passed to sr_rpc_subscribe_tree call. |
Definition at line 590 of file sysrepo_types.h.
int sr_rpc_send | ( | sr_session_ctx_t * | session, |
const char * | path, | ||
const sr_val_t * | input, | ||
const size_t | input_cnt, | ||
uint32_t | timeout_ms, | ||
sr_val_t ** | output, | ||
size_t * | output_cnt | ||
) |
Send an RPC/action and wait for the result. Data are represented as sr_val_t structures.
Required READ access.
[in] | session | Session (not DS-specific) to use. |
[in] | path | Path identifying the RPC/action. |
[in] | input | Array of input parameters (array of all nodes that hold some data in RPC/action input subtree - same as sr_get_items would return). |
[in] | input_cnt | Number of input parameters. |
[in] | timeout_ms | RPC/action callback timeout in milliseconds. If 0, default is used. |
[out] | output | Array of output parameters (all nodes that hold some data in RPC/action output subtree). Will be allocated by sysrepo and should be freed by caller using sr_free_values. |
[out] | output_cnt | Number of output parameters. |
int sr_rpc_send_tree | ( | sr_session_ctx_t * | session, |
struct lyd_node * | input, | ||
uint32_t | timeout_ms, | ||
sr_data_t ** | output | ||
) |
Send an RPC/action and wait for the result. Data are represented as libyang subtrees.
Required READ access.
[in] | session | Session (not DS-specific) to use. |
[in,out] | input | Input data tree in session connection libyang context, is validated. |
[in] | timeout_ms | RPC/action callback timeout in milliseconds. If 0, default is used. |
[out] | output | SR data with the output data tree. |
int sr_rpc_subscribe | ( | sr_session_ctx_t * | session, |
const char * | xpath, | ||
sr_rpc_cb | callback, | ||
void * | private_data, | ||
uint32_t | priority, | ||
sr_subscr_options_t | opts, | ||
sr_subscription_ctx_t ** | subscription | ||
) |
Subscribe for the delivery of an RPC/action. Data are represented as sr_val_t structures.
Required WRITE access.
[in] | session | Session (not DS-specific) to use. |
[in] | xpath | XPath identifying the RPC/action. Any predicates are allowed. |
[in] | callback | Callback to be called. |
[in] | private_data | Private context passed to the callback function, opaque to sysrepo. |
[in] | priority | Specifies the order in which the callbacks (within RPC/action) will be called, higher first. |
[in] | opts | Options overriding default behavior of the subscription, it is supposed to be a bitwise OR-ed value of any sr_subscr_flag_t flags. |
[in,out] | subscription | Subscription context, zeroed for first subscription, freed by sr_unsubscribe. |
int sr_rpc_subscribe_tree | ( | sr_session_ctx_t * | session, |
const char * | xpath, | ||
sr_rpc_tree_cb | callback, | ||
void * | private_data, | ||
uint32_t | priority, | ||
sr_subscr_options_t | opts, | ||
sr_subscription_ctx_t ** | subscription | ||
) |
Subscribe for the delivery of an RPC/action. Data are represented as libyang subtrees.
Required WRITE access.
[in] | session | Session (not DS-specific) to use. |
[in] | xpath | XPath identifying the RPC/action. Any predicates are allowed. |
[in] | callback | Callback to be called. |
[in] | private_data | Private context passed to the callback function, opaque to sysrepo. |
[in] | priority | Specifies the order in which the callbacks (within RPC/action) will be called, higher first. |
[in] | opts | Options overriding default behavior of the subscription, it is supposed to be a bitwise OR-ed value of any sr_subscr_flag_t flags. |
[in,out] | subscription | Subscription context, zeroed for first subscription, freed by sr_unsubscribe. |