fog-vsphere 2.5.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +4 -0
  3. data/.travis.yml +1 -1
  4. data/CHANGELOG.md +9 -0
  5. data/README.md +7 -1
  6. data/fog-vsphere.gemspec +2 -1
  7. data/lib/fog-vsphere.rb +1 -0
  8. data/lib/fog/bin/vsphere.rb +1 -1
  9. data/lib/fog/vsphere.rb +2 -4
  10. data/lib/fog/vsphere/compute.rb +23 -6
  11. data/lib/fog/vsphere/models/compute/cdrom.rb +2 -2
  12. data/lib/fog/vsphere/models/compute/cdroms.rb +3 -3
  13. data/lib/fog/vsphere/models/compute/cluster.rb +2 -2
  14. data/lib/fog/vsphere/models/compute/clusters.rb +3 -3
  15. data/lib/fog/vsphere/models/compute/customfield.rb +2 -2
  16. data/lib/fog/vsphere/models/compute/customfields.rb +3 -3
  17. data/lib/fog/vsphere/models/compute/customvalue.rb +2 -2
  18. data/lib/fog/vsphere/models/compute/customvalues.rb +5 -5
  19. data/lib/fog/vsphere/models/compute/datacenter.rb +2 -2
  20. data/lib/fog/vsphere/models/compute/datacenters.rb +3 -3
  21. data/lib/fog/vsphere/models/compute/datastore.rb +2 -2
  22. data/lib/fog/vsphere/models/compute/datastores.rb +3 -3
  23. data/lib/fog/vsphere/models/compute/folder.rb +2 -2
  24. data/lib/fog/vsphere/models/compute/folders.rb +3 -3
  25. data/lib/fog/vsphere/models/compute/host.rb +2 -2
  26. data/lib/fog/vsphere/models/compute/hosts.rb +4 -4
  27. data/lib/fog/vsphere/models/compute/interface.rb +2 -2
  28. data/lib/fog/vsphere/models/compute/interfaces.rb +8 -8
  29. data/lib/fog/vsphere/models/compute/interfacetype.rb +2 -2
  30. data/lib/fog/vsphere/models/compute/interfacetypes.rb +5 -5
  31. data/lib/fog/vsphere/models/compute/network.rb +2 -2
  32. data/lib/fog/vsphere/models/compute/networks.rb +3 -3
  33. data/lib/fog/vsphere/models/compute/process.rb +2 -2
  34. data/lib/fog/vsphere/models/compute/resource_pool.rb +2 -2
  35. data/lib/fog/vsphere/models/compute/resource_pools.rb +3 -3
  36. data/lib/fog/vsphere/models/compute/rule.rb +2 -2
  37. data/lib/fog/vsphere/models/compute/rules.rb +4 -4
  38. data/lib/fog/vsphere/models/compute/scsicontroller.rb +2 -2
  39. data/lib/fog/vsphere/models/compute/server.rb +6 -6
  40. data/lib/fog/vsphere/models/compute/servers.rb +4 -4
  41. data/lib/fog/vsphere/models/compute/servertype.rb +2 -2
  42. data/lib/fog/vsphere/models/compute/servertypes.rb +4 -4
  43. data/lib/fog/vsphere/models/compute/snapshot.rb +2 -2
  44. data/lib/fog/vsphere/models/compute/snapshots.rb +3 -3
  45. data/lib/fog/vsphere/models/compute/storage_pod.rb +2 -2
  46. data/lib/fog/vsphere/models/compute/storage_pods.rb +3 -3
  47. data/lib/fog/vsphere/models/compute/template.rb +2 -2
  48. data/lib/fog/vsphere/models/compute/templates.rb +3 -3
  49. data/lib/fog/vsphere/models/compute/ticket.rb +2 -2
  50. data/lib/fog/vsphere/models/compute/tickets.rb +4 -4
  51. data/lib/fog/vsphere/models/compute/volume.rb +3 -3
  52. data/lib/fog/vsphere/models/compute/volumes.rb +5 -5
  53. data/lib/fog/vsphere/requests/compute/cloudinit_to_customspec.rb +2 -2
  54. data/lib/fog/vsphere/requests/compute/create_folder.rb +2 -2
  55. data/lib/fog/vsphere/requests/compute/create_group.rb +2 -2
  56. data/lib/fog/vsphere/requests/compute/create_rule.rb +2 -2
  57. data/lib/fog/vsphere/requests/compute/create_vm.rb +2 -2
  58. data/lib/fog/vsphere/requests/compute/current_time.rb +2 -2
  59. data/lib/fog/vsphere/requests/compute/destroy_group.rb +2 -2
  60. data/lib/fog/vsphere/requests/compute/destroy_rule.rb +2 -2
  61. data/lib/fog/vsphere/requests/compute/folder_destroy.rb +2 -2
  62. data/lib/fog/vsphere/requests/compute/get_cluster.rb +5 -4
  63. data/lib/fog/vsphere/requests/compute/get_compute_resource.rb +3 -3
  64. data/lib/fog/vsphere/requests/compute/get_datacenter.rb +4 -4
  65. data/lib/fog/vsphere/requests/compute/get_datastore.rb +3 -3
  66. data/lib/fog/vsphere/requests/compute/get_folder.rb +6 -6
  67. data/lib/fog/vsphere/requests/compute/get_host.rb +3 -3
  68. data/lib/fog/vsphere/requests/compute/get_interface_type.rb +3 -3
  69. data/lib/fog/vsphere/requests/compute/get_network.rb +4 -4
  70. data/lib/fog/vsphere/requests/compute/get_resource_pool.rb +3 -3
  71. data/lib/fog/vsphere/requests/compute/get_server_type.rb +5 -5
  72. data/lib/fog/vsphere/requests/compute/get_storage_pod.rb +3 -3
  73. data/lib/fog/vsphere/requests/compute/get_template.rb +2 -2
  74. data/lib/fog/vsphere/requests/compute/get_virtual_machine.rb +4 -4
  75. data/lib/fog/vsphere/requests/compute/get_vm_first_scsi_controller.rb +3 -3
  76. data/lib/fog/vsphere/requests/compute/host_finish_maintenance.rb +2 -2
  77. data/lib/fog/vsphere/requests/compute/host_shutdown.rb +2 -2
  78. data/lib/fog/vsphere/requests/compute/host_start_maintenance.rb +2 -2
  79. data/lib/fog/vsphere/requests/compute/list_child_snapshots.rb +2 -2
  80. data/lib/fog/vsphere/requests/compute/list_clusters.rb +2 -2
  81. data/lib/fog/vsphere/requests/compute/list_compute_resources.rb +2 -2
  82. data/lib/fog/vsphere/requests/compute/list_customfields.rb +2 -2
  83. data/lib/fog/vsphere/requests/compute/list_datacenters.rb +2 -2
  84. data/lib/fog/vsphere/requests/compute/list_datastores.rb +4 -4
  85. data/lib/fog/vsphere/requests/compute/list_folders.rb +2 -2
  86. data/lib/fog/vsphere/requests/compute/list_groups.rb +2 -2
  87. data/lib/fog/vsphere/requests/compute/list_hosts.rb +2 -2
  88. data/lib/fog/vsphere/requests/compute/list_interface_types.rb +2 -2
  89. data/lib/fog/vsphere/requests/compute/list_networks.rb +4 -4
  90. data/lib/fog/vsphere/requests/compute/list_processes.rb +2 -2
  91. data/lib/fog/vsphere/requests/compute/list_resource_pools.rb +2 -2
  92. data/lib/fog/vsphere/requests/compute/list_rules.rb +2 -2
  93. data/lib/fog/vsphere/requests/compute/list_server_types.rb +2 -2
  94. data/lib/fog/vsphere/requests/compute/list_storage_pods.rb +2 -2
  95. data/lib/fog/vsphere/requests/compute/list_templates.rb +2 -2
  96. data/lib/fog/vsphere/requests/compute/list_virtual_machines.rb +2 -2
  97. data/lib/fog/vsphere/requests/compute/list_vm_cdroms.rb +3 -3
  98. data/lib/fog/vsphere/requests/compute/list_vm_customvalues.rb +2 -2
  99. data/lib/fog/vsphere/requests/compute/list_vm_interfaces.rb +3 -3
  100. data/lib/fog/vsphere/requests/compute/list_vm_scsi_controllers.rb +4 -4
  101. data/lib/fog/vsphere/requests/compute/list_vm_snapshots.rb +2 -2
  102. data/lib/fog/vsphere/requests/compute/list_vm_volumes.rb +2 -2
  103. data/lib/fog/vsphere/requests/compute/modify_vm_cdrom.rb +2 -2
  104. data/lib/fog/vsphere/requests/compute/modify_vm_controller.rb +2 -2
  105. data/lib/fog/vsphere/requests/compute/modify_vm_interface.rb +4 -4
  106. data/lib/fog/vsphere/requests/compute/modify_vm_volume.rb +2 -2
  107. data/lib/fog/vsphere/requests/compute/revert_to_snapshot.rb +2 -2
  108. data/lib/fog/vsphere/requests/compute/set_vm_customvalue.rb +2 -2
  109. data/lib/fog/vsphere/requests/compute/update_vm.rb +2 -2
  110. data/lib/fog/vsphere/requests/compute/upload_iso.rb +4 -4
  111. data/lib/fog/vsphere/requests/compute/vm_acquire_ticket.rb +2 -2
  112. data/lib/fog/vsphere/requests/compute/vm_clone.rb +11 -8
  113. data/lib/fog/vsphere/requests/compute/vm_config_vnc.rb +2 -2
  114. data/lib/fog/vsphere/requests/compute/vm_destroy.rb +2 -2
  115. data/lib/fog/vsphere/requests/compute/vm_execute.rb +2 -2
  116. data/lib/fog/vsphere/requests/compute/vm_migrate.rb +2 -2
  117. data/lib/fog/vsphere/requests/compute/vm_power_off.rb +2 -2
  118. data/lib/fog/vsphere/requests/compute/vm_power_on.rb +2 -2
  119. data/lib/fog/vsphere/requests/compute/vm_reboot.rb +2 -2
  120. data/lib/fog/vsphere/requests/compute/vm_reconfig_cdrom.rb +2 -2
  121. data/lib/fog/vsphere/requests/compute/vm_reconfig_cpus.rb +2 -2
  122. data/lib/fog/vsphere/requests/compute/vm_reconfig_hardware.rb +2 -2
  123. data/lib/fog/vsphere/requests/compute/vm_reconfig_memory.rb +2 -2
  124. data/lib/fog/vsphere/requests/compute/vm_reconfig_volumes.rb +2 -2
  125. data/lib/fog/vsphere/requests/compute/vm_relocate.rb +2 -2
  126. data/lib/fog/vsphere/requests/compute/vm_remove_snapshot.rb +2 -2
  127. data/lib/fog/vsphere/requests/compute/vm_rename.rb +2 -2
  128. data/lib/fog/vsphere/requests/compute/vm_revert_snapshot.rb +2 -2
  129. data/lib/fog/vsphere/requests/compute/vm_suspend.rb +2 -2
  130. data/lib/fog/vsphere/requests/compute/vm_take_snapshot.rb +2 -2
  131. data/lib/fog/vsphere/version.rb +1 -1
  132. data/tests/helper.rb +3 -0
  133. data/tests/models/compute/cluster_tests.rb +3 -3
  134. data/tests/models/compute/hosts_tests.rb +1 -1
  135. data/tests/models/compute/rules_tests.rb +1 -1
  136. data/tests/models/compute/server_tests.rb +4 -4
  137. data/tests/models/compute/server_unit_tests.rb +1 -1
  138. data/tests/models/compute/servers_tests.rb +1 -1
  139. data/tests/models/compute/tickets_tests.rb +1 -1
  140. data/tests/requests/compute/get_network_tests.rb +23 -15
  141. data/tests/requests/compute/revert_to_snapshot_tests.rb +1 -1
  142. data/tests/requests/compute/update_vm_tests.rb +1 -1
  143. data/tests/requests/compute/vm_clone_tests.rb +10 -5
  144. metadata +26 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 45a6779fc97119bf814c810a3953731bb574e97dc2a806922cfe7291f34c5acb
4
- data.tar.gz: 8606ad0e48b0715b2cfcbbc4e2d1e5976f93a6bce82942fb456d8c3acdd37b85
3
+ metadata.gz: 3104c3caaef8f008444f574b175899511cfb25ce937ab983ea7e2ca6c0973b97
4
+ data.tar.gz: 7272ca524f7453b3984522de5e493c7f394681f9a2a7624f88001085857240a0
5
5
  SHA512:
6
- metadata.gz: 02a8cf0c88859c98f9afb68f69b78b634e7db977a37ee457923c7bcad9cfe75721663bd353a974f16c9dbd3a93b11b5341f89a0b5e23836cf25b110a66925702
7
- data.tar.gz: e01bdf1f3c62f9be49e1a0d056823e411c49d5d95d736c3e668549442f9a36eafd9d6622b9f61126934f59eb96ce319abc94bf9aefa254265bf6cdc1d9927e49
6
+ metadata.gz: 00a479bae8d9529d030289f650ddb16785ff33742e50f8059897c3189a87b9fdba401dd41b77cf8b533778d2953f665d0c7386e3d6c26b02f1a8c3cf984dfe11
7
+ data.tar.gz: f1185b6844ae1b427b9f4064f04ce10ab3198bca8b822e3c6bddaaf8cc78494c8ab66acfe73a7bb705e5a92b7bf7f3f8cd9a02d7499ca0628f3cdbd1b4606b69
@@ -94,6 +94,10 @@ Metrics/ParameterLists:
94
94
  Metrics/PerceivedComplexity:
