(c *stdapi.Context)
| 575 | } |
| 576 | |
| 577 | func (s *Server) InstanceShell(c *stdapi.Context) error { |
| 578 | if err := s.hook("InstanceShellValidate", c); err != nil { |
| 579 | return err |
| 580 | } |
| 581 | |
| 582 | id := c.Var("id") |
| 583 | |
| 584 | var opts structs.InstanceShellOptions |
| 585 | if err := stdapi.UnmarshalOptions(c.Request(), &opts); err != nil { |
| 586 | return err |
| 587 | } |
| 588 | |
| 589 | v, err := s.provider(c).WithContext(c.Context()).InstanceShell(id, stdsdk.NewAdapterWs(c.Websocket()), opts) |
| 590 | if err != nil { |
| 591 | return err |
| 592 | } |
| 593 | |
| 594 | if vs, ok := interface{}(v).(Sortable); ok { |
| 595 | sort.Slice(v, vs.Less) |
| 596 | } |
| 597 | |
| 598 | return renderStatusCode(c, v) |
| 599 | } |
| 600 | |
| 601 | func (s *Server) InstanceTerminate(c *stdapi.Context) error { |
| 602 | if err := s.hook("InstanceTerminateValidate", c); err != nil { |
nothing calls this directly
no test coverage detected