summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorAgustin Henze <tin@redhat.com>2019-04-09 14:53:44 +0000
committerKamil TrzciƄski <ayufan@ayufan.eu>2019-04-09 14:53:44 +0000
commit20093f9de0b34da88a8b01ca94ee773685b16308 (patch)
tree6418fff41e2f5deeb5f3839d90472b28c18cf942 /lib/api
parent67c330841271537eddad6fc938aa638d68f48a11 (diff)
downloadgitlab-ce-20093f9de0b34da88a8b01ca94ee773685b16308.tar.gz
Add new permission model `read-pipeline-variable`
Used to get the variables via the API endpoint `/projects/:id/pipelines/:pipeline_id/variables` Signed-off-by: Agustin Henze <tin@redhat.com>
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/pipelines.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/api/pipelines.rb b/lib/api/pipelines.rb
index ac8fe98e55e..f29a18e94cf 100644
--- a/lib/api/pipelines.rb
+++ b/lib/api/pipelines.rb
@@ -81,6 +81,19 @@ module API
present pipeline, with: Entities::Pipeline
end
+ desc 'Gets the variables for a given pipeline' do
+ detail 'This feature was introduced in GitLab 11.11'
+ success Entities::Variable
+ end
+ params do
+ requires :pipeline_id, type: Integer, desc: 'The pipeline ID'
+ end
+ get ':id/pipelines/:pipeline_id/variables' do
+ authorize! :read_pipeline_variable, pipeline
+
+ present pipeline.variables, with: Entities::Variable
+ end
+
desc 'Deletes a pipeline' do
detail 'This feature was introduced in GitLab 11.6'
http_codes [[204, 'Pipeline was deleted'], [403, 'Forbidden']]