fog-vsphere 1.7.0 → 1.7.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +2 -1
- data/.rubocop.yml +8 -0
- data/.rubocop_todo.yml +217 -0
- data/.travis.yml +6 -7
- data/CHANGELOG.md +2 -6
- data/CONTRIBUTORS.md +10 -0
- data/Rakefile +10 -1
- data/lib/fog/vsphere/compute.rb +0 -2
- data/lib/fog/vsphere/models/compute/scsicontroller.rb +1 -6
- data/lib/fog/vsphere/models/compute/server.rb +7 -29
- data/lib/fog/vsphere/models/compute/ticket.rb +16 -0
- data/lib/fog/vsphere/models/compute/tickets.rb +25 -0
- data/lib/fog/vsphere/models/compute/volume.rb +28 -46
- data/lib/fog/vsphere/models/compute/volumes.rb +1 -1
- data/lib/fog/vsphere/requests/compute/create_vm.rb +44 -32
- data/lib/fog/vsphere/requests/compute/host_finish_maintenance.rb +14 -0
- data/lib/fog/vsphere/requests/compute/host_shutdown.rb +14 -0
- data/lib/fog/vsphere/requests/compute/host_start_maintenance.rb +14 -0
- data/lib/fog/vsphere/requests/compute/list_vm_scsi_controllers.rb +11 -4
- data/lib/fog/vsphere/requests/compute/list_vm_volumes.rb +1 -2
- data/lib/fog/vsphere/requests/compute/modify_vm_controller.rb +14 -2
- data/lib/fog/vsphere/requests/compute/modify_vm_volume.rb +3 -3
- data/lib/fog/vsphere/requests/compute/vm_acquire_ticket.rb +34 -0
- data/lib/fog/vsphere/requests/compute/vm_reconfig_volumes.rb +15 -26
- data/lib/fog/vsphere/requests/compute/vm_relocate.rb +54 -0
- data/lib/fog/vsphere/requests/compute/vm_remove_snapshot.rb +29 -0
- data/lib/fog/vsphere/requests/compute/vm_rename.rb +24 -0
- data/lib/fog/vsphere/requests/compute/vm_revert_snapshot.rb +29 -0
- data/lib/fog/vsphere/requests/compute/vm_suspend.rb +54 -0
- data/lib/fog/vsphere/version.rb +1 -1
- data/tests/class_from_string_tests.rb +3 -3
- data/tests/compute_tests.rb +16 -17
- data/tests/helpers/mock_helper.rb +3 -3
- data/tests/models/compute/cluster_tests.rb +4 -5
- data/tests/models/compute/hosts_tests.rb +2 -4
- data/tests/models/compute/rules_tests.rb +10 -16
- data/tests/models/compute/server_tests.rb +33 -29
- data/tests/models/compute/servers_tests.rb +2 -4
- data/tests/models/compute/ticket_tests.rb +12 -0
- data/tests/models/compute/tickets_tests.rb +8 -0
- data/tests/requests/compute/current_time_tests.rb +2 -4
- data/tests/requests/compute/folder_destroy_tests.rb +5 -7
- data/tests/requests/compute/get_network_tests.rb +18 -22
- data/tests/requests/compute/list_child_snapshots_tests.rb +1 -2
- data/tests/requests/compute/list_clusters_tests.rb +5 -6
- data/tests/requests/compute/list_datastores_tests.rb +6 -7
- data/tests/requests/compute/list_hosts_tests.rb +3 -4
- data/tests/requests/compute/list_networks_tests.rb +6 -7
- data/tests/requests/compute/list_storage_pods_test.rb +3 -4
- data/tests/requests/compute/list_virtual_machines_tests.rb +16 -20
- data/tests/requests/compute/list_vm_cdroms_tests.rb +1 -2
- data/tests/requests/compute/list_vm_snapshots_tests.rb +1 -2
- data/tests/requests/compute/modify_vm_cdrom_tests.rb +3 -4
- data/tests/requests/compute/revert_to_snapshot_tests.rb +2 -4
- data/tests/requests/compute/set_vm_customvalue_tests.rb +0 -2
- data/tests/requests/compute/vm_clone_tests.rb +20 -20
- data/tests/requests/compute/vm_config_vnc_tests.rb +3 -4
- data/tests/requests/compute/vm_destroy_tests.rb +1 -4
- data/tests/requests/compute/vm_migrate_tests.rb +1 -2
- data/tests/requests/compute/vm_power_off_tests.rb +2 -4
- data/tests/requests/compute/vm_power_on_tests.rb +1 -3
- data/tests/requests/compute/vm_reboot_tests.rb +2 -4
- data/tests/requests/compute/vm_reconfig_cdrom_tests.rb +2 -3
- data/tests/requests/compute/vm_reconfig_cpus_tests.rb +1 -3
- data/tests/requests/compute/vm_reconfig_hardware_tests.rb +2 -4
- data/tests/requests/compute/vm_reconfig_memory_tests.rb +1 -3
- data/tests/requests/compute/vm_suspend_tests.rb +23 -0
- data/tests/requests/compute/vm_take_snapshot_tests.rb +1 -3
- metadata +22 -4
- data/gemfiles/Gemfile.1.9.2+ +0 -9
@@ -1,10 +1,9 @@
|
|
1
1
|
Shindo.tests('Fog::Compute[:vsphere] | list_vm_cdroms request', ['vsphere']) do
|
2
|
-
|
3
2
|
compute = Fog::Compute[:vsphere]
|
4
3
|
|
5
4
|
tests('The response should') do
|
6
5
|
response = compute.list_vm_cdroms('5032c8a5-9c5e-ba7a-3804-832a03e16381')
|
7
|
-
test('be a kind of Array') { response.
|
6
|
+
test('be a kind of Array') { response.is_a? Array }
|
8
7
|
test('it should contains Hashes') { response.all? { |i| Hash === i } }
|
9
8
|
end
|
10
9
|
end
|
@@ -1,10 +1,9 @@
|
|
1
1
|
Shindo.tests('Fog::Compute[:vsphere] | list_vm_snapshots request', ['vsphere']) do
|
2
|
-
|
3
2
|
compute = Fog::Compute[:vsphere]
|
4
3
|
|
5
4
|
tests('The response should') do
|
6
5
|
response = compute.list_vm_snapshots('5032c8a5-9c5e-ba7a-3804-832a03e16381')
|
7
|
-
test('be a kind of Array') { response.
|
6
|
+
test('be a kind of Array') { response.is_a? Array }
|
8
7
|
test('it should contains Hashes') { response.all? { |i| Hash === i } }
|
9
8
|
end
|
10
9
|
end
|
@@ -1,21 +1,20 @@
|
|
1
1
|
Shindo.tests('Fog::Compute[:vsphere] | modify_vm_cdrom request', ['vsphere']) do
|
2
|
-
|
3
2
|
compute = Fog::Compute[:vsphere]
|
4
3
|
|
5
4
|
modify_target = '5032c8a5-9c5e-ba7a-3804-832a03e16381'
|
6
5
|
modify_cdrom = compute.cdroms.new(
|
7
|
-
instance_uuid: modify_target
|
6
|
+
instance_uuid: modify_target
|
8
7
|
)
|
9
8
|
|
10
9
|
tests('When adding a cdrom the response should') do
|
11
10
|
response = compute.add_vm_cdrom(modify_cdrom)
|
12
|
-
test('be a kind of Hash') { response.
|
11
|
+
test('be a kind of Hash') { response.is_a? Hash }
|
13
12
|
test('should have a task_state key') { response.key? 'task_state' }
|
14
13
|
end
|
15
14
|
|
16
15
|
tests('When destroying a cdrom the response should') do
|
17
16
|
response = compute.destroy_vm_cdrom(modify_cdrom)
|
18
|
-
test('be a kind of Hash') { response.
|
17
|
+
test('be a kind of Hash') { response.is_a? Hash }
|
19
18
|
test('should have a task_state key') { response.key? 'task_state' }
|
20
19
|
end
|
21
20
|
end
|
@@ -1,15 +1,13 @@
|
|
1
1
|
Shindo.tests('Fog::Compute[:vsphere] | revert_to_snapshot request', ['vsphere']) do
|
2
|
-
|
3
2
|
compute = Fog::Compute[:vsphere]
|
4
3
|
|
5
4
|
tests('The response should') do
|
6
|
-
response = compute.revert_to_snapshot(Fog::Compute::Vsphere::Snapshot.new(:
|
7
|
-
test('be a kind of Hash') { response.
|
5
|
+
response = compute.revert_to_snapshot(Fog::Compute::Vsphere::Snapshot.new(service: 1))
|
6
|
+
test('be a kind of Hash') { response.is_a? Hash }
|
8
7
|
test('should have a task_state key') { response.key? 'state' }
|
9
8
|
end
|
10
9
|
|
11
10
|
tests('The expected options') do
|
12
11
|
raises(ArgumentError, 'raises ArgumentError when input param is missing') { compute.revert_to_snapshot(nil) }
|
13
12
|
end
|
14
|
-
|
15
13
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
Shindo.tests('Fog::Compute[:vsphere] | set_vm_customvalue request', ['vsphere']) do
|
2
|
-
|
3
2
|
compute = Fog::Compute[:vsphere]
|
4
3
|
|
5
4
|
instance_uuid = '50137835-88a1-436e-768e-9b2677076e67'
|
@@ -16,5 +15,4 @@ Shindo.tests('Fog::Compute[:vsphere] | set_vm_customvalue request', ['vsphere'])
|
|
16
15
|
raises(ArgumentError, 'raises ArgumentError when custom_key option is missing') { compute.set_vm_customvalue(instance_uuid) }
|
17
16
|
raises(ArgumentError, 'raises ArgumentError when custom_value option is missing') { compute.set_vm_customvalue(instance_uuid, custom_key) }
|
18
17
|
end
|
19
|
-
|
20
18
|
end
|
@@ -1,47 +1,47 @@
|
|
1
|
-
Shindo.tests(
|
1
|
+
Shindo.tests('Fog::Compute[:vsphere] | vm_clone request', 'vsphere') do
|
2
2
|
# require 'guid'
|
3
3
|
compute = Fog::Compute[:vsphere]
|
4
4
|
response = nil
|
5
5
|
response_linked = nil
|
6
6
|
|
7
|
-
template =
|
8
|
-
datacenter =
|
7
|
+
template = 'rhel64'
|
8
|
+
datacenter = 'Solutions'
|
9
9
|
|
10
|
-
tests(
|
10
|
+
tests('Standard Clone | The return value should') do
|
11
11
|
servers_size = compute.servers.size
|
12
12
|
response = compute.vm_clone('datacenter' => datacenter, 'template_path' => template, 'name' => 'cloning_vm', 'wait' => true)
|
13
|
-
test(
|
14
|
-
%w
|
13
|
+
test('be a kind of Hash') { response.is_a? Hash }
|
14
|
+
%w[vm_ref new_vm task_ref].each do |key|
|
15
15
|
test("have a #{key} key") { response.key? key }
|
16
16
|
end
|
17
|
-
test(
|
18
|
-
test(
|
17
|
+
test('creates a new server') { compute.servers.size == servers_size + 1 }
|
18
|
+
test('new server name is set') { compute.get_virtual_machine(response['new_vm']['id'])['name'] == 'cloning_vm' }
|
19
19
|
end
|
20
20
|
|
21
|
-
tests(
|
21
|
+
tests('Standard Clone setting ram and cpu | The return value should') do
|
22
22
|
servers_size = compute.servers.size
|
23
23
|
response = compute.vm_clone('datacenter' => datacenter, 'template_path' => template, 'name' => 'cloning_vm', 'memoryMB' => '8192', 'numCPUs' => '8', 'wait' => true)
|
24
|
-
test(
|
25
|
-
%w
|
24
|
+
test('be a kind of Hash') { response.is_a? Hash }
|
25
|
+
%w[vm_ref new_vm task_ref].each do |key|
|
26
26
|
test("have a #{key} key") { response.key? key }
|
27
27
|
end
|
28
|
-
test(
|
29
|
-
test(
|
28
|
+
test('creates a new server') { compute.servers.size == servers_size + 1 }
|
29
|
+
test('new server name is set') { compute.get_virtual_machine(response['new_vm']['id'])['name'] == 'cloning_vm' }
|
30
30
|
end
|
31
31
|
|
32
|
-
tests(
|
32
|
+
tests('Linked Clone | The return value should') do
|
33
33
|
servers_size = compute.servers.size
|
34
34
|
response = compute.vm_clone('datacenter' => datacenter, 'template_path' => template, 'name' => 'cloning_vm_linked', 'wait' => 1, 'linked_clone' => true)
|
35
|
-
test(
|
36
|
-
%w
|
35
|
+
test('be a kind of Hash') { response.is_a? Hash }
|
36
|
+
%w[vm_ref new_vm task_ref].each do |key|
|
37
37
|
test("have a #{key} key") { response.key? key }
|
38
38
|
end
|
39
|
-
test(
|
40
|
-
test(
|
39
|
+
test('creates a new server') { compute.servers.size == servers_size + 1 }
|
40
|
+
test('new server name is set') { compute.get_virtual_machine(response['new_vm']['id'])['name'] == 'cloning_vm_linked' }
|
41
41
|
end
|
42
42
|
|
43
|
-
tests(
|
44
|
-
raises(ArgumentError, 'it should raise ArgumentError') { compute.vm_clone(:
|
43
|
+
tests('When invalid input is presented') do
|
44
|
+
raises(ArgumentError, 'it should raise ArgumentError') { compute.vm_clone(foo: 1) }
|
45
45
|
raises(Fog::Compute::Vsphere::NotFound, 'it should raise Fog::Compute::Vsphere::NotFound when the UUID is not a string') do
|
46
46
|
pending # require 'guid'
|
47
47
|
compute.vm_clone('instance_uuid' => Guid.from_s(template), 'name' => 'jefftestfoo')
|
@@ -1,19 +1,18 @@
|
|
1
1
|
Shindo.tests('Fog::Compute[:vsphere] | vm_config_vnc request', ['vsphere']) do
|
2
|
-
|
3
2
|
compute = Fog::Compute[:vsphere]
|
4
3
|
|
5
4
|
reconfig_target = '50137835-88a1-436e-768e-9b2677076e67'
|
6
|
-
vnc_spec = {:
|
5
|
+
vnc_spec = { port: '5900', password: 'ssaaa', enabled: 'true' }
|
7
6
|
|
8
7
|
tests('The response should') do
|
9
8
|
response = compute.vm_config_vnc('instance_uuid' => reconfig_target).merge(vnc_spec)
|
10
|
-
test('be a kind of Hash') { response.
|
9
|
+
test('be a kind of Hash') { response.is_a? Hash }
|
11
10
|
test('should have a task_state key') { response.key? 'task_state' }
|
12
11
|
end
|
13
12
|
|
14
13
|
tests('VNC attrs response should') do
|
15
14
|
response = compute.vm_get_vnc(reconfig_target)
|
16
|
-
test('be a kind of Hash') { response.
|
15
|
+
test('be a kind of Hash') { response.is_a? Hash }
|
17
16
|
test('should have a port key') { response.key? :port }
|
18
17
|
end
|
19
18
|
end
|
@@ -1,17 +1,14 @@
|
|
1
1
|
Shindo.tests('Fog::Compute[:vsphere] | vm_destroy request', ['vsphere']) do
|
2
|
-
|
3
2
|
compute = Fog::Compute[:vsphere]
|
4
3
|
|
5
4
|
booted_vm = '5032c8a5-9c5e-ba7a-3804-832a03e16381'
|
6
5
|
|
7
6
|
tests('The response should') do
|
8
7
|
response = compute.vm_destroy('instance_uuid' => booted_vm)
|
9
|
-
test('be a kind of Hash') { response.
|
8
|
+
test('be a kind of Hash') { response.is_a? Hash }
|
10
9
|
test('should have a task_state key') { response.key? 'task_state' }
|
11
|
-
|
12
10
|
end
|
13
11
|
tests('The expected options') do
|
14
12
|
raises(ArgumentError, 'raises ArgumentError when instance_uuid option is missing') { compute.vm_destroy }
|
15
13
|
end
|
16
|
-
|
17
14
|
end
|
@@ -1,12 +1,11 @@
|
|
1
1
|
Shindo.tests('Fog::Compute[:vsphere] | vm_migrate request', ['vsphere']) do
|
2
|
-
|
3
2
|
compute = Fog::Compute[:vsphere]
|
4
3
|
|
5
4
|
powered_on_vm = '50137835-88a1-436e-768e-9b2677076e67'
|
6
5
|
|
7
6
|
tests('The response should') do
|
8
7
|
response = compute.vm_migrate('instance_uuid' => powered_on_vm)
|
9
|
-
test('be a kind of Hash') { response.
|
8
|
+
test('be a kind of Hash') { response.is_a? Hash }
|
10
9
|
test('should have a task_state key') { response.key? 'task_state' }
|
11
10
|
end
|
12
11
|
|
@@ -1,18 +1,17 @@
|
|
1
1
|
Shindo.tests('Fog::Compute[:vsphere] | vm_power_off request', ['vsphere']) do
|
2
|
-
|
3
2
|
compute = Fog::Compute[:vsphere]
|
4
3
|
|
5
4
|
powered_on_vm = '5032c8a5-9c5e-ba7a-3804-832a03e16381'
|
6
5
|
|
7
6
|
tests('The response should') do
|
8
7
|
response = compute.vm_power_off('instance_uuid' => powered_on_vm)
|
9
|
-
test('be a kind of Hash') { response.
|
8
|
+
test('be a kind of Hash') { response.is_a? Hash }
|
10
9
|
test('should have a task_state key') { response.key? 'task_state' }
|
11
10
|
test('should have a power_off_type key') { response.key? 'power_off_type' }
|
12
11
|
end
|
13
12
|
|
14
13
|
# When forcing the shutdown, we expect the result to be
|
15
|
-
{ true => 'cut_power', false => 'shutdown_guest'}.each do |force, expected|
|
14
|
+
{ true => 'cut_power', false => 'shutdown_guest' }.each do |force, expected|
|
16
15
|
tests("When 'force' => #{force}") do
|
17
16
|
response = compute.vm_power_off('instance_uuid' => powered_on_vm, 'force' => force)
|
18
17
|
test('should retur power_off_type of #{expected}') { response['power_off_type'] == expected }
|
@@ -22,5 +21,4 @@ Shindo.tests('Fog::Compute[:vsphere] | vm_power_off request', ['vsphere']) do
|
|
22
21
|
tests('The expected options') do
|
23
22
|
raises(ArgumentError, 'raises ArgumentError when instance_uuid option is missing') { compute.vm_power_off }
|
24
23
|
end
|
25
|
-
|
26
24
|
end
|
@@ -1,17 +1,15 @@
|
|
1
1
|
Shindo.tests('Fog::Compute[:vsphere] | vm_power_on request', ['vsphere']) do
|
2
|
-
|
3
2
|
compute = Fog::Compute[:vsphere]
|
4
3
|
|
5
4
|
powered_off_vm = nil
|
6
5
|
|
7
6
|
tests('The response should') do
|
8
7
|
response = compute.vm_power_on('instance_uuid' => powered_off_vm)
|
9
|
-
test('be a kind of Hash') { response.
|
8
|
+
test('be a kind of Hash') { response.is_a? Hash }
|
10
9
|
test('should have a task_state key') { response.key? 'task_state' }
|
11
10
|
end
|
12
11
|
|
13
12
|
tests('The expected options') do
|
14
13
|
raises(ArgumentError, 'raises ArgumentError when instance_uuid option is missing') { compute.vm_power_on }
|
15
14
|
end
|
16
|
-
|
17
15
|
end
|
@@ -1,18 +1,17 @@
|
|
1
1
|
Shindo.tests('Fog::Compute[:vsphere] | vm_reboot request', ['vsphere']) do
|
2
|
-
|
3
2
|
compute = Fog::Compute[:vsphere]
|
4
3
|
|
5
4
|
powered_on_vm = '5032c8a5-9c5e-ba7a-3804-832a03e16381'
|
6
5
|
|
7
6
|
tests('The response should') do
|
8
7
|
response = compute.vm_reboot('instance_uuid' => powered_on_vm)
|
9
|
-
test('be a kind of Hash') { response.
|
8
|
+
test('be a kind of Hash') { response.is_a? Hash }
|
10
9
|
test('should have a task_state key') { response.key? 'task_state' }
|
11
10
|
test('should have a reboot_type key') { response.key? 'reboot_type' }
|
12
11
|
end
|
13
12
|
|
14
13
|
# When forcing the shutdown, we expect the result to be
|
15
|
-
{ true => 'reset_power', false => 'reboot_guest'}.each do |force, expected|
|
14
|
+
{ true => 'reset_power', false => 'reboot_guest' }.each do |force, expected|
|
16
15
|
tests("When force => #{force}") do
|
17
16
|
response = compute.vm_reboot('instance_uuid' => powered_on_vm, 'force' => force)
|
18
17
|
test("should return reboot_type of #{expected}") { response['reboot_type'] == expected }
|
@@ -22,5 +21,4 @@ Shindo.tests('Fog::Compute[:vsphere] | vm_reboot request', ['vsphere']) do
|
|
22
21
|
tests('The expected options') do
|
23
22
|
raises(ArgumentError, 'raises ArgumentError when instance_uuid option is missing') { compute.vm_reboot }
|
24
23
|
end
|
25
|
-
|
26
24
|
end
|
@@ -1,15 +1,14 @@
|
|
1
1
|
Shindo.tests('Fog::Compute[:vsphere] | vm_reconfig_cdrom request', ['vsphere']) do
|
2
|
-
|
3
2
|
compute = Fog::Compute[:vsphere]
|
4
3
|
|
5
4
|
reconfig_target = '5032c8a5-9c5e-ba7a-3804-832a03e16381'
|
6
5
|
reconfig_spec = {
|
7
|
-
'start_connected' => false
|
6
|
+
'start_connected' => false
|
8
7
|
}
|
9
8
|
|
10
9
|
tests('the response should') do
|
11
10
|
response = compute.vm_reconfig_cdrom('instance_uuid' => reconfig_target, 'hardware_spec' => reconfig_spec)
|
12
|
-
test('be a kind of Hash') { response.
|
11
|
+
test('be a kind of Hash') { response.is_a? Hash }
|
13
12
|
test('should have a task_state key') { response.key? 'task_state' }
|
14
13
|
end
|
15
14
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
Shindo.tests('Fog::Compute[:vsphere] | vm_reconfig_cpus request', ['vsphere']) do
|
2
|
-
|
3
2
|
compute = Fog::Compute[:vsphere]
|
4
3
|
|
5
4
|
reconfig_target = '50137835-88a1-436e-768e-9b2677076e67'
|
@@ -7,7 +6,7 @@ Shindo.tests('Fog::Compute[:vsphere] | vm_reconfig_cpus request', ['vsphere']) d
|
|
7
6
|
|
8
7
|
tests('The response should') do
|
9
8
|
response = compute.vm_reconfig_cpus('instance_uuid' => reconfig_target, 'cpus' => reconfig_spec)
|
10
|
-
test('be a kind of Hash') { response.
|
9
|
+
test('be a kind of Hash') { response.is_a? Hash }
|
11
10
|
test('should have a task_state key') { response.key? 'task_state' }
|
12
11
|
end
|
13
12
|
|
@@ -15,5 +14,4 @@ Shindo.tests('Fog::Compute[:vsphere] | vm_reconfig_cpus request', ['vsphere']) d
|
|
15
14
|
raises(ArgumentError, 'raises ArgumentError when instance_uuid option is missing') { compute.vm_reconfig_cpus('cpus' => reconfig_spec) }
|
16
15
|
raises(ArgumentError, 'raises ArgumentError when cpus option is missing') { compute.vm_reconfig_cpus('instance_uuid' => reconfig_target) }
|
17
16
|
end
|
18
|
-
|
19
17
|
end
|
@@ -1,13 +1,12 @@
|
|
1
1
|
Shindo.tests('Fog::Compute[:vsphere] | vm_reconfig_hardware request', ['vsphere']) do
|
2
|
-
|
3
2
|
compute = Fog::Compute[:vsphere]
|
4
3
|
|
5
4
|
reconfig_target = '50137835-88a1-436e-768e-9b2677076e67'
|
6
|
-
reconfig_spec = {'guestId' => 'rhel5_64Guest'}
|
5
|
+
reconfig_spec = { 'guestId' => 'rhel5_64Guest' }
|
7
6
|
|
8
7
|
tests('The response should') do
|
9
8
|
response = compute.vm_reconfig_hardware('instance_uuid' => reconfig_target, 'hardware_spec' => reconfig_spec)
|
10
|
-
test('be a kind of Hash') { response.
|
9
|
+
test('be a kind of Hash') { response.is_a? Hash }
|
11
10
|
test('should have a task_state key') { response.key? 'task_state' }
|
12
11
|
end
|
13
12
|
|
@@ -15,5 +14,4 @@ Shindo.tests('Fog::Compute[:vsphere] | vm_reconfig_hardware request', ['vsphere'
|
|
15
14
|
raises(ArgumentError, 'raises ArgumentError when instance_uuid option is missing') { compute.vm_reconfig_hardware('hardware_spec' => reconfig_spec) }
|
16
15
|
raises(ArgumentError, 'raises ArgumentError when hardware_spec option is missing') { compute.vm_reconfig_hardware('instance_uuid' => reconfig_target) }
|
17
16
|
end
|
18
|
-
|
19
17
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
Shindo.tests('Fog::Compute[:vsphere] | vm_reconfig_memory request', ['vsphere']) do
|
2
|
-
|
3
2
|
compute = Fog::Compute[:vsphere]
|
4
3
|
|
5
4
|
reconfig_target = '50137835-88a1-436e-768e-9b2677076e67'
|
@@ -7,7 +6,7 @@ Shindo.tests('Fog::Compute[:vsphere] | vm_reconfig_memory request', ['vsphere'])
|
|
7
6
|
|
8
7
|
tests('The response should') do
|
9
8
|
response = compute.vm_reconfig_memory('instance_uuid' => reconfig_target, 'memory' => reconfig_spec)
|
10
|
-
test('be a kind of Hash') { response.
|
9
|
+
test('be a kind of Hash') { response.is_a? Hash }
|
11
10
|
test('should have a task_state key') { response.key? 'task_state' }
|
12
11
|
end
|
13
12
|
|
@@ -15,5 +14,4 @@ Shindo.tests('Fog::Compute[:vsphere] | vm_reconfig_memory request', ['vsphere'])
|
|
15
14
|
raises(ArgumentError, 'raises ArgumentError when instance_uuid option is missing') { compute.vm_reconfig_memory('memory' => reconfig_spec) }
|
16
15
|
raises(ArgumentError, 'raises ArgumentError when memory option is missing') { compute.vm_reconfig_memory('instance_uuid' => reconfig_target) }
|
17
16
|
end
|
18
|
-
|
19
17
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
Shindo.tests('Fog::Compute[:vsphere] | vm_suspend request', ['vsphere']) do
|
2
|
+
compute = Fog::Compute[:vsphere]
|
3
|
+
powered_on_vm = '5032c8a5-9c5e-ba7a-3804-832a03e16381'
|
4
|
+
|
5
|
+
tests('The response should') do
|
6
|
+
response = compute.vm_suspend('instance_uuid' => powered_on_vm)
|
7
|
+
test('be a kind of Hash') { response.is_a?(Hash) }
|
8
|
+
test('should have a task_state key') { response.key? 'task_state' }
|
9
|
+
test('should have a suspend_type key') { response.key? 'suspend_type' }
|
10
|
+
end
|
11
|
+
|
12
|
+
# When forcing the shutdown, we expect the result to be
|
13
|
+
{ true => 'suspend', false => 'standby_guest' }.each do |force, expected|
|
14
|
+
tests("When 'force' => #{force}") do
|
15
|
+
response = compute.vm_suspend('instance_uuid' => powered_on_vm, 'force' => force)
|
16
|
+
test('should return suspend_type of #{expected}') { response['suspend_type'] == expected }
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
tests('The expected options') do
|
21
|
+
raises(ArgumentError, 'raises ArgumentError when instance_uuid option is missing') { compute.vm_suspend }
|
22
|
+
end
|
23
|
+
end
|
@@ -1,12 +1,11 @@
|
|
1
1
|
Shindo.tests('Fog::Compute[:vsphere] | vm_take_snapshot request', ['vsphere']) do
|
2
|
-
|
3
2
|
compute = Fog::Compute[:vsphere]
|
4
3
|
|
5
4
|
powered_off_vm = nil
|
6
5
|
|
7
6
|
tests('The response should') do
|
8
7
|
response = compute.vm_take_snapshot('instance_uuid' => powered_off_vm, 'name' => 'foobar')
|
9
|
-
test('be a kind of Hash') { response.
|
8
|
+
test('be a kind of Hash') { response.is_a? Hash }
|
10
9
|
test('should have a task_state key') { response.key? 'task_state' }
|
11
10
|
test('should have a was_cancelled key') { response.key? 'was_cancelled' }
|
12
11
|
end
|
@@ -15,5 +14,4 @@ Shindo.tests('Fog::Compute[:vsphere] | vm_take_snapshot request', ['vsphere']) d
|
|
15
14
|
raises(ArgumentError, 'raises ArgumentError when instance_uuid option is missing') { compute.vm_take_snapshot('name' => 'foobar') }
|
16
15
|
raises(ArgumentError, 'raises ArgumentError when name option is missing') { compute.vm_take_snapshot('instance_uuid' => powered_off_vm) }
|
17
16
|
end
|
18
|
-
|
19
17
|
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.7.0
|
4
|
+
version: 1.7.0.1
|
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:
|
11
|
+
date: 2018-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-core
|
@@ -131,6 +131,8 @@ extensions: []
|
|
131
131
|
extra_rdoc_files: []
|
132
132
|
files:
|
133
133
|
- ".gitignore"
|
134
|
+
- ".rubocop.yml"
|
135
|
+
- ".rubocop_todo.yml"
|
134
136
|
- ".travis.yml"
|
135
137
|
- CHANGELOG.md
|
136
138
|
- CONTRIBUTING.md
|
@@ -140,7 +142,6 @@ files:
|
|
140
142
|
- README.md
|
141
143
|
- Rakefile
|
142
144
|
- fog-vsphere.gemspec
|
143
|
-
- gemfiles/Gemfile.1.9.2+
|
144
145
|
- lib/fog/bin/vsphere.rb
|
145
146
|
- lib/fog/vsphere.rb
|
146
147
|
- lib/fog/vsphere/compute.rb
|
@@ -182,6 +183,8 @@ files:
|
|
182
183
|
- lib/fog/vsphere/models/compute/storage_pods.rb
|
183
184
|
- lib/fog/vsphere/models/compute/template.rb
|
184
185
|
- lib/fog/vsphere/models/compute/templates.rb
|
186
|
+
- lib/fog/vsphere/models/compute/ticket.rb
|
187
|
+
- lib/fog/vsphere/models/compute/tickets.rb
|
185
188
|
- lib/fog/vsphere/models/compute/volume.rb
|
186
189
|
- lib/fog/vsphere/models/compute/volumes.rb
|
187
190
|
- lib/fog/vsphere/requests/compute/cloudinit_to_customspec.rb
|
@@ -207,6 +210,9 @@ files:
|
|
207
210
|
- lib/fog/vsphere/requests/compute/get_template.rb
|
208
211
|
- lib/fog/vsphere/requests/compute/get_virtual_machine.rb
|
209
212
|
- lib/fog/vsphere/requests/compute/get_vm_first_scsi_controller.rb
|
213
|
+
- lib/fog/vsphere/requests/compute/host_finish_maintenance.rb
|
214
|
+
- lib/fog/vsphere/requests/compute/host_shutdown.rb
|
215
|
+
- lib/fog/vsphere/requests/compute/host_start_maintenance.rb
|
210
216
|
- lib/fog/vsphere/requests/compute/list_child_snapshots.rb
|
211
217
|
- lib/fog/vsphere/requests/compute/list_clusters.rb
|
212
218
|
- lib/fog/vsphere/requests/compute/list_compute_resources.rb
|
@@ -238,6 +244,7 @@ files:
|
|
238
244
|
- lib/fog/vsphere/requests/compute/revert_to_snapshot.rb
|
239
245
|
- lib/fog/vsphere/requests/compute/set_vm_customvalue.rb
|
240
246
|
- lib/fog/vsphere/requests/compute/upload_iso.rb
|
247
|
+
- lib/fog/vsphere/requests/compute/vm_acquire_ticket.rb
|
241
248
|
- lib/fog/vsphere/requests/compute/vm_clone.rb
|
242
249
|
- lib/fog/vsphere/requests/compute/vm_config_vnc.rb
|
243
250
|
- lib/fog/vsphere/requests/compute/vm_destroy.rb
|
@@ -251,6 +258,11 @@ files:
|
|
251
258
|
- lib/fog/vsphere/requests/compute/vm_reconfig_hardware.rb
|
252
259
|
- lib/fog/vsphere/requests/compute/vm_reconfig_memory.rb
|
253
260
|
- lib/fog/vsphere/requests/compute/vm_reconfig_volumes.rb
|
261
|
+
- lib/fog/vsphere/requests/compute/vm_relocate.rb
|
262
|
+
- lib/fog/vsphere/requests/compute/vm_remove_snapshot.rb
|
263
|
+
- lib/fog/vsphere/requests/compute/vm_rename.rb
|
264
|
+
- lib/fog/vsphere/requests/compute/vm_revert_snapshot.rb
|
265
|
+
- lib/fog/vsphere/requests/compute/vm_suspend.rb
|
254
266
|
- lib/fog/vsphere/requests/compute/vm_take_snapshot.rb
|
255
267
|
- lib/fog/vsphere/version.rb
|
256
268
|
- tests/class_from_string_tests.rb
|
@@ -264,6 +276,8 @@ files:
|
|
264
276
|
- tests/models/compute/server_tests.rb
|
265
277
|
- tests/models/compute/server_unit_tests.rb
|
266
278
|
- tests/models/compute/servers_tests.rb
|
279
|
+
- tests/models/compute/ticket_tests.rb
|
280
|
+
- tests/models/compute/tickets_tests.rb
|
267
281
|
- tests/requests/compute/current_time_tests.rb
|
268
282
|
- tests/requests/compute/folder_destroy_tests.rb
|
269
283
|
- tests/requests/compute/get_network_tests.rb
|
@@ -290,6 +304,7 @@ files:
|
|
290
304
|
- tests/requests/compute/vm_reconfig_cpus_tests.rb
|
291
305
|
- tests/requests/compute/vm_reconfig_hardware_tests.rb
|
292
306
|
- tests/requests/compute/vm_reconfig_memory_tests.rb
|
307
|
+
- tests/requests/compute/vm_suspend_tests.rb
|
293
308
|
- tests/requests/compute/vm_take_snapshot_tests.rb
|
294
309
|
homepage: https://github.com/fog/fog-vsphere
|
295
310
|
licenses:
|
@@ -311,7 +326,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
311
326
|
version: '0'
|
312
327
|
requirements: []
|
313
328
|
rubyforge_project:
|
314
|
-
rubygems_version: 2.
|
329
|
+
rubygems_version: 2.7.6
|
315
330
|
signing_key:
|
316
331
|
specification_version: 4
|
317
332
|
summary: Module for the 'fog' gem to support VMware vSphere.
|
@@ -327,6 +342,8 @@ test_files:
|
|
327
342
|
- tests/models/compute/server_tests.rb
|
328
343
|
- tests/models/compute/server_unit_tests.rb
|
329
344
|
- tests/models/compute/servers_tests.rb
|
345
|
+
- tests/models/compute/ticket_tests.rb
|
346
|
+
- tests/models/compute/tickets_tests.rb
|
330
347
|
- tests/requests/compute/current_time_tests.rb
|
331
348
|
- tests/requests/compute/folder_destroy_tests.rb
|
332
349
|
- tests/requests/compute/get_network_tests.rb
|
@@ -353,4 +370,5 @@ test_files:
|
|
353
370
|
- tests/requests/compute/vm_reconfig_cpus_tests.rb
|
354
371
|
- tests/requests/compute/vm_reconfig_hardware_tests.rb
|
355
372
|
- tests/requests/compute/vm_reconfig_memory_tests.rb
|
373
|
+
- tests/requests/compute/vm_suspend_tests.rb
|
356
374
|
- tests/requests/compute/vm_take_snapshot_tests.rb
|