diff --git a/app/models/configuration_template.rb b/app/models/configuration_template.rb new file mode 100644 index 00000000000..dc4eddd9130 --- /dev/null +++ b/app/models/configuration_template.rb @@ -0,0 +1,3 @@ +class ConfigurationTemplate < ApplicationRecord + belongs_to :ext_management_system, :foreign_key => "ems_id" +end diff --git a/app/models/ems_refresh/save_inventory_physical_infra.rb b/app/models/ems_refresh/save_inventory_physical_infra.rb index ca678d3ac1d..88a60a2e844 100644 --- a/app/models/ems_refresh/save_inventory_physical_infra.rb +++ b/app/models/ems_refresh/save_inventory_physical_infra.rb @@ -23,6 +23,7 @@ def save_ems_physical_infra_inventory(ems, hashes, target = nil) child_keys = [ :physical_servers, + :configuration_templates ] # Save and link other subsections @@ -51,6 +52,20 @@ def save_physical_servers_inventory(ems, hashes, target = nil) store_ids_for_new_records(ems.physical_servers, hashes, :ems_ref) end + def save_configuration_templates_inventory(ems, hashes, target = nil) + target = ems if target.nil? + + ems.configuration_templates.reset + deletes = if target == ems + :use_association + else + [] + end + + save_inventory_multi(ems.configuration_templates, hashes, deletes, [:ems_ref]) + store_ids_for_new_records(ems.configuration_templates, hashes, :ems_ref) + end + # # Saves asset details information of a resource # diff --git a/app/models/ext_management_system.rb b/app/models/ext_management_system.rb index 643f3282fb7..b992d7aec1e 100644 --- a/app/models/ext_management_system.rb +++ b/app/models/ext_management_system.rb @@ -59,6 +59,7 @@ def self.supported_types_and_descriptions_hash has_many :customization_specs, :foreign_key => "ems_id", :dependent => :destroy, :inverse_of => :ext_management_system has_many :storage_profiles, :foreign_key => "ems_id", :dependent => :destroy, :inverse_of => :ext_management_system has_many :physical_servers, :foreign_key => "ems_id", :dependent => :destroy, :inverse_of => :ext_management_system + has_many :configuration_templates, :foreign_key => "ems_id", :dependent => :destroy, :inverse_of => :ext_management_system has_one :iso_datastore, :foreign_key => "ems_id", :dependent => :destroy, :inverse_of => :ext_management_system diff --git a/db/fixtures/miq_product_features.yml b/db/fixtures/miq_product_features.yml index d3926f0d2f7..d414f4910f7 100644 --- a/db/fixtures/miq_product_features.yml +++ b/db/fixtures/miq_product_features.yml @@ -6391,6 +6391,26 @@ :feature_type: view :identifier: guest_device_show +# Configuration Templates +- :name: Configuration Templates + :description: Everything under Configuration Templates + :feature_type: node + :identifier: configuration_template + :children: + - :name: View + :description: View Configuration Template + :feature_type: view + :identifier: configuration_template_view + :children: + - :name: List + :description: Display Lists of Configuration Templates + :feature_type: view + :identifier: configuration_template_show_list + - :name: Show + :description: Display Individual Configuration Templates + :feature_type: view + :identifier: configuration_template_show + # Physical Infrastructure Topology - :name: Physical Infra Topology :description: Physical Infra Topology