diff --git a/app/models/container_group_performance.rb b/app/models/container_group_performance.rb new file mode 100644 index 00000000000..b2bebf17e0a --- /dev/null +++ b/app/models/container_group_performance.rb @@ -0,0 +1,5 @@ +class ContainerGroupPerformance < MetricRollup + default_scope { where "resource_type = 'ContainerGroup' and resource_id IS NOT NULL" } + + belongs_to :container_group, :foreign_key => :resource_id, :class_name => ContainerGroup.name +end diff --git a/app/models/container_node_performance.rb b/app/models/container_node_performance.rb new file mode 100644 index 00000000000..b429025c195 --- /dev/null +++ b/app/models/container_node_performance.rb @@ -0,0 +1,5 @@ +class ContainerNodePerformance < MetricRollup + default_scope { where "resource_type = 'ContainerNode' and resource_id IS NOT NULL" } + + belongs_to :container_node, :foreign_key => :resource_id, :class_name => ContainerNode.name +end diff --git a/app/models/container_performance.rb b/app/models/container_performance.rb new file mode 100644 index 00000000000..1871e34a094 --- /dev/null +++ b/app/models/container_performance.rb @@ -0,0 +1,5 @@ +class ContainerPerformance < MetricRollup + default_scope { where "resource_type = 'Container' and resource_id IS NOT NULL" } + + belongs_to :container_node, :foreign_key => :resource_id, :class_name => Container.name +end diff --git a/app/models/container_project_performance.rb b/app/models/container_project_performance.rb new file mode 100644 index 00000000000..27a4e94287c --- /dev/null +++ b/app/models/container_project_performance.rb @@ -0,0 +1,5 @@ +class ContainerProjectPerformance < MetricRollup + default_scope { where "resource_type = 'ContainerProject' and resource_id IS NOT NULL" } + + belongs_to :container_node, :foreign_key => :resource_id, :class_name => ContainerProject.name +end diff --git a/lib/miq_expression.rb b/lib/miq_expression.rb index 40e38938250..3b76f911445 100644 --- a/lib/miq_expression.rb +++ b/lib/miq_expression.rb @@ -17,11 +17,15 @@ class MiqExpression ManageIQ::Providers::Foreman::ConfigurationManager::ConfiguredSystem ManageIQ::Providers::ConfigurationManager Container + ContainerPerformance ContainerGroup + ContainerGroupPerformance ContainerImage ContainerImageRegistry ContainerNode + ContainerNodePerformance ContainerProject + ContainerProjectPerformance ContainerReplicator ContainerRoute ContainerService @@ -1330,6 +1334,8 @@ def self.get_column_details(column_names, class_path, assoc_path, opts) next(c) if includes.include?(c) c if includes.detect { |incl| c.match(incl) } end.compact + when base_model.starts_with?("Container") + excludes += ["^.*derived_host_count_off$", "^.*derived_host_count_on$", "^.*derived_vm_count_off$", "^.*derived_vm_count_on$", "^.*derived_storage.*$"] end column_names.collect do|c| diff --git a/locale/en.yml b/locale/en.yml index 01bae87f2b9..fa2d86f112a 100644 --- a/locale/en.yml +++ b/locale/en.yml @@ -700,11 +700,15 @@ en: CustomButton: Button CustomButtonSet: Buttons Group Container: Container + ContainerPerformance: Performance - Container ContainerGroup: Pod + ContainerGroupPerformance: Performance - Pod ContainerImageRegistry: Image Registry ContainerImage: Container Image ContainerNode: Node + ContainerNodePerformance: Performance - ContainerNode ContainerProject: Project + ContainerProjectPerformance: Performance - ContainerProject ContainerRoute: Route ContainerReplicator: Replicator ContainerService: Container Service