Sha256: 1f3d58190e12fa5db9371b834f96b8b815dd873632372fa182f18f69092e6f4c
Contents?: true
Size: 801 Bytes
Versions: 33
Compression:
Stored size: 801 Bytes
Contents
module ForemanInventoryUpload class TasksController < ::ApplicationController def create selected_org = Organization.current subscribed_hosts_ids = Set.new( ForemanInventoryUpload::Generators::Queries.for_slice( Host.unscoped.where(organization: selected_org) ).pluck(:id) ) if subscribed_hosts_ids.empty? return render json: { message: N_('Nothing to sync, there are no hosts with subscription for this organization.'), }, status: :method_not_allowed else host_statuses = InventorySync::Async::InventoryFullSync.perform_now(selected_org) end render json: { syncHosts: host_statuses[:sync], disconnectHosts: host_statuses[:disconnect], }, status: :ok end end end
Version data entries
33 entries across 33 versions & 1 rubygems