Skip to content

Commit

Permalink
🌱 Update the Task TypeScript interface
Browse files Browse the repository at this point in the history
Update the `Task` interface, and related, to follow
the current definitions of Task REST resource[1] on
the hub.

Supports: konveyor#1955, konveyor#1956, konveyor#1957

[1] - https://github.com/konveyor/tackle2-hub/blob/1366d95b62ac7717826fd9f64c9e268013107008/api/task.go#L725-L748

Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
  • Loading branch information
sjd78 committed Jun 14, 2024
1 parent c2f4f06 commit 9b3992a
Showing 1 changed file with 50 additions and 19 deletions.
69 changes: 50 additions & 19 deletions client/src/app/api/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,18 +307,62 @@ export type TaskState =

export interface Task {
id?: number;
createUser?: string;
updateUser?: string;
createTime?: string;
application: { id: number };

name: string;
kind: string;
addon: string;
extensions: string[];
state?: TaskState;
locator?: string;
priority?: number;
policy: TaskPolicy;
ttl: TTL;
data: TaskData;
error?: string;
image?: string;
application: Ref;
bucket?: Ref;
pod?: string;
retries?: number;
started?: string;
terminated?: string;
state?: TaskState;
job?: string;
report?: TaskReport;
events?: TaskEvent[];
errors?: TaskError[];
activity?: string[];
attached?: Attachment[];
}

export interface TaskPolicy {
isolated?: boolean;
preemptEnabled?: boolean;
preemptExempt?: boolean;
}

export interface TTL {
created?: number;
pending?: number;
running?: number;
succeeded?: number;
failed?: number;
}

export interface TaskEvent {
kind: string;
count: number;
reason?: string;
last: string; // time
}

export interface TaskError {
severity: string;
description: string;
}

export interface Attachment {
id: number;
name?: string;
activity?: number;
}

export interface TaskData {
Expand Down Expand Up @@ -355,19 +399,6 @@ export interface TaskData {
};
}

interface TaskReport {
activity: string[];
completed: number;
createTime: string;
createUser: string;
error: string;
id: number;
status: string;
task: number;
total: number;
updateUser: string;
}

export interface TaskgroupTask {
name: string;
data: any;
Expand Down

0 comments on commit 9b3992a

Please sign in to comment.