95
95
  Max: 159
96
96
 
97
+ Naming/FileName:
98
+ Exclude:
99
+ - 'lib/fog-vsphere.rb'
100
+
97
101
  # Offense count: 10
98
102
  Style/CaseEquality:
99
103
  Exclude:
@@ -1,6 +1,6 @@
1
1
  language: ruby
2
2
  sudo: false
3
- before_install: gem install bundler
3
+ before_install: gem install bundler -v 1.17.3
4
4
  matrix:
5
5
  allow_failures:
6
6
  - rvm: jruby-head
@@ -1,3 +1,12 @@
1
+ ## v3.0.0
2
+
3
+ * Change module namespace to Fog::Vsphere::Compute (#192)
4
+ * Update ruby string method to prevent traceback (#189)
5
+ * Allow builds with rbvmomi 2.0.0+ (#187)
6
+ * Raise error in case path and cluster do not exist (#183)
7
+ * Update vm_clone template to not always be false (#180)
8
+ * fetch datacenter by vm_mob_ref.path if user does not have permission to access hosts (#176)
9
+
1
10
  ## v2.5.0
2
11
 
3
12
  * Expose extraConfig from user_data for vm_clone #172
data/README.md CHANGED
@@ -26,6 +26,12 @@ Or install it yourself as:
26
26
  gem install fog-vsphere
27
27
  ```
28
28
 
29
+ ## Upgrading
30
+
31
+ In version 3.0.0 we have changed the namespacing of `Compute` service.
32
+ `Fog::Compute::Vsphere` became `Fog::Vsphere::Compute` as recommended by fog-core.
33
+ We hope we are not causing any issues as `Fog::Compute[:vsphere]` is only public API.
34
+
29
35
  ## Usage
30
36
 
31
37
  To connect to your vSphere instance with Fog vSphere:
@@ -67,7 +73,7 @@ compute.list_virtual_machines
67
73
 
68
74
  # List a VM's SCSI controllers
69
75
  compute.list_vm_scsi_controllers('ab589f9a-af35-428e-9690-9b96587d86f3')
70
- #=> [<Fog::Compute::Vsphere::SCSIController
76
+ #=> [<Fog::Vsphere::Compute::SCSIController
71
77
  #=> shared_bus='noSharing',
72
78
  #=> type='VirtualLsiLogicController',
73
79
  #=> unit_number=7,
@@ -22,12 +22,13 @@ Gem::Specification.new do |spec|
22
22
  spec.required_ruby_version = '>= 2.0.0'
23
23
 
24
24
  spec.add_runtime_dependency 'fog-core'
25
- spec.add_runtime_dependency 'rbvmomi', '~> 1.9'
25
+ spec.add_runtime_dependency 'rbvmomi', '>= 1.9', '< 3'
26
26
 
27
27
  spec.add_development_dependency 'bundler', '~> 1.10'
28
28
  spec.add_development_dependency 'pry', '~> 0.10'
29
29
  spec.add_development_dependency 'rake', '~> 10.0'
30
30
  spec.add_development_dependency 'minitest', '~> 5.8'
31
31
  spec.add_development_dependency 'rubocop', '~> 0.50.0'
32
+ spec.add_development_dependency 'mocha', '~> 1.8'
32
33
  spec.add_development_dependency 'shindo', '~> 0.3'
33
34
  end
@@ -0,0 +1 @@
1
+ require 'fog/vsphere'
@@ -3,7 +3,7 @@ class Vsphere < Fog::Bin
3
3
  def class_for(key)
4
4
  case key
5
5
  when :compute
6
- Fog::Compute::Vsphere
6
+ Fog::Vsphere::Compute
7
7
  else
8
8
  raise ArgumentError, "Unrecognized service: #{key}"
9
9
  end
@@ -1,10 +1,6 @@
1
1
  require 'fog/core'
2
2
 
3
3
  module Fog
4
- module Compute
5
- autoload :Vsphere, File.expand_path('../vsphere/compute.rb', __FILE__)
6
- end
7
-
8
4
  module Vsphere
9
5
  extend Fog::Provider
10
6
 
@@ -14,6 +10,8 @@ module Fog
14
10
  class NotFound < ServiceError; end
15
11
  end
16
12
 
13
+ autoload :Compute, File.expand_path('../vsphere/compute', __FILE__)
14
+
17
15
  service(:compute, 'Compute')
18
16
 
19
17
  # This helper was originally added as Fog.class_as_string and moved to core but only used here
@@ -1,8 +1,9 @@
1
1
  require 'digest/sha2'
2
2
  # rubocop:disable Lint/RescueWithoutErrorClass
3
+ # rubocop:disable Metrics/ModuleLength
3
4
  module Fog
4
- module Compute
5
- class Vsphere < Fog::Service
5
+ module Vsphere
6
+ class Compute < Fog::Service
6
7
  requires :vsphere_username, :vsphere_password, :vsphere_server
7
8
  recognizes :vsphere_port, :vsphere_path, :vsphere_ns
8
9
  recognizes :vsphere_rev, :vsphere_ssl, :vsphere_expected_pubkey_hash
@@ -199,12 +200,28 @@ module Fog
199
200
  # finished cloning.
200
201
  if attrs['hypervisor'].is_a?(RbVmomi::VIM::HostSystem)
201
202
  host = attrs['hypervisor']
203
+
204
+ # @note
205
+ # - User might not have permission to access host
206
+ # - i.e. host.name might raise NoPermission error
207
+ has_permission_to_access_host = true
208
+ begin
209
+ host.name
210
+ rescue RbVmomi::Fault => e
211
+ raise e unless e.message && e.message['NoPermission:']
212
+ has_permission_to_access_host = false
213
+ end
214
+
202
215
  attrs['datacenter'] = proc {
203
216
  begin
204
- parent_attribute(host.path, :datacenter)[1]
205
- rescue
206
- nil
207
- end
217
+ if has_permission_to_access_host
218
+ parent_attribute(host.path, :datacenter)[1]
219
+ else
220
+ parent_attribute(vm_mob_ref.path, :datacenter)[1]
221
+ end
222
+ rescue
223
+ nil
224
+ end
208
225
  }
209
226
  attrs['cluster'] = proc {
210
227
  begin
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Cdrom < Fog::Model
5
5
  identity :key
6
6
 
@@ -1,9 +1,9 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Cdroms < Fog::Collection
5
5
  attribute :instance_uuid, alias: :server_id
6
- model Fog::Compute::Vsphere::Cdrom
6
+ model Fog::Vsphere::Compute::Cdrom
7
7
 
8
8
  def all(_filters = {})
9
9
  load service.list_vm_cdroms(instance_uuid)
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Cluster < Fog::Model
5
5
  identity :id
6
6
 
@@ -1,10 +1,10 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Clusters < Fog::Collection
5
5
  autoload :Cluster, File.expand_path('../cluster', __FILE__)
6
6
 
7
- model Fog::Compute::Vsphere::Cluster
7
+ model Fog::Vsphere::Compute::Cluster
8
8
  attr_accessor :datacenter
9
9
 
10
10
  def all(filters = {})
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Customfield < Fog::Model
5
5
  identity :key
6
6
 
@@ -1,10 +1,10 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Customfields < Fog::Collection
5
5
  autoload :Customfield, File.expand_path('../customfield', __FILE__)
6
6
 
7
- model Fog::Compute::Vsphere::Customfield
7
+ model Fog::Vsphere::Compute::Customfield
8
8
 
9
9
  attr_accessor :vm
10
10
 
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Customvalue < Fog::Model
5
5
  attribute :value
6
6
  attribute :key
@@ -1,17 +1,17 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Customvalues < Fog::Collection
5
5
  autoload :Customvalue, File.expand_path('../customvalue', __FILE__)
6
6
 
7
- model Fog::Compute::Vsphere::Customvalue
7
+ model Fog::Vsphere::Compute::Customvalue
8
8
 
9
9
  attr_accessor :vm
10
10
 
11
11
  def all(_filters = {})
12
12
  requires :vm
13
13
  case vm
14
- when Fog::Compute::Vsphere::Server
14
+ when Fog::Vsphere::Compute::Server
15
15
  load service.list_vm_customvalues(vm.id)
16
16
  else
17
17
  raise 'customvalues should have vm'
@@ -21,7 +21,7 @@ module Fog
21
21
  def get(key)
22
22
  requires :vm
23
23
  case vm
24
- when Fog::Compute::Vsphere::Server
24
+ when Fog::Vsphere::Compute::Server
25
25
  load service.list_vm_customvalues(vm.id)
26
26
  else
27
27
  raise 'customvalues should have vm'
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Datacenter < Fog::Model
5
5
  identity :id
6
6
  attribute :name
@@ -1,10 +1,10 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Datacenters < Fog::Collection
5
5
  autoload :Datacenter, File.expand_path('../datacenter', __FILE__)
6
6
 
7
- model Fog::Compute::Vsphere::Datacenter
7
+ model Fog::Vsphere::Compute::Datacenter
8
8
 
9
9
  def all(filters = {})
10
10
  load service.list_datacenters(filters)
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Datastore < Fog::Model
5
5
  identity :id
6
6
 
@@ -1,10 +1,10 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Datastores < Fog::Collection
5
5
  autoload :Datastore, File.expand_path('../datastore', __FILE__)
6
6
 
7
- model Fog::Compute::Vsphere::Datastore
7
+ model Fog::Vsphere::Compute::Datastore
8
8
  attr_accessor :datacenter, :cluster
9
9
 
10
10
  def all(filters = {})
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Folder < Fog::Model
5
5
  identity :id
6
6
 
@@ -1,10 +1,10 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Folders < Fog::Collection
5
5
  autoload :Folder, File.expand_path('../folder', __FILE__)
6
6
 
7
- model Fog::Compute::Vsphere::Folder
7
+ model Fog::Vsphere::Compute::Folder
8
8
  attr_accessor :datacenter, :type, :path
9
9
 
10
10
  def all(filters = {})
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Host < Fog::Model
5
5
  identity :name
6
6
 
@@ -1,11 +1,11 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Hosts < Fog::Collection
5
5
  attribute :datacenter
6
6
  attribute :cluster
7
7
 
8
- model Fog::Compute::Vsphere::Host
8
+ model Fog::Vsphere::Compute::Host
9
9
 
10
10
  def all(_filters = {})
11
11
  requires :datacenter, :cluster
@@ -14,7 +14,7 @@ module Fog
14
14
 
15
15
  def get(name)
16
16
  all.find { |host| host.name == name } ||
17
- raise(Fog::Compute::Vsphere::NotFound, "no such host #{name}")
17
+ raise(Fog::Vsphere::Compute::NotFound, "no such host #{name}")
18
18
  end
19
19
  end
20
20
  end
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Interface < Fog::Model
5
5
  SAVE_MUTEX = Mutex.new
6
6
 
@@ -1,10 +1,10 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Interfaces < Fog::Collection
5
5
  autoload :Interface, File.expand_path('../interface', __FILE__)
6
6
 
7
- model Fog::Compute::Vsphere::Interface
7
+ model Fog::Vsphere::Compute::Interface
8
8
 
9
9
  attribute :server_id
10
10
 
@@ -12,9 +12,9 @@ module Fog
12
12
  requires :server_id
13
13
 
14
14
  case server
15
- when Fog::Compute::Vsphere::Server
15
+ when Fog::Vsphere::Compute::Server
16
16
  load service.list_vm_interfaces(server.id)
17
- when Fog::Compute::Vsphere::Template
17
+ when Fog::Vsphere::Compute::Template
18
18
  load service.list_template_interfaces(server.id)
19
19
  else
20
20
  raise 'interfaces should have vm or template'
@@ -28,9 +28,9 @@ module Fog
28
28
  requires :server_id
29
29
 
30
30
  case server
31
- when Fog::Compute::Vsphere::Server
31
+ when Fog::Vsphere::Compute::Server
32
32
  interface = service.get_vm_interface(server.id, key: id, mac: id, name: id, datacenter: server.datacenter)
33
- when Fog::Compute::Vsphere::Template
33
+ when Fog::Vsphere::Compute::Template
34
34
  interface = service.get_template_interfaces(server.id, key: id, mac: id, name: id)
35
35
  else
36
36
 
@@ -38,7 +38,7 @@ module Fog
38
38
  end
39
39
 
40
40
  if interface
41
- Fog::Compute::Vsphere::Interface.new(interface.merge(server_id: server.id, service: service))
41
+ Fog::Vsphere::Compute::Interface.new(interface.merge(server_id: server.id, service: service))
42
42
  end
43
43
  end
44
44
 
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Interfacetype < Fog::Model
5
5
  identity :id
6
6