diff options
Diffstat (limited to 'shared')
-rw-r--r-- | shared/models/runners/list-runner-jobs-query.model.ts | 3 | ||||
-rw-r--r-- | shared/server-commands/runners/runner-jobs-command.ts | 22 |
2 files changed, 18 insertions, 7 deletions
diff --git a/shared/models/runners/list-runner-jobs-query.model.ts b/shared/models/runners/list-runner-jobs-query.model.ts index a5b62c55d..ef19b31fa 100644 --- a/shared/models/runners/list-runner-jobs-query.model.ts +++ b/shared/models/runners/list-runner-jobs-query.model.ts | |||
@@ -1,6 +1,9 @@ | |||
1 | import { RunnerJobState } from './runner-job-state.model' | ||
2 | |||
1 | export interface ListRunnerJobsQuery { | 3 | export interface ListRunnerJobsQuery { |
2 | start?: number | 4 | start?: number |
3 | count?: number | 5 | count?: number |
4 | sort?: string | 6 | sort?: string |
5 | search?: string | 7 | search?: string |
8 | stateOneOf?: RunnerJobState[] | ||
6 | } | 9 | } |
diff --git a/shared/server-commands/runners/runner-jobs-command.ts b/shared/server-commands/runners/runner-jobs-command.ts index 26dbef77a..0a0ffb5d3 100644 --- a/shared/server-commands/runners/runner-jobs-command.ts +++ b/shared/server-commands/runners/runner-jobs-command.ts | |||
@@ -8,6 +8,7 @@ import { | |||
8 | isHLSTranscodingPayloadSuccess, | 8 | isHLSTranscodingPayloadSuccess, |
9 | isLiveRTMPHLSTranscodingUpdatePayload, | 9 | isLiveRTMPHLSTranscodingUpdatePayload, |
10 | isWebVideoOrAudioMergeTranscodingPayloadSuccess, | 10 | isWebVideoOrAudioMergeTranscodingPayloadSuccess, |
11 | ListRunnerJobsQuery, | ||
11 | RequestRunnerJobBody, | 12 | RequestRunnerJobBody, |
12 | RequestRunnerJobResult, | 13 | RequestRunnerJobResult, |
13 | ResultList, | 14 | ResultList, |
@@ -27,19 +28,14 @@ import { AbstractCommand, OverrideCommandOptions } from '../shared' | |||
27 | 28 | ||
28 | export class RunnerJobsCommand extends AbstractCommand { | 29 | export class RunnerJobsCommand extends AbstractCommand { |
29 | 30 | ||
30 | list (options: OverrideCommandOptions & { | 31 | list (options: OverrideCommandOptions & ListRunnerJobsQuery = {}) { |
31 | start?: number | ||
32 | count?: number | ||
33 | sort?: string | ||
34 | search?: string | ||
35 | } = {}) { | ||
36 | const path = '/api/v1/runners/jobs' | 32 | const path = '/api/v1/runners/jobs' |
37 | 33 | ||
38 | return this.getRequestBody<ResultList<RunnerJobAdmin>>({ | 34 | return this.getRequestBody<ResultList<RunnerJobAdmin>>({ |
39 | ...options, | 35 | ...options, |
40 | 36 | ||
41 | path, | 37 | path, |
42 | query: pick(options, [ 'start', 'count', 'sort', 'search' ]), | 38 | query: pick(options, [ 'start', 'count', 'sort', 'search', 'stateOneOf' ]), |
43 | implicitToken: true, | 39 | implicitToken: true, |
44 | defaultExpectedStatus: HttpStatusCode.OK_200 | 40 | defaultExpectedStatus: HttpStatusCode.OK_200 |
45 | }) | 41 | }) |
@@ -57,6 +53,18 @@ export class RunnerJobsCommand extends AbstractCommand { | |||
57 | }) | 53 | }) |
58 | } | 54 | } |
59 | 55 | ||
56 | deleteByAdmin (options: OverrideCommandOptions & { jobUUID: string }) { | ||
57 | const path = '/api/v1/runners/jobs/' + options.jobUUID | ||
58 | |||
59 | return this.deleteRequest({ | ||
60 | ...options, | ||
61 | |||
62 | path, | ||
63 | implicitToken: true, | ||
64 | defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 | ||
65 | }) | ||
66 | } | ||
67 | |||
60 | // --------------------------------------------------------------------------- | 68 | // --------------------------------------------------------------------------- |
61 | 69 | ||
62 | request (options: OverrideCommandOptions & RequestRunnerJobBody) { | 70 | request (options: OverrideCommandOptions & RequestRunnerJobBody) { |