fog-vcloud-director 0.1.10 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.rubocop.yml +4 -240
- data/.rubocop_local.yml +1 -0
- data/.travis.yml +5 -10
- data/README.md +3 -0
- data/docs/examples-vm-reconfigure.md +39 -0
- data/docs/vm-to-reconfigure.xml +373 -0
- data/fog-vcloud-director.gemspec +4 -1
- data/lib/fog/vcloud_director.rb +14 -1
- data/lib/fog/vcloud_director/compute.rb +34 -8
- data/lib/fog/vcloud_director/core.rb +0 -3
- data/lib/fog/vcloud_director/generators/compute/org_vdc_network.rb +1 -1
- data/lib/fog/vcloud_director/generators/compute/reconfigure_vm.rb +110 -0
- data/lib/fog/vcloud_director/generators/compute/vapp.rb +0 -1
- data/lib/fog/vcloud_director/models/compute/catalog.rb +0 -2
- data/lib/fog/vcloud_director/models/compute/catalog_item.rb +0 -2
- data/lib/fog/vcloud_director/models/compute/catalog_items.rb +0 -1
- data/lib/fog/vcloud_director/models/compute/catalogs.rb +0 -1
- data/lib/fog/vcloud_director/models/compute/custom_field.rb +0 -2
- data/lib/fog/vcloud_director/models/compute/disk.rb +1 -2
- data/lib/fog/vcloud_director/models/compute/disks.rb +0 -1
- data/lib/fog/vcloud_director/models/compute/media.rb +0 -2
- data/lib/fog/vcloud_director/models/compute/medias.rb +0 -1
- data/lib/fog/vcloud_director/models/compute/network.rb +0 -2
- data/lib/fog/vcloud_director/models/compute/networks.rb +0 -1
- data/lib/fog/vcloud_director/models/compute/organization.rb +0 -2
- data/lib/fog/vcloud_director/models/compute/organizations.rb +0 -1
- data/lib/fog/vcloud_director/models/compute/tag.rb +1 -2
- data/lib/fog/vcloud_director/models/compute/tags.rb +0 -1
- data/lib/fog/vcloud_director/models/compute/task.rb +0 -2
- data/lib/fog/vcloud_director/models/compute/tasks.rb +0 -1
- data/lib/fog/vcloud_director/models/compute/template_vm.rb +0 -1
- data/lib/fog/vcloud_director/models/compute/template_vms.rb +2 -3
- data/lib/fog/vcloud_director/models/compute/vapp.rb +25 -8
- data/lib/fog/vcloud_director/models/compute/vapp_template.rb +0 -2
- data/lib/fog/vcloud_director/models/compute/vapp_templates.rb +0 -1
- data/lib/fog/vcloud_director/models/compute/vapps.rb +0 -1
- data/lib/fog/vcloud_director/models/compute/vdc.rb +0 -2
- data/lib/fog/vcloud_director/models/compute/vdcs.rb +0 -1
- data/lib/fog/vcloud_director/models/compute/vm.rb +10 -30
- data/lib/fog/vcloud_director/models/compute/vm_customization.rb +0 -2
- data/lib/fog/vcloud_director/models/compute/vm_customizations.rb +0 -1
- data/lib/fog/vcloud_director/models/compute/vm_network.rb +0 -2
- data/lib/fog/vcloud_director/models/compute/vm_networks.rb +0 -1
- data/lib/fog/vcloud_director/models/compute/vms.rb +1 -2
- data/lib/fog/vcloud_director/parsers/compute/vapp.rb +93 -0
- data/lib/fog/vcloud_director/parsers/compute/vm.rb +3 -62
- data/lib/fog/vcloud_director/parsers/compute/vm_parser_helper.rb +47 -0
- data/lib/fog/vcloud_director/parsers/compute/vms.rb +2 -23
- data/lib/fog/vcloud_director/query.rb +0 -1
- data/lib/fog/vcloud_director/requests/compute/delete_vapp.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/get_lease_settings_section_vapp.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/get_template_vm.rb +1 -47
- data/lib/fog/vcloud_director/requests/compute/get_template_vms.rb +0 -13
- data/lib/fog/vcloud_director/requests/compute/get_vapp.rb +4 -3
- data/lib/fog/vcloud_director/requests/compute/get_vapp_metadata.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/get_vapp_owner.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/get_vm.rb +0 -46
- data/lib/fog/vcloud_director/requests/compute/instantiate_vapp_template.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/post_power_on_vapp.rb +2 -2
- data/lib/fog/vcloud_director/requests/compute/post_reconfigure_vm.rb +4 -84
- data/lib/fog/vcloud_director/requests/compute/post_update_vapp_metadata.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/put_cpu.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/put_memory.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/put_metadata_value.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/put_network_connection_system_section_vapp.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/put_vm.rb +1 -1
- data/lib/fog/vcloud_director/version.rb +1 -1
- data/spec/common_assertions.rb +42 -0
- data/spec/fixtures/vm.xml +419 -0
- data/spec/secrets.yaml.templ +3 -0
- data/spec/spec_helper.rb +5 -5
- data/spec/vcloud_director/generators/compute/compose_common_spec.rb +1 -6
- data/spec/vcloud_director/generators/compute/compose_vapp_spec.rb +67 -0
- data/spec/vcloud_director/generators/compute/create_snapshot_spec.rb +4 -0
- data/spec/vcloud_director/generators/compute/customization_spec.rb +4 -0
- data/spec/vcloud_director/generators/compute/disks_spec.rb +4 -0
- data/spec/vcloud_director/generators/compute/edge_gateway_service_configuration_spec.rb +4 -0
- data/spec/vcloud_director/generators/compute/instantiate_vapp_template_params_spec.rb +1 -4
- data/spec/vcloud_director/generators/compute/metadata_spec.rb +4 -0
- data/spec/vcloud_director/generators/compute/org_vdc_network_spec.rb +4 -0
- data/spec/vcloud_director/generators/compute/recompose_vapp_spec.rb +4 -0
- data/spec/vcloud_director/generators/compute/reconfigure_vm_spec.rb +117 -0
- data/spec/vcloud_director/generators/compute/vapp_spec.rb +4 -0
- data/spec/vcloud_director/generators/compute/vm_network_spec.rb +4 -0
- data/spec/vcloud_director/generators/compute/vm_spec.rb +4 -0
- data/spec/vcloud_director/models/compute/basic_spec.rb +44 -0
- data/spec/vcloud_director/models/compute/vapps_spec.rb +104 -0
- data/spec/vcloud_director/models/compute/vms_spec.rb +54 -0
- data/spec/vcloud_director/parsers/compute/disks_spec.rb +4 -0
- data/spec/vcloud_director/parsers/compute/metadata_spec.rb +4 -0
- data/spec/vcloud_director/parsers/compute/network_spec.rb +4 -0
- data/spec/vcloud_director/parsers/compute/vm_customization_spec.rb +4 -0
- data/spec/vcloud_director/parsers/compute/vm_network_spec.rb +4 -0
- data/spec/vcloud_director/parsers/compute/vm_parser_helper_spec.rb +4 -0
- data/spec/vcloud_director/parsers/compute/vm_spec.rb +4 -0
- data/spec/vcloud_director/parsers/compute/vms_by_metadata_spec.rb +4 -0
- data/spec/vcloud_director/parsers/compute/vms_spec.rb +4 -0
- data/spec/vcloud_director/requests/compute/basic_spec.rb +212 -0
- data/spec/vcloud_director/requests/compute/get_vapp_spec.rb +11 -0
- data/spec/vcloud_director/requests/compute/get_vdc_spec.rb +10 -0
- data/spec/vcloud_director/requests/compute/instantiate_vapp_template_spec.rb +1 -3
- data/spec/vcloud_director/requests/compute/post_reconfigure_vm_spec.rb +26 -0
- data/spec/vcr_cassettes/authentication.yml +48 -0
- data/spec/vcr_cassettes/get_vapp.yml +937 -0
- data/spec/vcr_cassettes/get_vapps-expired.yml +918 -0
- data/spec/vcr_cassettes/get_vapps-novms.yml +215 -0
- data/spec/vcr_cassettes/get_vapps.yml +118 -0
- data/spec/vcr_cassettes/get_vdc.yml +118 -0
- data/spec/vcr_cassettes/get_vm.yml +398 -0
- data/spec/vcr_cassettes/post_reconfigure_vm-virtual_hardware.yml +445 -0
- data/spec/vcr_spec_helper.rb +34 -0
- data/tasks/test.rake +3 -10
- metadata +129 -5
- data/lib/fog/vcloud_director/requests/compute/get_vms.rb +0 -41
- data/spec/vcloud_director/spec_helper.rb +0 -13
@@ -0,0 +1,34 @@
|
|
1
|
+
require './spec/spec_helper'
|
2
|
+
require 'vcr'
|
3
|
+
|
4
|
+
VCR.configure do |config|
|
5
|
+
config.cassette_library_dir = 'spec/vcr_cassettes'
|
6
|
+
config.allow_http_connections_when_no_cassette = false
|
7
|
+
config.hook_into :webmock
|
8
|
+
config.default_cassette_options = { :allow_unused_http_interactions => false }
|
9
|
+
end
|
10
|
+
|
11
|
+
def vcr_service
|
12
|
+
Fog.unmock!
|
13
|
+
|
14
|
+
hostname = secrets.fetch(:hostname, 'hostname')
|
15
|
+
username = secrets.fetch(:username, 'username')
|
16
|
+
password = secrets.fetch(:password, 'password')
|
17
|
+
|
18
|
+
VCR.configure do |config|
|
19
|
+
config.before_playback { |interaction| interaction.filter!('VMWARE_CLOUD_HOST', hostname) }
|
20
|
+
config.filter_sensitive_data('VMWARE_CLOUD_AUTHORIZATION') { Base64.encode64("#{username}:#{password}").chomp }
|
21
|
+
config.filter_sensitive_data('VMWARE_CLOUD_HOST') { hostname }
|
22
|
+
end
|
23
|
+
|
24
|
+
@vcr_service ||= VCR.use_cassette('authentication') do
|
25
|
+
Fog::Compute::VcloudDirector.new(
|
26
|
+
:vcloud_director_username => username,
|
27
|
+
:vcloud_director_password => password,
|
28
|
+
:vcloud_director_host => hostname,
|
29
|
+
:vcloud_director_show_progress => false,
|
30
|
+
:vcloud_director_api_version => '9.0',
|
31
|
+
:connection_options => { :ssl_verify_peer => false }
|
32
|
+
).tap { |service| service.send(:login) }
|
33
|
+
end
|
34
|
+
end
|
data/tasks/test.rake
CHANGED
@@ -1,13 +1,6 @@
|
|
1
|
-
require
|
1
|
+
require 'rake/testtask'
|
2
2
|
|
3
3
|
Rake::TestTask.new do |t|
|
4
|
-
t.
|
5
|
-
t.
|
6
|
-
end
|
7
|
-
|
8
|
-
namespace :test do
|
9
|
-
mock = ENV["FOG_MOCK"] || "true"
|
10
|
-
task :travis do
|
11
|
-
sh("export FOG_MOCK=#{mock} && bundle exec shindont")
|
12
|
-
end
|
4
|
+
t.pattern = 'spec/**/*_spec.rb'
|
5
|
+
t.warning = false
|
13
6
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-vcloud-director
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luka Zakrajšek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-core
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: mocha
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: vcr
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,8 +108,36 @@ dependencies:
|
|
94
108
|
- - ">="
|
95
109
|
- !ruby/object:Gem::Version
|
96
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: webmock
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
97
125
|
- !ruby/object:Gem::Dependency
|
98
126
|
name: rubocop
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 0.52.1
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 0.52.1
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: pronto-rubocop
|
99
141
|
requirement: !ruby/object:Gem::Requirement
|
100
142
|
requirements:
|
101
143
|
- - ">="
|
@@ -121,6 +163,7 @@ files:
|
|
121
163
|
- ".gitignore"
|
122
164
|
- ".hound.yml"
|
123
165
|
- ".rubocop.yml"
|
166
|
+
- ".rubocop_local.yml"
|
124
167
|
- ".ruby-gemset"
|
125
168
|
- ".travis.yml"
|
126
169
|
- Gemfile
|
@@ -128,6 +171,8 @@ files:
|
|
128
171
|
- README.md
|
129
172
|
- Rakefile
|
130
173
|
- docs/examples-vapp-instantiate.md
|
174
|
+
- docs/examples-vm-reconfigure.md
|
175
|
+
- docs/vm-to-reconfigure.xml
|
131
176
|
- docs/web-server-with-db-vapp.xml
|
132
177
|
- fog-vcloud-director.gemspec
|
133
178
|
- lib/fog/vcloud_director.rb
|
@@ -143,6 +188,7 @@ files:
|
|
143
188
|
- lib/fog/vcloud_director/generators/compute/metadata.rb
|
144
189
|
- lib/fog/vcloud_director/generators/compute/org_vdc_network.rb
|
145
190
|
- lib/fog/vcloud_director/generators/compute/recompose_vapp.rb
|
191
|
+
- lib/fog/vcloud_director/generators/compute/reconfigure_vm.rb
|
146
192
|
- lib/fog/vcloud_director/generators/compute/vapp.rb
|
147
193
|
- lib/fog/vcloud_director/generators/compute/vm.rb
|
148
194
|
- lib/fog/vcloud_director/generators/compute/vm_network.rb
|
@@ -181,6 +227,7 @@ files:
|
|
181
227
|
- lib/fog/vcloud_director/parsers/compute/disks.rb
|
182
228
|
- lib/fog/vcloud_director/parsers/compute/metadata.rb
|
183
229
|
- lib/fog/vcloud_director/parsers/compute/network.rb
|
230
|
+
- lib/fog/vcloud_director/parsers/compute/vapp.rb
|
184
231
|
- lib/fog/vcloud_director/parsers/compute/vm.rb
|
185
232
|
- lib/fog/vcloud_director/parsers/compute/vm_customization.rb
|
186
233
|
- lib/fog/vcloud_director/parsers/compute/vm_network.rb
|
@@ -300,7 +347,6 @@ files:
|
|
300
347
|
- lib/fog/vcloud_director/requests/compute/get_vm_disks.rb
|
301
348
|
- lib/fog/vcloud_director/requests/compute/get_vm_network.rb
|
302
349
|
- lib/fog/vcloud_director/requests/compute/get_vm_pending_question.rb
|
303
|
-
- lib/fog/vcloud_director/requests/compute/get_vms.rb
|
304
350
|
- lib/fog/vcloud_director/requests/compute/get_vms_by_metadata.rb
|
305
351
|
- lib/fog/vcloud_director/requests/compute/get_vms_disk_attached_to.rb
|
306
352
|
- lib/fog/vcloud_director/requests/compute/get_vms_in_lease_from_query.rb
|
@@ -373,11 +419,50 @@ files:
|
|
373
419
|
- lib/fog/vcloud_director/requests/compute/put_vm.rb
|
374
420
|
- lib/fog/vcloud_director/requests/compute/put_vm_capabilities.rb
|
375
421
|
- lib/fog/vcloud_director/version.rb
|
422
|
+
- spec/common_assertions.rb
|
423
|
+
- spec/fixtures/vm.xml
|
424
|
+
- spec/secrets.yaml.templ
|
376
425
|
- spec/spec_helper.rb
|
377
426
|
- spec/vcloud_director/generators/compute/compose_common_spec.rb
|
427
|
+
- spec/vcloud_director/generators/compute/compose_vapp_spec.rb
|
428
|
+
- spec/vcloud_director/generators/compute/create_snapshot_spec.rb
|
429
|
+
- spec/vcloud_director/generators/compute/customization_spec.rb
|
430
|
+
- spec/vcloud_director/generators/compute/disks_spec.rb
|
431
|
+
- spec/vcloud_director/generators/compute/edge_gateway_service_configuration_spec.rb
|
378
432
|
- spec/vcloud_director/generators/compute/instantiate_vapp_template_params_spec.rb
|
433
|
+
- spec/vcloud_director/generators/compute/metadata_spec.rb
|
434
|
+
- spec/vcloud_director/generators/compute/org_vdc_network_spec.rb
|
435
|
+
- spec/vcloud_director/generators/compute/recompose_vapp_spec.rb
|
436
|
+
- spec/vcloud_director/generators/compute/reconfigure_vm_spec.rb
|
437
|
+
- spec/vcloud_director/generators/compute/vapp_spec.rb
|
438
|
+
- spec/vcloud_director/generators/compute/vm_network_spec.rb
|
439
|
+
- spec/vcloud_director/generators/compute/vm_spec.rb
|
440
|
+
- spec/vcloud_director/models/compute/basic_spec.rb
|
441
|
+
- spec/vcloud_director/models/compute/vapps_spec.rb
|
442
|
+
- spec/vcloud_director/models/compute/vms_spec.rb
|
443
|
+
- spec/vcloud_director/parsers/compute/disks_spec.rb
|
444
|
+
- spec/vcloud_director/parsers/compute/metadata_spec.rb
|
445
|
+
- spec/vcloud_director/parsers/compute/network_spec.rb
|
446
|
+
- spec/vcloud_director/parsers/compute/vm_customization_spec.rb
|
447
|
+
- spec/vcloud_director/parsers/compute/vm_network_spec.rb
|
448
|
+
- spec/vcloud_director/parsers/compute/vm_parser_helper_spec.rb
|
449
|
+
- spec/vcloud_director/parsers/compute/vm_spec.rb
|
450
|
+
- spec/vcloud_director/parsers/compute/vms_by_metadata_spec.rb
|
451
|
+
- spec/vcloud_director/parsers/compute/vms_spec.rb
|
452
|
+
- spec/vcloud_director/requests/compute/basic_spec.rb
|
453
|
+
- spec/vcloud_director/requests/compute/get_vapp_spec.rb
|
454
|
+
- spec/vcloud_director/requests/compute/get_vdc_spec.rb
|
379
455
|
- spec/vcloud_director/requests/compute/instantiate_vapp_template_spec.rb
|
380
|
-
- spec/vcloud_director/
|
456
|
+
- spec/vcloud_director/requests/compute/post_reconfigure_vm_spec.rb
|
457
|
+
- spec/vcr_cassettes/authentication.yml
|
458
|
+
- spec/vcr_cassettes/get_vapp.yml
|
459
|
+
- spec/vcr_cassettes/get_vapps-expired.yml
|
460
|
+
- spec/vcr_cassettes/get_vapps-novms.yml
|
461
|
+
- spec/vcr_cassettes/get_vapps.yml
|
462
|
+
- spec/vcr_cassettes/get_vdc.yml
|
463
|
+
- spec/vcr_cassettes/get_vm.yml
|
464
|
+
- spec/vcr_cassettes/post_reconfigure_vm-virtual_hardware.yml
|
465
|
+
- spec/vcr_spec_helper.rb
|
381
466
|
- tasks/bundler.rake
|
382
467
|
- tasks/console.rake
|
383
468
|
- tasks/lint.rake
|
@@ -459,8 +544,47 @@ signing_key:
|
|
459
544
|
specification_version: 4
|
460
545
|
summary: Module for the 'fog' gem to support vCloud Director.
|
461
546
|
test_files:
|
547
|
+
- spec/common_assertions.rb
|
548
|
+
- spec/fixtures/vm.xml
|
549
|
+
- spec/secrets.yaml.templ
|
462
550
|
- spec/spec_helper.rb
|
463
551
|
- spec/vcloud_director/generators/compute/compose_common_spec.rb
|
552
|
+
- spec/vcloud_director/generators/compute/compose_vapp_spec.rb
|
553
|
+
- spec/vcloud_director/generators/compute/create_snapshot_spec.rb
|
554
|
+
- spec/vcloud_director/generators/compute/customization_spec.rb
|
555
|
+
- spec/vcloud_director/generators/compute/disks_spec.rb
|
556
|
+
- spec/vcloud_director/generators/compute/edge_gateway_service_configuration_spec.rb
|
464
557
|
- spec/vcloud_director/generators/compute/instantiate_vapp_template_params_spec.rb
|
558
|
+
- spec/vcloud_director/generators/compute/metadata_spec.rb
|
559
|
+
- spec/vcloud_director/generators/compute/org_vdc_network_spec.rb
|
560
|
+
- spec/vcloud_director/generators/compute/recompose_vapp_spec.rb
|
561
|
+
- spec/vcloud_director/generators/compute/reconfigure_vm_spec.rb
|
562
|
+
- spec/vcloud_director/generators/compute/vapp_spec.rb
|
563
|
+
- spec/vcloud_director/generators/compute/vm_network_spec.rb
|
564
|
+
- spec/vcloud_director/generators/compute/vm_spec.rb
|
565
|
+
- spec/vcloud_director/models/compute/basic_spec.rb
|
566
|
+
- spec/vcloud_director/models/compute/vapps_spec.rb
|
567
|
+
- spec/vcloud_director/models/compute/vms_spec.rb
|
568
|
+
- spec/vcloud_director/parsers/compute/disks_spec.rb
|
569
|
+
- spec/vcloud_director/parsers/compute/metadata_spec.rb
|
570
|
+
- spec/vcloud_director/parsers/compute/network_spec.rb
|
571
|
+
- spec/vcloud_director/parsers/compute/vm_customization_spec.rb
|
572
|
+
- spec/vcloud_director/parsers/compute/vm_network_spec.rb
|
573
|
+
- spec/vcloud_director/parsers/compute/vm_parser_helper_spec.rb
|
574
|
+
- spec/vcloud_director/parsers/compute/vm_spec.rb
|
575
|
+
- spec/vcloud_director/parsers/compute/vms_by_metadata_spec.rb
|
576
|
+
- spec/vcloud_director/parsers/compute/vms_spec.rb
|
577
|
+
- spec/vcloud_director/requests/compute/basic_spec.rb
|
578
|
+
- spec/vcloud_director/requests/compute/get_vapp_spec.rb
|
579
|
+
- spec/vcloud_director/requests/compute/get_vdc_spec.rb
|
465
580
|
- spec/vcloud_director/requests/compute/instantiate_vapp_template_spec.rb
|
466
|
-
- spec/vcloud_director/
|
581
|
+
- spec/vcloud_director/requests/compute/post_reconfigure_vm_spec.rb
|
582
|
+
- spec/vcr_cassettes/authentication.yml
|
583
|
+
- spec/vcr_cassettes/get_vapp.yml
|
584
|
+
- spec/vcr_cassettes/get_vapps-expired.yml
|
585
|
+
- spec/vcr_cassettes/get_vapps-novms.yml
|
586
|
+
- spec/vcr_cassettes/get_vapps.yml
|
587
|
+
- spec/vcr_cassettes/get_vdc.yml
|
588
|
+
- spec/vcr_cassettes/get_vm.yml
|
589
|
+
- spec/vcr_cassettes/post_reconfigure_vm-virtual_hardware.yml
|
590
|
+
- spec/vcr_spec_helper.rb
|
@@ -1,41 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Compute
|
3
|
-
class VcloudDirector
|
4
|
-
class Real
|
5
|
-
require 'fog/vcloud_director/parsers/compute/vms'
|
6
|
-
|
7
|
-
# Retrieve a vApp or VM.
|
8
|
-
#
|
9
|
-
# @note This should probably be deprecated.
|
10
|
-
#
|
11
|
-
# @param [String] id Object identifier of the vApp or VM.
|
12
|
-
# @return [Excon::Response]
|
13
|
-
# * body<~Hash>:
|
14
|
-
#
|
15
|
-
# @see #get_vapp
|
16
|
-
def get_vms(id)
|
17
|
-
request(
|
18
|
-
:expects => 200,
|
19
|
-
:idempotent => true,
|
20
|
-
:method => 'GET',
|
21
|
-
:parser => Fog::Parsers::Compute::VcloudDirector::Vms.new,
|
22
|
-
:path => "vApp/#{id}"
|
23
|
-
)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
class Mock
|
27
|
-
def get_vms(id)
|
28
|
-
vapp = get_vapp(id).body
|
29
|
-
parser = Fog::Parsers::Compute::VcloudDirector::Vms.new
|
30
|
-
vms = vapp[:Children][:Vm].map {|child| parse_vapp_to_vm(child) }
|
31
|
-
body = {:type => vapp[:type], :vms => vms}
|
32
|
-
Excon::Response.new(
|
33
|
-
:status => 200,
|
34
|
-
:headers => {'Content-Type' => "#{body[:type]};version=#{api_version}"},
|
35
|
-
:body => body
|
36
|
-
)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require "fog/vcloud_director"
|
2
|
-
|
3
|
-
if ENV["FOG_MOCK"] == "true"
|
4
|
-
Fog.mock!
|
5
|
-
end
|
6
|
-
|
7
|
-
if Fog.mock?
|
8
|
-
Fog.credentials = {
|
9
|
-
:vcloud_director_host => 'vcloud-director-host',
|
10
|
-
:vcloud_director_password => 'vcloud_director_password',
|
11
|
-
:vcloud_director_username => 'vcd_user@vcd_org_name',
|
12
|
-
}.merge(Fog.credentials)
|
13
|
-
end
|