diff --git a/src/api/rest/server/common/utility.go b/src/api/rest/server/common/utility.go index 55362b3e1..181c2b437 100644 --- a/src/api/rest/server/common/utility.go +++ b/src/api/rest/server/common/utility.go @@ -111,8 +111,8 @@ type ObjectList struct { Object []string `json:"object"` } -// func RestGetObjectList is a rest api wrapper for GetObjectList. -// RestGetObjectList godoc +// func RestGetObjects is a rest api wrapper for GetObjectList. +// RestGetObjects godoc // @Summary List all objects for a given key // @Description List all objects for a given key // @Tags Admin @@ -123,7 +123,7 @@ type ObjectList struct { // @Failure 404 {object} common.SimpleMsg // @Failure 500 {object} common.SimpleMsg // @Router /objects [get] -func RestGetObjectList(c echo.Context) error { +func RestGetObjects(c echo.Context) error { parentKey := c.QueryParam("key") fmt.Printf("[Get Tumblebug Object List] with Key: %s \n", parentKey) @@ -137,8 +137,8 @@ func RestGetObjectList(c echo.Context) error { return c.JSON(http.StatusOK, &objectList) } -// func RestGetObjectValue is a rest api wrapper for GetObjectValue. -// RestGetObjectValue godoc +// func RestGetObject is a rest api wrapper for GetObject. +// RestGetObject godoc // @Summary Get value of an object // @Description Get value of an object // @Tags Admin @@ -149,7 +149,7 @@ func RestGetObjectList(c echo.Context) error { // @Failure 404 {object} common.SimpleMsg // @Failure 500 {object} common.SimpleMsg // @Router /object [get] -func RestGetObjectValue(c echo.Context) error { +func RestGetObject(c echo.Context) error { parentKey := c.QueryParam("key") fmt.Printf("[Get Tumblebug Object Value] with Key: %s \n", parentKey) @@ -164,10 +164,10 @@ func RestGetObjectValue(c echo.Context) error { return c.JSON(http.StatusOK, &contentJSON) } -// func RestDeleteObjectValue is a rest api wrapper for DeleteObject. -// RestDeleteObjectValue godoc -// @Summary Delete value of an object -// @Description Delete value of an object +// func RestDeleteObject is a rest api wrapper for DeleteObject. +// RestDeleteObject godoc +// @Summary Delete an object +// @Description Delete an object // @Tags Admin // @Accept json // @Produce json @@ -195,8 +195,8 @@ func RestDeleteObject(c echo.Context) error { // func RestDeleteObjects is a rest api wrapper for DeleteObjects. // RestDeleteObjects godoc -// @Summary Delete objects -// @Description Delete objects +// @Summary Delete child objects along with the given object +// @Description Delete child objects along with the given object // @Tags Admin // @Accept json // @Produce json diff --git a/src/api/rest/server/server.go b/src/api/rest/server/server.go index 3ccdec139..eb3a5980e 100644 --- a/src/api/rest/server/server.go +++ b/src/api/rest/server/server.go @@ -128,8 +128,8 @@ func ApiServer() { e.GET("/tumblebug/config", rest_common.RestGetAllConfig) e.DELETE("/tumblebug/config", rest_common.RestDelAllConfig) - e.GET("/tumblebug/objects", rest_common.RestGetObjectList) - e.GET("/tumblebug/object", rest_common.RestGetObjectValue) + e.GET("/tumblebug/object", rest_common.RestGetObject) + e.GET("/tumblebug/objects", rest_common.RestGetObjects) e.DELETE("/tumblebug/object", rest_common.RestDeleteObject) e.DELETE("/tumblebug/objects", rest_common.RestDeleteObjects) diff --git a/src/docs/docs.go b/src/docs/docs.go index 20384f468..ccdeeaa4b 100644 --- a/src/docs/docs.go +++ b/src/docs/docs.go @@ -3142,7 +3142,7 @@ var doc = `{ } }, "delete": { - "description": "Delete value of an object", + "description": "Delete an object", "consumes": [ "application/json" ], @@ -3152,7 +3152,7 @@ var doc = `{ "tags": [ "Admin" ], - "summary": "Delete value of an object", + "summary": "Delete an object", "parameters": [ { "type": "string", @@ -3228,7 +3228,7 @@ var doc = `{ } }, "delete": { - "description": "Delete objects", + "description": "Delete child objects along with the given object", "consumes": [ "application/json" ], @@ -3238,7 +3238,7 @@ var doc = `{ "tags": [ "Admin" ], - "summary": "Delete objects", + "summary": "Delete child objects along with the given object", "parameters": [ { "type": "string", diff --git a/src/docs/swagger.json b/src/docs/swagger.json index 13a3c519d..07a6b73e6 100644 --- a/src/docs/swagger.json +++ b/src/docs/swagger.json @@ -3127,7 +3127,7 @@ } }, "delete": { - "description": "Delete value of an object", + "description": "Delete an object", "consumes": [ "application/json" ], @@ -3137,7 +3137,7 @@ "tags": [ "Admin" ], - "summary": "Delete value of an object", + "summary": "Delete an object", "parameters": [ { "type": "string", @@ -3213,7 +3213,7 @@ } }, "delete": { - "description": "Delete objects", + "description": "Delete child objects along with the given object", "consumes": [ "application/json" ], @@ -3223,7 +3223,7 @@ "tags": [ "Admin" ], - "summary": "Delete objects", + "summary": "Delete child objects along with the given object", "parameters": [ { "type": "string", diff --git a/src/docs/swagger.yaml b/src/docs/swagger.yaml index ebb23636d..fd7ac905f 100644 --- a/src/docs/swagger.yaml +++ b/src/docs/swagger.yaml @@ -3117,7 +3117,7 @@ paths: delete: consumes: - application/json - description: Delete value of an object + description: Delete an object parameters: - description: delete object value by key in: query @@ -3139,7 +3139,7 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/common.SimpleMsg' - summary: Delete value of an object + summary: Delete an object tags: - Admin get: @@ -3174,7 +3174,7 @@ paths: delete: consumes: - application/json - description: Delete objects + description: Delete child objects along with the given object parameters: - description: Delete child objects based on the given key string in: query @@ -3196,7 +3196,7 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/common.SimpleMsg' - summary: Delete objects + summary: Delete child objects along with the given object tags: - Admin get: