Skip to content

Commit ed93d0c

Browse files
docs(cockpit): deprecate managed alerts routes (scaleway#5061)
Co-authored-by: Jonathan Remy <[email protected]>
1 parent 1e904ab commit ed93d0c

File tree

3 files changed

+3
-100
lines changed

3 files changed

+3
-100
lines changed

cmd/scw/testdata/test-all-usage-cockpit-managed-alerts-usage.golden

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
Managed alerts management commands.
44

55
USAGE:
6-
scw cockpit managed-alerts <command>
7-
8-
AVAILABLE COMMANDS:
9-
disable Disable managed alerts
10-
enable Enable managed alerts
6+
scw cockpit managed-alerts
117

128
FLAGS:
139
-h, --help help for managed-alerts
@@ -17,5 +13,3 @@ GLOBAL FLAGS:
1713
-D, --debug Enable debug mode
1814
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
1915
-p, --profile string The config profile to use
20-
21-
Use "scw cockpit managed-alerts [command] --help" for more information about a command.

docs/commands/cockpit.md

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ This API allows you to manage your Scaleway Cockpit, for storing and visualizing
2525
- [List Grafana users](#list-grafana-users)
2626
- [Reset a Grafana user password](#reset-a-grafana-user-password)
2727
- [Managed alerts management commands](#managed-alerts-management-commands)
28-
- [Disable managed alerts](#disable-managed-alerts)
29-
- [Enable managed alerts](#enable-managed-alerts)
3028
- [Pricing plans management commands](#pricing-plans-management-commands)
3129
- [Get current plan](#get-current-plan)
3230
- [List plan types](#list-plan-types)
@@ -431,46 +429,15 @@ scw cockpit grafana-user reset-password [arg=value ...]
431429

432430
Managed alerts management commands.
433431

434-
435-
### Disable managed alerts
436-
437-
Disable the sending of managed alerts for the specified Project.
438-
439-
**Usage:**
440-
441-
```
442-
scw cockpit managed-alerts disable [arg=value ...]
443-
```
444-
445-
446-
**Args:**
447-
448-
| Name | | Description |
449-
|------|---|-------------|
450-
| project-id | | Project ID to use. If none is passed the default project ID will be used |
451-
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config |
452-
453-
454-
455-
### Enable managed alerts
456-
457-
Enable the sending of managed alerts for the specified Project. Managed alerts are predefined alerts that apply to Scaleway recources integrated with Cockpit by default.
432+
Managed alerts management commands.
458433

459434
**Usage:**
460435

461436
```
462-
scw cockpit managed-alerts enable [arg=value ...]
437+
scw cockpit managed-alerts
463438
```
464439

465440

466-
**Args:**
467-
468-
| Name | | Description |
469-
|------|---|-------------|
470-
| project-id | | Project ID to use. If none is passed the default project ID will be used |
471-
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config |
472-
473-
474441

475442
## Pricing plans management commands
476443

internal/namespaces/cockpit/v1/cockpit_cli.go

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ func GetGeneratedCommands() *core.Commands {
5858
cockpitContactPointCreate(),
5959
cockpitContactPointList(),
6060
cockpitContactPointDelete(),
61-
cockpitManagedAlertsEnable(),
62-
cockpitManagedAlertsDisable(),
6361
cockpitTestAlertTrigger(),
6462
)
6563
}
@@ -1239,62 +1237,6 @@ func cockpitContactPointDelete() *core.Command {
12391237
}
12401238
}
12411239

1242-
func cockpitManagedAlertsEnable() *core.Command {
1243-
return &core.Command{
1244-
Short: `Enable managed alerts`,
1245-
Long: `Enable the sending of managed alerts for the specified Project. Managed alerts are predefined alerts that apply to Scaleway recources integrated with Cockpit by default.`,
1246-
Namespace: "cockpit",
1247-
Resource: "managed-alerts",
1248-
Verb: "enable",
1249-
// Deprecated: false,
1250-
ArgsType: reflect.TypeOf(cockpit.RegionalAPIEnableManagedAlertsRequest{}),
1251-
ArgSpecs: core.ArgSpecs{
1252-
core.ProjectIDArgSpec(),
1253-
core.RegionArgSpec(
1254-
scw.RegionFrPar,
1255-
scw.RegionNlAms,
1256-
scw.RegionPlWaw,
1257-
),
1258-
},
1259-
Run: func(ctx context.Context, args any) (i any, e error) {
1260-
request := args.(*cockpit.RegionalAPIEnableManagedAlertsRequest)
1261-
1262-
client := core.ExtractClient(ctx)
1263-
api := cockpit.NewRegionalAPI(client)
1264-
1265-
return api.EnableManagedAlerts(request)
1266-
},
1267-
}
1268-
}
1269-
1270-
func cockpitManagedAlertsDisable() *core.Command {
1271-
return &core.Command{
1272-
Short: `Disable managed alerts`,
1273-
Long: `Disable the sending of managed alerts for the specified Project.`,
1274-
Namespace: "cockpit",
1275-
Resource: "managed-alerts",
1276-
Verb: "disable",
1277-
// Deprecated: false,
1278-
ArgsType: reflect.TypeOf(cockpit.RegionalAPIDisableManagedAlertsRequest{}),
1279-
ArgSpecs: core.ArgSpecs{
1280-
core.ProjectIDArgSpec(),
1281-
core.RegionArgSpec(
1282-
scw.RegionFrPar,
1283-
scw.RegionNlAms,
1284-
scw.RegionPlWaw,
1285-
),
1286-
},
1287-
Run: func(ctx context.Context, args any) (i any, e error) {
1288-
request := args.(*cockpit.RegionalAPIDisableManagedAlertsRequest)
1289-
1290-
client := core.ExtractClient(ctx)
1291-
api := cockpit.NewRegionalAPI(client)
1292-
1293-
return api.DisableManagedAlerts(request)
1294-
},
1295-
}
1296-
}
1297-
12981240
func cockpitTestAlertTrigger() *core.Command {
12991241
return &core.Command{
13001242
Short: `Trigger a test alert`,

0 commit comments

Comments
 (0)