Project

General

Profile

Download (7.21 KB) Statistics
| Branch: | Tag: | Revision:
3d6d01c7 Ohad Levy
require 'api_constraints'

017e1049 Ohad Levy
Foreman::Application.routes.draw do
#ENC requests goes here
match "node/:name" => 'hosts#externalNodes', :constraints => { :name => /[^\.][\w\.-]+/ }
post "reports/create"
post "fact_values/create"

baa3d6f9 Ohad Levy
resources :reports, :only => [:index, :show, :destroy, :create] do
017e1049 Ohad Levy
collection do
get 'auto_complete_search'
end
bd5e3385 Ohad Levy
end
017e1049 Ohad Levy
match '(:controller)/help', :action => 'welcome', :as => "help"
constraints(:id => /[^\/]+/) do
resources :hosts do
member do
get 'clone'
get 'storeconfig_klasses'
get 'externalNodes'
get 'setBuild'
get 'cancelBuild'
get 'puppetrun'
get 'pxe_config'
put 'toggle_manage'
post 'environment_selected'
334d0359 Amos Benari
put 'power'
197e2dce Ohad Levy
get 'console'
017e1049 Ohad Levy
end
collection do
get 'show_search'
get 'multiple_actions'
get 'multiple_parameters'
post 'update_multiple_parameters'
get 'select_multiple_hostgroup'
post 'update_multiple_hostgroup'
get 'select_multiple_environment'
post 'update_multiple_environment'
0f9c9a06 Ohad Levy
get 'multiple_puppetrun'
post 'update_multiple_puppetrun'
017e1049 Ohad Levy
get 'multiple_destroy'
post 'submit_multiple_destroy'
get 'multiple_build'
post 'submit_multiple_build'
get 'reset_multiple'
get 'multiple_disable'
post 'submit_multiple_disable'
get 'multiple_enable'
post 'submit_multiple_enable'
get 'auto_complete_search'
get 'template_used'
get 'active'
9b41cf08 Ohad Levy
get 'pending'
017e1049 Ohad Levy
get 'out_of_sync'
get 'errors'
get 'disabled'
995b1748 Amos Benari
post 'current_parameters'
017e1049 Ohad Levy
post 'process_hostgroup'
post 'hostgroup_or_environment_selected'
post 'hypervisor_selected'
post 'architecture_selected'
post 'os_selected'
post 'domain_selected'
da6fa387 Ohad Levy
post 'use_image_selected'
334d0359 Amos Benari
post 'compute_resource_selected'
dd42df0a Ohad Levy
post 'medium_selected'
017e1049 Ohad Levy
end

constraints(:host_id => /[^\/]+/) do
resources :reports ,:only => [:index, :show]
resources :facts ,:only => :index, :controller => :fact_values
resources :puppetclasses ,:only => :index
resources :lookup_keys ,:only => :show
end
end

resources :bookmarks, :except => [:show]
resources :lookup_keys, :except => [:new, :create] do
resources :lookup_values, :only => [:index, :create, :update, :destroy]
end

resources :facts, :only => [:index, :show] do
constraints(:id => /[^\/]+/) do
resources :values, :only => :index, :controller => :fact_values, :as => "host_fact_values"
end
end

resources :hypervisors do
constraints(:id => /[^\/]+/) do
resources :guests, :controller => "Hypervisors::Guests", :except => [:edit] do
member do
put 'power'
end
end
end
end if SETTINGS[:libvirt]
c8ce839a Ohad Levy
end

d6e27caf Ohad Levy
resources :settings, :only => [:index, :update] do
collection do
get 'auto_complete_search'
end
end
017e1049 Ohad Levy
resources :common_parameters do
collection do
get 'auto_complete_search'
end
end
resources :environments do
collection do
get 'import_environments'
post 'obsolete_and_new'
get 'auto_complete_search'
end
end

resources :hostgroups do
member do
get 'nest'
get 'clone'
end
collection do
get 'auto_complete_search'
24e55891 Ohad Levy
post 'environment_selected'
post 'hypervisor_selected'
post 'architecture_selected'
post 'os_selected'
post 'domain_selected'
da6fa387 Ohad Levy
post 'use_image_selected'
dd42df0a Ohad Levy
post 'medium_selected'
017e1049 Ohad Levy
end
end

