Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-10-12 21:38:02 +0300
committerRobert Speicher <robert@gitlab.com>2016-10-12 21:38:02 +0300
commit58e2b44afe535100508eb4d49d7e7df24e408383 (patch)
tree297acd474db338de3de6290543e8f14bbe2c4252 /lib/api
parent5aa7b13c2ed61f22aa3be48b2ad5fe2ed6ea3a5e (diff)
parentb998479c81512b7c9a2cff28e7aabff3c4be0424 (diff)
Merge branch 'api-version' into 'master'
API: Version information ## What does this MR do? Adds a new endpoint to retrieve the version information. ## Why was this MR needed? Clients can now use this information to enable/disable certain API features depending on the version. ## What are the relevant issue numbers? Closes #22608, https://gitlab.com/gitlab-org/gitlab-ce/issues/23148 See merge request !6822
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/api.rb1
-rw-r--r--lib/api/version.rb12
2 files changed, 13 insertions, 0 deletions
diff --git a/lib/api/api.rb b/lib/api/api.rb
index c64d444842d..920d098bb24 100644
--- a/lib/api/api.rb
+++ b/lib/api/api.rb
@@ -72,6 +72,7 @@ module API
mount ::API::Triggers
mount ::API::Users
mount ::API::Variables
+ mount ::API::Version
route :any, '*path' do
error!('404 Not Found', 404)
diff --git a/lib/api/version.rb b/lib/api/version.rb
new file mode 100644
index 00000000000..9ba576bd828
--- /dev/null
+++ b/lib/api/version.rb
@@ -0,0 +1,12 @@
+module API
+ class Version < Grape::API
+ before { authenticate! }
+
+ desc 'Get the version information of the GitLab instance.' do
+ detail 'This feature was introduced in GitLab 8.13.'
+ end
+ get '/version' do
+ { version: Gitlab::VERSION, revision: Gitlab::REVISION }
+ end
+ end
+end