From d80dd2291ff01d264dfa802b769fa19756f07821 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 5 Nov 2019 09:31:27 +0100 Subject: documentation: update Lua API docs Signed-off-by: Jo-Philipp Wich (cherry picked from commit 2ae6e3c6b3c3b65cd955bb10fb9065beebc5ffd2) --- documentation/api/modules/luci.model.uci.html | 146 +++++++++++++++++++++++--- 1 file changed, 133 insertions(+), 13 deletions(-) (limited to 'documentation/api/modules/luci.model.uci.html') diff --git a/documentation/api/modules/luci.model.uci.html b/documentation/api/modules/luci.model.uci.html index 77a81fd468..c1eaf5f813 100644 --- a/documentation/api/modules/luci.model.uci.html +++ b/documentation/api/modules/luci.model.uci.html @@ -213,11 +213,10 @@ Add an anonymous section. - Cursor:apply (configlist, command) + Cursor:apply (rollback) -Applies UCI configuration changes - +Applies UCI configuration changes. @@ -234,6 +233,13 @@ Get a table of saved but uncommitted changes. Commit saved changes. + + Cursor:confirm () + + +Confirms UCI apply process. + + Cursor:delete (config, section, option) @@ -326,6 +332,20 @@ Manually load a config. Revert saved but uncommitted changes. + + Cursor:rollback () + + +Cancels UCI apply process. + + + + Cursor:rollback_pending () + + +Checks whether a pending rollback is scheduled. + + Cursor:save (config) @@ -365,7 +385,7 @@ Set given values as list. Cursor:set_savedir (directory) -Set the directory for uncommited changes. +Set the directory for uncommitted changes. @@ -462,11 +482,18 @@ Name of created section -
Cursor:apply (configlist, command)
+
Cursor:apply (rollback)
-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. @@ -474,11 +501,7 @@ Applies UCI configuration changes
  • - configlist: List of UCI configurations -
  • - -
  • - command: Don't apply only return the command + rollback: Enable rollback mechanism
@@ -488,6 +511,9 @@ Applies UCI configuration changes +

Return value:

+Boolean whether operation succeeded +
@@ -581,6 +607,35 @@ Boolean whether operation succeeded +
Cursor:confirm ()
+
+ + +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. + + + + + + + + +

Return value:

+Boolean whether operation succeeded + + + +
+ + + +
Cursor:delete (config, section, option)
@@ -1059,6 +1114,71 @@ Boolean whether operation succeeded +
Cursor:rollback ()
+
+ + +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. + + + + + + + + +

Return value:

+Boolean whether operation succeeded + + + +
+ + + + +
Cursor:rollback_pending ()
+
+ + +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. + + + + + + + + +

Return values:

+
    + +
  1. Boolean whether rollback is pending + +
  2. Remaining time in seconds + +
+ + + +
+ + + +
Cursor:save (config)
@@ -1280,7 +1400,7 @@ Boolean whether operation succeeded
-Set the directory for uncommited changes. +Set the directory for uncommitted changes. @@ -1346,7 +1466,7 @@ Boolean whether operation succeeded 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. -- cgit v1.2.3