Sha256: bac7d32c4fd4e73981851098bb6792845b7f087273be9113fa68083fe0f49bcd

Contents?: true

Size: 1.98 KB

Versions: 6

Compression:

Stored size: 1.98 KB

Contents

Foreman::Application.routes.draw do
  namespace :foreman_tasks do
    resources :recurring_logics, :only => [:index, :show] do
      member do
        post :cancel
        put :enable
        put :disable
      end
    end

    resources :tasks, :only => [:show] do
      collection do
        get 'auto_complete_search'
        get '/summary/:recent_timeframe', action: 'summary'
        get '/summary/:id/sub_tasks/:recent_timeframe', action: 'summary_sub_tasks'
      end
      member do
        post :abort
        post :cancel
        post :resume
        post :unlock
        post :force_unlock
        post :cancel_step
      end
    end
    resources :tasks, :only => [:show], constraints: ->(req) { req.format == :csv } do
      member do
        get :sub_tasks
      end
    end
    resources :tasks, :only => [:index], constraints: ->(req) { req.format == :csv }

    match '/tasks' => 'react#index', :via => [:get]
    match '/tasks/:id/sub_tasks' => 'react#index', :via => [:get]
    match '/ex_tasks/:id' => 'react#index', :via => [:get]

    namespace :api do
      resources :recurring_logics, :only => [:index, :show, :update] do
        member do
          post :cancel
        end
      end

      resources :tasks, :only => [:show, :index] do
        member do
          get :details
          get :sub_tasks
        end
        collection do
          post :bulk_search
          post :bulk_resume
          get :summary
          get '/summary/:id/sub_tasks/', action: 'summary_sub_tasks'
          post :callback
        end
      end
    end

    if ForemanTasks.dynflow.required?
      require 'dynflow/web'
      mount ForemanTasks.dynflow.web_console => '/dynflow'
      if defined? ::Sidekiq
        require 'sidekiq/web'
        redis_url = SETTINGS.dig(:dynflow, :redis_url)
        Sidekiq.redis = { url: redis_url }
        Sidekiq::Web.set :sessions, false
        mount Sidekiq::Web => '/sidekiq', :constraints => ForemanTasks::Dynflow::SidekiqConsoleConstraint.new
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
foreman-tasks-0.17.6 config/routes.rb
foreman-tasks-1.0.1 config/routes.rb
foreman-tasks-1.0.0 config/routes.rb
foreman-tasks-0.17.5 config/routes.rb
foreman-tasks-0.17.4 config/routes.rb
foreman-tasks-0.17.3 config/routes.rb