diff --git a/ui/src/app/shared/api/task.service.ts b/ui/src/app/shared/api/task.service.ts index b5e409468..9c4e05064 100644 --- a/ui/src/app/shared/api/task.service.ts +++ b/ui/src/app/shared/api/task.service.ts @@ -44,14 +44,14 @@ export class TaskService { params = params.append('sort', `${sort},${order}`); } return this.httpClient - .get(UrlUtilities.calculateBaseApiUrl() + 'tasks/definitions', {headers, params}) + .get(UrlUtilities.calculateBaseApiUrl() + 'tasks/executions', {headers, params}) .pipe(map(TaskPage.parse), catchError(ErrorUtils.catchError)); } getTask(name: string, manifest = false): Observable { const headers = HttpUtils.getDefaultHttpHeaders(); return this.httpClient - .get(UrlUtilities.calculateBaseApiUrl() + `tasks/definitions/${name}?manifest=${manifest}`, {headers}) + .get(UrlUtilities.calculateBaseApiUrl() + `tasks/executions/${name}?manifest=${manifest}`, {headers}) .pipe(map(Task.parse), catchError(ErrorUtils.catchError)); } @@ -62,14 +62,14 @@ export class TaskService { .append('description', description); const headers = HttpUtils.getDefaultHttpHeaders(); return this.httpClient - .post(UrlUtilities.calculateBaseApiUrl() + 'tasks/definitions', {}, {headers, params}) + .post(UrlUtilities.calculateBaseApiUrl() + 'tasks/executions', {}, {headers, params}) .pipe(catchError(ErrorUtils.catchError)); } destroyTask(task: Task): Observable { const headers = HttpUtils.getDefaultHttpHeaders(); return this.httpClient - .delete(UrlUtilities.calculateBaseApiUrl() + 'tasks/definitions/' + task.name, {headers, observe: 'response'}) + .delete(UrlUtilities.calculateBaseApiUrl() + 'tasks/executions/' + task.name, {headers, observe: 'response'}) .pipe(catchError(ErrorUtils.catchError)); } @@ -216,7 +216,7 @@ export class TaskService { params = params.append('sort', `${sort},${order}`); } return this.httpClient - .get(UrlUtilities.calculateBaseApiUrl() + 'tasks/executions', {headers, params}) + .get(UrlUtilities.calculateBaseApiUrl() + 'tasks/thinexecutions', {headers, params}) .pipe(map(TaskExecutionPage.parse), catchError(ErrorUtils.catchError)); } diff --git a/ui/src/app/shared/model/task-execution.model.ts b/ui/src/app/shared/model/task-execution.model.ts index df1310791..1cb72156a 100644 --- a/ui/src/app/shared/model/task-execution.model.ts +++ b/ui/src/app/shared/model/task-execution.model.ts @@ -7,6 +7,7 @@ interface hrefObj { interface TaskExecutionLinks { 'tasks/logs': hrefObj; + 'tasks/definitions': hrefObj; } export class LaunchResponse { @@ -106,11 +107,53 @@ export class TaskExecution { } } +export class TaskExecutionThin { + executionId: number; + parentExecutionId: number; + exitCode: number; + taskName: string; + startTime: DateTime; + endTime: DateTime; + exitMessage: string; + externalExecutionId: number; + errorMessage: string; + schemaTarget: string; + platformName: string; + _links: TaskExecutionLinks; + + static parse(input: any): TaskExecution { + const execution = new TaskExecution(); + execution.executionId = input?.executionId; + execution.exitCode = input?.exitCode; + execution.taskName = input?.taskName; + execution.startTime = input?.startTime ? DateTime.fromISO(input.startTime) : null; + execution.endTime = input?.endTime ? DateTime.fromISO(input.endTime) : null; + execution.exitMessage = input?.exitMessage; + execution.schemaTarget = input?.schemaTarget || 'boot2'; + execution.errorMessage = input?.errorMessage; + execution.externalExecutionId = input?.externalExecutionId; + execution.parentExecutionId = input?.parentExecutionId; + execution._links = input?._links; + execution.schemaTarget = input?.schemaTarget; + return execution; + } +} + export class TaskExecutionPage extends Page { static parse(input: any): Page { const page = Page.fromJSON(input); - if (input && input._embedded && input._embedded.taskExecutionResourceList) { - page.items = input._embedded.taskExecutionResourceList.map(TaskExecution.parse); + if (input && input._embedded && input._embedded.taskExecutionThinResourceList) { + page.items = input._embedded.taskExecutionThinResourceList.map(TaskExecution.parse); + } + return page; + } +} + +export class TaskExecutionThinPage extends Page { + static parse(input: any): Page { + const page = Page.fromJSON(input); + if (input && input._embedded && input._embedded.taskExecutionThinResourceList) { + page.items = input._embedded.taskExecutionThinResourceList.map(TaskExecutionThin.parse); } return page; }