routes.rb 17.4 KB
Newer Older
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
1
require 'sidekiq/web'
2
require 'api/api'
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
3

gitlabhq's avatar
gitlabhq committed
4
Gitlab::Application.routes.draw do
5 6 7 8 9 10 11 12 13 14
  namespace :ci do
    # CI API
    Ci::API::API.logger Rails.logger
    mount Ci::API::API => '/api'

    resource :lint, only: [:show, :create]

    resources :projects do
      collection do
        post :add
15
        get :disabled
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
      end

      member do
        get :status, to: 'projects#badge'
        get :integration
        post :toggle_shared_runners
        get :dumped_yaml
      end

      resources :services, only: [:index, :edit, :update] do
        member do
          get :test
        end
      end

31
      resources :commits, only: [] do
32 33 34
        member do
          get :status
          get :cancel
35 36 37
        end
      end

38
      resources :builds, only: [] do
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
        member do
          get :cancel
          get :status
          post :retry
        end
      end

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

      resources :events, only: [:index]
    end

    resource :user_sessions do
      get :auth
      get :callback
    end

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

      resources :events, only: [:index]

      resources :projects do
        resources :runner_projects
      end

      resources :builds, only: :index

      resource :application_settings, only: [:show, :update]
    end

    root to: 'projects#index'
  end

Valery Sizov's avatar
Valery Sizov committed
79
  use_doorkeeper do
80 81 82
    controllers applications: 'oauth/applications',
                authorized_applications: 'oauth/authorized_applications',
                authorizations: 'oauth/authorizations'
Valery Sizov's avatar
Valery Sizov committed
83
  end
84

85 86 87 88 89
  # Autocomplete
  get '/autocomplete/users' => 'autocomplete#users'
  get '/autocomplete/users/:id' => 'autocomplete#user'


90
  # Search
91 92
  get 'search' => 'search#show'
  get 'search/autocomplete' => 'search#autocomplete', as: :search_autocomplete
Valery Sizov's avatar
Valery Sizov committed
93

94
  # API
95 96
  API::API.logger Rails.logger
  mount API::API => '/api'
97

GitLab's avatar
GitLab committed
98
  # Get all keys of user
99 100
  get ':username.keys' => 'profiles/keys#get_keys' , constraints: { username: /.*/ }

101
  constraint = lambda { |request| request.env['warden'].authenticate? and request.env['warden'].user.admin? }
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
102
  constraints constraint do
103
    mount Sidekiq::Web, at: '/admin/sidekiq', as: :sidekiq
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
104
  end
Ariejan de Vroom's avatar
Ariejan de Vroom committed
105

106
  # Enable Grack support
107
  mount Grack::AuthSpawner, at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\//.match(request.path_info) }, via: [:get, :post]
108

109
  # Help
Job van der Voort's avatar
Job van der Voort committed
110
  get 'help'                  => 'help#index'
111
  get 'help/:category/:file'  => 'help#show', as: :help_page, constraints: { category: /.*/, file: /[^\/\.]+/ }
Marin Jankovski's avatar
Marin Jankovski committed
112
  get 'help/shortcuts'
113
  get 'help/ui'               => 'help#ui'
114

Andrew8xx8's avatar
Andrew8xx8 committed
115 116 117 118 119
  #
  # Global snippets
  #
  resources :snippets do
    member do
120
      get 'raw'
Andrew8xx8's avatar
Andrew8xx8 committed
121 122
    end
  end
123 124

  get '/s/:username' => 'snippets#index', as: :user_snippets, constraints: { username: /.*/ }
Andrew8xx8's avatar
Andrew8xx8 committed
125

Douwe Maan's avatar
Douwe Maan committed
126 127 128 129 130 131 132
  #
  # Invites
  #

  resources :invites, only: [:show], constraints: { id: /[A-Za-z0-9_-]+/ } do
    member do
      post :accept
Douwe Maan's avatar
Douwe Maan committed
133
      match :decline, via: [:get, :post]
Douwe Maan's avatar
Douwe Maan committed
134 135
    end
  end
136

137 138 139
  # Spam reports
  resources :abuse_reports, only: [:new, :create]

