Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(iot): add support for twins-graphite-config #1962

Merged
merged 2 commits into from
Sep 16, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ USAGE:

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

FLAGS:
Expand Down
13 changes: 7 additions & 6 deletions cmd/scw/testdata/test-all-usage-iot-hub-create-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ USAGE:
scw iot hub create [arg=value ...]

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

FLAGS:
-h, --help help for create
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ARGS:
[disable-events] Disable Hub events
[events-topic-prefix] Hub events topic prefix
[enable-device-auto-provisioning] Enable device auto provisioning
[twins-graphite-config.push-uri]
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
Expand Down
4 changes: 3 additions & 1 deletion docs/commands/iot.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ scw iot device get-metrics <device-id ...> [arg=value ...]
| Name | | Description |
|------|---|-------------|
| device-id | Required | Device ID |
| start-date | Required<br />Default: `hour` | Start date used to compute the best scale for the returned metrics |
| start-date | Required | Start date used to compute the best scale for the returned metrics |
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |


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


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


Expand Down
13 changes: 12 additions & 1 deletion internal/namespaces/iot/v1/iot_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,12 @@ func iotHubCreate() *core.Command {
Deprecated: false,
Positional: false,
},
{
Name: "twins-graphite-config.push-uri",
Required: false,
Deprecated: false,
Positional: false,
},
core.RegionArgSpec(scw.RegionFrPar),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
Expand Down Expand Up @@ -340,6 +346,12 @@ func iotHubUpdate() *core.Command {
Deprecated: false,
Positional: false,
},
{
Name: "twins-graphite-config.push-uri",
Required: false,
Deprecated: false,
Positional: false,
},
core.RegionArgSpec(scw.RegionFrPar),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
Expand Down Expand Up @@ -1046,7 +1058,6 @@ func iotDeviceGetMetrics() *core.Command {
Required: true,
Deprecated: false,
Positional: false,
Default: core.DefaultValueSetter("hour"),
},
core.RegionArgSpec(scw.RegionFrPar),
},
Expand Down