diff --git a/lib/miq_automation_engine/service_models/miq_ae_service_cloud_tenant.rb b/lib/miq_automation_engine/service_models/miq_ae_service_cloud_tenant.rb index c21094b9b..b9c8f46f3 100644 --- a/lib/miq_automation_engine/service_models/miq_ae_service_cloud_tenant.rb +++ b/lib/miq_automation_engine/service_models/miq_ae_service_cloud_tenant.rb @@ -2,5 +2,7 @@ module MiqAeMethodService class MiqAeServiceCloudTenant < MiqAeServiceModelBase expose :update_cloud_tenant expose :delete_cloud_tenant + require_relative "mixins/miq_ae_external_url_mixin" + include MiqAeExternalUrlMixin end end diff --git a/lib/miq_automation_engine/service_models/miq_ae_service_ext_management_system.rb b/lib/miq_automation_engine/service_models/miq_ae_service_ext_management_system.rb index b736e206f..b726ecea9 100644 --- a/lib/miq_automation_engine/service_models/miq_ae_service_ext_management_system.rb +++ b/lib/miq_automation_engine/service_models/miq_ae_service_ext_management_system.rb @@ -4,6 +4,8 @@ class MiqAeServiceExtManagementSystem < MiqAeServiceModelBase include MiqAeServiceInflectorMixin require_relative "mixins/miq_ae_service_custom_attribute_mixin" include MiqAeServiceCustomAttributeMixin + require_relative "mixins/miq_ae_external_url_mixin" + include MiqAeExternalUrlMixin expose :to_s expose :authentication_userid diff --git a/lib/miq_automation_engine/service_models/miq_ae_service_generic_object.rb b/lib/miq_automation_engine/service_models/miq_ae_service_generic_object.rb index 720e228f7..c68b807ab 100644 --- a/lib/miq_automation_engine/service_models/miq_ae_service_generic_object.rb +++ b/lib/miq_automation_engine/service_models/miq_ae_service_generic_object.rb @@ -2,6 +2,8 @@ module MiqAeMethodService class MiqAeServiceGenericObject < MiqAeServiceModelBase require_relative "mixins/miq_ae_service_remove_from_vmdb_mixin" include MiqAeServiceRemoveFromVmdb + require_relative "mixins/miq_ae_external_url_mixin" + include MiqAeExternalUrlMixin require 'drb' def add_to_service(service) diff --git a/lib/miq_automation_engine/service_models/miq_ae_service_miq_group.rb b/lib/miq_automation_engine/service_models/miq_ae_service_miq_group.rb index 7a9160bc4..a7e3807b2 100644 --- a/lib/miq_automation_engine/service_models/miq_ae_service_miq_group.rb +++ b/lib/miq_automation_engine/service_models/miq_ae_service_miq_group.rb @@ -2,6 +2,8 @@ module MiqAeMethodService class MiqAeServiceMiqGroup < MiqAeServiceModelBase require_relative "mixins/miq_ae_service_custom_attribute_mixin" include MiqAeServiceCustomAttributeMixin + require_relative "mixins/miq_ae_external_url_mixin" + include MiqAeExternalUrlMixin expose :filters, :method => :get_filters end diff --git a/lib/miq_automation_engine/service_models/miq_ae_service_service.rb b/lib/miq_automation_engine/service_models/miq_ae_service_service.rb index da1e90a2a..842a4f0d7 100644 --- a/lib/miq_automation_engine/service_models/miq_ae_service_service.rb +++ b/lib/miq_automation_engine/service_models/miq_ae_service_service.rb @@ -6,6 +6,8 @@ class MiqAeServiceService < MiqAeServiceModelBase include MiqAeServiceCustomAttributeMixin require_relative "mixins/miq_ae_service_remove_from_vmdb_mixin" include MiqAeServiceRemoveFromVmdb + require_relative "mixins/miq_ae_external_url_mixin" + include MiqAeExternalUrlMixin expose :retire_service_resources expose :automate_retirement_entrypoint diff --git a/lib/miq_automation_engine/service_models/miq_ae_service_user.rb b/lib/miq_automation_engine/service_models/miq_ae_service_user.rb index 66089fd9c..8bb288e95 100644 --- a/lib/miq_automation_engine/service_models/miq_ae_service_user.rb +++ b/lib/miq_automation_engine/service_models/miq_ae_service_user.rb @@ -2,6 +2,8 @@ module MiqAeMethodService class MiqAeServiceUser < MiqAeServiceModelBase require_relative "mixins/miq_ae_service_custom_attribute_mixin" include MiqAeServiceCustomAttributeMixin + require_relative "mixins/miq_ae_external_url_mixin" + include MiqAeExternalUrlMixin expose :current_tenant, :association => true expose :name diff --git a/lib/miq_automation_engine/service_models/miq_ae_service_vm.rb b/lib/miq_automation_engine/service_models/miq_ae_service_vm.rb index 28eb6eb36..3cc130ad7 100644 --- a/lib/miq_automation_engine/service_models/miq_ae_service_vm.rb +++ b/lib/miq_automation_engine/service_models/miq_ae_service_vm.rb @@ -1,5 +1,8 @@ module MiqAeMethodService class MiqAeServiceVm < MiqAeServiceVmOrTemplate + require_relative "mixins/miq_ae_external_url_mixin" + include MiqAeExternalUrlMixin + def remote_console_url=(url) object_send(:remote_console_url=, url, MiqAeEngine::DrbRemoteInvoker.workspace.ae_user.id) end diff --git a/lib/miq_automation_engine/service_models/mixins/miq_ae_external_url_mixin.rb b/lib/miq_automation_engine/service_models/mixins/miq_ae_external_url_mixin.rb new file mode 100644 index 000000000..22df62ecd --- /dev/null +++ b/lib/miq_automation_engine/service_models/mixins/miq_ae_external_url_mixin.rb @@ -0,0 +1,6 @@ +module MiqAeExternalUrlMixin + extend ActiveSupport::Concern + def external_url=(url) + object_send(:external_url=, url, MiqAeEngine::DrbRemoteInvoker.workspace.ae_user) + end +end