dba/files
library moduleR
Summary
Stop jobs.
- Tags
Author: Christian Grün, BaseX Team 2005-21, BSD License
__source : files/file-stop.xqm
Imports
This module is imported by 0 modules. It imports 1 modules.
Variables
Functions
4.1 dba:file-stop
Arities: dba:file-stop#1R
dba:file-stop
(
$id
as
xs:string
)
as
element(rest:response)
- id
as
xs:string
s session ids
element(rest:response)
redirection
Invokes 3 functions from 3 modules
- util:info#3
- {http://basex.org/modules/jobs}stop#1
- {http://basex.org/modules/web}redirect#2
Invoked by 0 functions from 0 modules
Annotations
%rest:GET | () |
%rest:path | ('/dba/file-stop') |
%rest:query-param | ('id','{$id}') |
Source ( 11 lines)
function dba:file-stop(
$id as xs:string
) as element(rest:response) {
let $params := try {
jobs:stop($id),
map { 'info': util:info($id, 'job', 'stopped') }
} catch * {
map { 'error': $err:description }
}
return web:redirect($dba:CAT, $params)
}
Namespaces
The following namespaces are defined:
Prefix | Uri |
---|---|
dba | dba/files 2 3 4 5 6 7 8 |
rest | http://exquery.org/ns/restxq |
util | dba/util |
Source Code
(:~
: Stop jobs.
:
: @author Christian Grün, BaseX Team 2005-21, BSD License
:)
module namespace dba = 'dba/files';
import module namespace util = 'dba/util' at '../lib/util.xqm';
(:~ Top category :)
declare variable $dba:CAT := 'files';
(:~
: Stops jobs.
: @param $ids session ids
: @return redirection
:)
declare
%rest:GET
%rest:path('/dba/file-stop')
%rest:query-param('id', '{$id}')
function dba:file-stop(
$id as xs:string
) as element(rest:response) {
let $params := try {
jobs:stop($id),
map { 'info': util:info($id, 'job', 'stopped') }
} catch * {
map { 'error': $err:description }
}
return web:redirect($dba:CAT, $params)
};