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

Function FindPlan

utils/plans.go:10–21  ·  view source on GitHub ↗
(ctx context.Context, c *scalingo.Client, addon, plan string)

Source from the content-addressed store, hash-verified

8)
9
10func FindPlan(ctx context.Context, c *scalingo.Client, addon, plan string) (string, error) {
11 plans, err := c.AddonProviderPlansList(ctx, addon, scalingo.AddonProviderPlansListOpts{})
12 if err != nil {
13 return "", errors.Wrapf(ctx, err, "list addon %s plans", addon)
14 }
15 for _, p := range plans {
16 if plan == p.Name {
17 return p.ID, nil
18 }
19 }
20 return "", errors.Newf(ctx, "no plan %s found for addon %s", plan, addon)
21}

Callers 4

UpgradeFunction · 0.92
CreateFunction · 0.92
ProvisionFunction · 0.92
UpgradeFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected