Skip to content

Commit

Permalink
Fixed failure routes
Browse files Browse the repository at this point in the history
  • Loading branch information
MaartendeKruijf committed May 21, 2024
1 parent 8339d65 commit b1d7796
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
16 changes: 8 additions & 8 deletions routes/playbook/playbook_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ func NewPlaybookController(controller database.IController) *playbookController
// @Description return all stored playbooks default limit:100
// @Tags playbook
// @Produce json
// @success 200 {array} cacao.Playbook
// @error 400
// @success 200 {array} cacao.Playbook
// @failure 400 {object} api.Error
// @Router /playbook/ [GET]
func (plabookCtrl *playbookController) getAllPlaybooks(g *gin.Context) {
log.Trace("Trying to obtain all playbook IDs")
Expand All @@ -52,8 +52,8 @@ func (plabookCtrl *playbookController) getAllPlaybooks(g *gin.Context) {
// @Description get playbook meta information for playbook
// @Tags playbook
// @Produce json
// @success 200 {array} api.PlaybookMeta
// @error 400
// @success 200 {array} api.PlaybookMeta
// @failure 400 {object} api.Error
// @Router /playbook/meta [GET]
func (plabookCtrl *playbookController) getAllPlaybookMetas(g *gin.Context) {
log.Trace("Trying to obtain all playbook IDs")
Expand All @@ -78,7 +78,7 @@ func (plabookCtrl *playbookController) getAllPlaybookMetas(g *gin.Context) {
// @Accept json
// @Param data body cacao.Playbook true "playbook"
// @Success 200 {object} cacao.Playbook
// @error 400
// @failure 400 {object} api.Error
// @Router /playbook/ [POST]
func (plabookCtrl *playbookController) submitPlaybook(g *gin.Context) {
jsonData, err := io.ReadAll(g.Request.Body)
Expand Down Expand Up @@ -110,7 +110,7 @@ func (plabookCtrl *playbookController) submitPlaybook(g *gin.Context) {
// @Accept json
// @Param id path string true "playbook ID"
// @Success 200 {object} cacao.Playbook
// @error 400
// @failure 400 {object} api.Error
// @Router /playbook/{id} [GET]
func (plabookCtrl *playbookController) getPlaybookByID(g *gin.Context) {
id := g.Param("id")
Expand All @@ -136,7 +136,7 @@ func (plabookCtrl *playbookController) getPlaybookByID(g *gin.Context) {
// @Param id path string true "playbook Id"
// @Param data body cacao.Playbook true "playbook"
// @Success 200 {object} cacao.Playbook
// @error 400
// @failure 400 {object} api.Error
// @Router /playbook/{id} [PUT]
func (plabookCtrl *playbookController) updatePlaybookByID(g *gin.Context) {
id := g.Param("id")
Expand Down Expand Up @@ -167,7 +167,7 @@ func (plabookCtrl *playbookController) updatePlaybookByID(g *gin.Context) {
// @Accept json
// @Param id path string true "playbook ID"
// @Success 200
// @error 400
// @failure 400 {object} api.Error
// @Router /playbook/{id} [DELETE]
func (plabookCtrl *playbookController) deleteByPlaybookID(g *gin.Context) {
id := g.Param("id")
Expand Down
7 changes: 4 additions & 3 deletions routes/trigger/trigger_endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ import (
)

// trigger
//
// @Summary trigger a playbook by supplying a cacao playbook payload
// @Schemes
// @Description trigger playbook
// @Tags trigger
// @Accept json
// @Produce json
// @Param playbook body cacao.Playbook true "execute playbook by payload"
// @Success 200 "{"execution_id":"uuid","payload":"playbook--uuid"}"
// @error 400
// @Param playbook body cacao.Playbook true "execute playbook by payload"
// @Success 200 {object} api.Execution
// @failure 400 {object} api.Error
// @Router /trigger/playbook [POST]
func Routes(route *gin.Engine, trigger *TriggerApi) {
group := route.Group("/trigger")
Expand Down

0 comments on commit b1d7796

Please sign in to comment.