Valery Sizov's avatar
Valery Sizov committed
140
  #
141
  # Import
Valery Sizov's avatar
Valery Sizov committed
142
  #
143 144
  namespace :import do
    resource :github, only: [:create, :new], controller: :github do
Valery Sizov's avatar
Valery Sizov committed
145 146 147 148 149
      get :status
      get :callback
      get :jobs
    end

150
    resource :gitlab, only: [:create, :new], controller: :gitlab do
Valery Sizov's avatar
Valery Sizov committed
151 152 153 154
      get :status
      get :callback
      get :jobs
    end
Marcin Kulik's avatar
Marcin Kulik committed
155

Douwe Maan's avatar
Douwe Maan committed
156 157 158 159 160
    resource :bitbucket, only: [:create, :new], controller: :bitbucket do
      get :status
      get :callback
      get :jobs
    end
161

Marcin Kulik's avatar
Marcin Kulik committed
162 163 164 165 166
    resource :gitorious, only: [:create, :new], controller: :gitorious do
      get :status
      get :callback
      get :jobs
    end
167 168 169 170 171

    resource :google_code, only: [:create, :new], controller: :google_code do
      get :status
      post :callback
      get :jobs
172 173 174

      get   :new_user_map,    path: :user_map
      post  :create_user_map, path: :user_map
175
    end
Jared Szechy's avatar
Jared Szechy committed
176 177 178 179 180 181 182 183 184

    resource :fogbugz, only: [:create, :new], controller: :fogbugz do
      get :status
      post :callback
      get :jobs

      get   :new_user_map,    path: :user_map
      post  :create_user_map, path: :user_map
    end
Valery Sizov's avatar
Valery Sizov committed
185
  end
186

187 188 189
  #
  # Uploads
  #
190

191 192
  scope path: :uploads do
    # Note attachments and User/Group/Project avatars
193 194
    get ":model/:mounted_as/:id/:filename",
        to:           "uploads#show",
195
        constraints:  { model: /note|user|group|project/, mounted_as: /avatar|attachment/, filename: /[^\/]+/ }
196 197

    # Project markdown uploads
198
    get ":namespace_id/:project_id/:secret/:filename",
199
      to:           "projects/uploads#show",
200
      constraints:  { namespace_id: /[a-zA-Z.0-9_\-]+/, project_id: /[a-zA-Z.0-9_\-]+/, filename: /[^\/]+/ }
201
  end
Valery Sizov's avatar
Valery Sizov committed
202

203
  # Redirect old note attachments path to new uploads path.
204 205
  get "files/note/:id/:filename",
    to:           redirect("uploads/note/attachment/%{id}/%{filename}"),
206
    constraints:  { filename: /[^\/]+/ }
207

208
  #
Yatish Mehta's avatar
Yatish Mehta committed
209
  # Explore area
210
  #
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
211 212 213 214
  namespace :explore do
    resources :projects, only: [:index] do
      collection do
        get :trending
215
        get :starred
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
216 217 218
      end
    end

219
    resources :groups, only: [:index]
220
    resources :snippets, only: [:index]
221
    root to: 'projects#trending'
222 223
  end

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
224
  # Compatibility with old routing
225 226
  get 'public' => 'explore/projects#index'
  get 'public/projects' => 'explore/projects#index'
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
227

228 229 230
  #
  # Admin Area
  #
Nihad Abbasov's avatar
Nihad Abbasov committed
231
  namespace :admin do
232
    resources :users, constraints: { id: /[a-zA-Z.\/0-9_\-]+/ } do
233
      resources :keys, only: [:show, :destroy]
234
      resources :identities, only: [:index, :edit, :update, :destroy]
235

236
      member do
237 238 239
        get :projects
        get :keys
        get :groups
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
240
        put :team_update
241 242
        put :block
        put :unblock
243
        put :unlock
244
        put :confirm
245
        post :login_as
246
        patch :disable_two_factor
247
        delete 'remove/:email_id', action: 'remove_email', as: 'remove_email'
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
248 249
      end
    end
Andrey Kumanyaev's avatar
Andrey Kumanyaev committed
250

251
    resources :abuse_reports, only: [:index, :destroy]
