yumapro  23.10T-6
YumaPro SDK
Loading...
Searching...
No Matches
Configuration Templates

Configuration templates allow pre-configured YANG subtrees to be applied to incomplete edits to produce a complete subtree. More...

Collaboration diagram for Configuration Templates:

Functions

status_t agt_templates_init (void)
 initialize the yumaworks-templates More...
 
void agt_templates_cleanup (void)
 Cleanup the yumaworks-templates. More...
 
status_t agt_templates_set (const xmlChar *name, const xmlChar *targstr, obj_template_t *targobj, val_value_t *targval)
 Set a config template (new or replace) More...
 
void agt_templates_clear (const xmlChar *name)
 Clear a config template if found. More...
 
status_t agt_templates_validate_parm (ses_cb_t *scb, rpc_msg_t *msg, xml_node_t *methnode)
 Check for with-template parameter. More...
 
status_t agt_templates_apply_parm (rpc_msg_t *msg, val_value_t *newval)
 Apply a template to a subtree. More...
 
status_t u_yumaworks_templates_templates_template_edit (ses_cb_t *scb, rpc_msg_t *msg, agt_cbtyp_t cbtyp, op_editop_t editop, val_value_t *newval, val_value_t *curval, val_value_t **child_errorval, const xmlChar *k_templates_template_name)
 Edit database object callback. More...
 
status_t u_yumaworks_templates_templates_edit (ses_cb_t *scb, rpc_msg_t *msg, agt_cbtyp_t cbtyp, op_editop_t editop, val_value_t *newval, val_value_t *curval)
 Edit database object callback. More...
 
status_t u_yumaworks_templates_init (const xmlChar *modname, const xmlChar *revision)
 initialize the yumaworks-templates server instrumentation library More...
 
status_t u_yumaworks_templates_init2 (void)
 SIL init phase 2: non-config data structures. More...
 
void u_yumaworks_templates_cleanup (void)
 cleanup the server instrumentation library More...
 
status_t y_yumaworks_templates_init (const xmlChar *modname, const xmlChar *revision)
 initialize the yumaworks-templates server instrumentation library More...
 
status_t y_yumaworks_templates_init2 (void)
 SIL init phase 2: non-config data structures. More...
 
void y_yumaworks_templates_cleanup (void)
 cleanup the server instrumentation library More...
 

Detailed Description

Configuration templates allow pre-configured YANG subtrees to be applied to incomplete edits to produce a complete subtree.

Requires –with-yumaworks-templates=true to enable.

Function Documentation

◆ agt_templates_apply_parm()

status_t agt_templates_apply_parm ( rpc_msg_t msg,
val_value_t newval 
)

Apply a template to a subtree.

Go through the with-template parameters: Check the data node to see if the template should be applied If so, then add nodes to the newval as needed

Parameters
msgrpc msg for input parms and errors
newvalvalue that being created to check for templates
Returns
status
Here is the call graph for this function:

◆ agt_templates_cleanup()

void agt_templates_cleanup ( void  )

Cleanup the yumaworks-templates.

Called by the server during shutdown.

Here is the call graph for this function:

◆ agt_templates_clear()

void agt_templates_clear ( const xmlChar *  name)

Clear a config template if found.

Parameters
namename of template to remove
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_templates_init()

status_t agt_templates_init ( void  )

initialize the yumaworks-templates

Returns
error status
Here is the call graph for this function:

◆ agt_templates_set()

status_t agt_templates_set ( const xmlChar *  name,
const xmlChar *  targstr,
obj_template_t targobj,
val_value_t targval 
)

Set a config template (new or replace)

Parameters
nametemplate name to use
targstrabsolute path of target entry
targobjtarget object template
targvaltarget entry to apply template
Returns
status
Here is the call graph for this function:

◆ agt_templates_validate_parm()

status_t agt_templates_validate_parm ( ses_cb_t scb,
rpc_msg_t msg,
xml_node_t methnode 
)

Check for with-template parameter.

Parameters
scbsession invoking the RPC
msgmessage in progress for this <rpc> request
the msg->rpc_input value node contains the input (if any). It is a container matching the rpc/input node for the YANG rpc
methnodeXML node for the operation, which can be used in error reporting (or ignored
Returns
status return status for the phase; an error in validate phase will cancel invoke phase; an rpc-error will be added if an error is returned and the msg error Q is empty
Here is the call graph for this function:

◆ u_yumaworks_templates_cleanup()

void u_yumaworks_templates_cleanup ( void  )

cleanup the server instrumentation library

Called by the server during shutdown.

Here is the caller graph for this function:

◆ u_yumaworks_templates_init()

status_t u_yumaworks_templates_init ( const xmlChar *  modname,
const xmlChar *  revision 
)

initialize the yumaworks-templates server instrumentation library

Parameters
modnamerequested module name
revisionrequested version (NULL for any)
Returns
error status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ u_yumaworks_templates_init2()

status_t u_yumaworks_templates_init2 ( void  )

SIL init phase 2: non-config data structures.

Called after running config is loaded

Returns
error status
Here is the caller graph for this function:

◆ u_yumaworks_templates_templates_edit()

status_t u_yumaworks_templates_templates_edit ( ses_cb_t scb,
rpc_msg_t msg,
agt_cbtyp_t  cbtyp,
op_editop_t  editop,
val_value_t newval,
val_value_t curval 
)

Edit database object callback.

Path: /templates

Add object instrumentation in COMMIT phase.

Parameters
scbsession control block making the request
msgincoming rpc_msg_t in progress
cbtypreason for the callback
editopthe parent edit-config operation type, which is also used for all other callbacks that operate on objects
newvalcontainer object holding the proposed changes to apply to the current config, depending on the editop value. Will not be NULL.
curvalcurrent container values from the <running> or <candidate> configuration, if any. Could be NULL for create and other operations.
Returns
status:
Here is the call graph for this function:

◆ u_yumaworks_templates_templates_template_edit()

status_t u_yumaworks_templates_templates_template_edit ( ses_cb_t scb,
rpc_msg_t msg,
agt_cbtyp_t  cbtyp,
op_editop_t  editop,
val_value_t newval,
val_value_t curval,
val_value_t **  child_errorval,
const xmlChar *  k_templates_template_name 
)

Edit database object callback.

Path: /templates/template

Add object instrumentation in COMMIT phase.

Parameters
scbsession control block making the request
msgincoming rpc_msg_t in progress
cbtypreason for the callback
editopthe parent edit-config operation type, which is also used for all other callbacks that operate on objects
newvalcontainer object holding the proposed changes to apply to the current config, depending on the editop value. Will not be NULL.
curvalcurrent container values from the <running> or <candidate> configuration, if any. Could be NULL for create and other operations.
[out]child_errorvaladdress of return child error node
  • *child_errorval contains return child error node if error
k_templates_template_namekey 1
Returns
status:
Here is the call graph for this function:

◆ y_yumaworks_templates_cleanup()

void y_yumaworks_templates_cleanup ( void  )

cleanup the server instrumentation library

Called by the server during shutdown.

Here is the call graph for this function:

◆ y_yumaworks_templates_init()

status_t y_yumaworks_templates_init ( const xmlChar *  modname,
const xmlChar *  revision 
)

initialize the yumaworks-templates server instrumentation library

Parameters
modnamerequested module name
revisionrequested version (NULL for any)
Returns
error status
Here is the call graph for this function:

◆ y_yumaworks_templates_init2()

status_t y_yumaworks_templates_init2 ( void  )

SIL init phase 2: non-config data structures.

Called after running config is loaded

Returns
error status
Here is the call graph for this function:
Here is the caller graph for this function: