Skip to content

Commit c505d9d

Browse files
remyleonescaleway-botMonitob
authored
feat(iot): add support for twins-graphite-config (#1962)
Co-authored-by: scaleway-bot <[email protected]> Co-authored-by: jaime Bernabe <[email protected]>
1 parent 1616529 commit c505d9d

File tree

5 files changed

+24
-9
lines changed

5 files changed

+24
-9
lines changed

cmd/scw/testdata/test-all-usage-iot-device-get-metrics-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ USAGE:
77

88
ARGS:
99
device-id Device ID
10-
start-date=hour Start date used to compute the best scale for the returned metrics
10+
start-date Start date used to compute the best scale for the returned metrics
1111
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
1212

1313
FLAGS:

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ USAGE:
66
scw iot hub create [arg=value ...]
77

88
ARGS:
9-
name=<generated> Hub name (up to 255 characters)
10-
[project-id] Project ID to use. If none is passed the default project ID will be used
11-
product-plan=plan_shared Hub feature set (plan_unknown | plan_shared | plan_dedicated | plan_ha)
12-
[disable-events] Disable Hub events
13-
[events-topic-prefix] Hub events topic prefix (default '$SCW/events')
14-
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
9+
name=<generated> Hub name (up to 255 characters)
10+
[project-id] Project ID to use. If none is passed the default project ID will be used
11+
product-plan=plan_shared Hub feature set (plan_unknown | plan_shared | plan_dedicated | plan_ha)
12+
[disable-events] Disable Hub events
13+
[events-topic-prefix] Hub events topic prefix (default '$SCW/events')
14+
[twins-graphite-config.push-uri]
15+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
1516

1617
FLAGS:
1718
-h, --help help for create

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ ARGS:
1212
[disable-events] Disable Hub events
1313
[events-topic-prefix] Hub events topic prefix
1414
[enable-device-auto-provisioning] Enable device auto provisioning
15+
[twins-graphite-config.push-uri]
1516
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
1617

1718
FLAGS:

docs/commands/iot.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ scw iot device get-metrics <device-id ...> [arg=value ...]
186186
| Name | | Description |
187187
|------|---|-------------|
188188
| device-id | Required | Device ID |
189-
| start-date | Required<br />Default: `hour` | Start date used to compute the best scale for the returned metrics |
189+
| start-date | Required | Start date used to compute the best scale for the returned metrics |
190190
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
191191

192192

@@ -309,6 +309,7 @@ scw iot hub create [arg=value ...]
309309
| product-plan | Required<br />Default: `plan_shared`<br />One of: `plan_unknown`, `plan_shared`, `plan_dedicated`, `plan_ha` | Hub feature set |
310310
| disable-events | | Disable Hub events |
311311
| events-topic-prefix | | Hub events topic prefix (default '$SCW/events') |
312+
| twins-graphite-config.push-uri | | |
312313
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
313314

314315

@@ -480,6 +481,7 @@ scw iot hub update <hub-id ...> [arg=value ...]
480481
| disable-events | | Disable Hub events |
481482
| events-topic-prefix | | Hub events topic prefix |
482483
| enable-device-auto-provisioning | | Enable device auto provisioning |
484+
| twins-graphite-config.push-uri | | |
483485
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
484486

485487

internal/namespaces/iot/v1/iot_cli.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,12 @@ func iotHubCreate() *core.Command {
244244
Deprecated: false,
245245
Positional: false,
246246
},
247+
{
248+
Name: "twins-graphite-config.push-uri",
249+
Required: false,
250+
Deprecated: false,
251+
Positional: false,
252+
},
247253
core.RegionArgSpec(scw.RegionFrPar),
248254
},
249255
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
@@ -340,6 +346,12 @@ func iotHubUpdate() *core.Command {
340346
Deprecated: false,
341347
Positional: false,
342348
},
349+
{
350+
Name: "twins-graphite-config.push-uri",
351+
Required: false,
352+
Deprecated: false,
353+
Positional: false,
354+
},
343355
core.RegionArgSpec(scw.RegionFrPar),
344356
},
345357
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
@@ -1046,7 +1058,6 @@ func iotDeviceGetMetrics() *core.Command {
10461058
Required: true,
10471059
Deprecated: false,
10481060
Positional: false,
1049-
Default: core.DefaultValueSetter("hour"),
10501061
},
10511062
core.RegionArgSpec(scw.RegionFrPar),
10521063
},

0 commit comments

Comments
 (0)