Sha256: 12c5445623d1a72b73b154519a1851e7581be45350dbc813567df74af962236b

Contents?: true

Size: 789 Bytes

Versions: 69

Compression:

Stored size: 789 Bytes

Contents

module ForemanTasks
  module Concerns
    module HostsControllerExtension
      extend ActiveSupport::Concern

      included do
        alias_method_chain :facts, :dynflow
      end

      def facts_with_dynflow
        task = ForemanTasks.async_task(::Actions::Foreman::Host::ImportFacts,
                                       detect_host_type,
                                       params[:name],
                                       params[:facts],
                                       params[:certname],
                                       detected_proxy.try(:id))

        render :json => {:task_id => task.id}, :status => 202
      rescue ::Foreman::Exception => e
        render :json => {'message'=>e.to_s}, :status => :unprocessable_entity
      end

    end
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

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