MCPcopy Create free account
hub / github.com/Scalingo/cli / List

Function List

addons/list.go:13–32  ·  view source on GitHub ↗
(ctx context.Context, app string)

Source from the content-addressed store, hash-verified

11)
12
13func List(ctx context.Context, app string) error {
14 c, err := config.ScalingoClient(ctx)
15 if err != nil {
16 return errors.Wrapf(ctx, err, "fail to get Scalingo client")
17 }
18 resources, err := c.AddonsList(ctx, app)
19 if err != nil {
20 return errors.Wrap(ctx, err, "addons list")
21 }
22
23 t := tablewriter.NewWriter(os.Stdout)
24 t.Header([]string{"Addon", "ID", "Plan", "Status"})
25
26 for _, resource := range resources {
27 t.Append([]string{resource.AddonProvider.Name, resource.ID, resource.Plan.Name, string(resource.Status)})
28 }
29 t.Render()
30
31 return nil
32}

Callers 1

addons.goFile · 0.92

Calls 2

ScalingoClientFunction · 0.92
RenderMethod · 0.65

Tested by

no test coverage detected