Skip to content

Commit 48e1390

Browse files
authored
Resolve issues in Job structure (#204)
* fix issues with job structure * correct the endpoint for resource lookups
1 parent 011ecfc commit 48e1390

File tree

7 files changed

+110
-107
lines changed

7 files changed

+110
-107
lines changed

components/schemas/errors/ErrorEnvelope.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ required:
77
properties:
88
error:
99
$ref: Error.yml
10-
data:
11-
description: Data will always be `null` here.
12-
type: object
13-
nullable: true
10+
# data:
11+
# description: Data will always be `null` here.
12+
# type: object
13+
# nullable: true

components/schemas/jobs/Job.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ properties:
5050
description: An array of job tasks.
5151
type: array
5252
items:
53-
"$ref": "./JobTasks.yml"
53+
"$ref": ./JobTask.yml
5454
expires:
5555
description: A timestamp for when the job expires.
5656
"$ref": "../DateTime.yml"

components/schemas/jobs/JobState.yml

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
11
title: JobState
2-
allOf:
3-
- required:
4-
- current
2+
type: object
3+
required:
4+
- current
5+
- error
6+
properties:
7+
current:
8+
description: The current state of the job.
9+
type: string
10+
enum:
11+
- new
12+
- queued
13+
- error
14+
- scheduled
15+
- expired
16+
- running
17+
- completed
18+
changed:
19+
$ref: "../DateTime.yml"
20+
error:
21+
type: object
22+
nullable: true
23+
description: An error, if any, that has occurred for this job.
524
properties:
6-
current:
7-
description: The current state of the job.
25+
message:
826
type: string
9-
enum:
10-
- new
11-
- queued
12-
- error
13-
- scheduled
14-
- expired
15-
- running
16-
- completed
17-
- "$ref": "../State.yml"
27+
description: Details about the error that has occurred.

components/schemas/jobs/JobTask.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
title: JobTask
2+
type: object
3+
description: Information about a job task.
4+
required:
5+
- id
6+
- caption
7+
- header
8+
- events
9+
- error
10+
- steps
11+
- state
12+
- input
13+
- output
14+
properties:
15+
id:
16+
$ref: ../ID.yml
17+
caption:
18+
type: string
19+
description: A short description of the task.
20+
header:
21+
type: string
22+
description: The API function called.
23+
events:
24+
title: TaskEvents
25+
type: object
26+
description: A collection of timestamps for each event in the job's lifetime.
27+
required:
28+
- queued
29+
- completed
30+
- started
31+
properties:
32+
queued:
33+
description: The timestamp of when the task was queued.
34+
$ref: "../DateTime.yml"
35+
completed:
36+
description: The timestamp of when the task was completed.
37+
$ref: "../DateTime.yml"
38+
started:
39+
description: The timestamp of when the task was started.
40+
$ref: "../DateTime.yml"
41+
steps:
42+
description: An array of job task steps.
43+
type: array
44+
items:
45+
$ref: ./TaskStep.yml
46+
state:
47+
$ref: ./TaskState.yml
48+
input:
49+
type: object
50+
description: Input information used for the job tasks.
51+
additionalProperties:
52+
type: string
53+
output:
54+
type: object
55+
nullable: true
56+
description: Output informaiton used for the job tasks.
57+
additionalProperties:
58+
type: string
59+
error:
60+
type: object
61+
nullable: true
62+
description: An error object describing issues with the job.
63+
required:
64+
- message
65+
properties:
66+
message:
67+
type: string
68+
description: An error message

components/schemas/jobs/JobTasks.yml

Lines changed: 0 additions & 74 deletions
This file was deleted.

components/schemas/jobs/TaskState.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
title: TaskState
2-
allOf:
3-
- required:
4-
- current
5-
properties:
6-
current:
7-
description: The current state of the task.
8-
type: string
9-
enum:
10-
- pending
11-
- error
12-
- running
13-
- completed
14-
- "$ref": "../State.yml"
2+
type: object
3+
properties:
4+
changed:
5+
$ref: ../DateTime.yml
6+
current:
7+
description: The current state of the task.
8+
type: string
9+
enum:
10+
- pending
11+
- error
12+
- running
13+
- completed

public/api.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ paths:
408408
"/v1/security/report":
409409
$ref: paths/security/report.yml
410410
# Utils
411-
"/v1/utils/lookup":
411+
"/v1/utils/resource/lookup":
412412
$ref: paths/utils/resource/lookup.yml
413413
components:
414414
securitySchemes:

0 commit comments

Comments
 (0)