Function catalog
Give the functions of this server as data: the pages of the MQL Functions menu with their summary, every signature with its parameters and first example, the exact argument counts and the functions often used together in the Use cases. A small header with a hash tells when the catalog changed. Typical uses: completion and lint in the MentDB editor, a list of the functions available on a server before calling it.
function catalog
Description
The whole catalog of the functions of this server (compact JSON, about 2 MB): format, version, docs_port, docs_path, pages, functions, arity, often, hash. Built once, then kept in memory
The whole catalog of the functions of this server (compact JSON, about 2 MB): format, version, docs_port, docs_path, pages, functions, arity, often, hash. Built once, then kept in memory
admin
function catalog
mentdb
{"format":1,"version":"4.2.4","docs_port":9999,"docs_path":"/web/","pages":[{"name":"Network checks","group":"Extract and Load","file":"mql_network_checks.html","summary":"Check network services..."}],"functions":[{"name":"ip to_long","page":0,"desc":"An IPv4 address as an integer (an IPv4-mapped address is accepted)","params":[["ip","String",1,"The IPv4 address"]],"example":"ip to_long \"192.168.1.10\""}],"arity":{"ip to_long":[1]},"often":{},"hash":"93f4a74b49d1fa73ae82"}
function catalog <json_params>
Description
A part of the catalog with parameters: page (the functions of one page), names (a function name or a list of names, 5000 at most), usage (true: add often), examples (true: add the first example of each signature). The pages without a selected function are left out; hash is the one of the whole catalog
A part of the catalog with parameters: page (the functions of one page), names (a function name or a list of names, 5000 at most), usage (true: add often), examples (true: add the first example of each signature). The pages without a selected function are left out; hash is the one of the whole catalog
Parameters
json_params: The parameters - String - required
json_params: The parameters - String - required
admin
function catalog "{\"names\": [\"ip to_long\", \"ip from_long\"], \"examples\": false, \"usage\": false}"
mentdb
{"format":1,"version":"4.2.5","docs_port":0,"docs_path":"/web/","pages":[{"name":"Network checks","group":"Extract and Load","file":"mql_network_checks.html","summary":"Check network services: DNS records, open TCP ports, server greetings, TLS certificates and their expiry, HTTP availability, and compute on IP addresses and CIDR ranges offline. Typical uses: monitor a certificate before it expires, check that a partner server is reachable."}],"functions":[{"name":"ip to_long","page":0,"desc":"An IPv4 address as an integer (an IPv4-mapped address is accepted)","params":[["ip","String",1,"The IPv4 address"]]},{"name":"ip from_long","page":0,"desc":"An integer from 0 to 4294967295 as an IPv4 address","params":[["number","Number",1,"The integer"]]}],"arity":{"ip from_long":[1],"ip to_long":[1]},"hash":"e20fdca171f5f6a38f91"}
An unknown page is an error
admin
function catalog "{\"page\": \"No such page\"}"
mentdb
ERROR: Sorry, an error appears (json_params: the page 'No such page' does not exist (see function catalog_info for the pages)).
function catalog_info
Description
A small header of the catalog: format, version, hash (changes when a function or its documentation changes), pages, names, signatures, bytes (the size of the whole catalog) and recipes (the number of Use cases)
A small header of the catalog: format, version, hash (changes when a function or its documentation changes), pages, names, signatures, bytes (the size of the whole catalog) and recipes (the number of Use cases)
admin
function catalog_info
mentdb
{"format":1,"version":"4.2.4","hash":"93f4a74b49d1fa73ae82","pages":193,"names":2427,"signatures":3176,"bytes":2342062,"recipes":1134}
function usage <name>
Description
Where a function is used in the Use cases: name, page, signatures (the number of its signatures), used_in [{profile, profile_name, recipe, title}], often_with (the functions most often used with it, see the description of the page)
Where a function is used in the Use cases: name, page, signatures (the number of its signatures), used_in [{profile, profile_name, recipe, title}], often_with (the functions most often used with it, see the description of the page)
Parameters
name: The function name, ex: bank mt940 - String - required
name: The function name, ex: bank mt940 - String - required
admin
function usage "bank mt940"
mentdb
{"name":"bank mt940","page":"Bank statements","signatures":2,"used_in":[{"profile":"accountant","profile_name":"Accountant & manager","recipe":"bank-statement-reconcile","title":"Reconcile a bank statement with the expected payments"}],"often_with":["bank reconcile","bank to_rows","string char"]}
A function of the documentation that no recipe uses
admin
function usage "ip from_long"
mentdb
{"name":"ip from_long","page":"Network checks","signatures":1,"used_in":[],"often_with":[]}
An unknown function is an error
admin
function usage "no such function"
mentdb
ERROR: Sorry, an error appears (the function 'no such function' is not in the documentation of this server).
