Project

General

Profile

Revision 5274f6bc

Added by Daniel Lobato Garcia over 7 years ago

Fixes #7874 - Docker Containers API

Routes are namespaced, code still needs to be namespaced

View differences:

config/routes.rb
11 11
  end
12 12

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

  
19
  resources :registries, :only => [:index, :new, :create, :update, :destroy, :edit]
21
  resources :registries, :except => [:show]
22

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

Also available in: Unified diff