Module econfd_notif
An Erlang interface equivalent to the event notifications C-API,
(documented in confd_lib_events(3)).
Version: 5.7.19
An Erlang interface equivalent to the event notifications C-API,
(documented in confd_lib_events(3)).
notification() = #econfd_notif_audit{} | #econfd_notif_syslog{} | #econfd_notif_commit_simple{} | #econfd_notif_commit_diff{} | #econfd_notif_user_session{} | #econfd_notif_ha{} | #econfd_notif_subagent_info{} | #econfd_notif_commit_failed{} | #econfd_notif_snmpa{} | #econfd_notif_forward_info{} | #econfd_notif_confirmed_commit{} | #econfd_notif_upgrade{} | #econfd_notif_progress{} | #econfd_notif_stream_event{} | #econfd_notif_ncs_cq_progress{} | #econfd_notif_ncs_audit_network{} | confd_heartbeat | confd_health_check | confd_reopen_logs | ncs_package_reload
Close the event notification connection.
Equivalent to connect(Address, 4565, Mask).
Equivalent to connect(Address, Port, Mask, []).
connect(Address, Port, Mask, Options) -> econfd:connect_result()
- Address = econfd:ip()
- Port = non_neg_integer()
- Mask = integer()
- Options = [Option]
- Option = {heartbeat_interval, integer()} | {health_check_interval, integer()} | {stream_name, atom()} | {start_time, econfd:datetime()} | {stop_time, econfd:datetime()} | {xpath_filter, binary()} | {usid, integer()} | {verbosity, 0..3}
Connect to the notif server on host with address Address:Port.
If the port is changed it must also be changed in confd.conf.
The Mask argument is a bitmask made out of the
bits defined in econfd.hrl as CONFD_NOTIF_XXX.
If CONFD_NOTIF_HEARTBEAT and/or CONFD_NOTIF_HEALTH_CHECK is included in
Mask, the corresponding desired interval (in milliseconds) must be
included in the options list.
If CONFD_NOTIF_STREAM_EVENT is included in Mask, 'stream_name' must be
included in the options list, 'start_time'/'stop_time' option may be used
for replay, 'xpath_filter' may be used for event notification filtering,
and 'usid' may be given to apply AAA restrictions.
To close a notification socket, use
close/1
.
This function is deprecated: Use the function recv/2
instead.
Decode the notif message and return corresponding
record depending on the type of the message.
It is the resposibility of the application to
read data from the notifications socket.
notification_done(Socket, Thandle) -> Result
Indicate that we're done with diff processing.
Whenever we subscribe to ?CONFD_NOTIF_COMMIT_DIFF we must indicate to
confd that we're done with the diff processing. The transaction
hangs until we've done this.
notification_done(Socket, Usid, NotifType) -> Result
Indicate that we're done with notif processing.
When we subscribe to ?CONFD_NOTIF_AUDIT with ?CONFD_NOTIF_AUDIT_SYNC
or to ?NCS_NOTIF_AUDIT_NETWORK with ?NCS_NOTIF_AUDIT_NETWORK_SYNC,
we must indicate that we're done with the notif processing. The user-session
hangs until we've done this.
Equivalent to recv(Socket, infinity).
recv(Socket, Timeout) -> Result
Wait for an event notification message and return corresponding
record depending on the type of the message.
The logno element in the record is an integer.
These integers can be used as an index to the
function econfd_logsyms:get_logsym/1
in order to get a
textual description for the event.
When recv/2 returns
{error, timeout} the connection (and its
event subscriptions) is still active and the application needs to call
recv/2 again. But if recv/2 returns
{error, Reason} the connection to ConfD is closed and all
event subscriptions associated with it are cleared.
Generated by EDoc