Skip to content

Commit 71ca2c7

Browse files
feat(cockpit): add new Data-exporter endpoints + types (#5149)
Co-authored-by: Jonathan R. <[email protected]>
1 parent a42f9f4 commit 71ca2c7

10 files changed

+45
-33
lines changed

cmd/scw/testdata/test-all-usage-cockpit-grafana-user-create-usage.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Create a Grafana user
34
Create a Grafana user to connect to your Cockpit's Grafana. Upon creation, your user password displays only once, so make sure that you save it.
45
Each Grafana user is associated with a role: viewer or editor. A viewer can only view dashboards, whereas an editor can create and edit dashboards. Note that the `admin` username is not available for creation.
56

cmd/scw/testdata/test-all-usage-cockpit-grafana-user-delete-usage.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Delete a Grafana user
34
Delete a Grafana user from your Cockpit's Grafana, specified by the ID of the Project the Cockpit belongs to, and the ID of the Grafana user.
45

56
USAGE:

cmd/scw/testdata/test-all-usage-cockpit-grafana-user-list-usage.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
List Grafana users
34
List all Grafana users created in your Cockpit's Grafana. By default, the Grafana users returned in the list are ordered in ascending order.
45

56
USAGE:

cmd/scw/testdata/test-all-usage-cockpit-grafana-user-reset-password-usage.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Reset a Grafana user password
34
Reset the password of a Grafana user, specified by the ID of the Project the Cockpit belongs to, and the ID of the Grafana user.
45
A new password regenerates and only displays once. Make sure that you save it.
56

cmd/scw/testdata/test-all-usage-cockpit-grafana-user-usage.golden

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ USAGE:
66
scw cockpit grafana-user <command>
77

88
AVAILABLE COMMANDS:
9-
create Create a Grafana user
10-
delete Delete a Grafana user
11-
list List Grafana users
12-
reset-password Reset a Grafana user password
9+
create (Deprecated) EOL 2026-01-20
10+
delete (Deprecated) EOL 2026-01-20
11+
list (Deprecated) EOL 2026-01-20
12+
reset-password (Deprecated) EOL 2026-01-20
1313

1414
FLAGS:
1515
-h, --help help for grafana-user

cmd/scw/testdata/test-all-usage-cockpit-plan-get-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
33
Retrieve a pricing plan for the given Project, specified by the ID of the Project.
4-
Deprecated: retention is now managed at the data source level.
4+
Deprecated due to retention now being managed at the data source level.
55

66
USAGE:
77
scw cockpit plan get [arg=value ...]

cmd/scw/testdata/test-all-usage-cockpit-plan-list-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
33
Retrieve a list of available pricing plan types.
4-
Deprecated: retention is now managed at the data source level.
4+
Deprecated due to retention now being managed at the data source level.
55

66
USAGE:
77
scw cockpit plan list [arg=value ...]

cmd/scw/testdata/test-all-usage-cockpit-plan-select-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
33
Apply a pricing plan on a given Project. You must specify the ID of the pricing plan type. Note that you will be billed for the plan you apply.
4-
Deprecated: retention is now managed at the data source level.
4+
Deprecated due to retention now being managed at the data source level.
55

66
USAGE:
77
scw cockpit plan select [arg=value ...]

docs/commands/cockpit.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ This API allows you to manage your Scaleway Cockpit, for storing and visualizing
2020
- [Get your Cockpit's Grafana](#get-your-cockpit's-grafana)
2121
- [Synchronize Grafana data sources](#synchronize-grafana-data-sources)
2222
- [Grafana user management commands](#grafana-user-management-commands)
23-
- [Create a Grafana user](#create-a-grafana-user)
24-
- [Delete a Grafana user](#delete-a-grafana-user)
25-
- [List Grafana users](#list-grafana-users)
26-
- [Reset a Grafana user password](#reset-a-grafana-user-password)
23+
- [(Deprecated) EOL 2026-01-20](#(deprecated)-eol-2026-01-20)
24+
- [(Deprecated) EOL 2026-01-20](#(deprecated)-eol-2026-01-20)
25+
- [(Deprecated) EOL 2026-01-20](#(deprecated)-eol-2026-01-20)
26+
- [(Deprecated) EOL 2026-01-20](#(deprecated)-eol-2026-01-20)
2727
- [Managed alerts management commands](#managed-alerts-management-commands)
2828
- [Pricing plans management commands](#pricing-plans-management-commands)
2929
- [Get current plan](#get-current-plan)
@@ -342,8 +342,9 @@ scw cockpit grafana sync-data-sources [arg=value ...]
342342
Grafana user management commands.
343343

344344

345-
### Create a Grafana user
345+
### (Deprecated) EOL 2026-01-20
346346

347+
Create a Grafana user
347348
Create a Grafana user to connect to your Cockpit's Grafana. Upon creation, your user password displays only once, so make sure that you save it.
348349
Each Grafana user is associated with a role: viewer or editor. A viewer can only view dashboards, whereas an editor can create and edit dashboards. Note that the `admin` username is not available for creation.
349350

@@ -364,8 +365,9 @@ scw cockpit grafana-user create [arg=value ...]
364365

365366

366367

367-
### Delete a Grafana user
368+
### (Deprecated) EOL 2026-01-20
368369

370+
Delete a Grafana user
369371
Delete a Grafana user from your Cockpit's Grafana, specified by the ID of the Project the Cockpit belongs to, and the ID of the Grafana user.
370372

371373
**Usage:**
@@ -384,8 +386,9 @@ scw cockpit grafana-user delete [arg=value ...]
384386

385387

386388

387-
### List Grafana users
389+
### (Deprecated) EOL 2026-01-20
388390

391+
List Grafana users
389392
List all Grafana users created in your Cockpit's Grafana. By default, the Grafana users returned in the list are ordered in ascending order.
390393

391394
**Usage:**
@@ -404,8 +407,9 @@ scw cockpit grafana-user list [arg=value ...]
404407

405408

406409

407-
### Reset a Grafana user password
410+
### (Deprecated) EOL 2026-01-20
408411

412+
Reset a Grafana user password
409413
Reset the password of a Grafana user, specified by the ID of the Project the Cockpit belongs to, and the ID of the Grafana user.
410414
A new password regenerates and only displays once. Make sure that you save it.
411415

@@ -447,7 +451,7 @@ Pricing plans management commands.
447451
### Get current plan
448452

449453
Retrieve a pricing plan for the given Project, specified by the ID of the Project.
450-
Deprecated: retention is now managed at the data source level.
454+
Deprecated due to retention now being managed at the data source level.
451455

452456
**Usage:**
453457

@@ -467,7 +471,7 @@ scw cockpit plan get [arg=value ...]
467471
### List plan types
468472

469473
Retrieve a list of available pricing plan types.
470-
Deprecated: retention is now managed at the data source level.
474+
Deprecated due to retention now being managed at the data source level.
471475

472476
**Usage:**
473477

@@ -487,7 +491,7 @@ scw cockpit plan list [arg=value ...]
487491
### Apply a pricing plan
488492

489493
Apply a pricing plan on a given Project. You must specify the ID of the pricing plan type. Note that you will be billed for the plan you apply.
490-
Deprecated: retention is now managed at the data source level.
494+
Deprecated due to retention now being managed at the data source level.
491495

492496
**Usage:**
493497

internal/namespaces/cockpit/v1/cockpit_cli.go

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,14 @@ func cockpitGrafanaSyncDataSources() *core.Command {
225225

226226
func cockpitGrafanaUserCreate() *core.Command {
227227
return &core.Command{
228-
Short: `Create a Grafana user`,
229-
Long: `Create a Grafana user to connect to your Cockpit's Grafana. Upon creation, your user password displays only once, so make sure that you save it.
228+
Short: `(Deprecated) EOL 2026-01-20`,
229+
Long: `Create a Grafana user
230+
Create a Grafana user to connect to your Cockpit's Grafana. Upon creation, your user password displays only once, so make sure that you save it.
230231
Each Grafana user is associated with a role: viewer or editor. A viewer can only view dashboards, whereas an editor can create and edit dashboards. Note that the ` + "`" + `admin` + "`" + ` username is not available for creation.`,
231232
Namespace: "cockpit",
232233
Resource: "grafana-user",
233234
Verb: "create",
234-
// Deprecated: false,
235+
// Deprecated: true,
235236
ArgsType: reflect.TypeOf(cockpit.GlobalAPICreateGrafanaUserRequest{}),
236237
ArgSpecs: core.ArgSpecs{
237238
core.ProjectIDArgSpec(),
@@ -268,12 +269,13 @@ Each Grafana user is associated with a role: viewer or editor. A viewer can only
268269

269270
func cockpitGrafanaUserList() *core.Command {
270271
return &core.Command{
271-
Short: `List Grafana users`,
272-
Long: `List all Grafana users created in your Cockpit's Grafana. By default, the Grafana users returned in the list are ordered in ascending order.`,
272+
Short: `(Deprecated) EOL 2026-01-20`,
273+
Long: `List Grafana users
274+
List all Grafana users created in your Cockpit's Grafana. By default, the Grafana users returned in the list are ordered in ascending order.`,
273275
Namespace: "cockpit",
274276
Resource: "grafana-user",
275277
Verb: "list",
276-
// Deprecated: false,
278+
// Deprecated: true,
277279
ArgsType: reflect.TypeOf(cockpit.GlobalAPIListGrafanaUsersRequest{}),
278280
ArgSpecs: core.ArgSpecs{
279281
{
@@ -307,12 +309,13 @@ func cockpitGrafanaUserList() *core.Command {
307309

308310
func cockpitGrafanaUserDelete() *core.Command {
309311
return &core.Command{
310-
Short: `Delete a Grafana user`,
311-
Long: `Delete a Grafana user from your Cockpit's Grafana, specified by the ID of the Project the Cockpit belongs to, and the ID of the Grafana user.`,
312+
Short: `(Deprecated) EOL 2026-01-20`,
313+
Long: `Delete a Grafana user
314+
Delete a Grafana user from your Cockpit's Grafana, specified by the ID of the Project the Cockpit belongs to, and the ID of the Grafana user.`,
312315
Namespace: "cockpit",
313316
Resource: "grafana-user",
314317
Verb: "delete",
315-
// Deprecated: false,
318+
// Deprecated: true,
316319
ArgsType: reflect.TypeOf(cockpit.GlobalAPIDeleteGrafanaUserRequest{}),
317320
ArgSpecs: core.ArgSpecs{
318321
core.ProjectIDArgSpec(),
@@ -344,13 +347,14 @@ func cockpitGrafanaUserDelete() *core.Command {
344347

345348
func cockpitGrafanaUserResetPassword() *core.Command {
346349
return &core.Command{
347-
Short: `Reset a Grafana user password`,
348-
Long: `Reset the password of a Grafana user, specified by the ID of the Project the Cockpit belongs to, and the ID of the Grafana user.
350+
Short: `(Deprecated) EOL 2026-01-20`,
351+
Long: `Reset a Grafana user password
352+
Reset the password of a Grafana user, specified by the ID of the Project the Cockpit belongs to, and the ID of the Grafana user.
349353
A new password regenerates and only displays once. Make sure that you save it.`,
350354
Namespace: "cockpit",
351355
Resource: "grafana-user",
352356
Verb: "reset-password",
353-
// Deprecated: false,
357+
// Deprecated: true,
354358
ArgsType: reflect.TypeOf(cockpit.GlobalAPIResetGrafanaUserPasswordRequest{}),
355359
ArgSpecs: core.ArgSpecs{
356360
core.ProjectIDArgSpec(),
@@ -442,7 +446,7 @@ func cockpitPlanList() *core.Command {
442446
return &core.Command{
443447
Short: `List plan types`,
444448
Long: `Retrieve a list of available pricing plan types.
445-
Deprecated: retention is now managed at the data source level.`,
449+
Deprecated due to retention now being managed at the data source level.`,
446450
Namespace: "cockpit",
447451
Resource: "plan",
448452
Verb: "list",
@@ -480,7 +484,7 @@ func cockpitPlanSelect() *core.Command {
480484
return &core.Command{
481485
Short: `Apply a pricing plan`,
482486
Long: `Apply a pricing plan on a given Project. You must specify the ID of the pricing plan type. Note that you will be billed for the plan you apply.
483-
Deprecated: retention is now managed at the data source level.`,
487+
Deprecated due to retention now being managed at the data source level.`,
484488
Namespace: "cockpit",
485489
Resource: "plan",
486490
Verb: "select",
@@ -517,7 +521,7 @@ func cockpitPlanGet() *core.Command {
517521
return &core.Command{
518522
Short: `Get current plan`,
519523
Long: `Retrieve a pricing plan for the given Project, specified by the ID of the Project.
520-
Deprecated: retention is now managed at the data source level.`,
524+
Deprecated due to retention now being managed at the data source level.`,
521525
Namespace: "cockpit",
522526
Resource: "plan",
523527
Verb: "get",

0 commit comments

Comments
 (0)