Sha256: e10ea8932a1b8037feb27cfa18f5791cf07b3177118f92b0292ce58d6693cec5

Contents?: true

Size: 658 Bytes

Versions: 20

Compression:

Stored size: 658 Bytes

Contents

module ForemanInventoryUpload
  class MissingHostsController < ::ApplicationController
    def index
      organizations = Organization.current || User.current.my_organizations
      organization_id = organizations.pluck(:id)
      payload = InsightsMissingHosts.where(organization_id: organization_id)

      render :json => payload
    end

    def remove_hosts
      organization_id = params[:organization_id]
      search_term = params[:search_term]

      task = ForemanTasks.async_task(ForemanInventoryUpload::Async::RemoveInsightsHostsJob, search_term, organization_id)

      render json: {
        task: task,
      }, status: :ok
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
foreman_rh_cloud-11.0.3 app/controllers/foreman_inventory_upload/missing_hosts_controller.rb
foreman_rh_cloud-9.0.59 app/controllers/foreman_inventory_upload/missing_hosts_controller.rb
foreman_rh_cloud-11.0.2 app/controllers/foreman_inventory_upload/missing_hosts_controller.rb
foreman_rh_cloud-11.0.1 app/controllers/foreman_inventory_upload/missing_hosts_controller.rb
foreman_rh_cloud-11.0.0 app/controllers/foreman_inventory_upload/missing_hosts_controller.rb
foreman_rh_cloud-9.0.58 app/controllers/foreman_inventory_upload/missing_hosts_controller.rb
foreman_rh_cloud-10.0.2 app/controllers/foreman_inventory_upload/missing_hosts_controller.rb
foreman_rh_cloud-9.0.57 app/controllers/foreman_inventory_upload/missing_hosts_controller.rb
foreman_rh_cloud-10.0.1 app/controllers/foreman_inventory_upload/missing_hosts_controller.rb
foreman_rh_cloud-9.0.56 app/controllers/foreman_inventory_upload/missing_hosts_controller.rb
foreman_rh_cloud-9.0.55 app/controllers/foreman_inventory_upload/missing_hosts_controller.rb
foreman_rh_cloud-9.0.54 app/controllers/foreman_inventory_upload/missing_hosts_controller.rb
foreman_rh_cloud-9.0.53 app/controllers/foreman_inventory_upload/missing_hosts_controller.rb
foreman_rh_cloud-9.0.52 app/controllers/foreman_inventory_upload/missing_hosts_controller.rb
foreman_rh_cloud-8.0.52 app/controllers/foreman_inventory_upload/missing_hosts_controller.rb
foreman_rh_cloud-9.0.51 app/controllers/foreman_inventory_upload/missing_hosts_controller.rb
foreman_rh_cloud-8.0.51 app/controllers/foreman_inventory_upload/missing_hosts_controller.rb
foreman_rh_cloud-8.0.50 app/controllers/foreman_inventory_upload/missing_hosts_controller.rb
foreman_rh_cloud-8.0.49 app/controllers/foreman_inventory_upload/missing_hosts_controller.rb
foreman_rh_cloud-8.0.48 app/controllers/foreman_inventory_upload/missing_hosts_controller.rb