(ctx context.Context, app string)
| 11 | ) |
| 12 | |
| 13 | func 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 | } |
no test coverage detected