From ab8dd1204d050aff21aeca0307473a63d83f26a5 Mon Sep 17 00:00:00 2001 From: Claudia Bressi Date: Tue, 9 Apr 2024 15:05:44 +0200 Subject: [PATCH 1/9] Enabled task/definitions link --- ui/src/app/shared/model/task-execution.model.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/src/app/shared/model/task-execution.model.ts b/ui/src/app/shared/model/task-execution.model.ts index df1310791..89543f6dc 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 { From cbd7e1b563272bc6099be06c65d7d27cd47a1150 Mon Sep 17 00:00:00 2001 From: Claudia Bressi Date: Wed, 10 Apr 2024 08:43:47 +0200 Subject: [PATCH 2/9] Created optimized interface taskExecution --- .../app/shared/model/task-execution.model.ts | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/ui/src/app/shared/model/task-execution.model.ts b/ui/src/app/shared/model/task-execution.model.ts index 89543f6dc..b19cb6f92 100644 --- a/ui/src/app/shared/model/task-execution.model.ts +++ b/ui/src/app/shared/model/task-execution.model.ts @@ -107,6 +107,38 @@ 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); From bbc9a028800e8a3eb4efbe5057d0406b9a899837 Mon Sep 17 00:00:00 2001 From: Claudia Bressi Date: Wed, 10 Apr 2024 08:52:59 +0200 Subject: [PATCH 3/9] Up taskExecution page accordingly to new definition --- ui/src/app/shared/model/task-execution.model.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ui/src/app/shared/model/task-execution.model.ts b/ui/src/app/shared/model/task-execution.model.ts index b19cb6f92..4e6ca420f 100644 --- a/ui/src/app/shared/model/task-execution.model.ts +++ b/ui/src/app/shared/model/task-execution.model.ts @@ -148,3 +148,13 @@ export class TaskExecutionPage extends Page { return page; } } + +export class TaskExecutionThingPage 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(TaskExecutionThin.parse); + } + return page; + } +} \ No newline at end of file From 5369828c88d2f44230dd220ad053f2fa7f295252 Mon Sep 17 00:00:00 2001 From: Claudia Bressi Date: Wed, 10 Apr 2024 08:57:27 +0200 Subject: [PATCH 4/9] Up lint --- ui/src/app/shared/model/task-execution.model.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/app/shared/model/task-execution.model.ts b/ui/src/app/shared/model/task-execution.model.ts index 4e6ca420f..d90b252af 100644 --- a/ui/src/app/shared/model/task-execution.model.ts +++ b/ui/src/app/shared/model/task-execution.model.ts @@ -7,7 +7,7 @@ interface hrefObj { interface TaskExecutionLinks { 'tasks/logs': hrefObj; - 'tasks/definitions': hrefObj + 'tasks/definitions': hrefObj; } export class LaunchResponse { @@ -157,4 +157,4 @@ export class TaskExecutionThingPage extends Page { } return page; } -} \ No newline at end of file +} From c59367d1dc9aec75b112d70965ae2711eaf0cc3d Mon Sep 17 00:00:00 2001 From: Claudia Bressi Date: Wed, 10 Apr 2024 09:12:43 +0200 Subject: [PATCH 5/9] Up interface name --- ui/src/app/shared/model/task-execution.model.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/app/shared/model/task-execution.model.ts b/ui/src/app/shared/model/task-execution.model.ts index d90b252af..9bb14f083 100644 --- a/ui/src/app/shared/model/task-execution.model.ts +++ b/ui/src/app/shared/model/task-execution.model.ts @@ -149,7 +149,7 @@ export class TaskExecutionPage extends Page { } } -export class TaskExecutionThingPage extends Page { +export class TaskExecutionThinPage extends Page { static parse(input: any): Page { const page = Page.fromJSON(input); if (input && input._embedded && input._embedded.taskExecutionResourceList) { From 2da7289ef4fb08a45599674a88ce1fba87ba916f Mon Sep 17 00:00:00 2001 From: Claudia Bressi Date: Thu, 11 Apr 2024 13:37:11 +0200 Subject: [PATCH 6/9] Update task execution resource list --- ui/src/app/shared/model/task-execution.model.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/src/app/shared/model/task-execution.model.ts b/ui/src/app/shared/model/task-execution.model.ts index 9bb14f083..1cb72156a 100644 --- a/ui/src/app/shared/model/task-execution.model.ts +++ b/ui/src/app/shared/model/task-execution.model.ts @@ -142,8 +142,8 @@ export class TaskExecutionThin { 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; } @@ -152,8 +152,8 @@ export class TaskExecutionPage extends Page { export class TaskExecutionThinPage 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(TaskExecutionThin.parse); + if (input && input._embedded && input._embedded.taskExecutionThinResourceList) { + page.items = input._embedded.taskExecutionThinResourceList.map(TaskExecutionThin.parse); } return page; } From d01f4e55259b084b2bb8d4b30d28576693c0eb8f Mon Sep 17 00:00:00 2001 From: Claudia Bressi Date: Thu, 11 Apr 2024 17:24:10 +0200 Subject: [PATCH 7/9] Update task service endpoint --- ui/src/app/shared/api/task.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/src/app/shared/api/task.service.ts b/ui/src/app/shared/api/task.service.ts index b5e409468..d23c42286 100644 --- a/ui/src/app/shared/api/task.service.ts +++ b/ui/src/app/shared/api/task.service.ts @@ -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/definitions', {headers, params}) .pipe(map(TaskExecutionPage.parse), catchError(ErrorUtils.catchError)); } @@ -224,7 +224,7 @@ export class TaskService { const headers = HttpUtils.getDefaultHttpHeaders(); const params = new HttpParams({encoder: new DataflowEncoder()}).append('platform', platform); return this.httpClient - .get(UrlUtilities.calculateBaseApiUrl() + `tasks/executions/external/${externalExecutionId}`, { + .get(UrlUtilities.calculateBaseApiUrl() + `tasks/definitions/external/${externalExecutionId}`, { headers, params }) @@ -235,7 +235,7 @@ export class TaskService { const headers = HttpUtils.getDefaultHttpHeaders(); const params = new HttpParams({encoder: new DataflowEncoder()}).set('schemaTarget', schemaTarget); return this.httpClient - .get(UrlUtilities.calculateBaseApiUrl() + `tasks/executions/${executionId ?? 0}`, { + .get(UrlUtilities.calculateBaseApiUrl() + `tasks/definitions/${executionId ?? 0}`, { headers: headers, params: params }) From bf4e2aa52aca1a4ebf88e0caad897eb61a24a342 Mon Sep 17 00:00:00 2001 From: Claudia Bressi Date: Thu, 11 Apr 2024 17:31:01 +0200 Subject: [PATCH 8/9] Enable tasks/definitions on getExecutions only --- ui/src/app/shared/api/task.service.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/src/app/shared/api/task.service.ts b/ui/src/app/shared/api/task.service.ts index d23c42286..2604c08bb 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)); } @@ -224,7 +224,7 @@ export class TaskService { const headers = HttpUtils.getDefaultHttpHeaders(); const params = new HttpParams({encoder: new DataflowEncoder()}).append('platform', platform); return this.httpClient - .get(UrlUtilities.calculateBaseApiUrl() + `tasks/definitions/external/${externalExecutionId}`, { + .get(UrlUtilities.calculateBaseApiUrl() + `tasks/executions/external/${externalExecutionId}`, { headers, params }) @@ -235,7 +235,7 @@ export class TaskService { const headers = HttpUtils.getDefaultHttpHeaders(); const params = new HttpParams({encoder: new DataflowEncoder()}).set('schemaTarget', schemaTarget); return this.httpClient - .get(UrlUtilities.calculateBaseApiUrl() + `tasks/definitions/${executionId ?? 0}`, { + .get(UrlUtilities.calculateBaseApiUrl() + `tasks/executions/${executionId ?? 0}`, { headers: headers, params: params }) From fcac440c0184dac0237230ac5e27fba8eda4cc3d Mon Sep 17 00:00:00 2001 From: Claudia Bressi Date: Fri, 12 Apr 2024 12:05:40 +0200 Subject: [PATCH 9/9] Update endpoint for task executions --- ui/src/app/shared/api/task.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/app/shared/api/task.service.ts b/ui/src/app/shared/api/task.service.ts index 2604c08bb..9c4e05064 100644 --- a/ui/src/app/shared/api/task.service.ts +++ b/ui/src/app/shared/api/task.service.ts @@ -216,7 +216,7 @@ export class TaskService { params = params.append('sort', `${sort},${order}`); } return this.httpClient - .get(UrlUtilities.calculateBaseApiUrl() + 'tasks/definitions', {headers, params}) + .get(UrlUtilities.calculateBaseApiUrl() + 'tasks/thinexecutions', {headers, params}) .pipe(map(TaskExecutionPage.parse), catchError(ErrorUtils.catchError)); }