How to increase time out for one specific command

I am implementing an operational command and I want to increase the time out for this specific command as it takes longer time to complete

If it is not possible to increase time out for one specific command is there a way to increase the timeout system wide

Hello,

/confdConfig/capi/queryTimeout is by default set to 120 seconds and can be modified in the confd.conf.
This applies for all data callbacks.

In case one data callback (I assume your operational command is implemented as data callback) needs to increase the timeout, the confd_data_set_timeout function can be used. See documentation for confd_lib_dp.

Copied description:

A data callback should normally complete "quickly", since
e.g. the execution of a 'show' command in the CLI may require many
data callback invocations. 
Thus it should be possible to set the  /confdConfig/capi/queryTimeout in
confd.conf (see above) such that it covers the longest possible execution time
 for any data callback.

 In some rare  cases it may still be necessary for a data callback to have a longer  
execution time, and then this function can be used to extend (or
shorten) the timeout for the current callback invocation. The timeout
is given in seconds from the point in time when the function is
called.

It is indeed possible to set timeout for individual command and also for commands globally but that is probably not what you are looking for, the default timeout for both is infinity.

A better option is to set the timeout for the data provider interface, i.e. the time allowed for a data provider to respond to callbacks from ConfD.

The data provider timeout is configurable in confd.conf:

/confdConfig/capi/queryTimeout (xs:duration) [PT120S]
Timeout for a daemon to respond to a worker socket query, see confd_lib_dp(3). If the daemon fails to respond within the given time, it will be disconnected.

If you do want to change the command timeout, the following option in the cli-spec can be used:

/clispec/$MODE/modifications/timeout (xs:integer|infinity)

The "timeout" element makes it possible to add a custom command timeout (in seconds) to the specified built-in command.

Attributes:

src (cmdpathType)
The "src" attribute is mandatory. It specifies which command to add the timeout to. cmdpathType is a space-separated list of commands, pointing out a specific sub-command.

There is also a variant that set the global timeout for all commands:

/clispec/$MODE/cmd/timeout (xs:integer|infinity)

The "timeout" element is a timeout for the command in seconds. Default is infinity.