db-api-app(1)

NAME
db-api-app - Sample netconfd-pro server DB-API sub-system

SYNOPSIS

   send_edit:

   db-api-app [--subsys=<subsys-id>] [<logging-parameters>]

   getconfig:

   db-api-app [--subsys=<subsys-id>] [<logging-parameters>]
      --getconfig [--withdef] [--filespec=/path/to/output.<type>]
      [--with-state] [--xpath-filter=xpath-expression]

   Maintenance Mode:

   db-api-app --enter

   db-api-app --enter=N

   db-api-app --exit

   Log Level:

   db-api-app --set-log-level=dlevel

   Sub RPC:

   db-api-app --subrpc=name [--subrpc-modname=modname]
      --filespec=filename [--in-filespec=filename] [--user=string]

   Protocol Control:

   db-api-app --protocol-action=action --protocol=name

   Common parameters:

   db-api-app --subsys=string [--retry-limit=num]

DESCRIPTION
db-api-app is a sample YumaPro subsystem program to demonstrate how the DB-API and YControl libraries can be used within an application. The default send_edit will probably fail unless the server is configured with the correct YANG modules. Rewrite the send_edit request with your own parameters in db_api_app/main.c

Refer to the online YumaPro Developer Manual for full details on server development with DB-API subsystems:

https://docs.yumaworks.com/en/latest/dev/index.html

USAGE
Parameters can be entered in any order, and have the form:

   --name[=value]

where:

    name == parameter name
    value == optional parameter value

If db-api-app is called without any parameters, it will attempt to send a test edit to the server. The module "test" must be loaded into the server for this edit to succeed. This test module is usually installed as /usr/share/yumapro/modules/test/pass/test.yang

OPTIONS

--count=N
    The --count parameter can be used to specify number of times an edit request will be sent to the server.

--db-lock-change-state-time=N
    This parameter can be used to change the default frequency of sending <db-lock> and <db-unlock> requests for --db-lock-test. Default value is 7 seconds.

--db-lock-test
    The --db-lock-test parameter can be used to start the DB-API in a special test mode. The server must be started with --with-db-lock=true flag. The server will send <db-lock> and <db-unlock> requests to the db-api subsystem.

--db-lock-start-wait-time=N
    This parameter can be used to change the default wait time before sending the first <db-lock> request to the server for --db-lock-test. Default value is 30 seconds.

--enter=N
    The --enter=N parameter will cause a <enter-maintmode> request to be sent to the server, with the <allowed> parameter set according to the value of N:
         0 = no bits set
         1 = allow client sessions for read operations that read
             datastores or operational data
         2 = allow client sessions for general operations that
             do not access any datastores
         3 = allow read and operation sessions

--enter
    The --enter parameter will cause a <enter-maintmode> request to be sent to the server.

--exit
    The --exit parameter will cause a <exit-maintmode> request to be sent to the server.

--filespec=/path/to/output.<type>
    The --filespec parameter is optional if the --getconfig parameter is present or if the --subrpc parameter is present, and ignored if --getconfig is not present. If this parameter is not present then the test callback function will be used to print the response with val_dump_value. If present, this specifies the file location to save the response from the server.

    The format is determined by the <type> extension.
         xml = XML format
         json = JSON format

--getconfig
    The --getconfig parameter will cause a <getconfig> request to be sent to the server.

--log-level=level
    The --log-level, --log, and other logging parameters are also supported. The default log-level is 'info'.

--in-filespec=/path/to/input.xml
    The --in-filespec parameter is optional if the --subrpc parameter is present. This specifies the XML file location to read the RPC input in the same form as used in the <rpc> element for NETCONF.

--protocol=string
    The --protocol parameter identifies the protocol for the protocol-control request message to be sent to the server.

       -  Ignored unless the --protocol-action parameter is present.
       -  Mandatory if the --protocol-action parameter is present.

    The values are the same as for the 'protocol' parameter for the <protocol-control> operation.

--protocol-action=string
    The --protocol-action parameter identifies the protocol action for the protocol-control request message to be sent to the server. The values are the same as for the 'action' parameter for the <protocol-control> operation.

       - enable
       - disable
       - status

--retry-limit=num
    The --retry-limit parameter will cause the subsystem to terminate after the specified number of re-connect attempts. The default value is 5000 re-connect attempts. The parameter is a uint16 number between 1 and 65535.

--set-log-level=enum
    The --set-log-level parameter will cause a <set-log-level> request to be sent to the server. The enum string values are the same as the --log-level parameter.

--subrpc=string
    The --subrpc parameter is used to send an RPC request to the server. This parameter specifies the name of the RPC operation. If any input is needed then the --in-filespec parameter must be present. The --filespec parameter must be present and specifies the name of the file to store the RPC output from the server. The --user parameter can be used to specify a user name for the RPC operation.

--subrpc-modname=string
    The --subrpc-modname parameter is optional when the --subrpc parameter is used. It specifies the name of the module that contains the RPC. This parameter should be used when multiple RPCs with the same name exist in different modules.

--subsys-id=string
    The --subsys-id parameter keyword is optional. It specifies the subsystem identifier to use when registering with the netconfd-pro server. The default is 'subsys1' if no value is specified.

--user=string
    The --user parameter can be used if the --subrpc parameter is present. It specifies the username for access control purposes that should be used on the server for the RPC operation. If not present then the RPC operation will be invoked as the system user without any access control at all.

--withdef
    The --withdef parameter will cause a <getconfig> request to be sent to the server including the <withdef> parameter set to true. If it is missing, the default is not to request YANG defaults.

--with-state
    The --with-state parameter will cause a <getconfig> request to be sent to the server including the <with-state> parameter set to true. This will cause all non-configuration data nodes to be returned. If it is missing, the default is not to request these data nodes.

--xpath-filter=string
    The --xpath-filter parameter is used to add an optional XPath filter to the retrieval operation. If present, only data nodes included in the node-set result for this expression will be returned. The default is to return all data nodes.

AUTHOR
YumaWorks, Inc., <support at yumaworks dot com>

SEE ALSO
netconfd-pro(1) sil-sa-app(1) yp-ha-app(1)