Project

General

Profile

Download (1.32 KB) Statistics
| Branch: | Tag: | Revision:

foreman_docker / config / routes.rb @ master

1
Rails.application.routes.draw do
2
  resources :containers, :only => [:index, :new, :show, :destroy] do
3
    member do
4
      post :commit
5
      put :power
6
    end
7
  end
8

    
9
  resources :wizard_states, :only => [] do
10
    resources :steps, :controller => 'containers/steps', :only => [:show, :update]
11
  end
12

    
13
  resources :image_search, :only => [] do
14
    member do
15
      get :auto_complete_repository_name
16
      get :auto_complete_image_tag
17
      get :search_repository
18
    end
19
  end
20

    
21
  resources :registries, :except => [:show] do
22
    collection do
23
      get 'auto_complete_search'
24
    end
25
  end
26

    
27
  scope path: '/docker', as: :foreman_docker do
28
    namespace :api, :defaults => { :format => 'json' } do
29
      scope "(:apiv)", :module => :v2, :defaults => { :apiv => 'v2' }, :apiv => /v2/,
30
                       :constraints => ApiConstraints.new(:version => 2) do
31
        resources :containers, :only => [:index, :create, :show, :destroy] do
32
          member do
33
            get :logs
34
            put :power
35
          end
36
        end
37
        resources :compute_resources, :only => [] do
38
          resources :containers, :only => [:index, :create, :show, :destroy] do
39
            member do
40
              get :logs
41
              put :power
42
            end
43
          end
44
        end
45
        resources :registries, :except => [:new, :edit]
46
      end
47
    end
48
  end
49
end