From f8628258bc662bb013f61ad4f3aec2c229257790 Mon Sep 17 00:00:00 2001 From: "stonezdj(Daojun Zhang)" Date: Thu, 24 Nov 2022 10:38:52 +0800 Subject: [PATCH] Add Cron, CronType and Update Time for schedule (#17844) Remove create time because update time is added Signed-off-by: stonezdj --- api/v2.0/swagger.yaml | 9 ++++++++- src/server/v2.0/handler/jobservice.go | 12 +++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/api/v2.0/swagger.yaml b/api/v2.0/swagger.yaml index a0f0fae56..5f550c794 100644 --- a/api/v2.0/swagger.yaml +++ b/api/v2.0/swagger.yaml @@ -9500,12 +9500,19 @@ definitions: vendor_id: type: integer description: the vendor id of the current task + cron: + type: string + description: the cron of the current schedule task + cron_type: + type: string + description: the cron type of the current schedule task extra_attrs: type: string description: the extra attributes - creation_time: + update_time: type: string format: date-time + description: the update time of the schedule task SchedulerStatus: type: object description: the scheduler status diff --git a/src/server/v2.0/handler/jobservice.go b/src/server/v2.0/handler/jobservice.go index 9475281fb..7025af299 100644 --- a/src/server/v2.0/handler/jobservice.go +++ b/src/server/v2.0/handler/jobservice.go @@ -138,11 +138,13 @@ func toScheduleResponse(schs []*scheduler.Schedule) []*models.ScheduleTask { } } result = append(result, &models.ScheduleTask{ - ID: s.ID, - VendorType: s.VendorType, - VendorID: s.VendorID, - ExtraAttrs: string(extraAttr), - CreationTime: strfmt.DateTime(s.CreationTime), + ID: s.ID, + VendorType: s.VendorType, + VendorID: s.VendorID, + ExtraAttrs: string(extraAttr), + Cron: s.CRON, + CronType: s.CRONType, + UpdateTime: strfmt.DateTime(s.UpdateTime), }) } return result