Class: MiqAeMethodService::MiqAeServiceOrchestrationStack

Inherits:
MiqAeServiceModelBase show all
Includes:
MiqAeServiceRetirementMixin
Defined in:
lib/miq_automation_engine/service_models/miq_ae_service_orchestration_stack.rb

Constant Summary

Constants inherited from MiqAeServiceModelBase

MiqAeMethodService::MiqAeServiceModelBase::DELIMS, MiqAeMethodService::MiqAeServiceModelBase::EXPOSED_ATTR_BLACK_LIST, MiqAeMethodService::MiqAeServiceModelBase::SERVICE_MODEL_GLOB, MiqAeMethodService::MiqAeServiceModelBase::SERVICE_MODEL_PATH, MiqAeMethodService::MiqAeServiceModelBase::UNWISE

Instance Method Summary collapse

Methods included from MiqAeServiceRetirementMixin

#retirement_state=, #retirement_warn=, #retires_on=

Methods inherited from MiqAeServiceModelBase

ar_base_model, ar_method, #ar_method, association, association=, associations, #associations, base_class, base_model, inherited, #initialize, #inspect, #inspect_all, method_missing, #method_missing, model_name_from_active_record_model, model_name_from_file, #model_suffix, normalize, #object_class, #object_send, #reload, respond_to_missing?, service_models, #tag_assign, #tag_unassign, #taggable?, taggable?, #tagged_with?, #tags, #virtual_column_names, #virtual_columns_inspect, wrap_results, #wrap_results

Methods included from Vmdb::Logging

#_log

Methods included from MiqAeServiceObjectCommon

#[], #[]=, #attributes, #attributes=, #class_name, #current_field_name, #current_field_type, #current_message, #decrypt, #id, #instance_name, #name, #namespace, #parent

Constructor Details

This class inherits a constructor from MiqAeMethodService::MiqAeServiceModelBase

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class MiqAeMethodService::MiqAeServiceModelBase

Instance Method Details

#add_to_service(service) ⇒ Object

Raises:

  • (ArgumentError)

15
16
17
18
19
# File 'lib/miq_automation_engine/service_models/miq_ae_service_orchestration_stack.rb', line 15

def add_to_service(service)
  error_msg = "service must be a MiqAeServiceService"
  raise ArgumentError, error_msg unless service.kind_of?(MiqAeMethodService::MiqAeServiceService)
  ar_method { wrap_results(Service.find_by_id(service.id).add_resource!(@object)) }
end

#normalized_live_statusObject


28
29
30
31
32
# File 'lib/miq_automation_engine/service_models/miq_ae_service_orchestration_stack.rb', line 28

def normalized_live_status
  @object.raw_status.try(:normalized_status)
rescue MiqException::MiqOrchestrationStackNotExistError => err
  ['not_exist', err.message]
end

#remove_from_vmdbObject


21
22
23
24
25
26
# File 'lib/miq_automation_engine/service_models/miq_ae_service_orchestration_stack.rb', line 21

def remove_from_vmdb
  _log.info "Removing #{@object.class.name} id:<#{@object.id}>, name:<#{@object.name}>"
  object_send(:destroy)
  @object = nil
  true
end