routes.rb 2.6 KB

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