Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
github.com/kubernetes-client/go-base v0.0.0-20190205182333-3d0e39759d98
github.com/mattn/go-colorable v0.1.13
github.com/mattn/go-isatty v0.0.17
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.13.0.20230228105412-a7fe9ca961db
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.13.0.20230302103330-26bd265ecc73
github.com/spf13/cobra v1.6.1
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ github.com/pkg/term v1.1.0/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.13.0.20230228105412-a7fe9ca961db h1:vZY25aKHeibgVtTf+ucgzbCSs6ra0UKOfbdLNXBKtjA=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.13.0.20230228105412-a7fe9ca961db/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.13.0.20230302103330-26bd265ecc73 h1:L+ZRqJKnVPjOMuhRd7mN96K2xbVLYKnvtzQCXanXnMU=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.13.0.20230302103330-26bd265ecc73/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA=
Expand Down
48 changes: 48 additions & 0 deletions internal/namespaces/cockpit/v1beta1/cockpit_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ func GetGeneratedCommands() *core.Commands {
cockpitCockpit(),
cockpitToken(),
cockpitGrafanaUser(),
cockpitCockpitActivate(),
cockpitCockpitGet(),
cockpitCockpitDeactivate(),
cockpitCockpitResetGrafana(),
cockpitTokenCreate(),
cockpitTokenList(),
Expand Down Expand Up @@ -70,6 +72,29 @@ func cockpitGrafanaUser() *core.Command {
}
}

func cockpitCockpitActivate() *core.Command {
return &core.Command{
Short: `Activate a cockpit`,
Long: `Activate a cockpit associated with the given project ID.`,
Namespace: "cockpit",
Resource: "cockpit",
Verb: "activate",
// Deprecated: false,
ArgsType: reflect.TypeOf(cockpit.ActivateCockpitRequest{}),
ArgSpecs: core.ArgSpecs{
core.ProjectIDArgSpec(),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*cockpit.ActivateCockpitRequest)

client := core.ExtractClient(ctx)
api := cockpit.NewAPI(client)
return api.ActivateCockpit(request)

},
}
}

func cockpitCockpitGet() *core.Command {
return &core.Command{
Short: `Get cockpit`,
Expand All @@ -93,6 +118,29 @@ func cockpitCockpitGet() *core.Command {
}
}

func cockpitCockpitDeactivate() *core.Command {
return &core.Command{
Short: `Deactivate a cockpit`,
Long: `Deactivate a cockpit associated with the given project ID.`,
Namespace: "cockpit",
Resource: "cockpit",
Verb: "deactivate",
// Deprecated: false,
ArgsType: reflect.TypeOf(cockpit.DeactivateCockpitRequest{}),
ArgSpecs: core.ArgSpecs{
core.ProjectIDArgSpec(),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*cockpit.DeactivateCockpitRequest)

client := core.ExtractClient(ctx)
api := cockpit.NewAPI(client)
return api.DeactivateCockpit(request)

},
}
}

func cockpitCockpitResetGrafana() *core.Command {
return &core.Command{
Short: `Reset Grafana`,
Expand Down