Skip to content

Commit

Permalink
Merge pull request #622 from dougm/nsx
Browse files Browse the repository at this point in the history
Add support for OpaqueNetwork type
  • Loading branch information
dougm authored Nov 2, 2016
2 parents be2955e + 128b352 commit f493a3c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

### unreleased

* Add support for OpaqueNetwork type to Finder

* Add HostConfigManager.AccountManager support for ESX 5.5

### 0.11.1 (2016-10-27)
Expand Down
2 changes: 1 addition & 1 deletion find/finder.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ func (f *Finder) NetworkList(ctx context.Context, path string) ([]object.Network
for _, e := range es {
ref := e.Object.Reference()
switch ref.Type {
case "Network":
case "Network", "OpaqueNetwork":
r := object.NewNetwork(f.client, ref)
r.InventoryPath = e.Path
ns = append(ns, r)
Expand Down
8 changes: 8 additions & 0 deletions govc/vm/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ func (r *infoResult) collectReferences(pc *property.Collector, ctx context.Conte

var host []mo.HostSystem
var network []mo.Network
var opaque []mo.OpaqueNetwork
var dvp []mo.DistributedVirtualPortgroup
var datastore []mo.Datastore
// Table to drive inflating refs to their mo.* counterparts (dest)
Expand All @@ -193,6 +194,13 @@ func (r *infoResult) collectReferences(pc *property.Collector, ctx context.Conte
}
},
},
"OpaqueNetwork": {
&opaque, nil, func() {
for _, e := range opaque {
r.entities[e.Reference()] = e.Name
}
},
},
"DistributedVirtualPortgroup": {
&dvp, nil, func() {
for _, e := range dvp {
Expand Down
2 changes: 2 additions & 0 deletions list/lister.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ func ToElement(r mo.Reference, prefix string) Element {
// Network entity folders on an ESXi host can contain only Network objects.
case mo.Network:
name = m.Name
case mo.OpaqueNetwork:
name = m.Name
case mo.DistributedVirtualSwitch:
name = m.Name
case mo.DistributedVirtualPortgroup:
Expand Down
2 changes: 1 addition & 1 deletion object/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func NewReference(c *vim25.Client, e types.ManagedObjectReference) Reference {
return NewClusterComputeResource(c, e)
case "HostSystem":
return NewHostSystem(c, e)
case "Network":
case "Network", "OpaqueNetwork":
return NewNetwork(c, e)
case "ResourcePool":
return NewResourcePool(c, e)
Expand Down

0 comments on commit f493a3c

Please sign in to comment.