-
Notifications
You must be signed in to change notification settings - Fork 6
/
routes.rb
142 lines (115 loc) · 4.33 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
Rails.application.routes.draw do
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
devise_for :users
root :to => 'pages#index'
# Frontend
resources :users, :except => :show
get '/graph' => 'data/blueprint_layouts#show', :defaults => {:api_scenario_id => 'latest', :id => 1}
namespace :api do
namespace :v3 do
resources :areas, :only => [:index, :show]
resources :scenarios, :only => [:show, :create, :update] do
member do
get :batch
get :application_demands
get :production_parameters
get :energy_flow
get :merit
put :dashboard
end
collection do
post :merge
end
get :templates, :on => :collection
resources :converters, :only => :show do
get :topology, :on => :collection
post :stats, :on => :collection
end
resources :inputs, :only => [:index, :show]
resource :flexibility_order, only: [] do
collection do
post :set
get :get
end
end
get 'curves/loads', to: 'curves#load_curves', as: :merit_download
get 'curves/price', to: 'curves#price_curve', as: :merit_price_download
get 'curves/household_heat',
to: 'curves#household_heat_curves',
as: :curves_household_heat_download
get 'curves/hydrogen',
to: 'curves#hydrogen',
as: :curves_hydrogen_download
# Old paths for Merit downloads.
get 'merit/loads', to: redirect('api/v3/scenarios/%{scenario_id}/curves/loads')
get 'merit/price', to: redirect('api/v3/scenarios/%{scenario_id}/curves/price')
end
resources :converters, :only => :show do
get :topology, :on => :collection
end
resources :inputs, :only => [:index, :show] do
get :list, :on => :collection
end
end
end
namespace :mechanical_turk do
root :to => 'turks#index'
resource :factory, :only => [:new, :create, :show]
resources :turks, :only => [:index, :show]
end
namespace :data do
get '/redirect' => "base#redirect", :as => 'redirect'
post '/restart' => 'pages#restart', :as => 'restart'
post '/clear_cache' => 'pages#clear_cache', :as => 'clear_cache'
scope '/:api_scenario_id' do
root :to => "pages#index", :api_scenario_id => 'latest'
get '', to: 'pages#index'
# The Graphviz
resource :layout, :except => [:new, :index, :create, :destroy] do
member { get 'yaml' }
end
resources :gqueries, :only => [:index, :show] do
get :result, :on => :member
collection do
get :test
post :test
get :result
end
end
resources :converters, :only => [:index, :show]
resources :carriers, :only => [:index, :show]
resource :area, :as => :area, :only => :show
resources :query_tables
resources :query_table_cells, :except => [:show, :index]
resources :inputs, :only => [:index, :show]
resources :scenarios, :only => [:index, :show, :edit, :update, :new, :create] do
put :fix, :on => :member
end
get '/checks/share_groups' => 'checks#share_groups'
get '/checks/gquery_results' => 'checks#gquery_results'
get '/checks/loops' => 'checks#loops'
get '/checks/expected_demand' => 'checks#expected_demand'
get '/checks/index' => 'checks#index'
get '/debug/merit_order' => 'debug#merit_order'
get '/debug/calculation' => 'debug#calculation'
get '/debug/gquery' => 'debug#gquery', :as => :debug_gql
get '/gql' => "gql#index"
get '/gql/search' => "gql#search", :as => :gql_search
get '/gql/log' => "gql#log", :as => :gql_log
get '/gql/warnings' => "gql#warnings", :as => :gql_warnings
get '/merit' => 'merit#index'
get '/merit/download',
to: redirect("api/v3/scenarios/%{api_scenario_id}/merit/loads.csv")
get '/merit/download_prices',
to: redirect("api/v3/scenarios/%{api_scenario_id}/merit/price.csv")
get 'search' => 'search#index', :as => :search
end
end
get '/data', to: redirect("data/latest")
namespace :etsource do
root :to => 'commits#index'
resources :commits, :only => [:index, :show] do
get :import, :on => :member
end
end
end