Skip to content

Commit

Permalink
feat(iot): add generation for CLI commands
Browse files Browse the repository at this point in the history
  • Loading branch information
scaleway-bot authored and remyleone committed Aug 4, 2020
1 parent 45018f1 commit 7d7d8f9
Show file tree
Hide file tree
Showing 29 changed files with 1,449 additions and 0 deletions.
25 changes: 25 additions & 0 deletions cmd/scw/testdata/test-all-usage-iot-device-create-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Add a device.

USAGE:
scw iot device create [arg=value ...]

ARGS:
name Device name
hub-id ID of the device's hub
[allow-insecure] Allow plain and server-authenticated SSL connections in addition to mutually-authenticated ones
[message-filters.publish.policy] (unknown | accept | reject)
[message-filters.publish.topics.{index}]
[message-filters.subscribe.policy] (unknown | accept | reject)
[message-filters.subscribe.topics.{index}]
[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

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
19 changes: 19 additions & 0 deletions cmd/scw/testdata/test-all-usage-iot-device-delete-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Remove a device.

USAGE:
scw iot device delete <device-id ...> [arg=value ...]

ARGS:
device-id Device ID
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
-h, --help help for delete

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
19 changes: 19 additions & 0 deletions cmd/scw/testdata/test-all-usage-iot-device-disable-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Disable a device.

USAGE:
scw iot device disable <device-id ...> [arg=value ...]

ARGS:
device-id Device ID
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
-h, --help help for disable

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
19 changes: 19 additions & 0 deletions cmd/scw/testdata/test-all-usage-iot-device-enable-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Enable a device.

USAGE:
scw iot device enable <device-id ...> [arg=value ...]

ARGS:
device-id Device ID
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
-h, --help help for enable

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Get a device's metrics.

USAGE:
scw iot device get-metrics <device-id ...> [arg=value ...]

ARGS:
device-id Device ID
period Period over which the metrics span (hour | day | week | month | year)
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
-h, --help help for get-metrics

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
19 changes: 19 additions & 0 deletions cmd/scw/testdata/test-all-usage-iot-device-get-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Get a device.

USAGE:
scw iot device get <device-id ...> [arg=value ...]

ARGS:
device-id Device ID
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
-h, --help help for get

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
25 changes: 25 additions & 0 deletions cmd/scw/testdata/test-all-usage-iot-device-list-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
List devices.

USAGE:
scw iot device list [arg=value ...]

ARGS:
[order-by] Ordering of requested devices (name_asc | name_desc | status_asc | status_desc | hub_id_asc | hub_id_desc | created_at_asc | created_at_desc | updated_at_asc | updated_at_desc | enabled_asc | enabled_desc | allow_insecure_asc | allow_insecure_desc | last_seen_at_asc | last_seen_at_desc)
[name] Filter on the name
[hub-id] Filter on the hub
[enabled] Filter on the enabled flag
[allow-insecure] Filter on the allow_insecure flag
[is-connected] Filter on the is_connected state
[organization-id] Filter on the organization
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
-h, --help help for list

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
25 changes: 25 additions & 0 deletions cmd/scw/testdata/test-all-usage-iot-device-update-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Update a device.

USAGE:
scw iot device update <device-id ...> [arg=value ...]

ARGS:
device-id Device ID
[name] Device name
[allow-insecure] Allow plain and server-authenticated SSL connections in addition to mutually-authenticated ones
[message-filters.publish.policy] (unknown | accept | reject)
[message-filters.publish.topics.{index}]
[message-filters.subscribe.policy] (unknown | accept | reject)
[message-filters.subscribe.topics.{index}]
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
-h, --help help for update

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
27 changes: 27 additions & 0 deletions cmd/scw/testdata/test-all-usage-iot-device-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
IoT Device commands.

USAGE:
scw iot device <command>

AVAILABLE COMMANDS:
create Add a device
delete Remove a device
disable Disable a device
enable Enable a device
get Get a device
get-metrics Get a device's metrics
list List devices
update Update a device

FLAGS:
-h, --help help for device

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use

Use "scw iot device [command] --help" for more information about a command.
23 changes: 23 additions & 0 deletions cmd/scw/testdata/test-all-usage-iot-hub-create-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Create a hub.

USAGE:
scw iot hub create [arg=value ...]

ARGS:
name Hub name (up to 255 characters)
product-plan Hub feature set (plan_unknown | plan_shared | plan_dedicated | plan_ha)
[disable-events] Disable Hub events (default false)
[events-topic-prefix] Hub events topic prefix (default '$SCW/events')
[organization-id] Organization ID to use. If none is passed will use default organization ID from the config
[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

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
20 changes: 20 additions & 0 deletions cmd/scw/testdata/test-all-usage-iot-hub-delete-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Delete a hub.

USAGE:
scw iot hub delete <hub-id ...> [arg=value ...]

ARGS:
hub-id Hub ID
[delete-devices] Force deletion of devices added to this hub instead of rejecting operation
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
-h, --help help for delete

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
19 changes: 19 additions & 0 deletions cmd/scw/testdata/test-all-usage-iot-hub-disable-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Disable a hub.

USAGE:
scw iot hub disable <hub-id ...> [arg=value ...]

ARGS:
hub-id Hub ID
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
-h, --help help for disable

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
19 changes: 19 additions & 0 deletions cmd/scw/testdata/test-all-usage-iot-hub-enable-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Enable a hub.

USAGE:
scw iot hub enable <hub-id ...> [arg=value ...]

ARGS:
hub-id Hub ID
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
-h, --help help for enable

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
20 changes: 20 additions & 0 deletions cmd/scw/testdata/test-all-usage-iot-hub-get-metrics-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Get a hub's metrics.

USAGE:
scw iot hub get-metrics <hub-id ...> [arg=value ...]

ARGS:
hub-id Hub ID
period Period over which the metrics span (hour | day | week | month | year)
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
-h, --help help for get-metrics

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
19 changes: 19 additions & 0 deletions cmd/scw/testdata/test-all-usage-iot-hub-get-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Get a hub.

USAGE:
scw iot hub get <hub-id ...> [arg=value ...]

ARGS:
hub-id Hub ID
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
-h, --help help for get

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
21 changes: 21 additions & 0 deletions cmd/scw/testdata/test-all-usage-iot-hub-list-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
List hubs.

USAGE:
scw iot hub list [arg=value ...]

ARGS:
[order-by] Ordering of requested hub (name_asc | name_desc | status_asc | status_desc | product_plan_asc | product_plan_desc | created_at_asc | created_at_desc | updated_at_asc | updated_at_desc | enabled_asc | enabled_desc)
[name] Filter on the name
[organization-id] Filter on the organization
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
-h, --help help for list

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
22 changes: 22 additions & 0 deletions cmd/scw/testdata/test-all-usage-iot-hub-update-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Update a hub.

USAGE:
scw iot hub update <hub-id ...> [arg=value ...]

ARGS:
hub-id Hub ID
[name] Hub name (up to 255 characters)
[disable-events] Disable events
[events-topic-prefix] Hub events topic prefix
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
-h, --help help for update

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
Loading

0 comments on commit 7d7d8f9

Please sign in to comment.