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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/fog/vsphere/compute.rb +1 -0
- data/lib/fog/vsphere/models/compute/server.rb +9 -3
- data/lib/fog/vsphere/requests/compute/vm_rename.rb +24 -0
- data/lib/fog/vsphere/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db0f780c6c5076000b2b57254b785e90146d45e7
|
4
|
+
data.tar.gz: 2e4c439a77c42da160a258f34b71902f42ae7231
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3afe86e14e6bea538af974ad4015d0f7d3bba74f9c17473a4e71bc96e3ed5274acd053f075b7b6095cd591f6871daa3090015464fa3e2bf054cbaa8f87e09d06
|
7
|
+
data.tar.gz: 0ad8e324e32505f43950450efdab85ff466eb77943f3a2ec8ab01e1b5a37a8c5b998eedb5f1a7cc01776fa0e8b724bca5709866a1879b4f4328feb85d00a911e
|
data/CHANGELOG.md
CHANGED
data/lib/fog/vsphere/compute.rb
CHANGED
@@ -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
|
-
|
294
|
-
|
295
|
-
|
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
|
data/lib/fog/vsphere/version.rb
CHANGED
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.
|
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
|
+
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
|