Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for OpaqueNetwork type #622

Merged
merged 1 commit into from
Nov 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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