diff --git a/api/build/list_org.go b/api/build/list_org.go index 1ccd8b45b..9758bbc6a 100644 --- a/api/build/list_org.go +++ b/api/build/list_org.go @@ -35,6 +35,33 @@ import ( // required: true // type: string // - in: query +// name: event +// description: Filter by build event +// type: string +// enum: +// - comment +// - deployment +// - pull_request +// - push +// - schedule +// - tag +// - in: query +// name: branch +// description: Filter builds by branch +// type: string +// - in: query +// name: status +// description: Filter by build status +// type: string +// enum: +// - canceled +// - error +// - failure +// - killed +// - pending +// - running +// - success +// - in: query // name: page // description: The page of results to retrieve // type: integer @@ -109,7 +136,7 @@ func ListBuildsForOrg(c *gin.Context) { // verify the event provided is a valid event type if event != constants.EventComment && event != constants.EventDeploy && event != constants.EventPush && event != constants.EventPull && - event != constants.EventTag { + event != constants.EventTag && event != constants.EventSchedule { retErr := fmt.Errorf("unable to process event %s: invalid event type provided", event) util.HandleError(c, http.StatusBadRequest, retErr) diff --git a/api/build/list_repo.go b/api/build/list_repo.go index 2dd71fc1a..f11d35b0b 100644 --- a/api/build/list_repo.go +++ b/api/build/list_repo.go @@ -45,11 +45,12 @@ import ( // description: Filter by build event // type: string // enum: -// - push +// - comment +// - deployment // - pull_request +// - push +// - schedule // - tag -// - deployment -// - comment // - in: query // name: commit // description: Filter builds based on the commit hash @@ -159,7 +160,7 @@ func ListBuildsForRepo(c *gin.Context) { // verify the event provided is a valid event type if event != constants.EventComment && event != constants.EventDeploy && event != constants.EventPush && event != constants.EventPull && - event != constants.EventTag { + event != constants.EventTag && event != constants.EventSchedule { retErr := fmt.Errorf("unable to process event %s: invalid event type provided", event) util.HandleError(c, http.StatusBadRequest, retErr)