![]() |
sysrepo
1.4.168
YANG datastore
|
Typedefs | |
| typedef enum sr_ev_notif_type_e | sr_ev_notif_type_t |
| Type of the notification passed to the sr_event_notif_cb and sr_event_notif_tree_cb callbacks. More... | |
| typedef void(* | sr_event_notif_cb )(sr_session_ctx_t *session, const sr_ev_notif_type_t notif_type, const char *xpath, const sr_val_t *values, const size_t values_cnt, time_t timestamp, void *private_data) |
| Callback to be called for the delivery of a notification. Data are represented as sr_val_t structures. More... | |
| typedef void(* | sr_event_notif_tree_cb )(sr_session_ctx_t *session, const sr_ev_notif_type_t notif_type, const struct lyd_node *notif, time_t timestamp, void *private_data) |
| Callback to be called for the delivery of a notification. Data are represented as libyang subtrees. More... | |
Enumerations | |
| enum | sr_ev_notif_type_e { SR_EV_NOTIF_REALTIME, SR_EV_NOTIF_REPLAY, SR_EV_NOTIF_REPLAY_COMPLETE, SR_EV_NOTIF_STOP, SR_EV_NOTIF_SUSPENDED, SR_EV_NOTIF_RESUMED } |
| Type of the notification passed to the sr_event_notif_cb and sr_event_notif_tree_cb callbacks. More... | |
Functions | |
| int | sr_event_notif_subscribe (sr_session_ctx_t *session, const char *module_name, const char *xpath, time_t start_time, time_t stop_time, sr_event_notif_cb callback, void *private_data, sr_subscr_options_t opts, sr_subscription_ctx_t **subscription) |
| Subscribe for the delivery of a notification(s). Data are represented as sr_val_t structures. More... | |
| int | sr_event_notif_subscribe_tree (sr_session_ctx_t *session, const char *module_name, const char *xpath, time_t start_time, time_t stop_time, sr_event_notif_tree_cb callback, void *private_data, sr_subscr_options_t opts, sr_subscription_ctx_t **subscription) |
| Subscribes for the delivery of a notification(s). Data are represented as libyang subtrees. More... | |
| int | sr_event_notif_send (sr_session_ctx_t *session, const char *path, const sr_val_t *values, const size_t values_cnt) |
| Send a notification. Data are represented as sr_val_t structures. In case there are particularly many notifications send on a session (100 notif/s or more) and all of them are stored for replay, consider using sr_session_notif_buffer(). More... | |
| int | sr_event_notif_send_tree (sr_session_ctx_t *session, struct lyd_node *notif) |
| Send a notification. Data are represented as libyang subtrees. In case there are particularly many notifications send on a session (100 notif/s or more) and all of them are stored for replay, consider using sr_session_notif_buffer(). More... | |
| uint32_t | sr_event_notif_sub_id_get_last (const sr_subscription_ctx_t *subscription) |
| Get the subscription ID of the last notification subscription. More... | |
| int | sr_event_notif_sub_suspend (sr_subscription_ctx_t *subscription, uint32_t sub_id) |
| Suspend a notification subscription, special SR_EV_NOTIF_SUSPENDED notification is delivered. More... | |
| int | sr_event_notif_sub_resume (sr_subscription_ctx_t *subscription, uint32_t sub_id) |
| Resume a previously suspended notification subscription, special SR_EV_NOTIF_RESUMED notification is delivered. More... | |
| typedef enum sr_ev_notif_type_e sr_ev_notif_type_t |
Type of the notification passed to the sr_event_notif_cb and sr_event_notif_tree_cb callbacks.
| typedef void(* sr_event_notif_cb)(sr_session_ctx_t *session, const sr_ev_notif_type_t notif_type, const char *xpath, const sr_val_t *values, const size_t values_cnt, time_t timestamp, void *private_data) |
Callback to be called for the delivery of a notification. Data are represented as sr_val_t structures.
| [in] | session | Implicit session (do not stop) with information about the event originator session IDs. |
| [in] | notif_type | Type of the notification. |
| [in] | xpath | Full operation xpath identifying the exact notification executed. |
| [in] | values | Array of all nodes that hold some data in event notification subtree. |
| [in] | values_cnt | Number of items inside the values array. |
| [in] | timestamp | Time when the notification was generated |
| [in] | private_data | Private context opaque to sysrepo, as passed to sr_event_notif_subscribe call. |
| typedef void(* sr_event_notif_tree_cb)(sr_session_ctx_t *session, const sr_ev_notif_type_t notif_type, const struct lyd_node *notif, time_t timestamp, void *private_data) |
Callback to be called for the delivery of a notification. Data are represented as libyang subtrees.
| [in] | session | Implicit session (do not stop) with information about the event originator session IDs. |
| [in] | notif_type | Type of the notification. |
| [in] | notif | Notification data tree. Always points to the notification itself, even for nested ones. |
| [in] | timestamp | Time when the notification was generated |
| [in] | private_data | Private context opaque to sysrepo, as passed to sr_event_notif_subscribe_tree call. |
| enum sr_ev_notif_type_e |
Type of the notification passed to the sr_event_notif_cb and sr_event_notif_tree_cb callbacks.
| int sr_event_notif_subscribe | ( | sr_session_ctx_t * | session, |
| const char * | module_name, | ||
| const char * | xpath, | ||
| time_t | start_time, | ||
| time_t | stop_time, | ||
| sr_event_notif_cb | callback, | ||
| void * | private_data, | ||
| sr_subscr_options_t | opts, | ||
| sr_subscription_ctx_t ** | subscription | ||
| ) |
Subscribe for the delivery of a notification(s). Data are represented as sr_val_t structures.
Required WRITE access.
| [in] | session | Session (not DS-specific) to use. |
| [in] | module_name | Name of the module whose notifications to subscribe to. |
| [in] | xpath | Optional XPath further filtering received notifications. |
| [in] | start_time | Optional start time of the subscription. Used for replaying stored notifications. |
| [in] | stop_time | Optional stop time ending the notification subscription. |
| [in] | callback | Callback to be called when the event notification is delivered. |
| [in] | private_data | Private context passed to the callback function, opaque to sysrepo. |
| [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 that is supposed to be released by sr_unsubscribe. |
| int sr_event_notif_subscribe_tree | ( | sr_session_ctx_t * | session, |
| const char * | module_name, | ||
| const char * | xpath, | ||
| time_t | start_time, | ||
| time_t | stop_time, | ||
| sr_event_notif_tree_cb | callback, | ||
| void * | private_data, | ||
| sr_subscr_options_t | opts, | ||
| sr_subscription_ctx_t ** | subscription | ||
| ) |
Subscribes for the delivery of a notification(s). Data are represented as libyang subtrees.
Required WRITE access.
| [in] | session | Session (not DS-specific) to use. |
| [in] | module_name | Name of the module whose notifications to subscribe to. |
| [in] | xpath | Optional XPath further filtering received notifications. |
| [in] | start_time | Optional start time of the subscription. Used for replaying stored notifications. |
| [in] | stop_time | Optional stop time ending the notification subscription. |
| [in] | callback | Callback to be called when the event notification is delivered. |
| [in] | private_data | Private context passed to the callback function, opaque to sysrepo. |
| [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 that is supposed to be released by sr_unsubscribe. |
| int sr_event_notif_send | ( | sr_session_ctx_t * | session, |
| const char * | path, | ||
| const sr_val_t * | values, | ||
| const size_t | values_cnt | ||
| ) |
Send a notification. Data are represented as sr_val_t structures. In case there are particularly many notifications send on a session (100 notif/s or more) and all of them are stored for replay, consider using sr_session_notif_buffer().
Required WRITE access. If the module does not support replay, required READ access.
| [in] | session | Session (not DS-specific) to use. |
| [in] | path | Path identifying the notification. |
| [in] | values | Array of all nodes that hold some data in event notification subtree (same as sr_get_items would return). |
| [in] | values_cnt | Number of items inside the values array. |
| int sr_event_notif_send_tree | ( | sr_session_ctx_t * | session, |
| struct lyd_node * | notif | ||
| ) |
Send a notification. Data are represented as libyang subtrees. In case there are particularly many notifications send on a session (100 notif/s or more) and all of them are stored for replay, consider using sr_session_notif_buffer().
Required WRITE access. If the module does not support replay, required READ access.
| [in] | session | Session (not DS-specific) to use. |
| [in] | notif | Notification data tree to send. |
| uint32_t sr_event_notif_sub_id_get_last | ( | const sr_subscription_ctx_t * | subscription | ) |
Get the subscription ID of the last notification subscription.
| [in] | subscription | Subscription context to read from. |
| int sr_event_notif_sub_suspend | ( | sr_subscription_ctx_t * | subscription, |
| uint32_t | sub_id | ||
| ) |
Suspend a notification subscription, special SR_EV_NOTIF_SUSPENDED notification is delivered.
| [in] | subscription | Subscription context to use. |
| [in] | sub_id | Subscription ID of the specific subscription to suspend. |
| int sr_event_notif_sub_resume | ( | sr_subscription_ctx_t * | subscription, |
| uint32_t | sub_id | ||
| ) |
Resume a previously suspended notification subscription, special SR_EV_NOTIF_RESUMED notification is delivered.
| [in] | subscription | Subscription context to use. |
| [in] | sub_id | Subscription ID of the specific subscription to resume. |