-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tem): add support for webhook (#4004)
Co-authored-by: Rémy Léone <[email protected]>
- Loading branch information
1 parent
c3cb877
commit ac08142
Showing
11 changed files
with
610 additions
and
6 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
cmd/scw/testdata/test-all-usage-tem-webhook-create-usage.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 | ||
🟥🟥🟥 STDERR️️ 🟥🟥🟥️ | ||
Create a new Webhook triggered by a list of event types and pushed to a Scaleway SNS ARN. | ||
|
||
USAGE: | ||
scw tem webhook create [arg=value ...] | ||
|
||
ARGS: | ||
[domain-id] ID of the Domain to watch for triggering events | ||
[project-id] Project ID to use. If none is passed the default project ID will be used | ||
[name] Name of the Webhook | ||
[event-types.{index}] List of event types that will trigger an event (unknown_type | email_queued | email_dropped | email_deferred | email_delivered | email_spam | email_mailbox_not_found) | ||
[sns-arn] Scaleway SNS ARN topic to push the events to | ||
[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
19
cmd/scw/testdata/test-all-usage-tem-webhook-delete-usage.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 | ||
🟥🟥🟥 STDERR️️ 🟥🟥🟥️ | ||
You must specify the Webhook you want to delete by the `region` and `webhook_id`. Deleting a Webhook is permanent and cannot be undone. | ||
|
||
USAGE: | ||
scw tem webhook delete <webhook-id ...> [arg=value ...] | ||
|
||
ARGS: | ||
webhook-id ID of the Webhook to delete | ||
[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
19
cmd/scw/testdata/test-all-usage-tem-webhook-get-usage.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 | ||
🟥🟥🟥 STDERR️️ 🟥🟥🟥️ | ||
Retrieve information about a specific Webhook using the `webhook_id` and `region` parameters. | ||
|
||
USAGE: | ||
scw tem webhook get <webhook-id ...> [arg=value ...] | ||
|
||
ARGS: | ||
webhook-id ID of the Webhook to check | ||
[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 |
26 changes: 26 additions & 0 deletions
26
cmd/scw/testdata/test-all-usage-tem-webhook-list-events-usage.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 | ||
🟥🟥🟥 STDERR️️ 🟥🟥🟥️ | ||
Retrieve the list of Webhook events triggered from a specific Webhook or for a specific Project or Organization. You must specify the `region`. | ||
|
||
USAGE: | ||
scw tem webhook list-events [arg=value ...] | ||
|
||
ARGS: | ||
[order-by] (Optional) List Webhook events corresponding to specific criteria (created_at_desc | created_at_asc) | ||
webhook-id ID of the Webhook linked to the events | ||
[email-id] ID of the email linked to the events | ||
[event-types.{index}] List of event types linked to the events (unknown_type | email_queued | email_dropped | email_deferred | email_delivered | email_spam | email_mailbox_not_found) | ||
[statuses.{index}] List of event statuses (unknown_status | sending | sent | failed) | ||
[project-id] ID of the webhook Project | ||
[domain-id] ID of the domain to watch for triggering events | ||
[organization-id] ID of the webhook Organization | ||
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | all) | ||
|
||
FLAGS: | ||
-h, --help help for list-events | ||
|
||
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
22
cmd/scw/testdata/test-all-usage-tem-webhook-list-usage.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 | ||
🟥🟥🟥 STDERR️️ 🟥🟥🟥️ | ||
Retrieve Webhooks in a specific Project or in a specific Organization using the `region` parameter. | ||
|
||
USAGE: | ||
scw tem webhook list [arg=value ...] | ||
|
||
ARGS: | ||
[order-by] (Optional) List Webhooks corresponding to specific criteria (created_at_desc | created_at_asc) | ||
[project-id] (Optional) ID of the Project for which to list the Webhooks | ||
[domain-id] (Optional) ID of the Domain for which to list the Webhooks | ||
[organization-id] (Optional) ID of the Organization for which to list the Webhooks | ||
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | all) | ||
|
||
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
22
cmd/scw/testdata/test-all-usage-tem-webhook-update-usage.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 | ||
🟥🟥🟥 STDERR️️ 🟥🟥🟥️ | ||
Update a Webhook events type, SNS ARN or name. | ||
|
||
USAGE: | ||
scw tem webhook update [arg=value ...] | ||
|
||
ARGS: | ||
webhook-id ID of the Webhook to update | ||
[name] Name of the Webhook to update | ||
[event-types.{index}] List of event types to update (unknown_type | email_queued | email_dropped | email_deferred | email_delivered | email_spam | email_mailbox_not_found) | ||
[sns-arn] Scaleway SNS ARN topic to update | ||
[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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.