Class: VCenterDriver::DistributedPortGroup

Inherits:
Network
  • Object
show all
Defined in:
lib/network.rb

Overview

Class DistributedPortGroup

Constant Summary

Constants inherited from Network

Network::NETWORK_TYPE_DPG, Network::NETWORK_TYPE_NSXT, Network::NETWORK_TYPE_NSXV, Network::NETWORK_TYPE_PG, Network::NETWORK_TYPE_UNKNOWN, Network::REQUIRED_ATTRS

Instance Attribute Summary

Attributes inherited from Network

#item

Instance Method Summary collapse

Methods inherited from Network

create_one_network, generate_name, get_network_type, new_from_ref, nic?, remove_net_ref, retrieve_vlanid, to_one, to_one_template, virtual_switch, vlanid

Methods included from Memoize

#[], #[]=, #clear, #clear_all

Constructor Details

#initialize(item, vi_client = nil, _check = true) ⇒ DistributedPortGroup

Returns a new instance of DistributedPortGroup.



408
409
410
411
412
# File 'lib/network.rb', line 408

def initialize(item, vi_client = nil, _check = true)
    check_item(item, RbVmomi::VIM::DistributedVirtualPortgroup)

    super(item, vi_client, false)
end

Instance Method Details

#clustersObject



414
415
416
417
418
419
420
421
422
423
424
425
426
# File 'lib/network.rb', line 414

def clusters
    net_clusters = {}
    # should have to work
    # host_members =@item['host']
    host_members =
        self['config.distributedVirtualSwitch.summary.hostMember']
    host_members.each do |h|
        if !net_clusters.key?(h.parent._ref.to_s)
            net_clusters[h.parent._ref.to_s] = h.parent.name.to_s
        end
    end
    net_clusters
end

#network_typeObject



428
429
430
# File 'lib/network.rb', line 428

def network_type
    VCenterDriver::Network::NETWORK_TYPE_DPG
end