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

Method SystemResourceUpdate

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

Source from the content-addressed store, hash-verified

1434}
1435
1436func (s *Server) SystemResourceUpdate(c *stdapi.Context) error {
1437 if err := s.hook("SystemResourceUpdateValidate", c); err != nil {
1438 return err
1439 }
1440
1441 name := c.Var("name")
1442
1443 var opts structs.ResourceUpdateOptions
1444 if err := stdapi.UnmarshalOptions(c.Request(), &opts); err != nil {
1445 return err
1446 }
1447
1448 v, err := s.provider(c).WithContext(c.Context()).SystemResourceUpdate(name, opts)
1449 if err != nil {
1450 return err
1451 }
1452
1453 if vs, ok := interface{}(v).(Sortable); ok {
1454 sort.Slice(v, vs.Less)
1455 }
1456
1457 return c.RenderJSON(v)
1458}
1459
1460func (s *Server) SystemSyncInstancesIp(c *stdapi.Context) error {
1461 err := s.provider(c).WithContext(c.Context()).SyncInstancesIpInSecurityGroup()

Callers

nothing calls this directly

Calls 7

hookMethod · 0.95
providerMethod · 0.95
RequestMethod · 0.80
ContextMethod · 0.80
SliceMethod · 0.80
SystemResourceUpdateMethod · 0.65
WithContextMethod · 0.65

Tested by

no test coverage detected