Sha256: d4aaf2a0f17d829bd837d508c5377f1e9da627ca7f673428859d2de507bc7f82

Contents?: true

Size: 793 Bytes

Versions: 23

Compression:

Stored size: 793 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

23 entries across 23 versions & 1 rubygems

Version Path
foreman-tasks-0.13.0 app/controllers/foreman_tasks/concerns/hosts_controller_extension.rb
foreman-tasks-0.12.2 app/controllers/foreman_tasks/concerns/hosts_controller_extension.rb
foreman-tasks-0.11.2 app/controllers/foreman_tasks/concerns/hosts_controller_extension.rb
foreman-tasks-0.12.1 app/controllers/foreman_tasks/concerns/hosts_controller_extension.rb
foreman-tasks-0.12.0 app/controllers/foreman_tasks/concerns/hosts_controller_extension.rb
foreman-tasks-0.11.1 app/controllers/foreman_tasks/concerns/hosts_controller_extension.rb
foreman-tasks-0.10.9 app/controllers/foreman_tasks/concerns/hosts_controller_extension.rb
foreman-tasks-0.11.0 app/controllers/foreman_tasks/concerns/hosts_controller_extension.rb
foreman-tasks-0.10.8 app/controllers/foreman_tasks/concerns/hosts_controller_extension.rb
foreman-tasks-0.10.7 app/controllers/foreman_tasks/concerns/hosts_controller_extension.rb
foreman-tasks-0.10.6 app/controllers/foreman_tasks/concerns/hosts_controller_extension.rb
foreman-tasks-0.10.4 app/controllers/foreman_tasks/concerns/hosts_controller_extension.rb
foreman-tasks-0.9.6 app/controllers/foreman_tasks/concerns/hosts_controller_extension.rb
foreman-tasks-0.10.3 app/controllers/foreman_tasks/concerns/hosts_controller_extension.rb
foreman-tasks-0.10.2 app/controllers/foreman_tasks/concerns/hosts_controller_extension.rb
foreman-tasks-0.10.1 app/controllers/foreman_tasks/concerns/hosts_controller_extension.rb
foreman-tasks-0.9.5 app/controllers/foreman_tasks/concerns/hosts_controller_extension.rb
foreman-tasks-0.10.0 app/controllers/foreman_tasks/concerns/hosts_controller_extension.rb
foreman-tasks-0.9.4 app/controllers/foreman_tasks/concerns/hosts_controller_extension.rb
foreman-tasks-0.9.3 app/controllers/foreman_tasks/concerns/hosts_controller_extension.rb