X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=modules%2Fluci-base%2Fluasrc%2Fmodel%2Fuci.luadoc;h=0189d49aa1f5f2839533cfd018d459ae11b90ab2;hb=7a2fefc671ff7b5533620e809a4de07cb3b564a3;hp=ef89d09b9e1940162515678a2b41713e89a8fb98;hpb=9b22c9c1e1290f077297b14b835b3b9085b48bde;p=oweals%2Fluci.git diff --git a/modules/luci-base/luasrc/model/uci.luadoc b/modules/luci-base/luasrc/model/uci.luadoc index ef89d09b9..0189d49aa 100644 --- a/modules/luci-base/luasrc/model/uci.luadoc +++ b/modules/luci-base/luasrc/model/uci.luadoc @@ -5,7 +5,7 @@ The typical workflow for UCI is: Get a cursor instance from the cursor factory, modify data (via Cursor.add, Cursor.delete, etc.), save the changes to the staging area via Cursor.save and finally Cursor.commit the data to the actual config files. -LuCI then needs to Cursor.apply the changes so deamons etc. are +LuCI then needs to Cursor.apply the changes so daemons etc. are reloaded. @cstyle instance ]] @@ -28,12 +28,63 @@ Create a new Cursor initialized to the state directory. ]] ---[[ -Applies UCI configuration changes +Applies UCI configuration changes. + +If the rollback parameter is set to true, the apply function will invoke the +rollback mechanism which causes the configuration to be automatically reverted +if no confirm() call occurs within a certain timeout. + +The current default timeout is 30s and can be increased using the +"luci.apply.timeout" uci configuration key. @class function @name Cursor.apply -@param configlist List of UCI configurations -@param command Don't apply only return the command +@param rollback Enable rollback mechanism +@return Boolean whether operation succeeded +]] + +---[[ +Confirms UCI apply process. + +If a previous UCI apply with rollback has been invoked using apply(true), +this function confirms the process and cancels the pending rollback timer. + +If no apply with rollback session is active, the function has no effect and +returns with a "No data" error. + +@class function +@name Cursor.confirm +@return Boolean whether operation succeeded +]] + +---[[ +Cancels UCI apply process. + +If a previous UCI apply with rollback has been invoked using apply(true), +this function cancels the process and rolls back the configuration to the +pre-apply state. + +If no apply with rollback session is active, the function has no effect and +returns with a "No data" error. + +@class function +@name Cursor.rollback +@return Boolean whether operation succeeded +]] + +---[[ +Checks whether a pending rollback is scheduled. + +If a previous UCI apply with rollback has been invoked using apply(true), +and has not been confirmed or rolled back yet, this function returns true +and the remaining time until rollback in seconds. If no rollback is pending, +the function returns false. On error, the function returns false and an +additional string describing the error. + +@class function +@name Cursor.rollback_pending +@return Boolean whether rollback is pending +@return Remaining time in seconds ]] ---[[ @@ -121,7 +172,7 @@ has the same effect as deleting the option. ---[[ Create a sub-state of this cursor. -The sub-state is tied to the parent curser, means it the parent unloads or +The sub-state is tied to the parent cursor, means it the parent unloads or loads configs, the sub state will do so as well. @class function @@ -288,7 +339,7 @@ Set the configuration directory. ]] ---[[ -Set the directory for uncommited changes. +Set the directory for uncommitted changes. @class function @name Cursor.set_savedir