diff options
Diffstat (limited to 'shared/server-commands')
-rw-r--r-- | shared/server-commands/runners/runner-jobs-command.ts | 22 |
1 files changed, 15 insertions, 7 deletions
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) { |