Skip to content

Commit

Permalink
Add 'start housekeeping task for a project' feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyril Dupont committed Nov 29, 2022
1 parent 27f4bc4 commit 9260b24
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions projects.go
Expand Up @@ -1983,3 +1983,27 @@ func (s *ProjectsService) TransferProject(pid interface{}, opt *TransferProjectO

return p, resp, err
}

// StartHousekeepingProject start the Housekeeping task for a project.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/projects.html#start-the-housekeeping-task-for-a-project
func (s *ProjectsService) StartHousekeepingProject(pid interface{}, options ...RequestOptionFunc) (*Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, err
}
u := fmt.Sprintf("projects/%s/housekeeping", PathEscape(project))

req, err := s.client.NewRequest(http.MethodPost, u, nil, options)
if err != nil {
return nil, err
}

resp, err := s.client.Do(req, nil)
if err != nil {
return resp, err
}

return resp, err
}

0 comments on commit 9260b24

Please sign in to comment.