(c *stdapi.Context)
| 318 | } |
| 319 | |
| 320 | func (s *Server) BuildUpdate(c *stdapi.Context) error { |
| 321 | if err := s.hook("BuildUpdateValidate", c); err != nil { |
| 322 | return err |
| 323 | } |
| 324 | |
| 325 | app := c.Var("app") |
| 326 | id := c.Var("id") |
| 327 | |
| 328 | var opts structs.BuildUpdateOptions |
| 329 | if err := stdapi.UnmarshalOptions(c.Request(), &opts); err != nil { |
| 330 | return err |
| 331 | } |
| 332 | |
| 333 | v, err := s.provider(c).WithContext(c.Context()).BuildUpdate(app, id, opts) |
| 334 | if err != nil { |
| 335 | return err |
| 336 | } |
| 337 | |
| 338 | if vs, ok := interface{}(v).(Sortable); ok { |
| 339 | sort.Slice(v, vs.Less) |
| 340 | } |
| 341 | |
| 342 | return c.RenderJSON(v) |
| 343 | } |
| 344 | |
| 345 | func (s *Server) CapacityGet(c *stdapi.Context) error { |
| 346 | if err := s.hook("CapacityGetValidate", c); err != nil { |
nothing calls this directly
no test coverage detected