summaryrefslogtreecommitdiff
path: root/lib/api/pipelines.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/pipelines.rb')
-rw-r--r--lib/api/pipelines.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/api/pipelines.rb b/lib/api/pipelines.rb
index 1cfb982c04b..d4bd4e71343 100644
--- a/lib/api/pipelines.rb
+++ b/lib/api/pipelines.rb
@@ -81,6 +81,21 @@ module API
present pipeline, with: Entities::Pipeline
end
+ desc 'Deletes a pipeline' do
+ detail 'This feature was introduced in GitLab 11.6'
+ http_codes [[204, 'Pipeline was deleted'], [403, 'Forbidden']]
+ end
+ params do
+ requires :pipeline_id, type: Integer, desc: 'The pipeline ID'
+ end
+ delete ':id/pipelines/:pipeline_id' do
+ authorize! :admin_pipeline, user_project
+
+ AuditEventService.new(current_user, user_project).security_event
+
+ destroy_conditionally!(pipeline)
+ end
+
desc 'Retry builds in the pipeline' do
detail 'This feature was introduced in GitLab 8.11.'
success Entities::Pipeline