-
Notifications
You must be signed in to change notification settings - Fork 913
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wraps the ContainerView managed object. (#667)
- Loading branch information
1 parent
93064c0
commit 4994038
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package view | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/vmware/govmomi/object" | ||
"github.com/vmware/govmomi/vim25" | ||
"github.com/vmware/govmomi/vim25/methods" | ||
"github.com/vmware/govmomi/vim25/types" | ||
) | ||
|
||
type ContainerView struct { | ||
object.Common | ||
} | ||
|
||
func NewContainerView(c *vim25.Client, ref types.ManagedObjectReference) *ContainerView { | ||
return &ContainerView{ | ||
Common: object.NewCommon(c, ref), | ||
} | ||
} | ||
|
||
func (v ContainerView) Destroy(ctx context.Context) error { | ||
req := types.DestroyView{ | ||
This: v.Reference(), | ||
} | ||
_, err := methods.DestroyView(ctx, v.Client(), &req) | ||
return err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters