Sha256: 1c107e6420014d37f09c8e4abe1056db1acbe82ac77f4ef8ceb3655af394e52c
Contents?: true
Size: 1.22 KB
Versions: 23
Compression:
Stored size: 1.22 KB
Contents
module Fog module Vsphere class Compute class Real def destroy_group(attributes = {}) cluster = get_raw_cluster(attributes[:cluster], attributes[:datacenter]) group = cluster.configurationEx.group.find { |g| g.name == attributes[:name] } raise Fog::Vsphere::Error::NotFound, "group #{attributes[:name]} not found" unless group delete_spec = RbVmomi::VIM.ClusterConfigSpecEx(groupSpec: [ RbVmomi::VIM.ClusterGroupSpec( operation: RbVmomi::VIM.ArrayUpdateOperation('remove'), removeKey: group.name ) ]) cluster.ReconfigureComputeResource_Task(spec: delete_spec, modify: true).wait_for_completion end end class Mock def destroy_group(attributes = {}) group = data[:groups][attributes[:name]] raise Fog::Vsphere::Error::NotFound unless group data[:groups].delete(attributes[:name]) end end end end end
Version data entries
23 entries across 23 versions & 1 rubygems