Skip to content

Commit

Permalink
server: api: rest: Fix methods of bench APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
ish-hcc committed Oct 6, 2024
1 parent 91a5d07 commit 66f3fe7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions server/pkg/api/rest/controller/benchmarkInfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func GetBenchmarkInfo(c echo.Context) error {
// @Success 200 {object} model.Benchmark "Successfully get information of the benchmark."
// @Failure 400 {object} common.ErrorResponse "Sent bad request."
// @Failure 500 {object} common.ErrorResponse "Failed to get information of the benchmark."
// @Router /bench/{connId}/run [get]
// @Router /bench/{connId}/run [post]
func RunBenchmarkInfo(c echo.Context) error {
connID := c.Param("connId")
if connID == "" {
Expand Down Expand Up @@ -127,7 +127,7 @@ func RunBenchmarkInfo(c echo.Context) error {
// @Success 200 {object} model.SimpleMsg "Benchmark Stopped."
// @Failure 400 {object} common.ErrorResponse "Sent bad request."
// @Failure 500 {object} common.ErrorResponse "Failed to stop of the benchmark."
// @Router /bench/{connId}/stop [get]
// @Router /bench/{connId}/stop [post]
func StopBenchmarkInfo(c echo.Context) error {
connID := c.Param("connId")
if connID == "" {
Expand Down
4 changes: 2 additions & 2 deletions server/pkg/api/rest/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const docTemplate = `{
}
},
"/bench/{connId}/run": {
"get": {
"post": {
"description": "Run the benchmark information of the connection information. If no Benchmark Agent is present on the connected server, it will be automatically installed, and the benchmark will be executed.",
"consumes": [
"application/json"
Expand Down Expand Up @@ -110,7 +110,7 @@ const docTemplate = `{
}
},
"/bench/{connId}/stop": {
"get": {
"post": {
"description": "Stop the benchmark",
"consumes": [
"application/json"
Expand Down
4 changes: 2 additions & 2 deletions server/pkg/api/rest/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
}
},
"/bench/{connId}/run": {
"get": {
"post": {
"description": "Run the benchmark information of the connection information. If no Benchmark Agent is present on the connected server, it will be automatically installed, and the benchmark will be executed.",
"consumes": [
"application/json"
Expand Down Expand Up @@ -103,7 +103,7 @@
}
},
"/bench/{connId}/stop": {
"get": {
"post": {
"description": "Stop the benchmark",
"consumes": [
"application/json"
Expand Down
4 changes: 2 additions & 2 deletions server/pkg/api/rest/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@ paths:
tags:
- '[Import] BenchmarkInfo'
/bench/{connId}/run:
get:
post:
consumes:
- application/json
description: Run the benchmark information of the connection information. If
Expand Down Expand Up @@ -1334,7 +1334,7 @@ paths:
tags:
- '[Import] BenchmarkInfo'
/bench/{connId}/stop:
get:
post:
consumes:
- application/json
description: Stop the benchmark
Expand Down

0 comments on commit 66f3fe7

Please sign in to comment.