(ctx context.Context, databaseID, addonID string, params scalingo.FirewallRuleCreateParams)
| 50 | } |
| 51 | |
| 52 | func FirewallRulesAdd(ctx context.Context, databaseID, addonID string, params scalingo.FirewallRuleCreateParams) error { |
| 53 | c, err := config.ScalingoClient(ctx) |
| 54 | if err != nil { |
| 55 | return errors.Wrap(ctx, err, "get Scalingo client") |
| 56 | } |
| 57 | |
| 58 | rule, err := c.Preview().FirewallRulesCreate(ctx, databaseID, addonID, params) |
| 59 | if err != nil { |
| 60 | return errors.Wrap(ctx, err, "add firewall rule") |
| 61 | } |
| 62 | |
| 63 | io.Statusf("Firewall rule '%s' has been added to database '%s'.\n", rule.ID, databaseID) |
| 64 | io.Warning("Expect some delay for the firewall rules to be applied.") |
| 65 | |
| 66 | return nil |
| 67 | } |
| 68 | |
| 69 | func FirewallRulesRemove(ctx context.Context, databaseID, addonID, ruleID string) error { |
| 70 | c, err := config.ScalingoClient(ctx) |
no test coverage detected