Valery Sizov's avatar
Valery Sizov committed
252 253
    resources :applications

254 255
    resources :groups, constraints: { id: /[^\/]+/ } do
      member do
256
        put :members_update
257
      end
Andrey Kumanyaev's avatar
Andrey Kumanyaev committed
258
    end
Andrey Kumanyaev's avatar
Andrey Kumanyaev committed
259

260
    resources :deploy_keys, only: [:index, :new, :create, :destroy]
261

262
    resources :hooks, only: [:index, :create, :destroy] do
Valeriy Sizov's avatar
Valeriy Sizov committed
263 264
      get :test
    end
Andrey Kumanyaev's avatar
Andrey Kumanyaev committed
265

266
    resources :broadcast_messages, only: [:index, :create, :destroy]
267
    resource :logs, only: [:show]
268
    resource :background_jobs, controller: 'background_jobs', only: [:show]
269

Vinnie Okada's avatar
Vinnie Okada committed
270 271 272
    resources :namespaces, path: '/projects', constraints: { id: /[a-zA-Z.0-9_\-]+/ }, only: [] do
      root to: 'projects#index', as: :projects

273 274
      resources(:projects,
                path: '/',
Vinnie Okada's avatar
Vinnie Okada committed
275 276 277 278 279 280 281
                constraints: { id: /[a-zA-Z.0-9_\-]+/ },
                only: [:index, :show]) do
        root to: 'projects#show'

        member do
          put :transfer
        end
282 283 284
      end
    end

285 286 287
    resource :application_settings, only: [:show, :update] do
      resources :services
    end
288

Valery Sizov's avatar
Valery Sizov committed
289 290
    resources :labels

291
    root to: 'dashboard#index'
gitlabhq's avatar
gitlabhq committed
292 293
  end

randx's avatar
randx committed
294 295 296
  #
  # Profile Area
  #
297 298
  resource :profile, only: [:show, :update] do
    member do
299
      get :audit_log
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
300
      get :applications
301 302 303 304

      put :reset_private_token
      put :update_username
    end
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
305

306
    scope module: :profiles do
307 308 309 310 311
      resource :account, only: [:show, :update] do
        member do
          delete :unlink
        end
      end
312
      resource :notifications, only: [:show, :update]
313 314 315 316 317
      resource :password, only: [:new, :create, :edit, :update] do
        member do
          put :reset
        end
      end
318
      resource :preferences, only: [:show, :update]
319
      resources :keys
320
      resources :emails, only: [:index, :create, :destroy]
321
      resource :avatar, only: [:destroy]
322 323
      resource :two_factor_auth, only: [:new, :create, :destroy] do
        member do
324
          post :codes
325 326
        end
      end
327
    end
328
  end
329

330
  get 'u/:username/calendar' => 'users#calendar', as: :user_calendar,
331 332 333 334
      constraints: { username: /.*/ }

  get 'u/:username/calendar_activities' => 'users#calendar_activities', as: :user_calendar_activities,
      constraints: { username: /.*/ }
335

336
  get '/u/:username' => 'users#show', as: :user,
337
      constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ }
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
338

randx's avatar
randx committed
339 340 341
  #
  # Dashboard Area
  #
342 343 344 345
  resource :dashboard, controller: 'dashboard', only: [] do
    get :issues
    get :merge_requests
    get :activity
Douwe Maan's avatar
Douwe Maan committed
346 347 348

    scope module: :dashboard do
      resources :milestones, only: [:index, :show]
349

350
      resources :groups, only: [:index]
351
      resources :snippets, only: [:index]
352

353
      resources :projects, only: [:index] do
354 355 356 357
        collection do
          get :starred
        end
      end
Douwe Maan's avatar
Douwe Maan committed
358
    end
359 360

    root to: "dashboard/projects#index"
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
361
  end
gitlabhq's avatar
gitlabhq committed
362

randx's avatar
randx committed
363 364 365
  #
  # Groups Area
  #
366
  resources :groups, constraints: { id: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ }  do
randx's avatar
randx committed
367 368 369
    member do
      get :issues
      get :merge_requests
370
      get :projects
randx's avatar
randx committed
371
    end
372

Steven Thonus's avatar
Steven Thonus committed
373
    scope module: :groups do
374
      resources :group_members, only: [:index, :create, :update, :destroy] do
375
        post :resend_invite, on: :member
376
        delete :leave, on: :collection
377
      end
378

Steven Thonus's avatar
Steven Thonus committed
379
      resource :avatar, only: [:destroy]
Douwe Maan's avatar
Douwe Maan committed
380
      resources :milestones, only: [:index, :show, :update]
Steven Thonus's avatar
Steven Thonus committed
381
    end
randx's avatar
randx committed
382 383
  end

384
  resources :projects, constraints: { id: /[^\/]+/ }, only: [:index, :new, :create]
385

386
  devise_for :users, controllers: { omniauth_callbacks: :omniauth_callbacks, registrations: :registrations , passwords: :passwords, sessions: :sessions, confirmations: :confirmations }
gitlabhq's avatar
gitlabhq committed
387

388
  devise_scope :user do
389
    get '/users/auth/:provider/omniauth_error' => 'omniauth_callbacks#omniauth_error', as: :omniauth_error
390
  end
Vinnie Okada's avatar
Vinnie Okada committed
391

392
  root to: "root#index"
Vinnie Okada's avatar
Vinnie Okada committed
393

394 395 396
  #
  # Project Area
  #
Vinnie Okada's avatar
Vinnie Okada committed
397
  resources :namespaces, path: '/', constraints: { id: /[a-zA-Z.0-9_\-]+/ }, only: [] do
398
    resources(:projects, constraints: { id: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ }, except:
Vinnie Okada's avatar
Vinnie Okada committed
399 400 401 402 403 404 405 406
              [:new, :create, :index], path: "/") do
      member do
        put :transfer
        post :archive
        post :unarchive
        post :toggle_star
        post :markdown_preview
        get :autocomplete_sources
407
        get :activity
skv's avatar
skv committed
408
      end
409

Vinnie Okada's avatar
Vinnie Okada committed
410 411 412 413 414 415 416 417 418
      scope module: :projects do
        # Blob routes:
        get '/new/*id', to: 'blob#new', constraints: { id: /.+/ }, as: 'new_blob'
        post '/create/*id', to: 'blob#create', constraints: { id: /.+/ }, as: 'create_blob'
        get '/edit/*id', to: 'blob#edit', constraints: { id: /.+/ }, as: 'edit_blob'
        put '/update/*id', to: 'blob#update', constraints: { id: /.+/ }, as: 'update_blob'
        post '/preview/*id', to: 'blob#preview', constraints: { id: /.+/ }, as: 'preview_blob'

        scope do
419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435
          get(
            '/blob/*id/diff',
            to: 'blob#diff',
            constraints: { id: /.+/, format: false },
            as: :blob_diff
          )
          get(
            '/blob/*id',
            to: 'blob#show',
            constraints: { id: /.+/, format: false },
            as: :blob
          )
          delete(
            '/blob/*id',
            to: 'blob#destroy',
            constraints: { id: /.+/, format: false }
          )
436 437 438 439 440 441 442 443 444 445
          put(
            '/blob/*id',
            to: 'blob#update',
            constraints: { id: /.+/, format: false }
          )
          post(
            '/blob/*id',
            to: 'blob#create',
            constraints: { id: /.+/, format: false }
          )
Vinnie Okada's avatar
Vinnie Okada committed
446
        end
447

Vinnie Okada's avatar
Vinnie Okada committed
448 449 450 451 452 453 454
        scope do
          get(
            '/raw/*id',
            to: 'raw#show',
            constraints: { id: /.+/, format: /(html|js)/ },
            as: :raw
          )
455
        end
456

Vinnie Okada's avatar
Vinnie Okada committed
457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472
        scope do
          get(
            '/tree/*id',
            to: 'tree#show',
            constraints: { id: /.+/, format: /(html|js)/ },
            as: :tree
          )
        end

        scope do
          get(
            '/blame/*id',
            to: 'blame#show',
            constraints: { id: /.+/, format: /(html|js)/ },
            as: :blame
          )
473
        end
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
474

