DisableFeature is the command handler to disable a database feature on a database addon like 'force-ssl' or 'public-availability'
(ctx context.Context, app, addon, feature string)
| 81 | // DisableFeature is the command handler to disable a database feature on a |
| 82 | // database addon like 'force-ssl' or 'public-availability' |
| 83 | func DisableFeature(ctx context.Context, app, addon, feature string) error { |
| 84 | spinner := spinner.New(spinner.CharSets[11], 100*time.Millisecond) |
| 85 | spinner.Suffix = " Disabling database feature" |
| 86 | spinner.Start() |
| 87 | defer spinner.Stop() |
| 88 | |
| 89 | client, err := config.ScalingoClient(ctx) |
| 90 | if err != nil { |
| 91 | return errors.Wrapf(ctx, err, "fail to get Scalingo client") |
| 92 | } |
| 93 | |
| 94 | _, err = client.DatabaseDisableFeature(ctx, app, addon, feature) |
| 95 | if err != nil { |
| 96 | return errors.Wrapf(ctx, err, "fail to disable feature '%v'", feature) |
| 97 | } |
| 98 | spinner.Stop() |
| 99 | |
| 100 | io.Statusf("Feature %v has been disabled.\n", feature) |
| 101 | |
| 102 | return nil |
| 103 | } |
no test coverage detected