From 185aa881ac74da675cbd04fef870db92cc5c77de Mon Sep 17 00:00:00 2001 From: Adam Grare Date: Fri, 18 Oct 2024 11:10:41 -0400 Subject: [PATCH] Expose Vmware::Infra::Vm#set_description --- ..._service_manageiq-providers-vmware-infra_manager-vm.rb | 4 ++++ ...ice_manageiq-providers-vmware-infra_manager-vm_spec.rb | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-vmware-infra_manager-vm.rb b/lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-vmware-infra_manager-vm.rb index 675ed07f0..d391b4850 100644 --- a/lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-vmware-infra_manager-vm.rb +++ b/lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-vmware-infra_manager-vm.rb @@ -1,5 +1,9 @@ module MiqAeMethodService class MiqAeServiceManageIQ_Providers_Vmware_InfraManager_Vm < MiqAeServiceManageIQ_Providers_InfraManager_Vm + def set_description(new_description, options = {}) + sync_or_async_ems_operation(options[:sync], "set_description", [new_description]) + end + def set_number_of_cpus(count, options = {}) sync_or_async_ems_operation(options[:sync], "set_number_of_cpus", [count]) end diff --git a/spec/service_models/miq_ae_service_manageiq-providers-vmware-infra_manager-vm_spec.rb b/spec/service_models/miq_ae_service_manageiq-providers-vmware-infra_manager-vm_spec.rb index 4c0520a5c..2137f031a 100644 --- a/spec/service_models/miq_ae_service_manageiq-providers-vmware-infra_manager-vm_spec.rb +++ b/spec/service_models/miq_ae_service_manageiq-providers-vmware-infra_manager-vm_spec.rb @@ -15,6 +15,14 @@ } end + it "#set_description" do + service_vm.set_description("new-description") + + expect(MiqQueue.first).to have_attributes( + @base_queue_options.merge(:method_name => "set_description", :args => %w[new-description]) + ) + end + it "#set_number_of_cpus" do service_vm.set_number_of_cpus(1)