475 476 477 478
        scope do
          get(
            '/commits/*id',
            to: 'commits#show',
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
479
            constraints: { id: /(?:[^.]|\.(?!atom$))+/, format: /atom/ },
480 481 482 483 484 485
            as: :commits
          )
        end

        resource  :avatar, only: [:show, :destroy]
        resources :commit, only: [:show], constraints: { id: /[[:alnum:]]{6,40}/ } do
486 487 488 489
          member do
            get :branches
            get :ci
          end
490 491 492 493 494 495
        end

        resources :compare, only: [:index, :create]
        resources :network, only: [:show], constraints: { id: /(?:[^.]|\.(?!json$))+/, format: /json/ }

        resources :graphs, only: [:show], constraints: { id: /(?:[^.]|\.(?!json$))+/, format: /json/ } do
Vinnie Okada's avatar
Vinnie Okada committed
496 497
          member do
            get :commits
498
            get :ci
Vinnie Okada's avatar
Vinnie Okada committed
499
          end
500
        end
501

Vinnie Okada's avatar
Vinnie Okada committed
502 503
        get '/compare/:from...:to' => 'compare#show', :as => 'compare',
            :constraints => { from: /.+/, to: /.+/ }
504

Vinnie Okada's avatar
Vinnie Okada committed
505 506 507 508
        resources :snippets, constraints: { id: /\d+/ } do
          member do
            get 'raw'
          end
509
        end
510

Stan Hu's avatar
Stan Hu committed
511
        WIKI_SLUG_ID = { id: /[a-zA-Z.0-9_\-\/]+/ } unless defined? WIKI_SLUG_ID
512

Stan Hu's avatar
Stan Hu committed
513 514 515 516 517 518 519 520 521 522 523 524
        scope do
          # Order matters to give priority to these matches
          get '/wikis/git_access', to: 'wikis#git_access'
          get '/wikis/pages', to: 'wikis#pages', as: 'wiki_pages'
          post '/wikis', to: 'wikis#create'

          get '/wikis/*id/history', to: 'wikis#history', as: 'wiki_history', constraints: WIKI_SLUG_ID
          get '/wikis/*id/edit', to: 'wikis#edit', as: 'wiki_edit', constraints: WIKI_SLUG_ID

          get '/wikis/*id', to: 'wikis#show', as: 'wiki', constraints: WIKI_SLUG_ID
          delete '/wikis/*id', to: 'wikis#destroy', constraints: WIKI_SLUG_ID
          put '/wikis/*id', to: 'wikis#update', constraints: WIKI_SLUG_ID
525
        end
526

Vinnie Okada's avatar
Vinnie Okada committed
527 528 529 530 531
        resource :repository, only: [:show, :create] do
          member do
            get 'archive', constraints: { format: Gitlab::Regex.archive_formats_regex }
          end
        end
miks's avatar
miks committed
532

Vinnie Okada's avatar
Vinnie Okada committed
533 534 535 536
        resources :services, constraints: { id: /[^\/]+/ }, only: [:index, :edit, :update] do
          member do
            get :test
          end
537
        end
gitlabhq's avatar
gitlabhq committed
538

539
        resources :deploy_keys, constraints: { id: /\d+/ }, only: [:index, :new, :create] do
Vinnie Okada's avatar
Vinnie Okada committed
540 541 542 543
          member do
            put :enable
            put :disable
          end
544
        end
gitlabhq's avatar
gitlabhq committed
545

Vinnie Okada's avatar
Vinnie Okada committed
546 547 548 549 550 551 552 553 554 555 556
        resource :fork, only: [:new, :create]
        resource :import, only: [:new, :create, :show]

        resources :refs, only: [] do
          collection do
            get 'switch'
          end

          member do
            # tree viewer logs
            get 'logs_tree', constraints: { id: Gitlab::Regex.git_reference_regex }
557
            get 'logs_tree/*path' => 'refs#logs_tree', as: :logs_file, constraints: {
Vinnie Okada's avatar
Vinnie Okada committed
558 559 560 561
              id: Gitlab::Regex.git_reference_regex,
              path: /.*/
            }
          end
562
        end
563

