Skip to content

Commit 1f77c25

Browse files
feat(iot): remove get-metric from CLI (#1441)
Co-authored-by: Rémy Léone <rleone@scaleway.com>
1 parent 08eb623 commit 1f77c25

2 files changed

Lines changed: 0 additions & 38 deletions

File tree

cmd/scw/testdata/test-all-usage-iot-hub-usage.golden

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ AVAILABLE COMMANDS:
1111
disable Disable a hub
1212
enable Enable a hub
1313
get Get a hub
14-
get-metrics Get a hub's metrics
1514
list List hubs
1615
update Update a hub
1716

internal/namespaces/iot/v1beta1/iot_cli.go

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ func GetGeneratedCommands() *core.Commands {
3131
iotHubEnable(),
3232
iotHubDisable(),
3333
iotHubDelete(),
34-
iotHubGetMetrics(),
3534
iotDeviceList(),
3635
iotDeviceCreate(),
3736
iotDeviceGet(),
@@ -406,42 +405,6 @@ func iotHubDelete() *core.Command {
406405
}
407406
}
408407

409-
func iotHubGetMetrics() *core.Command {
410-
return &core.Command{
411-
Short: `Get a hub's metrics`,
412-
Long: `Get a hub's metrics.`,
413-
Namespace: "iot",
414-
Resource: "hub",
415-
Verb: "get-metrics",
416-
ArgsType: reflect.TypeOf(iot.GetHubMetricsRequest{}),
417-
ArgSpecs: core.ArgSpecs{
418-
{
419-
Name: "hub-id",
420-
Short: `Hub ID`,
421-
Required: true,
422-
Positional: true,
423-
},
424-
{
425-
Name: "period",
426-
Short: `Period over which the metrics span`,
427-
Required: true,
428-
Positional: false,
429-
Default: core.DefaultValueSetter("hour"),
430-
EnumValues: []string{"hour", "day", "week", "month", "year"},
431-
},
432-
core.RegionArgSpec(scw.RegionFrPar),
433-
},
434-
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
435-
request := args.(*iot.GetHubMetricsRequest)
436-
437-
client := core.ExtractClient(ctx)
438-
api := iot.NewAPI(client)
439-
return api.GetHubMetrics(request)
440-
441-
},
442-
}
443-
}
444-
445408
func iotDeviceList() *core.Command {
446409
return &core.Command{
447410
Short: `List devices`,

0 commit comments

Comments
 (0)