diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-21 02:50:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-21 02:50:22 +0300 |
commit | 9dc93a4519d9d5d7be48ff274127136236a3adb3 (patch) | |
tree | 70467ae3692a0e35e5ea56bcb803eb512a10bedb /lib/api/usage_data.rb | |
parent | 4b0f34b6d759d6299322b3a54453e930c6121ff0 (diff) |
Add latest changes from gitlab-org/gitlab@13-11-stable-eev13.11.0-rc43
Diffstat (limited to 'lib/api/usage_data.rb')
-rw-r--r-- | lib/api/usage_data.rb | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/api/usage_data.rb b/lib/api/usage_data.rb index c7d63f8d6ac..7deec15dcac 100644 --- a/lib/api/usage_data.rb +++ b/lib/api/usage_data.rb @@ -2,24 +2,22 @@ module API class UsageData < ::API::Base - before { authenticate! } + before { authenticate_non_get! } feature_category :usage_ping namespace 'usage_data' do before do - not_found! unless Feature.enabled?(:usage_data_api, default_enabled: true) + not_found! unless Feature.enabled?(:usage_data_api, default_enabled: :yaml, type: :ops) forbidden!('Invalid CSRF token is provided') unless verified_request? end desc 'Track usage data events' do detail 'This feature was introduced in GitLab 13.4.' end - params do requires :event, type: String, desc: 'The event name that should be tracked' end - post 'increment_counter' do event_name = params[:event] @@ -31,7 +29,6 @@ module API params do requires :event, type: String, desc: 'The event name that should be tracked' end - post 'increment_unique_users' do event_name = params[:event] @@ -39,6 +36,16 @@ module API status :ok end + + desc 'Get a list of all metric definitions' do + detail 'This feature was introduced in GitLab 13.11.' + end + get 'metric_definitions' do + content_type 'application/yaml' + env['api.format'] = :binary + + Gitlab::Usage::MetricDefinition.dump_metrics_yaml + end end end end |