Vinnie Okada's avatar
Vinnie Okada committed
564 565 566
        resources :merge_requests, constraints: { id: /\d+/ }, except: [:destroy] do
          member do
            get :diffs
567
            get :commits
568 569
            post :merge
            get :merge_check
Vinnie Okada's avatar
Vinnie Okada committed
570
            get :ci_status
Valery Sizov's avatar
tests  
Valery Sizov committed
571
            post :toggle_subscription
Vinnie Okada's avatar
Vinnie Okada committed
572 573 574 575 576 577 578
          end

          collection do
            get :branch_from
            get :branch_to
            get :update_branches
          end
579
        end
580

Vinnie Okada's avatar
Vinnie Okada committed
581 582 583
        resources :branches, only: [:index, :new, :create, :destroy], constraints: { id: Gitlab::Regex.git_reference_regex }
        resources :tags, only: [:index, :new, :create, :destroy], constraints: { id: Gitlab::Regex.git_reference_regex }
        resources :protected_branches, only: [:index, :create, :update, :destroy], constraints: { id: Gitlab::Regex.git_reference_regex }
584
        resource :variables, only: [:show, :update]
585
        resources :triggers, only: [:index, :create, :destroy]
586
        resource :ci_settings, only: [:edit, :update, :destroy]
587 588 589 590 591
        resources :ci_web_hooks, only: [:index, :create, :destroy] do
          member do
            get :test
          end
        end
Vinnie Okada's avatar
Vinnie Okada committed
592

593 594
        resources :builds, only: [:show]

Vinnie Okada's avatar
Vinnie Okada committed
595 596 597 598
        resources :hooks, only: [:index, :create, :destroy], constraints: { id: /\d+/ } do
          member do
            get :test
          end
599
        end
600

601
        resources :milestones, constraints: { id: /\d+/ } do
Vinnie Okada's avatar
Vinnie Okada committed
602 603 604 605
          member do
            put :sort_issues
            put :sort_merge_requests
          end
606
        end
607

Vinnie Okada's avatar
Vinnie Okada committed
608 609 610 611
        resources :labels, constraints: { id: /\d+/ } do
          collection do
            post :generate
          end
612
        end
613

Vinnie Okada's avatar
Vinnie Okada committed
614
        resources :issues, constraints: { id: /\d+/ }, except: [:destroy] do
Valery Sizov's avatar
Valery Sizov committed
615
          member do
Valery Sizov's avatar
tests  
Valery Sizov committed
616
            post :toggle_subscription
Valery Sizov's avatar
Valery Sizov committed
617
          end
Vinnie Okada's avatar
Vinnie Okada committed
618 619 620
          collection do
            post  :bulk_update
          end
621
        end
Robert Speicher's avatar
Robert Speicher committed
622

623
        resources :project_members, except: [:new, :edit], constraints: { id: /[a-zA-Z.\/0-9_\-#%+]+/ } do
Vinnie Okada's avatar
Vinnie Okada committed
624 625
          collection do
            delete :leave
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
626

Vinnie Okada's avatar
Vinnie Okada committed
627 628 629 630 631
            # Used for import team
            # from another project
            get :import
            post :apply_import
          end
632 633 634 635

          member do
            post :resend_invite
          end
636
        end
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
637

Vinnie Okada's avatar
Vinnie Okada committed
638 639 640 641
        resources :notes, only: [:index, :create, :destroy, :update], constraints: { id: /\d+/ } do
          member do
            delete :delete_attachment
          end
642
        end
643 644 645

        resources :uploads, only: [:create] do
          collection do
646
            get ":secret/:filename", action: :show, as: :show, constraints: { filename: /[^\/]+/ }
647
          end
648
        end
649

650 651 652 653 654 655 656
        resources :runners, only: [:index, :edit, :update, :destroy, :show] do
          member do
            get :resume
            get :pause
          end
        end
      end
657
    end
gitlabhq's avatar
gitlabhq committed
658
  end
659

660
  get ':id' => 'namespaces#show', constraints: { id: /(?:[^.]|\.(?!atom$))+/, format: /atom/ }
gitlabhq's avatar
gitlabhq committed
661
end