From 4f95c4d067fd6f43e3cba5219bce2b48c53a10e1 Mon Sep 17 00:00:00 2001 From: chlins Date: Mon, 17 Aug 2020 12:41:02 +0800 Subject: [PATCH] fix(preheat): fix the swagger definition of preheat get log api Signed-off-by: chlins --- api/v2.0/swagger.yaml | 5 +++-- src/server/v2.0/handler/preheat.go | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/api/v2.0/swagger.yaml b/api/v2.0/swagger.yaml index 8dfd3df76..0db6279b8 100644 --- a/api/v2.0/swagger.yaml +++ b/api/v2.0/swagger.yaml @@ -10,7 +10,6 @@ schemes: basePath: /api/v2.0 produces: - application/json - - text/plain consumes: - application/json securityDefinitions: @@ -1360,7 +1359,9 @@ paths: description: Get the log text stream of the specified task for the given execution tags: - preheat - operationId: GetLog + operationId: GetPreheatLog + produces: + - text/plain parameters: - $ref: '#/parameters/requestId' - $ref: '#/parameters/projectName' diff --git a/src/server/v2.0/handler/preheat.go b/src/server/v2.0/handler/preheat.go index 49ad25df1..1f370b774 100644 --- a/src/server/v2.0/handler/preheat.go +++ b/src/server/v2.0/handler/preheat.go @@ -704,8 +704,8 @@ func (api *preheatAPI) ListTasks(ctx context.Context, params operation.ListTasks WithLink(api.Links(ctx, params.HTTPRequest.URL, total, query.PageNumber, query.PageSize).String()) } -// GetLog gets log. -func (api *preheatAPI) GetLog(ctx context.Context, params operation.GetLogParams) middleware.Responder { +// GetPreheatLog gets log. +func (api *preheatAPI) GetPreheatLog(ctx context.Context, params operation.GetPreheatLogParams) middleware.Responder { if err := api.RequireProjectAccess(ctx, params.ProjectName, rbac.ActionRead, rbac.ResourcePreatPolicy); err != nil { return api.SendError(ctx, err) } @@ -715,7 +715,7 @@ func (api *preheatAPI) GetLog(ctx context.Context, params operation.GetLogParams return api.SendError(ctx, err) } - return operation.NewGetLogOK().WithPayload(string(l)).WithContentType("text/plain") + return operation.NewGetPreheatLogOK().WithPayload(string(l)) } // ListProvidersUnderProject is Get all providers at project level