summaryrefslogtreecommitdiff
path: root/config/routes/admin.rb
blob: e3b365ad276a992a7bef97ef33f200bec14a6111 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# frozen_string_literal: true

namespace :admin do
  resources :users, constraints: { id: %r{[a-zA-Z./0-9_\-]+} } do
    resources :keys, only: [:show, :destroy]
    resources :identities, except: [:show]
    resources :impersonation_tokens, only: [:index, :create] do
      member do
        put :revoke
      end
    end

    member do
      get :projects
      get :keys
      put :block
      put :unblock
      put :ban
      put :unban
      put :deactivate
      put :activate
      put :unlock
      put :confirm
      put :approve
      delete :reject
      post :impersonate
      patch :disable_two_factor
      delete 'remove/:email_id', action: 'remove_email', as: 'remove_email'
    end
  end

  resource :session, only: [:new, :create] do
    post 'destroy', action: :destroy, as: :destroy
  end

  resource :impersonation, only: :destroy

  resources :abuse_reports, only: [:index, :destroy]
  resources :gitaly_servers, only: [:index]

  namespace :serverless do
    resources :domains, only: [:index, :create, :update, :destroy] do
      member do
        post '/verify', to: 'domains#verify'
      end
    end
  end

  resources :spam_logs, only: [:index, :destroy] do
    member do
      post :mark_as_ham
    end
  end

  resources :applications

  resources :groups, only: [:index, :new, :create]

  scope(path: 'groups/*id',
        controller: :groups,
        constraints: { id: Gitlab::PathRegex.full_namespace_route_regex, format: /(html|json|atom)/ }) do
    scope(as: :group) do
      put :members_update
      get :edit, action: :edit
      get '/', action: :show
      patch '/', action: :update
      put '/', action: :update
      delete '/', action: :destroy
    end
  end

  resources :deploy_keys, only: [:index, :new, :create, :edit, :update, :destroy]

  resources :hooks, only: [:index, :create, :edit, :update, :destroy] do
    member do
      post :test
    end

    resources :hook_logs, only: [:show] do
      member do
        post :retry
      end
    end
  end

  resources :broadcast_messages, only: [:index, :edit, :create, :update, :destroy] do
    post :preview, on: :collection
  end

  get :instance_review, to: 'instance_review#index'

  resources :background_migrations, only: [:index] do
    member do
      post :pause
      post :resume
      post :retry
    end
  end

  resource :health_check, controller: 'health_check', only: [:show]
  resource :background_jobs, controller: 'background_jobs', only: [:show]

  resource :system_info, controller: 'system_info', only: [:show]
  resources :requests_profiles, only: [:index, :show], param: :name, constraints: { name: /.+\.(html|txt)/ }

  resources :projects, only: [:index]

  resources :usage_trends, only: :index
  resource :dev_ops_report, controller: 'dev_ops_report', only: :show
  resources :cohorts, only: :index

  scope(path: 'projects/*namespace_id',
        as: :namespace,
        constraints: { namespace_id: Gitlab::PathRegex.full_namespace_route_regex }) do
    resources(:projects,
              path: '/',
              constraints: { id: Gitlab::PathRegex.project_route_regex },
              only: [:show, :destroy]) do
      member do
        put :transfer
        post :repository_check
      end

      resources :runner_projects, only: [:create, :destroy]
    end
  end

  resource :application_settings, only: :update do
    resources :integrations, only: [:edit, :update] do
      member do
        get :overrides
        put :test
        post :reset
      end
    end

    get :usage_data
    put :reset_registration_token
    put :reset_health_check_token
    put :clear_repository_check_states
    match :general, :integrations, :repository, :ci_cd, :reporting, :metrics_and_profiling, :network, :preferences, via: [:get, :patch]
    get :lets_encrypt_terms_of_service

    post :create_self_monitoring_project
    get :status_create_self_monitoring_project
    delete :delete_self_monitoring_project
    get :status_delete_self_monitoring_project

    resource :appearances, only: [:show, :create, :update], path: 'appearance', module: 'application_settings' do
      member do
        get :preview_sign_in
        delete :logo
        delete :header_logos
        delete :favicon
      end
    end
  end

  resources :plan_limits, only: :create

  resources :labels

  resources :runners, only: [:index, :show, :update, :destroy] do
    member do
      post :resume
      post :pause
    end

    collection do
      get :tag_list, format: :json
      get :runner_setup_scripts, format: :json
    end
  end

  resources :jobs, only: :index do
    collection do
      post :cancel_all
    end
  end

  namespace :ci do
    resource :variables, only: [:show, :update]
  end

  concerns :clusterable

  get '/dashboard/stats', to: 'dashboard#stats'

  root to: 'dashboard#index'
end