Skip to content

Commit 4605322

Browse files
feat(tem): add 'email_blocklisted' and 'blocklist_created' to WebhookEventType (scaleway#4330)
Co-authored-by: Laure-di <[email protected]>
1 parent 3a0b52e commit 4605322

File tree

8 files changed

+81
-12
lines changed

8 files changed

+81
-12
lines changed

cmd/scw/testdata/test-all-usage-tem-webhook-create-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ARGS:
99
[domain-id] ID of the Domain to watch for triggering events
1010
[project-id] Project ID to use. If none is passed the default project ID will be used
1111
[name] Name of the Webhook
12-
[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)
12+
[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 | email_blocklisted | blocklist_created)
1313
[sns-arn] Scaleway SNS ARN topic to push the events to
1414
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
1515

cmd/scw/testdata/test-all-usage-tem-webhook-list-events-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ARGS:
99
[order-by] (Optional) List Webhook events corresponding to specific criteria (created_at_desc | created_at_asc)
1010
webhook-id ID of the Webhook linked to the events
1111
[email-id] ID of the email linked to the events
12-
[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)
12+
[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 | email_blocklisted | blocklist_created)
1313
[statuses.{index}] List of event statuses (unknown_status | sending | sent | failed)
1414
[project-id] ID of the webhook Project
1515
[domain-id] ID of the domain to watch for triggering events

cmd/scw/testdata/test-all-usage-tem-webhook-update-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ USAGE:
88
ARGS:
99
webhook-id ID of the Webhook to update
1010
[name] Name of the Webhook to update
11-
[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)
11+
[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 | email_blocklisted | blocklist_created)
1212
[sns-arn] Scaleway SNS ARN topic to update
1313
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
1414

docs/commands/audit-trail.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<!-- DO NOT EDIT: this file is automatically generated using scw-doc-gen -->
2+
# Documentation for `scw audit-trail`
3+
This API allows you to ensure accountability and security by recording events and changes performed within your Scaleway Organization.
4+
5+
- [Represent an entry in the Audit Trail](#represent-an-entry-in-the-audit-trail)
6+
- [List events](#list-events)
7+
- [Product integrated with Audit Trail](#product-integrated-with-audit-trail)
8+
- [Retrieve the list of Scaleway resources for which you have Audit Trail events](#retrieve-the-list-of-scaleway-resources-for-which-you-have-audit-trail-events)
9+
10+
11+
## Represent an entry in the Audit Trail
12+
13+
Represent an entry in the Audit Trail.
14+
15+
16+
### List events
17+
18+
Retrieve the list of Audit Trail events for a Scaleway Organization and/or Project. You must specify the `organization_id` and optionally, the `project_id`.
19+
20+
**Usage:**
21+
22+
```
23+
scw audit-trail event list [arg=value ...]
24+
```
25+
26+
27+
**Args:**
28+
29+
| Name | | Description |
30+
|------|---|-------------|
31+
| project-id | | (Optional) ID of the Project containing the Audit Trail events |
32+
| resource-type | One of: `unknown_type`, `secm_secret`, `secm_secret_version`, `kube_cluster`, `kube_pool`, `kube_node`, `kube_acl` | (Optional) Returns a paginated list of Scaleway resources' features |
33+
| method-name | | (Optional) Name of the method or the API call performed |
34+
| status | | (Optional) HTTP status code of the request. Returns either `200` if the request was successful or `403` if the permission was denied |
35+
| recorded-after | | (Optional) The `recorded_after` parameter defines the earliest timestamp from which Audit Trail events are retrieved. Returns `one hour ago` by default |
36+
| recorded-before | | (Optional) The `recorded_before` parameter defines the latest timestamp up to which Audit Trail events are retrieved. Returns `now` by default |
37+
| order-by | One of: `recorded_at_desc`, `recorded_at_asc` | |
38+
| page-size | | |
39+
| page-token | | |
40+
| product-name | | (Optional) Name of the Scaleway resource in a hyphenated format |
41+
| organization-id | | Organization ID to use. If none is passed the default organization ID will be used |
42+
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams` | Region to target. If none is passed will use default region from the config |
43+
44+
45+
46+
## Product integrated with Audit Trail
47+
48+
Product integrated with Audit Trail.
49+
50+
51+
### Retrieve the list of Scaleway resources for which you have Audit Trail events
52+
53+
Retrieve the list of Scaleway resources for which you have Audit Trail events.
54+
55+
**Usage:**
56+
57+
```
58+
scw audit-trail product list [arg=value ...]
59+
```
60+
61+
62+
**Args:**
63+
64+
| Name | | Description |
65+
|------|---|-------------|
66+
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams` | Region to target. If none is passed will use default region from the config |
67+
68+
69+

docs/commands/tem.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ scw tem webhook create [arg=value ...]
353353
| domain-id | | ID of the Domain to watch for triggering events |
354354
| project-id | | Project ID to use. If none is passed the default project ID will be used |
355355
| name | | Name of the Webhook |
356-
| event-types.{index} | One of: `unknown_type`, `email_queued`, `email_dropped`, `email_deferred`, `email_delivered`, `email_spam`, `email_mailbox_not_found` | List of event types that will trigger an event |
356+
| event-types.{index} | One of: `unknown_type`, `email_queued`, `email_dropped`, `email_deferred`, `email_delivered`, `email_spam`, `email_mailbox_not_found`, `email_blocklisted`, `blocklist_created` | List of event types that will trigger an event |
357357
| sns-arn | | Scaleway SNS ARN topic to push the events to |
358358
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
359359

@@ -440,7 +440,7 @@ scw tem webhook list-events [arg=value ...]
440440
| order-by | One of: `created_at_desc`, `created_at_asc` | (Optional) List Webhook events corresponding to specific criteria |
441441
| webhook-id | Required | ID of the Webhook linked to the events |
442442
| email-id | | ID of the email linked to the events |
443-
| event-types.{index} | One of: `unknown_type`, `email_queued`, `email_dropped`, `email_deferred`, `email_delivered`, `email_spam`, `email_mailbox_not_found` | List of event types linked to the events |
443+
| event-types.{index} | One of: `unknown_type`, `email_queued`, `email_dropped`, `email_deferred`, `email_delivered`, `email_spam`, `email_mailbox_not_found`, `email_blocklisted`, `blocklist_created` | List of event types linked to the events |
444444
| statuses.{index} | One of: `unknown_status`, `sending`, `sent`, `failed` | List of event statuses |
445445
| project-id | | ID of the webhook Project |
446446
| domain-id | | ID of the domain to watch for triggering events |
@@ -466,7 +466,7 @@ scw tem webhook update [arg=value ...]
466466
|------|---|-------------|
467467
| webhook-id | Required | ID of the Webhook to update |
468468
| name | | Name of the Webhook to update |
469-
| event-types.{index} | One of: `unknown_type`, `email_queued`, `email_dropped`, `email_deferred`, `email_delivered`, `email_spam`, `email_mailbox_not_found` | List of event types to update |
469+
| event-types.{index} | One of: `unknown_type`, `email_queued`, `email_dropped`, `email_deferred`, `email_delivered`, `email_spam`, `email_mailbox_not_found`, `email_blocklisted`, `blocklist_created` | List of event types to update |
470470
| sns-arn | | Scaleway SNS ARN topic to update |
471471
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
472472

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ require (
2626
github.com/mattn/go-isatty v0.0.20
2727
github.com/moby/buildkit v0.13.2
2828
github.com/opencontainers/go-digest v1.0.0
29-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241203133010-eced26f4687e
29+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241203154910-6e1399167b4e
3030
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
3131
github.com/spf13/cobra v1.8.1
3232
github.com/spf13/pflag v1.0.5

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,8 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz
466466
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
467467
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
468468
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
469-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241203133010-eced26f4687e h1:53liAlyBY6iZLtDYBbWcuSQnpS6Qhb5t2wCAWM/qcb8=
470-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241203133010-eced26f4687e/go.mod h1:kAoejOVBg1E/aVAR6IwKWEmbLCEg2IXklzPAkxzAaXA=
469+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241203154910-6e1399167b4e h1:i7eeW9A/r3nGsTr7KMYFDIuzKY45ql9BevxOLUUPajk=
470+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241203154910-6e1399167b4e/go.mod h1:kAoejOVBg1E/aVAR6IwKWEmbLCEg2IXklzPAkxzAaXA=
471471
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
472472
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
473473
github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA=

internal/namespaces/tem/v1alpha1/tem_cli.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ func temWebhookCreate() *core.Command {
769769
Required: false,
770770
Deprecated: false,
771771
Positional: false,
772-
EnumValues: []string{"unknown_type", "email_queued", "email_dropped", "email_deferred", "email_delivered", "email_spam", "email_mailbox_not_found"},
772+
EnumValues: []string{"unknown_type", "email_queued", "email_dropped", "email_deferred", "email_delivered", "email_spam", "email_mailbox_not_found", "email_blocklisted", "blocklist_created"},
773773
},
774774
{
775775
Name: "sns-arn",
@@ -912,7 +912,7 @@ func temWebhookUpdate() *core.Command {
912912
Required: false,
913913
Deprecated: false,
914914
Positional: false,
915-
EnumValues: []string{"unknown_type", "email_queued", "email_dropped", "email_deferred", "email_delivered", "email_spam", "email_mailbox_not_found"},
915+
EnumValues: []string{"unknown_type", "email_queued", "email_dropped", "email_deferred", "email_delivered", "email_spam", "email_mailbox_not_found", "email_blocklisted", "blocklist_created"},
916916
},
917917
{
918918
Name: "sns-arn",
@@ -1008,7 +1008,7 @@ func temWebhookListEvents() *core.Command {
10081008
Required: false,
10091009
Deprecated: false,
10101010
Positional: false,
1011-
EnumValues: []string{"unknown_type", "email_queued", "email_dropped", "email_deferred", "email_delivered", "email_spam", "email_mailbox_not_found"},
1011+
EnumValues: []string{"unknown_type", "email_queued", "email_dropped", "email_deferred", "email_delivered", "email_spam", "email_mailbox_not_found", "email_blocklisted", "blocklist_created"},
10121012
},
10131013
{
10141014
Name: "statuses.{index}",

0 commit comments

Comments
 (0)