Module econfd_schema
Support for using schema information in the Erlang API.Version: 6.5.4
Behaviours: gen_server
.
Description
Support for using schema information in the Erlang API.
Keeps schema info in a set of ets tables named by the toplevel namespace.Data Types
confd_cs_choice()
confd_cs_choice() = #confd_cs_choice{}
confd_cs_node()
confd_cs_node() = #confd_cs_node{}
confd_nsinfo()
confd_nsinfo() = #confd_nsinfo{}
confd_type_cbs()
confd_type_cbs() = #confd_type_cbs{}
Function Index
choice_children/1 | Get a flat list of children for a confd_cs_node() ,
with any choice/case structure(s) removed. |
get_cs/2 | Find schema node by namespace and tagpath. |
get_nslist/0 | Get a list of loaded namespaces with info. |
get_type/1 | Get schema type definition identifier for built-in type. |
get_type/2 | Get schema type definition identifier for type defined in namespace. |
ikeypath2cs/1 | Find schema node by ikeypath. |
load/1 | Load schema info from ConfD. |
load/2 | |
register_type_cbs/1 | Register callbacks for a user-defined type. |
str2val/2 | Convert string to value based on schema type. |
val2str/2 | Convert value to string based on schema type. |
Function Details
choice_children/1
choice_children(Node) -> Children
Node = confd_cs_node() | [econfd:qtag() | confd_cs_choice()]
Children = [econfd:qtag()]
Get a flat list of children for a confd_cs_node()
,
with any choice/case structure(s) removed.
get_cs/2
get_cs(Ns, Tagpath) -> Result
Ns = econfd:namespace()
Tagpath = econfd:tagpath()
Result = confd_cs_node() | not_found
Find schema node by namespace and tagpath.
get_nslist/0
get_nslist() -> [confd_nsinfo()]
Get a list of loaded namespaces with info.
get_type/1
Get schema type definition identifier for built-in type.
get_type/2
Get schema type definition identifier for type defined in namespace.
ikeypath2cs/1
Find schema node by ikeypath.
load/1
Load schema info from ConfD.
load/2
load(Address, Port) -> Result
Address = econfd:ip()
Port = non_neg_integer()
Result = ok | {error, econfd:error_reason()}
register_type_cbs/1
Register callbacks for a user-defined type. For an application running in its own Erlang VM, this function registers the callbacks in the loaded schema information, similar to confd_register_node_type() in the C API. For an application running inside ConfD, this function registers the callbacks in ConfD's internal schema information, similar to using a shared object with confd_type_cb_init() in the C API.
str2val/2
str2val(TypeId, Lexical) -> Result
TypeId = confd_cs_node() | econfd:type()
Lexical = binary()
Result = {ok, Value::econfd:value()} | {error, econfd:error_reason()}
Convert string to value based on schema type.
Note: For type identityref below a mount point (device data in NSO), TypeId must beconfd_cs_node()
.
val2str/2
val2str(TypeId, Value) -> Result
TypeId = confd_cs_node() | econfd:type()
Value = econfd:value()
Result = {ok, string()} | {error, econfd:error_reason()}
Convert value to string based on schema type.
Generated by EDoc