resources :puppetclasses do
collection do
get 'import_environments'
fc38fccd Florian Koch
post 'obsolete_and_new'
017e1049 Ohad Levy
get 'auto_complete_search'
end
constraints(:id => /[^\/]+/) do
resources :hosts
resources :lookup_keys, :except => [:show, :new, :create]
end
end

resources :smart_proxies, :except => [:show] do
constraints(:id => /[^\/]+/) do
resources :puppetca, :controller => "SmartProxies::Puppetca", :only => [:index, :update, :destroy]
resources :autosign, :controller => "SmartProxies::Autosign", :only => [:index, :new, :create, :destroy]
end
c8ce839a Ohad Levy
end

017e1049 Ohad Levy
resources :fact_values, :only => [:index] do
collection do
get 'auto_complete_search'
end
a7f78b19 Ohad Levy
end
017e1049 Ohad Levy
resources :notices, :only => :destroy
resources :audits do
collection do
get 'auto_complete_search'
end
31207a31 Ohad Levy
end
017e1049 Ohad Levy
if SETTINGS[:login]
resources :usergroups
resources :users do
collection do
get 'login'
post 'login'
get 'logout'
get 'auth_source_selected'
get 'auto_complete_search'
end
end
resources :roles do
collection do
get 'report'
post 'report'
get 'auto_complete_search'
end
end

resources :auth_source_ldaps
b96931f2 Ohad Levy
end
017e1049 Ohad Levy
if SETTINGS[:unattended]
constraints(:id => /[^\/]+/) do
resources :domains do
collection do
get 'auto_complete_search'
end
end
ddf9051a Ohad Levy
resources :config_templates do
017e1049 Ohad Levy
collection do
get 'auto_complete_search'
get 'build_pxe_default'
c4ba83b0 Ohad Levy
get 'revision'
017e1049 Ohad Levy
end
end
end

resources :operatingsystems do
member do
get 'bootfiles'
end
collection do
get 'auto_complete_search'
end
end
resources :media do
collection do
get 'auto_complete_search'
end
end

resources :models do
collection do
get 'auto_complete_search'
end
end

resources :architectures do
collection do
get 'auto_complete_search'
end
end

resources :ptables do
collection do
get 'auto_complete_search'
end
end

e170c321 Olivier Favre
constraints(:id => /[^\/]+/) do
resources :compute_resources do
334d0359 Amos Benari
member do
e170c321 Olivier Favre
post 'hardware_profile_selected'
post 'cluster_selected'
334d0359 Amos Benari
end
e170c321 Olivier Favre
constraints(:id => /[^\/]+/) do
resources :vms, :controller => "compute_resources_vms" do
member do
put 'power'
get 'console'
end
end
end
collection do
get 'auto_complete_search'
post 'provider_selected'
put 'test_connection'
end
resources :images
334d0359 Amos Benari
end
end

017e1049 Ohad Levy
resources :subnets, :except => [:show] do
collection do
get 'auto_complete_search'
get 'import'
post 'create_multiple'
post 'freeip'
end
end

match 'unattended/template/:id/:hostgroup', :to => "unattended#template"
2a0cffd3 Ohad Levy
end
017e1049 Ohad Levy
root :to => 'dashboard#index'
match 'dashboard', :to => 'dashboard#index', :as => "dashboard"
match 'dashboard/auto_complete_search', :to => 'hosts#auto_complete_search', :as => "auto_complete_search_dashboards"
match 'statistics', :to => 'statistics#index', :as => "statistics"
6187c1c4 Ohad Levy
match 'status', :to => 'home#status', :as => "status"
017e1049 Ohad Levy
# match for all unattended scripts
match 'unattended/(:action/(:id(.format)))', :controller => 'unattended'

dd42df0a Ohad Levy
resources :tasks, :only => [:show]

3d6d01c7 Ohad Levy
#Keep this line the last route
1b3cbe60 Amos Benari
match '*a', :to => 'errors#routing'
5563217a Ohad Levy
end