MCPcopy Create free account
hub / github.com/convox/rack / InstanceShell

Method InstanceShell

pkg/api/controllers.go:577–599  ·  view source on GitHub ↗
(c *stdapi.Context)

Source from the content-addressed store, hash-verified

575}
576
577func (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
601func (s *Server) InstanceTerminate(c *stdapi.Context) error {
602 if err := s.hook("InstanceTerminateValidate", c); err != nil {

Callers

nothing calls this directly

Calls 9

hookMethod · 0.95
providerMethod · 0.95
renderStatusCodeFunction · 0.85
RequestMethod · 0.80
ContextMethod · 0.80
WebsocketMethod · 0.80
SliceMethod · 0.80
InstanceShellMethod · 0.65
WithContextMethod · 0.65

Tested by

no test coverage detected