From 2b04d098404f641f3111392875a07d0bc8944ab1 Mon Sep 17 00:00:00 2001 From: Andrey Menezes Date: Wed, 17 May 2017 18:16:01 -0300 Subject: [PATCH 1/2] Add power off/on events to automate control and the relationship to physical_server --- app/models/event_stream.rb | 1 + app/models/physical_server.rb | 1 + db/fixtures/miq_event_definition_sets.csv | 1 + db/fixtures/miq_event_definitions.csv | 6 ++++++ 4 files changed, 9 insertions(+) diff --git a/app/models/event_stream.rb b/app/models/event_stream.rb index d52965abcb2..abf6aa1c748 100644 --- a/app/models/event_stream.rb +++ b/app/models/event_stream.rb @@ -26,6 +26,7 @@ class EventStream < ApplicationRecord belongs_to :container_node belongs_to :middleware_server, :foreign_key => :middleware_server_id + belongs_to :physical_server after_commit :emit_notifications, :on => :create diff --git a/app/models/physical_server.rb b/app/models/physical_server.rb index 42e39ccd434..2577bbd267f 100644 --- a/app/models/physical_server.rb +++ b/app/models/physical_server.rb @@ -1,6 +1,7 @@ class PhysicalServer < ApplicationRecord include NewWithTypeStiMixin include MiqPolicyMixin + include TenantIdentityMixin include_concern 'Operations' acts_as_miq_taggable diff --git a/db/fixtures/miq_event_definition_sets.csv b/db/fixtures/miq_event_definition_sets.csv index b2f1c0f8c3b..6af147dc2ce 100644 --- a/db/fixtures/miq_event_definition_sets.csv +++ b/db/fixtures/miq_event_definition_sets.csv @@ -12,3 +12,4 @@ orchestration_process,Orchestration Lifecycle storage_operational,Datastore Operation auth_validation,Authentication Validation container_operations,Container Operation +phs_operations,Physical Server Operation diff --git a/db/fixtures/miq_event_definitions.csv b/db/fixtures/miq_event_definitions.csv index d1d72f15c31..51605d985bf 100644 --- a/db/fixtures/miq_event_definitions.csv +++ b/db/fixtures/miq_event_definitions.csv @@ -210,3 +210,9 @@ containerreplicator_successfulcreate,Replicator Successfully Created Pod,Default containerreplicator_compliance_check,Replicator Compliance Check,Default,compliance containerreplicator_compliance_passed,Replicator Compliance Passed,Default,compliance containerreplicator_compliance_failed,Replicator Compliance Failed,Default,compliance + +# +# Physical Servers Operations +# +phs_poweroff,PHS Power OFF,Default,phs_operations +phs_poweron,PHS Power ON,Default,phs_operations From 25142c90ad1f085a711097878cff95f60b257d46 Mon Sep 17 00:00:00 2001 From: Andrey Menezes Date: Tue, 30 May 2017 16:49:21 -0300 Subject: [PATCH 2/2] Add events to physical server operations --- db/fixtures/miq_event_definition_sets.csv | 2 +- db/fixtures/miq_event_definitions.csv | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/db/fixtures/miq_event_definition_sets.csv b/db/fixtures/miq_event_definition_sets.csv index 6af147dc2ce..7ca83f87655 100644 --- a/db/fixtures/miq_event_definition_sets.csv +++ b/db/fixtures/miq_event_definition_sets.csv @@ -12,4 +12,4 @@ orchestration_process,Orchestration Lifecycle storage_operational,Datastore Operation auth_validation,Authentication Validation container_operations,Container Operation -phs_operations,Physical Server Operation +physical_server_operations,Physical Server Operation diff --git a/db/fixtures/miq_event_definitions.csv b/db/fixtures/miq_event_definitions.csv index 51605d985bf..a8da27b26f1 100644 --- a/db/fixtures/miq_event_definitions.csv +++ b/db/fixtures/miq_event_definitions.csv @@ -212,7 +212,8 @@ containerreplicator_compliance_passed,Replicator Compliance Passed,Default,compl containerreplicator_compliance_failed,Replicator Compliance Failed,Default,compliance # -# Physical Servers Operations +# Physical Server Operations # -phs_poweroff,PHS Power OFF,Default,phs_operations -phs_poweron,PHS Power ON,Default,phs_operations +physical_server_shutdown,Physical Server Shutdown,Default,physical_server_operations +physical_server_start,Physical Server Start,Default,physical_server_operations +physical_server_reset,Physical Server Reset,Default,physical_server_operations