build(deps): bump github.com/vmware/govmomi from 0.23.0 to 0.26.1

Bumps [github.com/vmware/govmomi](https://github.com/vmware/govmomi) from 0.23.0 to 0.26.1.
- [Release notes](https://github.com/vmware/govmomi/releases)
- [Changelog](https://github.com/vmware/govmomi/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vmware/govmomi/compare/v0.23.0...v0.26.1)

---
updated-dependencies:
- dependency-name: github.com/vmware/govmomi
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot] 2021-09-04 17:51:27 +00:00 committed by Ondřej Budai
parent 974c258382
commit 137819b9cd
77 changed files with 7610 additions and 486 deletions

View file

@ -36,6 +36,7 @@ type console struct {
*flags.VirtualMachineFlag
h5 bool
wss bool
capture string
}
@ -48,6 +49,7 @@ func (cmd *console) Register(ctx context.Context, f *flag.FlagSet) {
cmd.VirtualMachineFlag.Register(ctx, f)
f.BoolVar(&cmd.h5, "h5", false, "Generate HTML5 UI console link")
f.BoolVar(&cmd.wss, "wss", false, "Generate WebSocket console link")
f.StringVar(&cmd.capture, "capture", "", "Capture console screen shot to file")
}
@ -127,6 +129,17 @@ func (cmd *console) Run(ctx context.Context, f *flag.FlagSet) error {
return c.DownloadFile(ctx, cmd.capture, u, &param)
}
if cmd.wss {
ticket, err := vm.AcquireTicket(ctx, string(types.VirtualMachineTicketTypeWebmks))
if err != nil {
return err
}
link := fmt.Sprintf("wss://%s:%d/ticket/%s", ticket.Host, ticket.Port, ticket.Ticket)
fmt.Fprintln(cmd.Out, link)
return nil
}
m := session.NewManager(c)
ticket, err := m.AcquireCloneTicket(ctx)
if err != nil {
@ -167,7 +180,7 @@ func (cmd *console) Run(ctx context.Context, f *flag.FlagSet) error {
link = fmt.Sprintf("vmrc://clone:%s@%s/?moid=%s", ticket, u.Hostname(), vm.Reference().Value)
}
fmt.Fprintln(os.Stdout, link)
fmt.Fprintln(cmd.Out, link)
return nil
}