- NSO SDK API Reference
- NSO Python API
- ncs
- ncs.alarm
- ncs.application
- ncs.cdb
- ncs.childlist
- ncs.dp
- ncs.error
- ncs.events
- ncs.experimental
- ncs.fsm
- ncs.ha
- ncs.keypath
- ncs.log
- ncs.maagic
- ncs.maapi
- ncs.ns
- ncs.ns.ncs_ns
- ncs.ns.netconf_ncs_ns
- ncs.pool
- ncs.progress
- ncs.service_log
- ncs.template
- ncs.tm
- ncs.upgrade
- ncs.util
- _ncs
- _ncs.cdb
- _ncs.dp
- _ncs.error
- _ncs.events
- _ncs.ha
- _ncs.maapi
- NSO Java API
- API Overview
- com.tailf.cdb
- com.tailf.conf
- com.tailf.dp
- com.tailf.dp.annotations
- com.tailf.dp.proto
- com.tailf.dp.services
- com.tailf.ha
- com.tailf.maapi
- com.tailf.navu
- com.tailf.navu.traversal
- com.tailf.ncs
- com.tailf.ncs.alarmman
- com.tailf.ncs.alarmman.common
- com.tailf.ncs.alarmman.consumer
- com.tailf.ncs.alarmman.producer
- com.tailf.ncs.annotations
- com.tailf.ncs.ns
- com.tailf.ncs.proto
- com.tailf.ncs.snmp.snmp4j
- com.tailf.ncs.template
- com.tailf.ned
- com.tailf.notif
- com.tailf.progress
- com.tailf.proto
- com.tailf.util
- NSO Erlang API
- Manual Pages
- NSO Documentation Home
- NSO Guides
- NSO Change Log Explorer
- NSO NED Change Log Explorer
- NSO NED Capabilities Explorer
- NSO on DevNet
- Get Support
Module econfd_maapi
An Erlang interface equivalent to the MAAPI C-API.Version: 6.4.4
Description
An Erlang interface equivalent to the MAAPI C-API
This modules implements the Management Agent API. All functions in this module have an equivalent function in the C library. The actual semantics of each of the API functions described here is better described in the man page confd_lib_maapi(3).Data Types
confd_user_identification()
confd_user_identification() = #confd_user_identification{vendor = undefined | string(), product = undefined | string(), version = undefined | string(), client_identity = undefined | string()}
confd_user_info()
confd_user_info() = #confd_user_info{}
dbname()
dbname() = 0 | 1 | 2 | 3 | 4 | 6 | 7
The DB name can be either
- 0 = CONFD_NO_DB
- 1 = CONFD_CANDIDATE
- 2 = CONFD_RUNNING
- 3 = CONFD_STARTUP
- 4 = CONFD_OPERATIONAL
- 6 = CONFD_PRE_COMMIT_RUNNING
- 7 = CONFD_INTENDED
maapi_start_trans()
in confd_lib_maapi(3) for detailed information.
err()
err() = {error, {integer(), binary()}} | {error, closed}
Errors can be either
- {error, Ecode::integer(), Reason::binary()} where Ecode is one of the error codes defined in econfd_errors.hrl, and Reason is (possibly empty) textual description
- {error, closed} if the socket gets closed
find_next_type()
find_next_type() = 0 | 1
The type is used in find_next/3
can be either
- 0 = CONFD_FIND_NEXT
- 1 = CONFD_FIND_SAME_OR_NEXT
maapi_find_next()
in confd_lib_maapi(3) for detailed information.
maapi_cursor()
maapi_cursor() = #maapi_cursor{}
maapi_rollback()
maapi_rollback() = #maapi_rollback{nr = integer(), creator = binary(), date = binary(), via = binary(), fixed_nr = integer(), label = binary(), comment = binary()}
proto()
proto() = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
The protocol to start user session can be either
- 0 = CONFD_PROTO_UNKNOWN
- 1 = CONFD_PROTO_TCP
- 2 = CONFD_PROTO_SSH
- 3 = CONFD_PROTO_SYSTEM
- 4 = CONFD_PROTO_CONSOLE
- 5 = CONFD_PROTO_SSL
- 6 = CONFD_PROTO_HTTP
- 7 = CONFD_PROTO_HTTPS
- 8 = CONFD_PROTO_UDP
- 9 = CONFD_PROTO_TLS
verbosity()
verbosity() = 0 | 1 | 2 | 3
The type is used in start_span_th/7
and can be either
- 0 = CONFD_PROGRESS_NORMAL
- 1 = CONFD_PROGRESS_VERBOSE
- 2 = CONFD_PROGRESS_VERY_VERBOSE
- 3 = CONFD_PROGRESS_DEBUG
maapi_start_span_th()
in confd_lib_maapi(3) for detailed information.
xpath_eval_option()
xpath_eval_option() = {tracefun, term()} | {context, econfd:ikeypath()} | {varbindings, [{Name::string(), ValueExpr::string() | binary()}]} | {root, econfd:ikeypath()}
Function Index
aaa_reload/2 | Tell AAA to reload external AAA data. |
abort_trans/2 | Abort transaction. |
abort_upgrade/1 | Abort in-service upgrade. |
all_keys/3 | Utility function. |
apply_trans/3 | Equivalent to apply_trans(Socket, Tid, KeepOpen, 0) .
|
apply_trans/4 | Apply all in the transaction. |
attach/3 | Attach to a running transaction. |
attach2/4 | Attach to a running transaction. |
attach_init/1 | Attach to the CDB init/upgrade transaction in phase0. |
authenticate/4 | Autenticate a user using ConfD AAA. |
authenticate2/8 | Autenticate a user using ConfD AAA. |
candidate_abort_commit/1 | Equivalent to candidate_abort_commit(Socket, <<>>) .
|
candidate_abort_commit/2 | Cancel persistent confirmed commit. |
candidate_commit/1 | Copies candidate to running or confirms a confirmed commit. |
candidate_commit/2 | Confirms persistent confirmed commit. |
candidate_commit_info/3 | Like candidate_commit/1 , but set the "Label" and/or "Comment"
that is stored in the rollback file when the candidate is committed
to running. |
candidate_commit_info/4 | Combines candidate_commit/2 and candidate_commit_info/3
- set "Label" and/or "Comment" when confirming a persistent confirmed commit. |
candidate_confirmed_commit/2 | Copy candidate into running, but rollback if not confirmed by a
call of candidate_commit/1 . |
candidate_confirmed_commit/4 | Starts or extends persistent confirmed commit. |
candidate_confirmed_commit_info/4 | Like candidate_confirmed_commit/2 , but set the "Label"
and/or "Comment" that is stored in the rollback file when the
candidate is committed to running. |
candidate_confirmed_commit_info/6 | Combines candidate_confirmed_commit/4 and candidate_confirmed_commit_info/4 - set "Label" and/or "Comment"
when starting or extending a persistent confirmed commit. |
candidate_reset/1 | Copy running into candidate. |
candidate_validate/1 | Validate the candidate config. |
cli_prompt/4 | Prompt CLI user for a reply. |
cli_prompt/5 | Prompt CLI user for a reply - return error if no reply is received within Timeout seconds. |
cli_prompt_oneof/4 | Prompt CLI user for a reply. |
cli_prompt_oneof/5 | Prompt CLI user for a reply - return error if no reply is received within Timeout seconds. |
cli_read_eof/3 | Read data from CLI until EOF. |
cli_read_eof/4 | Read data from CLI until EOF - return error if no reply is received within Timeout seconds. |
cli_write/3 | Write mesage to the CLI. |
close/1 | Close socket. |
commit_trans/2 | Commit a transaction. |
commit_upgrade/1 | Commit in-service upgrade. |
confirmed_commit_in_progress/1 | Is a confirmed commit in progress. |
connect/1 | Connect a maapi socket to ConfD. |
connect/2 | Connect a maapi socket to ConfD. |
copy/3 | Copy data from one transaction to another. |
copy_running_to_startup/1 | Copy running to startup. |
copy_tree/4 | Copy an entire subtree in the configuration from one point to another. |
create/3 | Create a new element. |
delete/3 | Delete an element. |
delete_config/2 | Delete all data from a data store. |
detach/2 | Detach from the transaction. |
diff_iterate/4 | Equivalent to diff_iterate(Sock, Tid, Fun, 0, InitState) .
|
diff_iterate/5 | Iterate through a diff. |
end_progress_span/3 | |
end_user_session/1 | Ends a user session. |
exists/3 | Check if an element exists. |
find_next/3 | find the list entry matching Type and Key. |
finish_trans/2 | Finish a transaction. |
get_attrs/4 | Get the selected attributes for an element. |
get_authorization_info/2 | Get authorization info for a user session. |
get_case/4 | Get the current case for a choice. |
get_elem/3 | Read an element. |
get_elem_no_defaults/3 | (Deprecated.) Read an element, but return 'default' instead of the value if the default value is in effect. |
get_my_user_session_id/1 | Get my user session id. |
get_next/1 | iterate through the entries of a list. |
get_object/3 | Read all the values in a container or list entry. |
get_objects/2 | Read all the values for NumEntries list entries, starting at the point given by the cursor C. |
get_rollback_id/2 | Get rollback id of commited transaction. |
get_running_db_status/1 | Get the "running status". |
get_user_session/2 | Get session info for a user session. |
get_user_sessions/1 | Get all user sessions. |
get_values/4 | Read the values for the leafs that have the "value" 'not_found' in the Values list. |
hide_group/3 | Do hide a hide group. |
hkeypath2ikeypath/2 | (Deprecated.) Convert a hkeypath to an ikeypath. |
init_cursor/3 | Equivalent to init_cursor(Socket, Tik, IKeypath, undefined) .
|
init_cursor/4 | Initalize a get_next() cursor. |
init_upgrade/3 | Start in-service upgrade. |
insert/3 | Insert an entry in an integer-keyed list. |
install_crypto_keys/1 | Fetch keys for the encrypted data types from the server. |
is_candidate_modified/1 | Check if candidate has been modified. |
is_lock_set/2 | Check if a db is locked or not. |
is_running_modified/1 | Check if running has been modified since the last copy to startup was done. |
iterate/6 | Iterate over all the data in the transaction and the underlying data store. |
keypath_diff_iterate/5 | Iterate through a diff. |
keypath_diff_iterate/6 | |
kill_user_session/2 | Kill a user session. |
list_rollbacks/1 | (Deprecated.) Get a list of available rollback files. |
load_rollback/3 | (Deprecated.) Load a rollback file. |
lock/2 | Lock a database. |
lock_partial/3 | Request a partial lock on a database. |
move/4 | Move (rename) an entry in a list. |
move_ordered/4 | Move an entry in an "ordered-by user" list. |
ncs_apply_template/7 | Apply a template that has been loaded into NCS. |
ncs_apply_trans_params/4 | Apply transaction with commit parameters. |
ncs_get_trans_params/2 | Get transaction commit parameters. |
ncs_template_variables/3 | Retrieve the variables used in a template. |
ncs_templates/1 | Retrieve a list of the templates currently loaded into NCS. |
ncs_write_service_log_entry/5 | Write a service log entry. |
netconf_ssh_call_home/3 | |
netconf_ssh_call_home_opaque/4 | |
num_instances/3 | Find the number of entries in a list. |
perform_upgrade/2 | Do in-service upgrade. |
prepare_trans/2 | Equivalent to prepare_trans(Socket, Tid, 0) .
|
prepare_trans/3 | Prepare for commit. |
prio_message/3 | Write priority message. |
progress_info/6 | |
progress_info_th/7 | |
reload_config/1 | Tell ConfD daemon to reload its configuration. |
request_action/3 | Invoke an action defined in the data model. |
request_action_th/4 | Invoke an action defined in the data model using the provided transaction. |
revert/2 | Remove all changes in the transaction. |
set_attr/5 | Set the an attribute for an element. |
set_comment/3 | Set the "Comment" that is stored in the rollback file when a transaction towards running is committed. |
set_delayed_when/3 | Enable/disable the "delayed when" mode for a transaction. |
set_elem/4 | Write an element. |
set_elem2/4 | Write an element using the textual value representation. |
set_flags/3 | Change flag settings for a transaction. |
set_label/3 | Set the "Label" that is stored in the rollback file when a transaction towards running is committed. |
set_object/4 | Write an entire object, i.e. |
set_readonly_mode/2 | Control if we can create rw transactions. |
set_running_db_status/2 | Set the "running status". |
set_user_session/2 | Assign a user session. |
set_values/4 | Write a list of tagged values. |
shared_create/3 | Create a new element, and also set an attribute indicating how many times this element has been created. |
shared_set_elem/4 | Write an element from NCS FastMap. |
shared_set_elem2/4 | Write an element using the textual value representation from NCS fastmap. |
shared_set_values/4 | Write a list of tagged values from NCS FastMap. |
snmpa_reload/2 | Tell ConfD to reload external SNMP Agent config data. |
start_phase/3 | Tell ConfD to proceed to next start phase. |
start_progress_span/6 | |
start_progress_span_th/7 | |
start_trans/3 | Start a new transaction. |
start_trans/4 | Start a new transaction within an existing user session. |
start_trans/5 | Start a new transaction within an existing user session and/or with flags. |
start_trans_in_trans/4 | Start a new transaction with an existing transaction as backend. |
start_trans_in_trans/5 | Start a new transaction with an existing transaction as backend. |
start_user_session/6 | Equivalent to start_user_session(Socket,
UserName,
Context,
Groups,
SrcIp,
0,
Proto) .
|
start_user_session/7 | Equivalent to start_user_session(Socket,
UserName,
Context,
Groups,
SrcIp,
0,
Proto,
undefined) .
|
start_user_session/8 | Initiate a new maapi user session. |
stop/1 | Tell ConfD daemon to stop, returns when daemon has exited. |
stop/2 | Tell ConfD daemon to stop, if Synchronous is true won't return until daemon has come to a halt. |
sys_message/3 | Write system message. |
unhide_group/3 | Do unhide a hide group. |
unlock/2 | Unlock a database. |
unlock_partial/2 | Remove the partial lock identified by LockId. |
user_message/4 | Write user message. |
validate_trans/4 | Validate the transaction. |
wait_start/1 | Wait until ConfD daemon has completely started. |
wait_start/2 | Wait until ConfD daemon has reached a certain start phase. |
xpath_eval/6 | Evaluate the XPath expression Expr, invoking ResultFun for each node in the resulting node set. |
xpath_eval/7 | (Deprecated.) Evaluate the XPath expression Expr, invoking ResultFun for each node in the resulting node set. |
xpath_eval_expr/4 | Evaluate the XPath expression Expr, returning the result as a string. |
xpath_eval_expr/5 | Evaluate the XPath expression Expr, returning the result as a string. |
Function Details
aaa_reload/2
Tell AAA to reload external AAA data.
abort_trans/2
Abort transaction.
abort_upgrade/1
Abort in-service upgrade.
all_keys/3
all_keys(Socket, Tid, IKeypath) -> Result
Socket = econfd:socket()
Tid = integer()
IKeypath = econfd:ikeypath()
Result = {ok, [econfd:key()]} | err()
Utility function. Return all keys in a list.
apply_trans/3
apply_trans(Socket, Tid, KeepOpen) -> ok | err()
Socket = econfd:socket()
Tid = integer()
KeepOpen = boolean()
Equivalent to apply_trans(Socket, Tid, KeepOpen, 0)
.
apply_trans/4
apply_trans(Socket, Tid, KeepOpen, Flags) -> ok | err()
Socket = econfd:socket()
Tid = integer()
KeepOpen = boolean()
Flags = non_neg_integer()
Apply all in the transaction.
This is the combination of validate/prepare/commit done in the right order.attach/3
attach(Socket, Ns, Tctx) -> ok | err()
Socket = econfd:socket()
Ns = econfd:namespace() | 0
Tctx = econfd:confd_trans_ctx()
Attach to a running transaction.
Give NameSpace as 0 if it doesn't matter (-1 works too but is deprecated).attach2/4
attach2(Socket, Ns, USid, Thandle) -> ok | err()
Socket = econfd:socket()
Ns = econfd:namespace() | 0
USid = integer()
Thandle = integer()
Attach to a running transaction. Give NameSpace as 0 if it doesn't matter (-1 works too but is deprecated).
attach_init/1
attach_init(Socket) -> Result
Socket = econfd:socket()
Result = {ok, Thandle} | err()
Thandle = integer()
Attach to the CDB init/upgrade transaction in phase0.
Returns the transaction handle to use in subsequent maapi calls on success.authenticate/4
authenticate(Socket, User, Pass, Groups) -> ok | err()
Socket = econfd:socket()
User = binary()
Pass = binary()
Groups = [binary()]
Autenticate a user using ConfD AAA.
authenticate2/8
authenticate2(Socket, User, Pass, SrcIp, SrcPort, Context, Proto, Groups) -> ok | err()
Socket = econfd:socket()
User = binary()
Pass = binary()
SrcIp = econfd:ip()
SrcPort = non_neg_integer()
Context = binary()
Proto = integer()
Groups = [binary()]
Autenticate a user using ConfD AAA.
candidate_abort_commit/1
Equivalent to candidate_abort_commit(Socket, <<>>)
.
candidate_abort_commit/2
candidate_abort_commit(Socket, PersistId) -> ok | err()
Socket = econfd:socket()
PersistId = binary()
Cancel persistent confirmed commit.
candidate_commit/1
Equivalent to candidate_commit_info(Socket, undefined, <<>>, <<>>)
.
Copies candidate to running or confirms a confirmed commit.
candidate_commit/2
Equivalent to candidate_commit_info(Socket, PersistId, <<>>, <<>>)
.
Confirms persistent confirmed commit.
candidate_commit_info/3
candidate_commit_info(Socket, Label, Comment) -> ok | err()
Socket = econfd:socket()
Label = binary()
Comment = binary()
Equivalent to candidate_commit_info(Socket, undefined, Label, Comment)
.
Like candidate_commit/1
, but set the "Label" and/or "Comment"
that is stored in the rollback file when the candidate is committed
to running.
To set only the "Label", give Comment as an empty binary, and to set only the "Comment", give Label as an empty binary.
Note: To ensure that the "Label" and/or "Comment" are stored in the rollback file in all cases when doing a confirmed commit, they must be given both with the confirmed commit (usingcandidate_confirmed_commit_info/4
) and
with the confirming commit (using this function).
candidate_commit_info/4
candidate_commit_info(Socket, PersistId, Label, Comment) -> ok | err()
Socket = econfd:socket()
PersistId = binary() | undefined
Label = binary()
Comment = binary()
Combines candidate_commit/2
and candidate_commit_info/3
- set "Label" and/or "Comment" when confirming a persistent confirmed commit.
candidate_confirmed_commit_info/6
) and
with the confirming commit (using this function).
candidate_confirmed_commit/2
candidate_confirmed_commit(Socket, TimeoutSecs) -> ok | err()
Socket = econfd:socket()
TimeoutSecs = integer()
Equivalent to candidate_confirmed_commit_info(Socket,
TimeoutSecs,
undefined,
undefined,
<<>>,
<<>>)
.
Copy candidate into running, but rollback if not confirmed by a
call of candidate_commit/1
.
candidate_confirmed_commit/4
candidate_confirmed_commit(Socket, TimeoutSecs, Persist, PersistId) -> ok | err()
Socket = econfd:socket()
TimeoutSecs = integer()
Persist = binary() | undefined
PersistId = binary() | undefined
Equivalent to candidate_confirmed_commit_info(Socket,
TimeoutSecs,
Persist,
PersistId,
<<>>,
<<>>)
.
Starts or extends persistent confirmed commit.
candidate_confirmed_commit_info/4
candidate_confirmed_commit_info(Socket, TimeoutSecs, Label, Comment) -> ok | err()
Socket = econfd:socket()
TimeoutSecs = integer()
Label = binary()
Comment = binary()
Equivalent to candidate_confirmed_commit_info(Socket,
TimeoutSecs,
undefined,
undefined,
Label,
Comment)
.
Like candidate_confirmed_commit/2
, but set the "Label"
and/or "Comment" that is stored in the rollback file when the
candidate is committed to running.
To set only the "Label", give Comment as an empty binary, and to set only the "Comment", give Label as an empty binary.
Note: To ensure that the "Label" and/or "Comment" are stored in the rollback file in all cases when doing a confirmed commit, they must be given both with the confirmed commit (using this function) and with the confirming commit (usingcandidate_commit_info/3
).
candidate_confirmed_commit_info/6
candidate_confirmed_commit_info(Socket, TimeoutSecs, Persist, PersistId, Label, Comment) -> ok | err()
Socket = econfd:socket()
TimeoutSecs = integer()
Persist = binary() | undefined
PersistId = binary() | undefined
Label = binary()
Comment = binary()
Combines candidate_confirmed_commit/4
and candidate_confirmed_commit_info/4
- set "Label" and/or "Comment"
when starting or extending a persistent confirmed commit.
candidate_commit_info/4
).
candidate_reset/1
Copy running into candidate.
candidate_validate/1
Validate the candidate config.
cli_prompt/4
cli_prompt(Socket, USid, Prompt, Echo) -> {ok, binary()} | err()
Socket = econfd:socket()
USid = integer()
Prompt = binary()
Echo = boolean()
Prompt CLI user for a reply.
cli_prompt/5
cli_prompt(Socket, USid, Prompt, Echo, Timeout) -> {ok, binary()} | err()
Socket = econfd:socket()
USid = integer()
Prompt = binary()
Echo = boolean()
Timeout = non_neg_integer()
Prompt CLI user for a reply - return error if no reply is received within Timeout seconds.
cli_prompt_oneof/4
cli_prompt_oneof(Socket, USid, Prompt, Choice) -> {ok, binary()} | err()
Socket = econfd:socket()
USid = integer()
Prompt = binary()
Choice = binary()
Prompt CLI user for a reply.
cli_prompt_oneof/5
cli_prompt_oneof(Socket, USid, Prompt, Choice, Timeout) -> {ok, binary()} | err()
Socket = econfd:socket()
USid = integer()
Prompt = binary()
Choice = binary()
Timeout = non_neg_integer()
Prompt CLI user for a reply - return error if no reply is received within Timeout seconds.
cli_read_eof/3
cli_read_eof(Socket, USid, Echo) -> {ok, binary()} | err()
Socket = econfd:socket()
USid = integer()
Echo = boolean()
Read data from CLI until EOF.
cli_read_eof/4
cli_read_eof(Socket, USid, Echo, Timeout) -> {ok, binary()} | err()
Socket = econfd:socket()
USid = integer()
Echo = boolean()
Timeout = non_neg_integer()
Read data from CLI until EOF - return error if no reply is received within Timeout seconds.
cli_write/3
cli_write(Socket, USid, Message) -> ok | err()
Socket = econfd:socket()
USid = integer()
Message = binary()
Write mesage to the CLI.
close/1
Close socket.
commit_trans/2
Commit a transaction.
commit_upgrade/1
Commit in-service upgrade.
confirmed_commit_in_progress/1
confirmed_commit_in_progress(Socket) -> Result
Socket = econfd:socket()
Result = {ok, boolean()} | err()
Is a confirmed commit in progress.
connect/1
Connect a maapi socket to ConfD.
connect/2
Connect a maapi socket to ConfD.
copy/3
Copy data from one transaction to another.
copy_running_to_startup/1
Copy running to startup.
copy_tree/4
copy_tree(Socket, Tid, FromIKeypath, ToIKeypath) -> ok | err()
Socket = econfd:socket()
Tid = integer()
FromIKeypath = econfd:ikeypath()
ToIKeypath = econfd:ikeypath()
Copy an entire subtree in the configuration from one point to another.
create/3
create(Socket, Tid, IKeypath) -> ok | err()
Socket = econfd:socket()
Tid = integer()
IKeypath = econfd:ikeypath()
Create a new element.
delete/3
delete(Socket, Tid, IKeypath) -> ok | err()
Socket = econfd:socket()
Tid = integer()
IKeypath = econfd:ikeypath()
Delete an element.
delete_config/2
Delete all data from a data store.
detach/2
Detach from the transaction.
diff_iterate/4
diff_iterate(Sock, Tid, Fun, InitState) -> any()
Equivalent to diff_iterate(Sock, Tid, Fun, 0, InitState)
.
diff_iterate/5
diff_iterate(Socket, Tid, Fun, Flags, State) -> Result
Socket = econfd:socket()
Tid = integer()
Fun = fun((IKeypath, Op, OldValue, Value, State) -> {ok, Ret, State} | {error, term()})
IKeypath = econfd:ikeypath()
Op = integer()
OldValue = econfd:value() | undefined
Value = econfd:value() | undefined | econfd:key() | {}
State = term()
Ret = integer()
Flags = non_neg_integer()
Result = {ok, State} | {error, term()}
Iterate through a diff.
This function is used in combination with the notifications API where we get a chance to iterate through the diff of a transaction just before it gets commited. The transaction hangs until we have calledeconfd_notif:notification_done/2
.
The function can also be called from within validate() callbacks to
traverse a diff while validating.
Currently OldValue is always the atom 'undefined'.
When Op == ?MOP_MOVED_AFTER (only for "ordered-by user" list entry),
Value == {} means that the entry was moved first in the list, otherwise
Value is a econfd:key() tuple that identifies the entry it was moved after.
end_progress_span/3
end_progress_span(Socket, SpanId1, Annotation) -> Result
Socket = econfd:socket()
SpanId1 = binary()
Annotation = iolist()
Result = {ok, {SpanId2::binary() | undefined, TraceId::binary() | undefined}}
end_user_session/1
Ends a user session.
exists/3
exists(Socket, Tid, IKeypath) -> Result
Socket = econfd:socket()
Tid = integer()
IKeypath = econfd:ikeypath()
Result = {ok, boolean()} | err()
Check if an element exists.
find_next/3
find_next(Cursor, Type, Key) -> Result
Cursor = maapi_cursor()
Type = find_next_type()
Key = econfd:key()
Result = {ok, econfd:key(), Cursor} | done | err()
find the list entry matching Type and Key.
finish_trans/2
Finish a transaction.
get_attrs/4
get_attrs(Socket, Tid, IKeypath, AttrList) -> Result
Socket = econfd:socket()
Tid = integer()
IKeypath = econfd:ikeypath()
AttrList = [Attr]
Attr = integer()
Result = {ok, [{Attr, Value}]} | err()
Value = econfd:value()
Get the selected attributes for an element.
Calling with an empty attribute list returns all attributes.get_authorization_info/2
get_authorization_info(Socket, USid) -> Result
Socket = econfd:socket()
USid = integer()
Result = {ok, Info} | err()
Info = {[Group]}
Group = binary()
Get authorization info for a user session.
get_case/4
get_case(Socket, Tid, IKeypath, Choice) -> Result
Socket = econfd:socket()
Tid = integer()
IKeypath = econfd:ikeypath()
Choice = econfd:qtag() | [econfd:qtag()]
Result = {ok, Case} | err()
Case = econfd:qtag()
Get the current case for a choice.
get_elem/3
get_elem(Socket, Tid, IKeypath) -> Result
Socket = econfd:socket()
Tid = integer()
IKeypath = econfd:ikeypath()
Result = {ok, econfd:value()} | err()
Read an element.
get_elem_no_defaults/3
get_elem_no_defaults(Socket, Tid, IKeypath) -> Result
Socket = econfd:socket()
Tid = integer()
IKeypath = econfd:ikeypath()
Result = {ok, Value} | err()
Value = econfd:value() | default
This function is deprecated: Use set_flags/3 with ?MAAPI_FLAG_NO_DEFAULTS instead - this will take effect for all the functions that read values.
Read an element, but return 'default' instead of the value if the default value is in effect.
get_my_user_session_id/1
get_my_user_session_id(Socket) -> Result
Socket = econfd:socket()
Result = {ok, USid} | err()
USid = integer()
Get my user session id.
get_next/1
get_next(Cursor) -> Result
Cursor = maapi_cursor()
Result = {ok, econfd:key(), Cursor} | done | err()
iterate through the entries of a list.
get_object/3
get_object(Socket, Tid, IKeypath) -> Result
Socket = econfd:socket()
Tid = integer()
IKeypath = econfd:ikeypath()
Result = {ok, [econfd:value()]} | err()
Read all the values in a container or list entry.
get_objects/2
get_objects(Cursor, NumEntries) -> Result
Cursor = maapi_cursor()
NumEntries = integer()
Result = {ok, Cursor, Values} | {done, Values} | err()
Values = [[econfd:value()]]
Read all the values for NumEntries list entries, starting at the point given by the cursor C.
The return value has one Erlang list for each YANG list entry, i.e. it is a list of at most NumEntries lists. If we reached the end of the YANG list, {done, Values} is returned, and there will be fewer than NumEntries lists in Values - otherwise {ok, C2, Values} is returned, where C2 can be used to continue the traversal.get_rollback_id/2
Get rollback id of commited transaction.
get_running_db_status/1
get_running_db_status(Socket) -> Result
Socket = econfd:socket()
Result = {ok, Status} | err()
Status = Valid | Invalid
Valid = 1
Invalid = 0
Get the "running status".
get_user_session/2
get_user_session(Socket, USid) -> Result
Socket = econfd:socket()
USid = integer()
Result = {ok, confd_user_info()} | err()
Get session info for a user session.
get_user_sessions/1
get_user_sessions(Socket) -> Result
Socket = econfd:socket()
Result = {ok, [USid]} | err()
USid = integer()
Get all user sessions.
get_values/4
get_values(Socket, Tid, IKeypath, Values) -> Result
Socket = econfd:socket()
Tid = integer()
IKeypath = econfd:ikeypath()
Values = [econfd:tagval()]
Result = {ok, [econfd:tagval()]} | err()
Read the values for the leafs that have the "value" 'not_found' in the Values list.
This can be used to read an arbitrary set of sub-elements of a container or list entry. The return value is a list of the same length as Values, i.e. the requested leafs are in the same position in the returned list as in the Values argument. The elements in the returned list are always "canonical" though, i.e. of the formeconfd:tagval()
.
hide_group/3
hide_group(Socket, Tid, GroupName) -> ok | err()
Socket = econfd:socket()
Tid = integer()
GroupName = binary()
Do hide a hide group.
Hide all nodes belonging to a hide group in a transaction that started with flag FLAG_HIDE_ALL_HIDEGROUPS.hkeypath2ikeypath/2
hkeypath2ikeypath(Socket, HKeypath) -> Result
Socket = econfd:socket()
HKeypath = [non_neg_integer()]
Result = {ok, IKeypath} | err()
IKeypath = econfd:ikeypath()
This function is deprecated: hkeypaths are not used in the erlang API.
Convert a hkeypath to an ikeypath.
init_cursor/3
init_cursor(Socket, Tid, IKeypath) -> maapi_cursor()
Socket = econfd:socket()
Tid = integer()
IKeypath = econfd:ikeypath()
Equivalent to init_cursor(Socket, Tik, IKeypath, undefined)
.
init_cursor/4
init_cursor(Socket, Tid, IKeypath, XPath) -> maapi_cursor()
Socket = econfd:socket()
Tid = integer()
IKeypath = econfd:ikeypath()
XPath = undefined | binary() | string()
Initalize a get_next() cursor.
init_upgrade/3
init_upgrade(Socket, TimeoutSecs, Flags) -> ok | err()
Socket = econfd:socket()
TimeoutSecs = integer()
Flags = non_neg_integer()
Start in-service upgrade.
insert/3
insert(Socket, Tid, IKeypath) -> ok | err()
Socket = econfd:socket()
Tid = integer()
IKeypath = econfd:ikeypath()
Insert an entry in an integer-keyed list.
install_crypto_keys/1
Fetch keys for the encrypted data types from the server.
Encrypted data type can be tailf:des3-cbc-encrypted-string, tailf:aes-cfb-128-encrypted-string and tailf:aes-256-cfb-128-encrypted-string.is_candidate_modified/1
Check if candidate has been modified.
is_lock_set/2
is_lock_set(Socket, DbName) -> Result
Socket = econfd:socket()
DbName = dbname()
Result = {ok, integer()} | err()
Check if a db is locked or not.
Return 0 or the Usid of the lock owner.is_running_modified/1
Check if running has been modified since the last copy to startup was done.
iterate/6
iterate(Socket, Tid, IKeypath, Fun, Flags, State) -> Result
Socket = econfd:socket()
Tid = integer()
IKeypath = econfd:ikeypath()
Fun = fun((IKeypath, Value, Attrs, State) -> {ok, Ret, State} | {error, term()})
Value = econfd:value() | undefined
Attrs = [{Attr, Value}] | undefined
Attr = integer()
State = term()
Ret = integer()
Flags = non_neg_integer()
Result = {ok, State} | {error, term()}
Iterate over all the data in the transaction and the underlying data store.
Flags can be given as ?MAAPI_ITER_WANT_ATTR to request that attributes (if any) are passed to the Fun, otherwise it should be 0. The possible values for Ret in the return value for Fun are the same as fordiff_iterate/5
.
keypath_diff_iterate/5
keypath_diff_iterate(Socket, Tid, IKeypath, Fun, State) -> Result
Socket = econfd:socket()
Tid = integer()
IKeypath = econfd:ikeypath()
Fun = fun((IKeypath, Op, OldValue, Value, State) -> {ok, Ret, State} | {error, term()})
Op = integer()
OldValue = econfd:value()
Value = econfd:value() | econfd:key()
State = term()
Ret = integer()
Result = {ok, State} | {error, term()}
Iterate through a diff.
This function behaves likediff_iterate/5
with the exception that
the provided keypath IKP, prunes the tree and only diffs below that
path are considered.
keypath_diff_iterate/6
keypath_diff_iterate(Sock, Tid, IKP, Fun, Flags, InitState) -> any()
kill_user_session/2
Kill a user session.
list_rollbacks/1
This function is deprecated: Consult the /rollback-files list instead.
Get a list of available rollback files.
load_rollback/3
load_rollback(Socket, Tid, Id) -> ok | err()
Socket = econfd:socket()
Tid = integer()
Id = integer() | {fixed, integer()}
This function is deprecated: Use the action /rollback-files/apply-rollback-file instead.
Load a rollback file.
lock/2
Lock a database.
lock_partial/3
lock_partial(Socket, DbName, XPath) -> Result
Socket = econfd:socket()
DbName = dbname()
XPath = [binary()]
Result = {ok, LockId} | err()
LockId = integer()
Request a partial lock on a database.
The set of nodes to lock is specified as a list of XPath expressions.move/4
move(Socket, Tid, IKeypath, ToKey) -> ok | err()
Socket = econfd:socket()
Tid = integer()
IKeypath = econfd:ikeypath()
ToKey = econfd:key()
Move (rename) an entry in a list.
move_ordered/4
move_ordered(Socket, Tid, IKeypath, To) -> ok | err()
Socket = econfd:socket()
Tid = integer()
IKeypath = econfd:ikeypath()
To = first | last | {before | 'after', econfd:key()}
Move an entry in an "ordered-by user" list.
ncs_apply_template/7
ncs_apply_template(Socket, Tid, TemplateName, RootIKeypath, Variables, Documents, Shared) -> ok | err()
Socket = econfd:socket()
Tid = integer()
TemplateName = binary()
RootIKeypath = econfd:ikeypath()
Variables = term()
Documents = term()
Shared = boolean()
Apply a template that has been loaded into NCS.
The TemplateName parameter gives the name of the template. The Variables parameter is a list of variables and names for substitution into the template.ncs_apply_trans_params/4
ncs_apply_trans_params(Socket, Tid, KeepOpen, Params) -> Result
Socket = econfd:socket()
Tid = integer()
KeepOpen = boolean()
Params = [econfd:tagval()]
Result = ok | {ok, [econfd:tagval()]} | err()
Apply transaction with commit parameters.
This is a version of apply_trans that takes commit parameters in form of a list of tagged values according to the input parameters for rpc prepare-transaction as defined in tailf-netconf-ncs.yang module. The result of this function may include a list of tagged values according to the output parameters of rpc prepare-transaction or output parameters of rpc commit-transaction as defined in tailf-netconf-ncs.yang module.ncs_get_trans_params/2
ncs_get_trans_params(Socket, Tid) -> Result
Socket = econfd:socket()
Tid = integer()
Result = {ok, [econfd:tagval()]} | err()
Get transaction commit parameters.
ncs_template_variables/3
ncs_template_variables(Socket, Tid, TemplateName) -> {ok, binary()} | err()
Socket = econfd:socket()
Tid = integer()
TemplateName = binary()
Retrieve the variables used in a template.
ncs_templates/1
Retrieve a list of the templates currently loaded into NCS.
ncs_write_service_log_entry/5
ncs_write_service_log_entry(Socket, IKeypath, Message, Type, Level) -> ok | err()
Socket = econfd:socket()
IKeypath = econfd:ikeypath()
Message = string()
Type = econfd:value()
Level = econfd:value()
Write a service log entry.
netconf_ssh_call_home/3
netconf_ssh_call_home(Socket, Host, Port) -> ok | err()
Socket = econfd:socket()
Host = econfd:ip() | string()
Port = non_neg_integer()
netconf_ssh_call_home_opaque/4
netconf_ssh_call_home_opaque(Socket, Host, Opaque, Port) -> ok | err()
Socket = econfd:socket()
Host = econfd:ip() | string()
Opaque = string()
Port = non_neg_integer()
num_instances/3
num_instances(Socket, Tid, IKeypath) -> Result
Socket = econfd:socket()
Tid = non_neg_integer()
IKeypath = econfd:ikeypath()
Result = {ok, integer()} | err()
Find the number of entries in a list.
perform_upgrade/2
perform_upgrade(Socket, LoadPathList) -> ok | err()
Socket = econfd:socket()
LoadPathList = [binary()]
Do in-service upgrade.
prepare_trans/2
Equivalent to prepare_trans(Socket, Tid, 0)
.
prepare_trans/3
prepare_trans(Socket, Tid, Flags) -> ok | err()
Socket = econfd:socket()
Tid = integer()
Flags = non_neg_integer()
Prepare for commit.
prio_message/3
prio_message(Socket, To, Message) -> ok | err()
Socket = econfd:socket()
To = binary()
Message = binary()
Write priority message.
progress_info/6
progress_info(Socket, Verbosity, Msg, SIKP, Attrs, Links) -> ok
Socket = econfd:socket()
Verbosity = verbosity()
Msg = iolist()
SIKP = econfd:ikeypath()
Attrs = [{K::binary(), V::binary() | integer()}]
Links = [{TraceId::binary() | undefined, SpanId::binary() | undefined}]
progress_info_th/7
progress_info_th(Socket, Tid, Verbosity, Msg, SIKP, Attrs, Links) -> ok
Socket = econfd:socket()
Tid = integer()
Verbosity = verbosity()
Msg = iolist()
SIKP = econfd:ikeypath()
Attrs = [{K::binary(), V::binary() | integer()}]
Links = [{TraceId::binary() | undefined, SpanId::binary() | undefined}]
reload_config/1
Tell ConfD daemon to reload its configuration.
request_action/3
request_action(Socket, Params, IKeypath) -> Result
Socket = econfd:socket()
Params = [econfd:tagval()]
IKeypath = econfd:ikeypath()
Result = ok | {ok, [econfd:tagval()]} | err()
Invoke an action defined in the data model.
request_action_th/4
request_action_th(Socket, Tid, Params, IKeypath) -> Result
Socket = econfd:socket()
Tid = integer()
Params = [econfd:tagval()]
IKeypath = econfd:ikeypath()
Result = ok | {ok, [econfd:tagval()]} | err()
Invoke an action defined in the data model using the provided transaction.
Does the same thing as request_action/3, but uses the current namespace, the path position, and the user session from the transaction indicated by the 'Tid' handle.revert/2
Remove all changes in the transaction.
set_attr/5
set_attr(Socket, Tid, IKeypath, Attr, Value) -> ok | err()
Socket = econfd:socket()
Tid = integer()
IKeypath = econfd:ikeypath()
Attr = integer()
Value = econfd:value() | undefined
Set the an attribute for an element. Value == undefined means that the attribute should be deleted.
set_comment/3
set_comment(Socket, Tid, Comment) -> ok | err()
Socket = econfd:socket()
Tid = integer()
Comment = binary()
Set the "Comment" that is stored in the rollback file when a transaction towards running is committed.
set_delayed_when/3
set_delayed_when(Socket, Tid, Value) -> Result
Socket = econfd:socket()
Tid = integer()
Value = boolean()
Result = {ok, OldValue} | err()
OldValue = boolean()
Enable/disable the "delayed when" mode for a transaction.
Returns the old setting on success.set_elem/4
set_elem(Socket, Tid, IKeypath, Value) -> ok | err()
Socket = econfd:socket()
Tid = integer()
IKeypath = econfd:ikeypath()
Value = econfd:value()
Write an element.
set_elem2/4
set_elem2(Socket, Tid, IKeypath, BinValue) -> ok | err()
Socket = econfd:socket()
Tid = integer()
IKeypath = econfd:ikeypath()
BinValue = binary()
Write an element using the textual value representation.
set_flags/3
set_flags(Socket, Tid, Flags) -> ok | err()
Socket = econfd:socket()
Tid = integer()
Flags = non_neg_integer()
Change flag settings for a transaction.
See ?MAAPI_FLAG_XXX in econfd.hrl for the available flags, however ?MAAPI_FLAG_HIDE_INACTIVE ?MAAPI_FLAG_DELAYED_WHEN and ?MAAPI_FLAG_HIDE_ALL_HIDEGROUPS cannot be changed after transaction start (but seeset_delayed_when/3
).
set_label/3
Set the "Label" that is stored in the rollback file when a transaction towards running is committed.
set_object/4
set_object(Socket, Tid, IKeypath, ValueList) -> ok | err()
Socket = econfd:socket()
Tid = integer()
IKeypath = econfd:ikeypath()
ValueList = [econfd:value()]
Write an entire object, i.e. YANG list entry or container.
set_readonly_mode/2
Control if we can create rw transactions.
set_running_db_status/2
set_running_db_status(Socket, Status) -> ok | err()
Socket = econfd:socket()
Status = Valid | InValid
Valid = 1
InValid = 0
Set the "running status".
set_user_session/2
Assign a user session.
set_values/4
set_values(Socket, Tid, IKeypath, ValueList) -> ok | err()
Socket = econfd:socket()
Tid = integer()
IKeypath = econfd:ikeypath()
ValueList = [econfd:tagval()]
Write a list of tagged values.
This function is an alternative toset_object/4
, and allows for writing more complex structures
(e.g. multiple entries in a list).
shared_create/3
shared_create(Socket, Tid, IKeypath) -> ok | err()
Socket = econfd:socket()
Tid = integer()
IKeypath = econfd:ikeypath()
Create a new element, and also set an attribute indicating how many times this element has been created.
shared_set_elem/4
shared_set_elem(Socket, Tid, IKeypath, Value) -> ok | err()
Socket = econfd:socket()
Tid = integer()
IKeypath = econfd:ikeypath()
Value = econfd:value()
Write an element from NCS FastMap.
shared_set_elem2/4
shared_set_elem2(Socket, Tid, IKeypath, BinValue) -> ok | err()
Socket = econfd:socket()
Tid = integer()
IKeypath = econfd:ikeypath()
BinValue = binary()
Write an element using the textual value representation from NCS fastmap.
shared_set_values/4
shared_set_values(Socket, Tid, IKeypath, ValueList) -> ok | err()
Socket = econfd:socket()
Tid = integer()
IKeypath = econfd:ikeypath()
ValueList = [econfd:tagval()]
Write a list of tagged values from NCS FastMap.
snmpa_reload/2
Tell ConfD to reload external SNMP Agent config data.
start_phase/3
start_phase(Socket, Phase, Synchronous) -> ok | err()
Socket = econfd:socket()
Phase = 1 | 2
Synchronous = boolean()
Tell ConfD to proceed to next start phase.
start_progress_span/6
start_progress_span(Socket, Verbosity, Msg, SIKP, Attrs, Links) -> Result
Socket = econfd:socket()
Verbosity = verbosity()
Msg = iolist()
SIKP = econfd:ikeypath()
Attrs = [{K::binary(), V::binary() | integer()}]
Links = [{TraceId::binary() | undefined, SpanId1::binary() | undefined}]
Result = {ok, {SpanId2::binary() | undefined, TraceId::binary() | undefined}}
start_progress_span_th/7
start_progress_span_th(Socket, Tid, Verbosity, Msg, SIKP, Attrs, Links) -> Result
Socket = econfd:socket()
Tid = integer()
Verbosity = verbosity()
Msg = iolist()
SIKP = econfd:ikeypath()
Attrs = [{K::binary(), V::binary() | integer()}]
Links = [{TraceId::binary() | undefined, SpanId1::binary() | undefined}]
Result = {ok, {SpanId2::binary() | undefined, TraceId::binary() | undefined}}
start_trans/3
start_trans(Socket, DbName, RwMode) -> Result
Socket = econfd:socket()
DbName = dbname()
RwMode = integer()
Result = {ok, integer()} | err()
Start a new transaction.
start_trans/4
start_trans(Socket, DbName, RwMode, USid) -> Result
Socket = econfd:socket()
DbName = dbname()
RwMode = integer()
USid = integer()
Result = {ok, integer()} | err()
Start a new transaction within an existing user session.
start_trans/5
start_trans(Socket, DbName, RwMode, USid, Flags) -> Result
Socket = econfd:socket()
DbName = dbname()
RwMode = integer()
USid = integer()
Flags = non_neg_integer()
Result = {ok, integer()} | err()
Start a new transaction within an existing user session and/or with flags.
See ?MAAPI_FLAG_XXX in econfd.hrl for the available flags. To use the existing user session of the socket, give Usid = 0.start_trans_in_trans/4
start_trans_in_trans(Socket, RwMode, USid, Tid) -> Result
Socket = econfd:socket()
RwMode = integer()
USid = integer()
Tid = integer()
Result = {ok, integer()} | err()
Start a new transaction with an existing transaction as backend.
To use the existing user session of the socket, give Usid = 0.start_trans_in_trans/5
start_trans_in_trans(Socket, RwMode, USid, Tid, Flags) -> Result
Socket = econfd:socket()
RwMode = integer()
USid = integer()
Tid = integer()
Flags = non_neg_integer()
Result = {ok, integer()} | err()
Start a new transaction with an existing transaction as backend.
To use the existing user session of the socket, give Usid = 0.start_user_session/6
start_user_session(Socket, UserName, Context, Groups, SrcIp, Proto) -> ok | err()
Socket = econfd:socket()
UserName = binary()
Context = binary()
Groups = [binary()]
SrcIp = econfd:ip()
Proto = proto()
Equivalent to start_user_session(Socket,
UserName,
Context,
Groups,
SrcIp,
0,
Proto)
.
start_user_session/7
start_user_session(Socket, UserName, Context, Groups, SrcIp, SrcPort, Proto) -> ok | err()
Socket = econfd:socket()
UserName = binary()
Context = binary()
Groups = [binary()]
SrcIp = econfd:ip()
SrcPort = non_neg_integer()
Proto = proto()
Equivalent to start_user_session(Socket,
UserName,
Context,
Groups,
SrcIp,
0,
Proto,
undefined)
.
start_user_session/8
start_user_session(Socket, UserName, Context, Groups, SrcIp, SrcPort, Proto, UId) -> ok | err()
Socket = econfd:socket()
UserName = binary()
Context = binary()
Groups = [binary()]
SrcIp = econfd:ip()
SrcPort = non_neg_integer()
Proto = proto()
UId = confd_user_identification() | undefined
Initiate a new maapi user session.
returns a maapi session id. Before we can execute any maapi functions we must always have an associated user session.stop/1
Equivalent to stop(Sock, true)
.
Tell ConfD daemon to stop, returns when daemon has exited.
stop/2
Tell ConfD daemon to stop, if Synchronous is true won't return until daemon has come to a halt.
Note that the socket will most certainly not be possible to use again, since ConfD will close its end when it exits.sys_message/3
sys_message(Socket, To, Message) -> ok | err()
Socket = econfd:socket()
To = binary()
Message = binary()
Write system message.
unhide_group/3
unhide_group(Socket, Tid, GroupName) -> ok | err()
Socket = econfd:socket()
Tid = integer()
GroupName = binary()
Do unhide a hide group.
Unhide all nodes belonging to a hide group in a transaction that started with flag FLAG_HIDE_ALL_HIDEGROUPS.unlock/2
Unlock a database.
unlock_partial/2
Remove the partial lock identified by LockId.
user_message/4
user_message(Socket, To, From, Message) -> ok | err()
Socket = econfd:socket()
To = binary()
From = binary()
Message = binary()
Write user message.
validate_trans/4
validate_trans(Socket, Tid, UnLock, ForceValidation) -> ok | err()
Socket = econfd:socket()
Tid = integer()
UnLock = boolean()
ForceValidation = boolean()
Validate the transaction.
wait_start/1
Equivalent to wait_start(Socket, 2)
.
Wait until ConfD daemon has completely started.
wait_start/2
Wait until ConfD daemon has reached a certain start phase.
xpath_eval/6
xpath_eval(Socket, Tid, Expr, ResultFun, State, Options) -> Result
Socket = econfd:socket()
Tid = integer()
Expr = binary() | {compiled, Source, Compiled}
Source = binary()
Compiled = [binary() | tuple()]
ResultFun = fun((IKeypath, Value, State) -> {Ret, State})
IKeypath = econfd:ikeypath()
Value = term()
State = term()
Ret = integer()
Options = [xpath_eval_option()]
Result = {ok, State} | err()
Evaluate the XPath expression Expr, invoking ResultFun for each node in the resulting node set.
The possible values for Ret in the return value for ResultFun are ?ITER_CONTINUE and ?ITER_STOP.xpath_eval/7
xpath_eval(Socket, Tid, Expr, ResultFun, TraceFun, State, Context) -> Result
Socket = econfd:socket()
Tid = integer()
Expr = binary()
ResultFun = fun((IKeypath, Value, State) -> {Ret, State})
IKeypath = econfd:ikeypath()
Value = econfd:value() | undefined
State = term()
Ret = integer()
TraceFun = fun((binary()) -> none()) | undefined
Context = econfd:ikeypath() | []
Result = {ok, State} | {error, term()}
This function is deprecated: This function is kept for backwards compatibility,
use xpath_eval/6
.
Evaluate the XPath expression Expr, invoking ResultFun for each node in the resulting node set.
The possible values for Ret in the return value for ResultFun are ?ITER_CONTINUE and ?ITER_STOP.xpath_eval_expr/4
xpath_eval_expr(Socket, Tid, Expr, Options) -> Result
Socket = econfd:socket()
Tid = integer()
Expr = binary() | {compiled, Source, Compiled}
Source = binary()
Compiled = [binary() | tuple()]
Options = [xpath_eval_option()]
Result = {ok, binary()} | err()
Evaluate the XPath expression Expr, returning the result as a string.
xpath_eval_expr/5
xpath_eval_expr(Socket, Tid, Expr, TraceFun, Context) -> Result
Socket = econfd:socket()
Tid = integer()
Expr = binary()
TraceFun = fun((binary()) -> none()) | undefined
Context = econfd:ikeypath() | []
Result = {ok, binary()} | err()
Evaluate the XPath expression Expr, returning the result as a string.
Generated by EDoc