diff --git a/app/controllers/api/physical_servers_controller.rb b/app/controllers/api/physical_servers_controller.rb new file mode 100644 index 00000000000..8ed5d719710 --- /dev/null +++ b/app/controllers/api/physical_servers_controller.rb @@ -0,0 +1,4 @@ +module Api + class PhysicalServersController < BaseController + end +end diff --git a/app/models/host.rb b/app/models/host.rb index 1988dbc8873..3b29a796fc0 100644 --- a/app/models/host.rb +++ b/app/models/host.rb @@ -91,6 +91,9 @@ class Host < ApplicationRecord has_many :host_aggregate_hosts, :dependent => :destroy has_many :host_aggregates, :through => :host_aggregate_hosts + # Physical server reference + belongs_to :physical_server, :inverse_of => :host + serialize :settings, Hash deprecate_attribute :address, :hostname diff --git a/app/models/physical_server.rb b/app/models/physical_server.rb index 8fda121f54a..2543d3fb2fb 100644 --- a/app/models/physical_server.rb +++ b/app/models/physical_server.rb @@ -5,6 +5,8 @@ class PhysicalServer < ApplicationRecord belongs_to :ext_management_system, :foreign_key => :ems_id, :class_name => "ManageIQ::Providers::PhysicalInfraManager" + has_one :host, inverse_of => :physical_server + def name_with_details details % { :name => name,