2023-03-09 14:55:52 +01:00
|
|
|
/*****************************************************************************
|
2023-10-04 12:32:27 +02:00
|
|
|
* Requests for /jobs routes *
|
2023-03-09 14:55:52 +01:00
|
|
|
*****************************************************************************/
|
2023-11-09 14:29:01 +01:00
|
|
|
nopaque.requests.jobs = {};
|
2023-03-09 14:55:52 +01:00
|
|
|
|
2023-11-09 14:29:01 +01:00
|
|
|
nopaque.requests.jobs.entity = {};
|
2023-03-09 14:55:52 +01:00
|
|
|
|
2023-11-09 14:29:01 +01:00
|
|
|
nopaque.requests.jobs.entity.delete = (jobId) => {
|
2023-03-09 14:55:52 +01:00
|
|
|
let input = `/jobs/${jobId}`;
|
|
|
|
let init = {
|
|
|
|
method: 'DELETE'
|
|
|
|
};
|
2023-11-09 14:29:01 +01:00
|
|
|
return nopaque.requests.JSONfetch(input, init);
|
2023-10-04 13:48:10 +02:00
|
|
|
};
|
2023-03-09 14:55:52 +01:00
|
|
|
|
2023-11-09 14:29:01 +01:00
|
|
|
nopaque.requests.jobs.entity.log = (jobId) => {
|
2023-03-09 14:55:52 +01:00
|
|
|
let input = `/jobs/${jobId}/log`;
|
|
|
|
let init = {
|
|
|
|
method: 'GET'
|
|
|
|
};
|
2023-11-09 14:29:01 +01:00
|
|
|
return nopaque.requests.JSONfetch(input, init);
|
2023-10-04 13:48:10 +02:00
|
|
|
};
|
2023-03-10 08:47:03 +01:00
|
|
|
|
2023-11-09 14:29:01 +01:00
|
|
|
nopaque.requests.jobs.entity.restart = (jobId) => {
|
2023-03-10 08:47:03 +01:00
|
|
|
let input = `/jobs/${jobId}/restart`;
|
|
|
|
let init = {
|
|
|
|
method: 'POST'
|
|
|
|
};
|
2023-11-09 14:29:01 +01:00
|
|
|
return nopaque.requests.JSONfetch(input, init);
|
2023-10-04 13:48:10 +02:00
|
|
|
};
|