Sha256: 158310d8810c36ff2f8d2aaad2d33f3e11ad6e882b711b4ca503e33d028fd7d6

Contents?: true

Size: 1.12 KB

Versions: 17

Compression:

Stored size: 1.12 KB

Contents

module ForemanTasks
  module Api
    class RecurringLogicsController < ::Api::V2::BaseController
      include ::Api::Version2

      resource_description do
        resource_id 'recurring_logics'
        api_version 'v2'
        api_base_url '/foreman_tasks/api'
      end

      before_filter :find_resource, :only => %w{show cancel destroy}

      api :GET, '/recurring_logics', N_('List recurring logics')
      def index
        @recurring_logics = resource_scope_for_index
      end

      api :GET, '/recurring_logics/:id', N_('Show recurring logic details')
      param :id, :identifier, desc: "ID of the recurring logic", required: true
      def show
      end

      api :POST, '/recurring_logics/:id/cancel', N_('Cancel recurring logic')
      param :id, :identifier, desc: 'ID of the recurring logic', required: true
      def cancel
        process_response @recurring_logic.cancel
      end

      def resource_class
        ForemanTasks::RecurringLogic
      end

      def action_permission
        case params[:action]
        when 'cancel'
          'edit'
        else
          super
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
foreman-tasks-0.8.6 app/controllers/foreman_tasks/api/recurring_logics_controller.rb
foreman-tasks-0.8.5 app/controllers/foreman_tasks/api/recurring_logics_controller.rb
foreman-tasks-0.8.4 app/controllers/foreman_tasks/api/recurring_logics_controller.rb
foreman-tasks-0.8.3 app/controllers/foreman_tasks/api/recurring_logics_controller.rb
foreman-tasks-0.8.2 app/controllers/foreman_tasks/api/recurring_logics_controller.rb
foreman-tasks-0.8.1 app/controllers/foreman_tasks/api/recurring_logics_controller.rb
foreman-tasks-0.8.0 app/controllers/foreman_tasks/api/recurring_logics_controller.rb
foreman-tasks-0.7.20 app/controllers/foreman_tasks/api/recurring_logics_controller.rb
foreman-tasks-0.7.19 app/controllers/foreman_tasks/api/recurring_logics_controller.rb
foreman-tasks-0.7.18 app/controllers/foreman_tasks/api/recurring_logics_controller.rb
foreman-tasks-0.7.17 app/controllers/foreman_tasks/api/recurring_logics_controller.rb
foreman-tasks-0.7.16 app/controllers/foreman_tasks/api/recurring_logics_controller.rb
foreman-tasks-0.7.15 app/controllers/foreman_tasks/api/recurring_logics_controller.rb
foreman-tasks-0.7.14 app/controllers/foreman_tasks/api/recurring_logics_controller.rb
foreman-tasks-0.7.13 app/controllers/foreman_tasks/api/recurring_logics_controller.rb
foreman-tasks-0.7.12 app/controllers/foreman_tasks/api/recurring_logics_controller.rb
foreman-tasks-0.7.11 app/controllers/foreman_tasks/api/recurring_logics_controller.rb