dba/logs
library moduleR
Summary
Delete log files.
- Tags
Author: Christian Grün, BaseX Team 2005-21, BSD License
__source : logs/log-delete.xqm
Imports
This module is imported by 0 modules. It imports 1 modules.
Variables
Functions
4.1 dba:log-delete
Arities: dba:log-delete#1R
dba:log-delete
(
$names
as
xs:string*
)
as
element(rest:response)
- names
as
xs:string*
names of log files
element(rest:response)
redirection
Invokes 3 functions from 3 modules
- util:info#3
- {http://basex.org/modules/admin}delete-logs#0
- {http://basex.org/modules/web}redirect#2
Invoked by 0 functions from 0 modules
Annotations
%rest:GET | () |
%rest:path | ('/dba/log-delete') |
%rest:query-param | ('name','{$names}') |
Source ( 10 lines)
function dba:log-delete(
$names as xs:string*
) as element(rest:response) {
try {
$names ! admin:delete-logs(.),
web:redirect($dba:CAT, map { 'info': util:info($names, 'log', 'deleted') })
} catch * {
web:redirect($dba:CAT, map { 'error': $err:description })
}
}
Namespaces
The following namespaces are defined:
Prefix | Uri |
---|---|
dba | dba/logs 2 3 |
rest | http://exquery.org/ns/restxq |
util | dba/util |
Source Code
(:~
: Delete log files.
:
: @author Christian Grün, BaseX Team 2005-21, BSD License
:)
module namespace dba = 'dba/logs';
import module namespace util = 'dba/util' at '../lib/util.xqm';
(:~ Top category :)
declare variable $dba:CAT := 'logs';
(:~
: Deletes database logs.
: @param $names names of log files
: @return redirection
:)
declare
%rest:GET
%rest:path('/dba/log-delete')
%rest:query-param('name', '{$names}')
function dba:log-delete(
$names as xs:string*
) as element(rest:response) {
try {
$names ! admin:delete-logs(.),
web:redirect($dba:CAT, map { 'info': util:info($names, 'log', 'deleted') })
} catch * {
web:redirect($dba:CAT, map { 'error': $err:description })
}
};