If you like BoxMatrix then please contribute Supportdata, Supportdata2, Firmware and/or Hardware (get in touch).
My metamonk@yahoo.com is not reachable by me since years. Please use hippie2000@webnmail.de instead.
Property:plugin common.lua
BoxMatrix >> Webinterface >> plugin_common.lua | @ BoxMatrix - IRC-Chat - Translate: de es fr it nl pl |
News | Selectors | Models | Accessories | Components | Environment | Config | Commands | System | Webif | Software | Develop | Lexicon | Community | Project | Media |
UI-Structure | UI-Modules | HTML-Files | XML-Files | REST-API | Lua-Scripts | Javascript | Browser | SSI-Files | SSI-Directives | HTML-Text | Event-Text | Help-Pages | CSS-Files | Graphics | Research |
RESTAPI-Script
RESTAPI-Script: | plugin_common.lua - type Script | Wiki | Freetz | IPPF | whmf | AVM | Web |
Location: | Webinterface >> RESTAPI-Scripts - Origin: AVM | ||||||
Path: | Release: /usr/rest_api Lab+Rel: /usr/rest_api | ||||||
Properties: | Size: 60.7k - 61.0k - Firmware: 7.90 - 8.00 | ||||||
Function: | REST-API Plugin helper functions |
Goto: Functions - Dependencies - Model-Matrix - SMW-Browser
Details
plugin_common.lua provides REST-API Plugin helper functions. It is included by monitor.lua.
The exported functions can:
- PUT or POST all data coming from the client
- GET all requested data from the backend
- PUT all data coming from the client
- POST all data coming from the client
- DELETE all data defined by the client
The client is the caller of the REST-API, the backend is the UI-Modules API.
- Lexicon: REST, API, SCGI
- Commands: scgi_server
- Ports: Port-8187-tcp
- UI-Mods: webui
- API-Root: api.lua
- Includes: api_generic.lua, rest_config.lua, security.lua, espresso.lua, rest_api_const.lua, response.lua, error.lua
- Includes: avmluamessages.lua, uimod.lua, api_generic_filter.lua, resource.lua, datatype.lua, plugin_common.lua
- Modules: storagenasrights_rest.lua, webusb_rest.lua
- Modules: calllog_rest.lua, faxjournal_rest.lua, phonebook_rest.lua, smarthome_rest.lua, boxnotify_rest.lua
- Develop: obl_fboxname.lua, dev_debug.lua, landevice.lua, query_tree.lua, fake_modules.lua, obl.lua
- Common: array.lua, common.lua, func.lua, math.lua, string.lua, table.lua, typecheck.lua, validcheck.lua
- Plugins: configflags.lua, eventlog.lua, info.lua, monitor.lua, phonebook.lua, smarthome.lua, timermix.lua
- Misc-Plugins: misc.lua, boxname.lua, configuration.lua, handsets.lua, update_status.lua, wan_status.lua
- Setup-Plugins: setup.lua
Functions
The function names of scripts often help to understand function blocks (and show gaps in the docs). fw 8.00 functions:
$ grep -e '^function' -e '^local function' /usr/rest_api/plugin_common.lua # Fills the given data_sources-list with all needed backend-data sources for the given resource_model # Also splits the path_intern-string in every resource and saves it in the path_list-s in every entry local function get_needed_data_sources_rec(resource_model, data_sources, parent_path) # Gets the neededed backend-data sources for the given resource_model # Also adds the corresponding http-query-parameter UIDs to the paths if available local function get_needed_data_sources(resource_model, params) # Gets all data from backend which is requested by data_sources # Does the backend-query using the uimod-api local function get_backend_data(data_sources) # Gets one string-value out of the given backend data as described by the path_list local function get_backend_data_entry_by_path(raw_backend_data, path_list, pos) # Picks the needed data out of the backend data and copies it into our wanted output structure local function data_pick(resource_model, raw_backend_data, params, pos) # Prepares the request-strings for the uimod-API # Removes all '\INDEX'-pattern in the request-strings for the uimod-api # Removes all '\1' -pattern in the request-strings for the uimod-api local function prepare_request_strings(uimod_request_data, potential_uids_without_holes) # The recursive part of check_body_data_and_map_to_internal() local function check_body_data_and_map_to_internal_rec(resource_model, body_data, absolute_path_intern, absolute_path_extern, uimod_request_data, plugin_name) # Checks whether all body-data given by the client are part of the resource model and gets the request data for the uimod-api local function check_body_data_and_map_to_internal(resource_model, body_data, params, plugin_name) # Gets a (sub-)resource model out of the given resource model # The sub-resource models always includes the whole path up to the root local function get_resource_model_recursive(params, pos, resource_model) # Removes the unnessecary first part of the result_list which contains the full absolute path # Also chooses the right list-elements by UID, if there are some given in the params.potential_uids and in the result_list_raw local function unwrap_result_data(result_list_raw, params) # Reverts the mapping from the internal path given in a result back to the external path local function revert_mapping(result, uimod_request_data, plugin_name) # PUTs or POSTs all data coming from the client function plugin_common.put_post_plugin_data(resource_model, params, plugin_name, request_type) # Extracts the fitting sub_resource_model out of the resource_model according to the given parameters # Should be called in the plugins function plugin_common.get_resource_model(params, resource_model) # GETs all requested data from the backend function plugin_common.get_plugin_data(resource_model, params) # PUTs all data coming from the client function plugin_common.put_plugin_data(resource_model, params, plugin_name) # POSTs all data coming from the client function plugin_common.post_plugin_data(resource_model, params, plugin_name) # DELETEs all data defined by the client function plugin_common.delete_plugin_data(resource_model, params, plugin_name)
Dependencies
Daily updated index of all dependencies of this script. Last update: GMT.
A *
in the Mod
column marks info from Supportdata-Probes, which will always stay incomplete.
If an Object
includes itself then this is a file with the same name but another Path
and the dependencies are merged.
Relation | Typ | Object | Mod | Firmware | Info | Origin |
---|---|---|---|---|---|---|
Requires | rest | array.lua | 25 | 7.90 - 8.00 | REST-API common collection of array-functions | AVM |
Requires | rest | common.lua (restapi) | 25 | 7.90 - 8.00 | REST-API common helper functions | AVM |
Requires | rest | datatype.lua | 25 | 7.90 - 8.00 | REST-API Datatype Conversion | AVM |
Requires | rest | response.lua | 25 | 7.90 - 8.00 | REST-API Response API | AVM |
Requires | rest | rest_api_const.lua | 25 | 7.90 - 8.00 | REST-API Const Tables | AVM |
Requires | rest | table.lua | 25 | 7.90 - 8.00 | REST-API common extension of the Lua table module | AVM |
Requires | rest | uimod.lua (restapi) | 25 | 7.90 - 8.00 | REST-API UI-Modules API | AVM |
Required by | rest | monitor.lua | 24 | 7.90 - 8.00 | REST-API Plugin for the monitoring API | AVM |
8 dependencies for this script |
Model-Matrix
Daily updated index of the presence, path and size of this script for each model. Last update: GMT.
Showing all models using this script. Click any column header (click-wait-click) to sort the list by the respective data.
The (main/scrpn/boot/arm/prx/atom/rtl)
label in the Model
column shows which CPU is meant for Multi-Linux models.
Note that this list is merged from Firmware-Probes of all known AVM firmware for a model, including Recovery.exe and Labor-Files.
Model | Firmware | Path | Size/Bytes |
---|---|---|---|
FRITZ!Box 4040 | 7.90 - 8.00 | /usr/rest_api | 61.0k |
FRITZ!Box 4050 | 7.90 | /usr/rest_api | 60.8k |
FRITZ!Box 4060 | 7.90 | /usr/rest_api | 61.0k |
FRITZ!Box 5530 Fiber (main) | 8.00 | /usr/rest_api | 60.7k |
FRITZ!Box 5590 Fiber (main) | 7.90 - 8.00 | /usr/rest_api | 61.0k |
FRITZ!Box 5590 Fiber (prx) | 7.90 - 8.00 | /usr/rest_api | 60.7k |
FRITZ!Box 6591 Cable (arm) | 8.00 | /usr/rest_api | 60.8k |
FRITZ!Box 6591 Cable (atom) | 7.90 | /usr/rest_api | 60.9k |
FRITZ!Box 6660 Cable (arm) | 7.90 - 8.00 | /usr/rest_api | 60.8k |
FRITZ!Box 6660 Cable (atom) | 7.90 | /usr/rest_api | 60.9k |
FRITZ!Box 6670 Cable (arm) | 7.90 | /usr/rest_api | 60.8k |
FRITZ!Box 6670 Cable (atom) | 7.90 | /usr/rest_api | 60.9k |
FRITZ!Box 6690 Cable (arm) | 7.90 | /usr/rest_api | 60.8k |
FRITZ!Box 6690 Cable (atom) | 7.90 | /usr/rest_api | 60.9k |
FRITZ!Box 6850 5G | 7.90 | /usr/rest_api | 61.0k |
FRITZ!Box 6850 LTE | 7.90 | /usr/rest_api | 61.0k |
FRITZ!Box 7510 | 7.90 - 8.00 | /usr/rest_api | 60.8k |
FRITZ!Box 7520 | 8.00 | /usr/rest_api | 61.0k |
FRITZ!Box 7520 v2 (main) | 7.90 - 8.00 | /usr/rest_api | 61.0k |
FRITZ!Box 7530 | 7.90 - 8.00 | /usr/rest_api | 61.0k |
FRITZ!Box 7530 AX | 8.00 | /usr/rest_api | 60.9k |
FRITZ!Box 7583 VDSL (main) | 8.00 | /usr/rest_api | 60.7k |
FRITZ!Box 7590 (main) | 7.90 - 8.00 | /usr/rest_api | 60.7k |
FRITZ!Box 7590 AX (main) | 8.00 | /usr/rest_api | 60.7k |
FRITZ!Box 7690 | 7.90 | /usr/rest_api | 60.8k |
25 models use this script |