diff --git a/app/models/container_service.rb b/app/models/container_service.rb index 6f5d7cb5fc5..b269bce7e75 100644 --- a/app/models/container_service.rb +++ b/app/models/container_service.rb @@ -1,5 +1,6 @@ class ContainerService < ApplicationRecord include CustomAttributeMixin + include SupportsFeatureMixin # :name, :uid, :creation_timestamp, :resource_version, :namespace # :labels, :selector, :protocol, :port, :container_port, :portal_ip, :session_affinity diff --git a/app/models/metric/ci_mixin.rb b/app/models/metric/ci_mixin.rb index 8c1828d0cd6..c86fbdc59e4 100644 --- a/app/models/metric/ci_mixin.rb +++ b/app/models/metric/ci_mixin.rb @@ -19,6 +19,12 @@ module Metric::CiMixin Metric::LongTermAverages::AVG_METHODS_WITHOUT_OVERHEAD.each do |vcol| virtual_column vcol, :type => :float, :uses => :vim_performance_operating_ranges end + + supports :capture do + unless self.class.parent::MetricsCapture.instance_methods.include?(:perf_collect_metrics) + unsupported_reason_add(:metrics, _('This provider does not support metrics collection')) + end + end end def has_perf_data? diff --git a/app/models/miq_enterprise.rb b/app/models/miq_enterprise.rb index 3bb76bf8c6b..4e748d9325f 100644 --- a/app/models/miq_enterprise.rb +++ b/app/models/miq_enterprise.rb @@ -16,6 +16,7 @@ class MiqEnterprise < ApplicationRecord acts_as_miq_taggable + include SupportsFeatureMixin include AggregationMixin include MiqPolicyMixin diff --git a/app/models/miq_region.rb b/app/models/miq_region.rb index 36f2388224b..aeff15cf1d3 100644 --- a/app/models/miq_region.rb +++ b/app/models/miq_region.rb @@ -26,6 +26,7 @@ class MiqRegion < ApplicationRecord include ConfigurationManagementMixin include MiqPolicyMixin + include SupportsFeatureMixin include Metric::CiMixin alias_method :all_storages, :storages diff --git a/app/models/mixins/supports_feature_mixin.rb b/app/models/mixins/supports_feature_mixin.rb index acc680a2f23..aa5d61b0e6c 100644 --- a/app/models/mixins/supports_feature_mixin.rb +++ b/app/models/mixins/supports_feature_mixin.rb @@ -89,6 +89,7 @@ module SupportsFeatureMixin :launch_cockpit => 'Launch Cockpit UI', :live_migrate => 'Live Migration', :migrate => 'Migration', + :capture => 'Capture of Capacity & Utilization Metrics', :provisioning => 'Provisioning', :publish => 'Publishing', :quick_stats => 'Quick Stats', diff --git a/app/models/storage.rb b/app/models/storage.rb index e994845dc5d..d20790cacae 100644 --- a/app/models/storage.rb +++ b/app/models/storage.rb @@ -35,11 +35,11 @@ class Storage < ApplicationRecord include SerializedEmsRefObjMixin include FilterableMixin + include SupportsFeatureMixin include Metric::CiMixin include StorageMixin include AsyncDeleteMixin include AvailabilityMixin - include SupportsFeatureMixin include TenantIdentityMixin virtual_column :v_used_space, :type => :integer diff --git a/app/models/zone.rb b/app/models/zone.rb index f2b5e280d25..d71800fa729 100644 --- a/app/models/zone.rb +++ b/app/models/zone.rb @@ -28,6 +28,7 @@ class Zone < ApplicationRecord include AuthenticationMixin + include SupportsFeatureMixin include Metric::CiMixin include AggregationMixin include ConfigurationManagementMixin