Skip to content

Commit 81a3776

Browse files
feat(cockpit): remove GetMetrics endpoint from CLI (#3265)
Co-authored-by: Rémy Léone <[email protected]>
1 parent b238ac3 commit 81a3776

File tree

3 files changed

+0
-69
lines changed

3 files changed

+0
-69
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ AVAILABLE COMMANDS:
99
activate Activate a Cockpit
1010
deactivate Deactivate a Cockpit
1111
get Get a Cockpit
12-
get-metrics Get Cockpit metrics
1312
reset-grafana Reset a Grafana
1413

1514
WORKFLOW COMMANDS:

docs/commands/cockpit.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Cockpit's API allows you to activate your Cockpit on your Projects. Scaleway's C
1010
- [Activate a Cockpit](#activate-a-cockpit)
1111
- [Deactivate a Cockpit](#deactivate-a-cockpit)
1212
- [Get a Cockpit](#get-a-cockpit)
13-
- [Get Cockpit metrics](#get-cockpit-metrics)
1413
- [Reset a Grafana](#reset-a-grafana)
1514
- [Wait for a cockpit to reach a stable state (installation)](#wait-for-a-cockpit-to-reach-a-stable-state-(installation))
1615
- [Contacts management commands](#contacts-management-commands)
@@ -156,28 +155,6 @@ scw cockpit cockpit get [arg=value ...]
156155

157156

158157

159-
### Get Cockpit metrics
160-
161-
Get metrics from your Cockpit with the specified Project ID.
162-
163-
**Usage:**
164-
165-
```
166-
scw cockpit cockpit get-metrics [arg=value ...]
167-
```
168-
169-
170-
**Args:**
171-
172-
| Name | | Description |
173-
|------|---|-------------|
174-
| project-id | | Project ID to use. If none is passed the default project ID will be used |
175-
| start-date | | Desired time range's start date for the metrics |
176-
| end-date | | Desired time range's end date for the metrics |
177-
| metric-name | | Name of the metric requested |
178-
179-
180-
181158
### Reset a Grafana
182159

183160
Reset your Cockpit's Grafana associated with the specified Project ID.

internal/namespaces/cockpit/v1beta1/cockpit_cli.go

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ func GetGeneratedCommands() *core.Commands {
2828
cockpitContact(),
2929
cockpitCockpitActivate(),
3030
cockpitCockpitGet(),
31-
cockpitCockpitGetMetrics(),
3231
cockpitCockpitDeactivate(),
3332
cockpitCockpitResetGrafana(),
3433
cockpitTokenCreate(),
@@ -157,50 +156,6 @@ func cockpitCockpitGet() *core.Command {
157156
}
158157
}
159158

160-
func cockpitCockpitGetMetrics() *core.Command {
161-
return &core.Command{
162-
Short: `Get Cockpit metrics`,
163-
Long: `Get metrics from your Cockpit with the specified Project ID.`,
164-
Namespace: "cockpit",
165-
Resource: "cockpit",
166-
Verb: "get-metrics",
167-
// Deprecated: false,
168-
ArgsType: reflect.TypeOf(cockpit.GetCockpitMetricsRequest{}),
169-
ArgSpecs: core.ArgSpecs{
170-
core.ProjectIDArgSpec(),
171-
{
172-
Name: "start-date",
173-
Short: `Desired time range's start date for the metrics`,
174-
Required: false,
175-
Deprecated: false,
176-
Positional: false,
177-
},
178-
{
179-
Name: "end-date",
180-
Short: `Desired time range's end date for the metrics`,
181-
Required: false,
182-
Deprecated: false,
183-
Positional: false,
184-
},
185-
{
186-
Name: "metric-name",
187-
Short: `Name of the metric requested`,
188-
Required: false,
189-
Deprecated: false,
190-
Positional: false,
191-
},
192-
},
193-
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
194-
request := args.(*cockpit.GetCockpitMetricsRequest)
195-
196-
client := core.ExtractClient(ctx)
197-
api := cockpit.NewAPI(client)
198-
return api.GetCockpitMetrics(request)
199-
200-
},
201-
}
202-
}
203-
204159
func cockpitCockpitDeactivate() *core.Command {
205160
return &core.Command{
206161
Short: `Deactivate a Cockpit`,

0 commit comments

Comments
 (0)