Class: Nic::Managed

Direct Known Subclasses

BMC, Bond, Bridge

Constant Summary

Constants included from DnsInterface

DnsInterface::RECORD_TYPES

Constants included from EncryptValue

EncryptValue::ENCRYPTION_PREFIX

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Exportable

#export_attr, #export_iterable, #to_export

Methods included from InterfaceCloning

#setup_object_clone

Methods included from DnsInterface

#dns_record

Methods included from Orchestration::ExternalIPAM

#generate_external_ipam_task_id

Methods included from SubnetsHelper

#minimal?, #subnet_type_f

Methods included from Orchestration::Common

#handle_validation_errors, #log_orchestration_errors

Methods included from Orchestration::TFTP

#generate_pxe_template, #rebuild_tftp, #rebuild_tftp_kind_safe, #tftp, #tftp6, #tftp6?, #tftp?, #tftp_ready?

Methods included from Orchestration::DNS

#dns6?, #dns?, #dns_conflict_detected?, #dns_ready?, #pending_dns_record_changes?, #queue_dns, #queue_dns_create, #queue_dns_destroy, #queue_dns_update, #queue_remove_dns_conflicts, #rebuild_dns, #reverse_dns6?, #reverse_dns?

Methods included from Orchestration::DHCP

#dhcp?, #dhcp_records, #generate_dhcp_task_id, #rebuild_dhcp, #reset_dhcp_record_cache

Methods included from Orchestration

#enable_orchestration!, #post_queue, #record_conflicts, #skip_orchestration!, #skip_orchestration?, #skip_orchestration_for_testing?, #valid?, #without_orchestration

Methods inherited from Interface

#alias?, #bridge, #bridge?, #fqdn_before_last_save, #mtu, #saved_change_to_fqdn?, #vlanid

Methods inherited from Base

allowed_types, #bmc?, #bond?, #bridge?, #children_mac_addresses, #clone, #compute_provides_ip?, default_ignored_attributes, #fqdn, #host_managed?, #hostname, #inheriting_mac, #ip6=, #ip=, #mac_based_ipam?, #matches_subnet?, #name=, #physical?, register_type, #require_ip4_validation?, #require_ip6_validation?, #required_ip_addresses_set?, #shortname, #to_audit_label, type_by_name, #type_name, #validated?

Methods included from Encryptable

#encrypt_setters

Methods included from EncryptValue

#decrypt_field, #encrypt_field, #encryption_key, #is_decryptable?, #is_encryptable?, #matches_prefix?, reset_warnings

Methods inherited from ApplicationRecord

graphql_type, #logger, logger

Methods included from AuditAssociations::AssociationsDefinitions

#audit_associations, #audited, #configure_dirty_associations, #normalize_associations

Class Method Details

.humanized_nameObject


63
64
65
# File 'app/models/nic/managed.rb', line 63

def self.humanized_name
  N_('Interface')
end

Instance Method Details

#ip6_available?Boolean

Returns:

  • (Boolean)

71
72
73
# File 'app/models/nic/managed.rb', line 71

def ip6_available?
  ip6.present? || compute_provides_ip?(:ip6)
end

#ip_available?Boolean

Returns:

  • (Boolean)

67
68
69
# File 'app/models/nic/managed.rb', line 67

def ip_available?
  ip.present? || compute_provides_ip?(:ip)
end

#mac_available?Boolean

Returns:

  • (Boolean)

75
76
77
# File 'app/models/nic/managed.rb', line 75

def mac_available?
  mac_addresses_for_provisioning.any? || (host.present? && host.compute_provides?(:mac))
end

#progress_report_idObject


47
48
49
50
51
52
53
# File 'app/models/nic/managed.rb', line 47

def progress_report_id
  if host&.respond_to?(:progress_report_id)
    host.progress_report_id
  else
    super
  end
end

#progress_report_id=(value) ⇒ Object


55
56
57
58
59
60
61
# File 'app/models/nic/managed.rb', line 55

def progress_report_id=(value)
  if host&.respond_to?(:progress_report_id=)
    host.progress_report_id = value
  else
    super
  end
end

#queueObject

this ensures we can create an interface even when there is no host queue e.g. outside to Host nested attributes


39
40
41
42
43
44
45
# File 'app/models/nic/managed.rb', line 39

def queue
  if host&.respond_to?(:queue)
    host.queue
  else
    super
  end
end