fog-vsphere 1.9.2 → 1.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c0ca9adbc08b0aa2c4315f71619c527b7247acfc
4
- data.tar.gz: 20794599aae0172656042849f39fdd2b156df8ef
3
+ metadata.gz: db0f780c6c5076000b2b57254b785e90146d45e7
4
+ data.tar.gz: 2e4c439a77c42da160a258f34b71902f42ae7231
5
5
  SHA512:
6
- metadata.gz: '084edffdaf1a33f71796ed93d505473ff07934a8e2da787a9c0f5f9d4a01afb7c4bf3ee22d3532e987c563defe6eb820f2e431d4a54d5ae6ee7c6b22a6ab0e15'
7
- data.tar.gz: dd7b16ba29a06f92cbb0de94219505ee0fe1faafa4a919ca5c5bc03632c4c517bde33a00624aa7b6dc6d8de5f4f55a670d318ca5630e365077c9fadb80440dd2
6
+ metadata.gz: 3afe86e14e6bea538af974ad4015d0f7d3bba74f9c17473a4e71bc96e3ed5274acd053f075b7b6095cd591f6871daa3090015464fa3e2bf054cbaa8f87e09d06
7
+ data.tar.gz: 0ad8e324e32505f43950450efdab85ff466eb77943f3a2ec8ab01e1b5a37a8c5b998eedb5f1a7cc01776fa0e8b724bca5709866a1879b4f4328feb85d00a911e
@@ -1,3 +1,7 @@
1
+ ## v1.10.0
2
+
3
+ * Add request to rename VM
4
+
1
5
  ## v1.9.2
2
6
 
3
7
  * Properly escape regex characters in DC names for `list_clusters`
@@ -93,6 +93,7 @@ module Fog
93
93
  request :vm_reconfig_volumes
94
94
  request :vm_reconfig_cpus
95
95
  request :vm_reconfig_cdrom
96
+ request :vm_rename
96
97
  request :vm_config_vnc
97
98
  request :create_folder
98
99
  request :list_server_types
@@ -70,6 +70,11 @@ module Fog
70
70
  end
71
71
  # End Lazy Loaded Attributes
72
72
 
73
+ def vm_rename
74
+ requires :instance_uuid, :name
75
+ service.vm_rename('instance_uuid' => instance_uuid, 'name' => name)
76
+ end
77
+
73
78
  def vm_reconfig_memory(options = {})
74
79
  requires :instance_uuid, :memory
75
80
  service.vm_reconfig_memory('instance_uuid' => instance_uuid, 'memory' => memory_mb)
@@ -290,9 +295,10 @@ module Fog
290
295
  def save
291
296
  requires :name, :cluster, :datacenter
292
297
  if persisted?
293
- vm_reconfig_cpus if attribute_changed?(:cpus) || attribute_changed?(:corespersocket)
294
- vm_reconfig_memory if attribute_changed?(:memory_mb)
295
- vm_reconfig_volumes if attribute_changed?(:volumes)
298
+ vm_rename if attribute_changed?(:name)
299
+ vm_reconfig_cpus if attribute_changed?(:cpus) || attribute_changed?(:corespersocket)
300
+ vm_reconfig_memory if attribute_changed?(:memory_mb)
301
+ vm_reconfig_volumes if attribute_changed?(:volumes)
296
302
  else
297
303
  self.id = service.create_vm(attributes)
298
304
  end
@@ -0,0 +1,24 @@
1
+ module Fog
2
+ module Compute
3
+ class Vsphere
4
+ class Real
5
+ def vm_rename(options = {})
6
+ raise ArgumentError, "name is a required parameter" unless options.key? 'name'
7
+ raise ArgumentError, "instance_uuid is a required parameter" unless options.key? 'instance_uuid'
8
+ vm_mob_ref = get_vm_ref(options['instance_uuid'])
9
+ task = vm_mob_ref.Rename_Task(:newName => options['name'])
10
+ task.wait_for_completion
11
+ { 'task_state' => task.info.state }
12
+ end
13
+ end
14
+
15
+ class Mock
16
+ def vm_rename(options = {})
17
+ raise ArgumentError, "name is a required parameter" unless options.key? 'name'
18
+ raise ArgumentError, "instance_uuid is a required parameter" unless options.key? 'instance_uuid'
19
+ { 'task_state' => 'success' }
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Vsphere
3
- VERSION = '1.9.2'.freeze
3
+ VERSION = '1.10.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-vsphere
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.2
4
+ version: 1.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - J.R. Garcia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-11 00:00:00.000000000 Z
11
+ date: 2017-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-core
@@ -251,6 +251,7 @@ files:
251
251
  - lib/fog/vsphere/requests/compute/vm_reconfig_hardware.rb
252
252
  - lib/fog/vsphere/requests/compute/vm_reconfig_memory.rb
253
253
  - lib/fog/vsphere/requests/compute/vm_reconfig_volumes.rb
254
+ - lib/fog/vsphere/requests/compute/vm_rename.rb
254
255
  - lib/fog/vsphere/requests/compute/vm_suspend.rb
255
256
  - lib/fog/vsphere/requests/compute/vm_take_snapshot.rb
256
257
  - lib/fog/vsphere/version.rb