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
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/metadata.rb')
-rw-r--r--lib/api/metadata.rb57
1 files changed, 13 insertions, 44 deletions
diff --git a/lib/api/metadata.rb b/lib/api/metadata.rb
index 3e42ffe336a..788d9843c63 100644
--- a/lib/api/metadata.rb
+++ b/lib/api/metadata.rb
@@ -9,6 +9,8 @@ module API
before { authenticate! }
+ METADATA_TAGS = %w[metadata].freeze
+
feature_category :not_owned # rubocop:todo Gitlab/AvoidFeatureCategoryNotOwned
METADATA_QUERY = <<~EOF
@@ -21,6 +23,7 @@ module API
externalUrl
version
}
+ enterprise
}
}
EOF
@@ -35,30 +38,13 @@ module API
end
end
- desc 'Retrieve metadata information for this GitLab instance.' do
+ desc 'Retrieve metadata information for this GitLab instance' do
detail 'This feature was introduced in GitLab 15.2.'
- success [
- {
- code: 200,
- model: Entities::Metadata,
- message: 'successful operation',
- examples: {
- successful_response: {
- 'value' => {
- version: "15.0-pre",
- revision: "c401a659d0c",
- kas: {
- enabled: true,
- externalUrl: "grpc://gitlab.example.com:8150",
- version: "15.0.0"
- }
- }
- }
- }
- }
+ success Entities::Metadata
+ failure [
+ { code: 401, message: 'Unauthorized' }
]
- failure [{ code: 401, message: 'unauthorized operation' }]
- tags %w[metadata]
+ tags METADATA_TAGS
end
get '/metadata' do
run_metadata_query
@@ -66,31 +52,14 @@ module API
# Support the deprecated `/version` route.
# See https://gitlab.com/gitlab-org/gitlab/-/issues/366287
- desc 'Get the version information of the GitLab instance.' do
+ desc 'Retrieves version information for the GitLab instance' do
detail 'This feature was introduced in GitLab 8.13 and deprecated in 15.5. ' \
'We recommend you instead use the Metadata API.'
- success [
- {
- code: 200,
- model: Entities::Metadata,
- message: 'successful operation',
- examples: {
- 'Example' => {
- 'value' => {
- version: "15.0-pre",
- revision: "c401a659d0c",
- kas: {
- enabled: true,
- externalUrl: "grpc://gitlab.example.com:8150",
- version: "15.0.0"
- }
- }
- }
- }
- }
+ success Entities::Metadata
+ failure [
+ { code: 401, message: 'Unauthorized' }
]
- failure [{ code: 401, message: 'unauthorized operation' }]
- tags %w[metadata]
+ tags METADATA_TAGS
end
get '/version' do