Skip to content

Commit 771ce43

Browse files
authored
feat(cockpit): add support for products dashboard (#3404)
1 parent 1189dce commit 771ce43

File tree

6 files changed

+51
-10
lines changed

6 files changed

+51
-10
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Product dashboards management commands.
4+
5+
USAGE:
6+
scw cockpit product-dashboards
7+
8+
FLAGS:
9+
-h, --help help for product-dashboards
10+
11+
GLOBAL FLAGS:
12+
-c, --config string The path to the config file
13+
-D, --debug Enable debug mode
14+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
15+
-p, --profile string The config profile to use

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ USAGE:
66
scw cockpit <command>
77

88
AVAILABLE COMMANDS:
9-
alert Managed alerts management commands
10-
cockpit Cockpit management commands
11-
contact Contacts management commands
12-
datasource Datasource management commands
13-
grafana-user Grafana user management commands
14-
plan Pricing plans management commands
15-
token Token management commands
9+
alert Managed alerts management commands
10+
cockpit Cockpit management commands
11+
contact Contacts management commands
12+
datasource Datasource management commands
13+
grafana-user Grafana user management commands
14+
plan Pricing plans management commands
15+
product-dashboards Product dashboards management commands
16+
token Token management commands
1617

1718
FLAGS:
1819
-h, --help help for cockpit

docs/commands/cockpit.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Cockpit API.
2525
- [Pricing plans management commands](#pricing-plans-management-commands)
2626
- [Get a list of all pricing plans available](#get-a-list-of-all-pricing-plans-available)
2727
- [Select your chosen pricing plan for your Cockpit, specifying the Cockpit's Project ID and the pricing plan's ID in the request](#select-your-chosen-pricing-plan-for-your-cockpit,-specifying-the-cockpit's-project-id-and-the-pricing-plan's-id-in-the-request)
28+
- [Product dashboards management commands](#product-dashboards-management-commands)
2829
- [Token management commands](#token-management-commands)
2930
- [Create a token associated with the specified Project ID](#create-a-token-associated-with-the-specified-project-id)
3031
- [Delete the token associated with the specified token ID](#delete-the-token-associated-with-the-specified-token-id)
@@ -413,6 +414,20 @@ scw cockpit plan select [arg=value ...]
413414

414415

415416

417+
## Product dashboards management commands
418+
419+
Product dashboards management commands.
420+
421+
Product dashboards management commands.
422+
423+
**Usage:**
424+
425+
```
426+
scw cockpit product-dashboards
427+
```
428+
429+
430+
416431
## Token management commands
417432

418433
Token management commands.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ require (
2424
github.com/moby/buildkit v0.11.6
2525
github.com/opencontainers/go-digest v1.0.0
2626
github.com/pkg/errors v0.9.1
27-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.21.0.20231004140311-fc4689b18e37
27+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.21.0.20231009083832-bf1663f18403
2828
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
2929
github.com/spf13/cobra v1.7.0
3030
github.com/spf13/pflag v1.0.5

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,8 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN
487487
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
488488
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
489489
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
490-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.21.0.20231004140311-fc4689b18e37 h1:w5vDrB6s8sREQSbEFAWNMKkvDUgIdkopKGD80mgO3Qo=
491-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.21.0.20231004140311-fc4689b18e37/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
490+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.21.0.20231009083832-bf1663f18403 h1:V1rM50XQgFKUBDetgZo6ixhBZVK7+4mory9iHoiX2c0=
491+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.21.0.20231009083832-bf1663f18403/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
492492
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
493493
github.com/secure-systems-lab/go-securesystemslib v0.4.0 h1:b23VGrQhTA8cN2CbBw7/FulN9fTtqYUdS5+Oxzt+DUE=
494494
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=

internal/namespaces/cockpit/v1beta1/cockpit_cli.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ func GetGeneratedCommands() *core.Commands {
2727
cockpitPlan(),
2828
cockpitAlert(),
2929
cockpitContact(),
30+
cockpitProductDashboards(),
3031
cockpitCockpitActivate(),
3132
cockpitCockpitGet(),
3233
cockpitCockpitDeactivate(),
@@ -120,6 +121,15 @@ func cockpitContact() *core.Command {
120121
}
121122
}
122123

124+
func cockpitProductDashboards() *core.Command {
125+
return &core.Command{
126+
Short: `Product dashboards management commands`,
127+
Long: `Product dashboards management commands.`,
128+
Namespace: "cockpit",
129+
Resource: "product-dashboards",
130+
}
131+
}
132+
123133
func cockpitCockpitActivate() *core.Command {
124134
return &core.Command{
125135
Short: `Activate the Cockpit of the specified Project ID`,

0 commit comments

Comments
 (0)