Skip to content

Commit

Permalink
Exported FindSnapshot() Method (#715)
Browse files Browse the repository at this point in the history
  • Loading branch information
aniketGslab authored and dougm committed May 4, 2017
1 parent b8b228c commit 0ccad10
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions object/virtual_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,11 +518,11 @@ func (m snapshotMap) add(parent string, tree []types.VirtualMachineSnapshotTree)
}
}

// findSnapshot supports snapshot lookup by name, where name can be:
// FindSnapshot supports snapshot lookup by name, where name can be:
// 1) snapshot ManagedObjectReference.Value (unique)
// 2) snapshot name (may not be unique)
// 3) snapshot tree path (may not be unique)
func (v VirtualMachine) findSnapshot(ctx context.Context, name string) (Reference, error) {
func (v VirtualMachine) FindSnapshot(ctx context.Context, name string) (Reference, error) {
var o mo.VirtualMachine

err := v.Properties(ctx, v.Reference(), []string{"snapshot"}, &o)
Expand Down Expand Up @@ -550,7 +550,7 @@ func (v VirtualMachine) findSnapshot(ctx context.Context, name string) (Referenc

// RemoveSnapshot removes a named snapshot
func (v VirtualMachine) RemoveSnapshot(ctx context.Context, name string, removeChildren bool, consolidate *bool) (*Task, error) {
snapshot, err := v.findSnapshot(ctx, name)
snapshot, err := v.FindSnapshot(ctx, name)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -586,7 +586,7 @@ func (v VirtualMachine) RevertToCurrentSnapshot(ctx context.Context, suppressPow

// RevertToSnapshot reverts to a named snapshot
func (v VirtualMachine) RevertToSnapshot(ctx context.Context, name string, suppressPowerOn bool) (*Task, error) {
snapshot, err := v.findSnapshot(ctx, name)
snapshot, err := v.FindSnapshot(ctx, name)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 0ccad10

Please sign in to comment.