/
routes.rb
287 lines (260 loc) · 7.14 KB
/
routes.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
require 'api_constraints'
Foreman::Application.routes.draw do
#ENC requests goes here
match "node/:name" => 'hosts#externalNodes', :constraints => { :name => /[^\.][\w\.-]+/ }
post "reports/create"
post "fact_values/create"
resources :reports, :only => [:index, :show, :destroy, :create] do
collection do
get 'auto_complete_search'
end
end
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'
put 'power'
get 'console'
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'
get 'multiple_puppetrun'
post 'update_multiple_puppetrun'
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'
get 'pending'
get 'out_of_sync'
get 'errors'
get 'disabled'
get 'current_parameters'
get 'puppetclass_parameters'
post 'process_hostgroup'
post 'hostgroup_or_environment_selected'
post 'architecture_selected'
post 'os_selected'
post 'domain_selected'
post 'use_image_selected'
post 'compute_resource_selected'
post 'medium_selected'
end
constraints(:host_id => /[^\/]+/) do
resources :reports ,:only => [:index, :show]
resources :audits ,:only => :index
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]
collection do
get 'auto_complete_search'
end
end
resources :facts, :only => [:index, :show] do
constraints(:id => /[^\/]+/) do
resources :values, :only => :index, :controller => :fact_values, :as => "host_fact_values"
end
end
end
resources :settings, :only => [:index, :update] do
collection do
get 'auto_complete_search'
end
end
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 :trends do
collection do
post 'count'
end
end
resources :hostgroups do
member do
get 'nest'
get 'clone'
end
collection do
get 'auto_complete_search'
post 'environment_selected'
post 'architecture_selected'
post 'os_selected'
post 'domain_selected'
post 'use_image_selected'
post 'medium_selected'
end
end
resources :puppetclasses do
collection do
get 'import_environments'
post 'obsolete_and_new'
get 'auto_complete_search'
end
member do
get 'parameters'
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
end
resources :fact_values, :only => [:index] do
collection do
get 'auto_complete_search'
end
end
resources :notices, :only => :destroy
resources :audits do
collection do
get 'auto_complete_search'
end
end
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
end
if SETTINGS[:unattended]
constraints(:id => /[^\/]+/) do
resources :domains do
collection do
get 'auto_complete_search'
end
end
resources :config_templates do
collection do
get 'auto_complete_search'
get 'build_pxe_default'
get 'revision'
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
constraints(:id => /[^\/]+/) do
resources :compute_resources do
member do
post 'hardware_profile_selected'
post 'cluster_selected'
end
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
end
end
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"
end
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"
match 'status', :to => 'home#status', :as => "status"
# match for all unattended scripts
match 'unattended/(:action/(:id(.format)))', :controller => 'unattended'
resources :tasks, :only => [:show]
#Keep this line the last route
match '*a', :to => 'errors#routing'
end