Class: ForemanNetbox::NetboxFacet

Inherits:
ApplicationRecord
  • Object
show all
Includes:
Facets::Base
Defined in:
app/models/foreman_netbox/netbox_facet.rb

Constant Summary collapse

COMMON_PARAMS =
%i[interfaces ip_addresses tenant].freeze
DEVICE_PARAMS =
%i[device device_role device_type manufacturer site].freeze
VIRTUAL_MACHINE_PARAMS =
%i[virtual_machine cluster cluster_type].freeze

Instance Method Summary collapse

Instance Method Details

#cached_netbox_paramsObject



22
23
24
# File 'app/models/foreman_netbox/netbox_facet.rb', line 22

def cached_netbox_params
  ForemanNetbox::CachedNetboxParameters.call(host)
end

#netbox_paramsObject



18
19
20
# File 'app/models/foreman_netbox/netbox_facet.rb', line 18

def netbox_params
  ForemanNetbox::NetboxParameters.call(host)
end

#netbox_params_diffObject



26
27
28
# File 'app/models/foreman_netbox/netbox_facet.rb', line 26

def netbox_params_diff
  ForemanNetbox::NetboxParametersComparator.call(cached_netbox_params, netbox_params)
end

#netbox_will_change?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'app/models/foreman_netbox/netbox_facet.rb', line 30

def netbox_will_change?
  netbox_params_diff.keys.any?
end

#synchronization_success?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'app/models/foreman_netbox/netbox_facet.rb', line 14

def synchronization_success?
  !synchronization_error
end