From b795b481722c08fc837668b6c779bbb8ac047387 Mon Sep 17 00:00:00 2001 From: Greg McCullough Date: Fri, 7 Apr 2017 14:37:54 -0400 Subject: [PATCH] Merge pull request #86 from lfu/prevent_retirement_request Add policy checking for the retirement request. (cherry picked from commit c6c51d4e6580c866334629b627cefb955fd1801d) --- .../request_orchestration_stack_retire.yaml | 4 ++++ .../POLICY.class/request_service_retire.yaml | 6 ++++-- .../MiqEvent/POLICY.class/request_vm_retire.yaml | 6 ++++-- .../__methods__/check_policy_prevent.yaml | 12 ++++++++++++ .../event_handlers.class/check_policy_prevent.yaml | 12 ++++++++++++ 5 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 content/automate/ManageIQ/System/event_handlers.class/__methods__/check_policy_prevent.yaml create mode 100644 content/automate/ManageIQ/System/event_handlers.class/check_policy_prevent.yaml diff --git a/content/automate/ManageIQ/System/Event/MiqEvent/POLICY.class/request_orchestration_stack_retire.yaml b/content/automate/ManageIQ/System/Event/MiqEvent/POLICY.class/request_orchestration_stack_retire.yaml index 1ac047790..66fbea200 100644 --- a/content/automate/ManageIQ/System/Event/MiqEvent/POLICY.class/request_orchestration_stack_retire.yaml +++ b/content/automate/ManageIQ/System/Event/MiqEvent/POLICY.class/request_orchestration_stack_retire.yaml @@ -10,6 +10,10 @@ object: fields: - logical_event: value: request_orchestration_stack_retire + - rel1: + value: "/System/event_handlers/event_enforce_policy" + - rel2: + value: "/System/event_handlers/check_policy_prevent" - rel4: value: "/System/Process/parse_provider_category" - rel5: diff --git a/content/automate/ManageIQ/System/Event/MiqEvent/POLICY.class/request_service_retire.yaml b/content/automate/ManageIQ/System/Event/MiqEvent/POLICY.class/request_service_retire.yaml index f22a11bb3..97bfd074a 100644 --- a/content/automate/ManageIQ/System/Event/MiqEvent/POLICY.class/request_service_retire.yaml +++ b/content/automate/ManageIQ/System/Event/MiqEvent/POLICY.class/request_service_retire.yaml @@ -11,8 +11,10 @@ object: - logical_event: value: request_service_retire - rel1: + value: "/System/event_handlers/event_enforce_policy" + - rel2: + value: "/System/event_handlers/check_policy_prevent" + - rel3: value: "/Service/Retirement/StateMachines/Methods/GetRetirementEntryPoint" - rel4: value: "${/#retirement_entry_point}?service_id=${process#service_id}" - - rel5: - value: "/System/event_handlers/event_enforce_policy" diff --git a/content/automate/ManageIQ/System/Event/MiqEvent/POLICY.class/request_vm_retire.yaml b/content/automate/ManageIQ/System/Event/MiqEvent/POLICY.class/request_vm_retire.yaml index 4fc3369f1..6454011e3 100644 --- a/content/automate/ManageIQ/System/Event/MiqEvent/POLICY.class/request_vm_retire.yaml +++ b/content/automate/ManageIQ/System/Event/MiqEvent/POLICY.class/request_vm_retire.yaml @@ -10,9 +10,11 @@ object: fields: - logical_event: value: request_vm_retire + - rel2: + value: "/System/event_handlers/event_enforce_policy" + - rel3: + value: "/System/event_handlers/check_policy_prevent" - rel4: value: "/System/Process/parse_provider_category" - rel5: value: "/${/#ae_provider_category}/VM/Lifecycle/Retirement?vm_id=${process#vm_id}" - - rel6: - value: "/System/event_handlers/event_enforce_policy" diff --git a/content/automate/ManageIQ/System/event_handlers.class/__methods__/check_policy_prevent.yaml b/content/automate/ManageIQ/System/event_handlers.class/__methods__/check_policy_prevent.yaml new file mode 100644 index 000000000..2e236c704 --- /dev/null +++ b/content/automate/ManageIQ/System/event_handlers.class/__methods__/check_policy_prevent.yaml @@ -0,0 +1,12 @@ +--- +object_type: method +version: 1.0 +object: + attributes: + name: check_policy_prevent + display_name: + description: + scope: instance + language: ruby + location: builtin + inputs: [] diff --git a/content/automate/ManageIQ/System/event_handlers.class/check_policy_prevent.yaml b/content/automate/ManageIQ/System/event_handlers.class/check_policy_prevent.yaml new file mode 100644 index 000000000..777f7242f --- /dev/null +++ b/content/automate/ManageIQ/System/event_handlers.class/check_policy_prevent.yaml @@ -0,0 +1,12 @@ +--- +object_type: instance +version: 1.0 +object: + attributes: + display_name: + name: check_policy_prevent + inherits: + description: + fields: + - meth1: + value: check_policy_prevent