admin.rb 3.92 KB
Newer Older
1
namespace :admin do
2
  resources :users, constraints: { id: %r{[a-zA-Z./0-9_\-]+} } do
3 4
    resources :keys, only: [:show, :destroy]
    resources :identities, except: [:show]
5
    resources :impersonation_tokens, only: [:index, :create] do
6 7 8 9
      member do
        put :revoke
      end
    end
10 11 12 13 14 15 16 17 18

    member do
      get :projects
      get :keys
      put :block
      put :unblock
      put :unlock
      put :confirm
      post :impersonate
19
      post :reset_runners_minutes
20 21 22 23 24
      patch :disable_two_factor
      delete 'remove/:email_id', action: 'remove_email', as: 'remove_email'
    end
  end

25 26 27 28
  ## EE-specific
  resource :push_rule, only: [:show, :update]
  ## EE-specific

29 30 31
  resource :impersonation, only: :destroy

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

34 35 36 37 38 39 40 41
  resources :spam_logs, only: [:index, :destroy] do
    member do
      post :mark_as_ham
    end
  end

  resources :applications

42 43 44 45
  resources :groups, only: [:index, :new, :create]

  scope(path: 'groups/*id',
        controller: :groups,
46
        constraints: { id: Gitlab::PathRegex.full_namespace_route_regex, format: /(html|json|atom)/ }) do
47 48

    scope(as: :group) do
49
      put :members_update
50
      post :reset_runners_minutes
51 52 53 54 55
      get :edit, action: :edit
      get '/', action: :show
      patch '/', action: :update
      put '/', action: :update
      delete '/', action: :destroy
56 57 58
    end
  end

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

61 62 63 64
  resources :hooks, only: [:index, :create, :edit, :update, :destroy] do
    member do
      get :test
    end
65 66 67 68 69 70

    resources :hook_logs, only: [:show] do
      member do
        get :retry
      end
    end
71 72 73 74 75 76 77
  end

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

  resource :logs, only: [:show]
78 79 80
  resource :health_check, controller: 'health_check', only: [:show] do
    post :reset_storage_health
  end
81
  resource :background_jobs, controller: 'background_jobs', only: [:show]
82 83 84

  ## EE-specific
  resource :email, only: [:show, :create]
85
  resources :audit_logs, controller: 'audit_logs', only: [:index]
86 87
  ## EE-specific

88 89 90
  resource :system_info, controller: 'system_info', only: [:show]
  resources :requests_profiles, only: [:index, :show], param: :name, constraints: { name: /.+\.html/ }

91 92
  get 'conversational_development_index' => 'conversational_development_index#show'

93
  resources :projects, only: [:index]
94

95 96
  scope(path: 'projects/*namespace_id',
        as: :namespace,
97
        constraints: { namespace_id: Gitlab::PathRegex.full_namespace_route_regex }) do
98 99
    resources(:projects,
              path: '/',
100
              constraints: { id: Gitlab::PathRegex.project_route_regex },
101
              only: [:show]) do
102 103 104 105 106 107 108 109 110 111 112 113

      member do
        put :transfer
        post :repository_check
      end

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

  resource :appearances, only: [:show, :create, :update], path: 'appearance' do
    member do
114
      get :preview_sign_in
115 116 117 118 119 120 121
      delete :logo
      delete :header_logos
    end
  end

  resource :application_settings, only: [:show, :update] do
    resources :services, only: [:index, :edit, :update]
122 123

    get :usage_data
124 125 126 127 128
    put :reset_runners_token
    put :reset_health_check_token
    put :clear_repository_check_states
  end

129 130 131 132 133
  ## EE-specific
  resource :license, only: [:show, :new, :create, :destroy] do
    get :download, on: :member
  end

134
  resources :geo_nodes, only: [:index, :create, :new, :edit, :update, :destroy] do
135 136
    member do
      post :repair
137
      post :toggle
138
      get  :status
139 140 141 142
    end
  end
  ## EE-specific

143 144 145 146 147 148 149 150 151
  resources :labels

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

152
  resources :cohorts, only: :index
153

154
  resources :jobs, only: :index do
155 156 157 158 159 160 161
    collection do
      post :cancel_all
    end
  end

  root to: 'dashboard#index'
end