fix(preheat): fix the swagger definition of preheat get log api

Signed-off-by: chlins <chlins.zhang@gmail.com>
This commit is contained in:
chlins 2020-08-17 12:41:02 +08:00
parent 0921beaf4c
commit 4f95c4d067
2 changed files with 6 additions and 5 deletions

View File

@ -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'

View File

@ -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