routes.rb 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. Huginn::Application.routes.draw do
  2. resources :agents do
  3. member do
  4. post :run
  5. post :handle_details_post
  6. put :leave_scenario
  7. delete :remove_events
  8. delete :memory, action: :destroy_memory
  9. end
  10. collection do
  11. put :toggle_visibility
  12. post :propagate
  13. get :type_details
  14. get :event_descriptions
  15. post :validate
  16. post :complete
  17. delete :undefined, action: :destroy_undefined
  18. end
  19. resources :logs, :only => [:index] do
  20. collection do
  21. delete :clear
  22. end
  23. end
  24. resources :events, :only => [:index]
  25. scope module: :agents do
  26. resources :dry_runs, only: [:index, :create]
  27. end
  28. end
  29. scope module: :agents do
  30. resources :dry_runs, only: [:index, :create]
  31. end
  32. resource :diagram, :only => [:show]
  33. resources :events, :only => [:index, :show, :destroy] do
  34. member do
  35. post :reemit
  36. end
  37. end
  38. resources :scenarios do
  39. collection do
  40. resource :scenario_imports, :only => [:new, :create]
  41. end
  42. member do
  43. get :share
  44. get :export
  45. put :enable_or_disable_all_agents
  46. end
  47. resource :diagram, :only => [:show]
  48. end
  49. resources :user_credentials, :except => :show do
  50. collection do
  51. post :import
  52. end
  53. end
  54. resources :services, :only => [:index, :destroy] do
  55. member do
  56. post :toggle_availability
  57. end
  58. end
  59. resources :jobs, :only => [:index, :destroy] do
  60. member do
  61. put :run
  62. end
  63. collection do
  64. delete :destroy_failed
  65. delete :destroy_all
  66. post :retry_queued
  67. end
  68. end
  69. namespace :admin do
  70. resources :users, except: :show do
  71. member do
  72. put :deactivate
  73. put :activate
  74. get :switch_to_user
  75. end
  76. collection do
  77. get :switch_back
  78. end
  79. end
  80. end
  81. get "/worker_status" => "worker_status#show"
  82. match "/users/:user_id/web_requests/:agent_id/:secret" => "web_requests#handle_request", :as => :web_requests, :via => [:get, :post, :put, :delete]
  83. post "/users/:user_id/webhooks/:agent_id/:secret" => "web_requests#handle_request" # legacy
  84. post "/users/:user_id/update_location/:secret" => "web_requests#update_location" # legacy
  85. devise_for :users,
  86. controllers: {
  87. omniauth_callbacks: 'omniauth_callbacks',
  88. registrations: 'users/registrations'
  89. },
  90. sign_out_via: [:post, :delete]
  91. if Rails.env.development?
  92. mount LetterOpenerWeb::Engine, at: "/letter_opener"
  93. end
  94. get "/about" => "home#about"
  95. root :to => "home#index"
  96. end