From 9533de87404e7ca98438b48a132d58ef479c67b4 Mon Sep 17 00:00:00 2001 From: Simon Johansson Date: Thu, 7 Nov 2013 11:44:52 +0000 Subject: [PATCH 1/2] Added VM.host_name --- esx.gemspec | 2 +- lib/esx.rb | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/esx.gemspec b/esx.gemspec index fd320d6..04226c7 100644 --- a/esx.gemspec +++ b/esx.gemspec @@ -5,7 +5,7 @@ Gem::Specification.new do |s| s.name = "esx" - s.version = "0.4.4" + s.version = "0.4.5" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Sergio Rubio", "Massimo Maino"] diff --git a/lib/esx.rb b/lib/esx.rb index 306fb2a..5788891 100644 --- a/lib/esx.rb +++ b/lib/esx.rb @@ -547,6 +547,13 @@ def ip_address guest_info.ip_address end + # + # Shortcut to GuestInfo.host_name + # + def host_name + guest_info.host_name + end + def nics list = [] vm_object.config.hardware.device.grep(RbVmomi::VIM::VirtualEthernetCard).each do |n| @@ -599,6 +606,10 @@ def ip_address _wrapped_object.ipAddress end + def host_name + _wrapped_object.hostName + end + def nics n = [] _wrapped_object.net.each do |nic| From 65b49361844d19d0f0780e03c17c964f133871e2 Mon Sep 17 00:00:00 2001 From: Simon Johansson Date: Thu, 7 Nov 2013 12:08:24 +0000 Subject: [PATCH 2/2] Add VM.rename --- esx.gemspec | 3 +-- lib/esx.rb | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/esx.gemspec b/esx.gemspec index 04226c7..22a33d7 100644 --- a/esx.gemspec +++ b/esx.gemspec @@ -5,7 +5,7 @@ Gem::Specification.new do |s| s.name = "esx" - s.version = "0.4.5" + s.version = "0.4.6" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Sergio Rubio", "Massimo Maino"] @@ -92,4 +92,3 @@ Gem::Specification.new do |s| s.add_dependency(%q, [">= 0"]) end end - diff --git a/lib/esx.rb b/lib/esx.rb index 5788891..7f147a8 100644 --- a/lib/esx.rb +++ b/lib/esx.rb @@ -562,6 +562,10 @@ def nics list end + def rename(new_name) + vm_object.Rename_Task ({"newName" => new_name}) + end + end class NetworkInterface