Skip to content

Commit

Permalink
Merge branch 'master' into fix/rdb_cli
Browse files Browse the repository at this point in the history
  • Loading branch information
remyleone authored Jan 15, 2025
2 parents dce6fb1 + ea63ad7 commit 97eb2ff
Show file tree
Hide file tree
Showing 10 changed files with 339 additions and 6 deletions.
22 changes: 22 additions & 0 deletions cmd/scw/testdata/test-all-usage-tem-blocklists-create-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Create multiple blocklists in a specific Project or Organization using the `region` parameter.

USAGE:
scw tem blocklists create [arg=value ...]

ARGS:
[domain-id] Domain ID linked to the blocklist
[emails.{index}] Email blocked by the blocklist
[type] Type of blocklist (unknown_type | mailbox_full | mailbox_not_found)
[reason] Reason to block the email
[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-tem-blocklists-delete-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
You must specify the blocklist you want to delete by the `region` and `blocklist_id`.

USAGE:
scw tem blocklists delete [arg=value ...]

ARGS:
blocklist-id ID of the blocklist 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
23 changes: 23 additions & 0 deletions cmd/scw/testdata/test-all-usage-tem-blocklists-list-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Retrieve the list of blocklists.

USAGE:
scw tem blocklists list [arg=value ...]

ARGS:
[order-by] (Optional) List blocklist corresponding to specific criteria (created_at_desc | created_at_asc | ends_at_desc | ends_at_asc)
[domain-id] (Optional) Filter by a domain ID
[email] (Optional) Filter by an email address
[type] (Optional) Filter by a blocklist type (unknown_type | mailbox_full | mailbox_not_found)
[custom] (Optional) Filter by custom blocklist (true) or automatic Transactional Email blocklist (false)
[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 cmd/scw/testdata/test-all-usage-tem-blocklists-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
This section allows you to manage the blocklist of your emails.

USAGE:
scw tem blocklists <command>

AVAILABLE COMMANDS:
create Bulk create blocklists
delete Delete a blocklist
list List blocklists

FLAGS:
-h, --help help for blocklists

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 tem blocklists [command] --help" for more information about a command.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ARGS:
[subject] (Optional) List emails with this subject
[search] (Optional) List emails by searching to all fields
[order-by] (Optional) List emails corresponding to specific criteria (created_at_desc | created_at_asc | updated_at_desc | updated_at_asc | status_desc | status_asc | mail_from_desc | mail_from_asc | mail_rcpt_desc | mail_rcpt_asc | subject_desc | subject_asc)
[flags.{index}] (Optional) List emails containing only specific flags (unknown_flag | soft_bounce | hard_bounce | spam | mailbox_full | mailbox_not_found | greylisted | send_before_expiration)
[flags.{index}] (Optional) List emails containing only specific flags (unknown_flag | soft_bounce | hard_bounce | spam | mailbox_full | mailbox_not_found | greylisted | send_before_expiration | blocklisted)
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | all)

DEPRECATED ARGS:
Expand Down
1 change: 1 addition & 0 deletions cmd/scw/testdata/test-all-usage-tem-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ USAGE:
scw tem <command>

AVAILABLE COMMANDS:
blocklists Blocklist
domain Domain management commands
email Email management commands
project-settings Project settings management commands
Expand Down
78 changes: 77 additions & 1 deletion docs/commands/tem.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
# Documentation for `scw tem`
This API allows you to manage your Transactional Email services.

- [Blocklist](#blocklist)
- [Bulk create blocklists](#bulk-create-blocklists)
- [Delete a blocklist](#delete-a-blocklist)
- [List blocklists](#list-blocklists)
- [Domain management commands](#domain-management-commands)
- [Domain DNS check](#domain-dns-check)
- [Register a domain in a project](#register-a-domain-in-a-project)
Expand All @@ -26,6 +30,78 @@ This API allows you to manage your Transactional Email services.
- [Update a Webhook](#update-a-webhook)


## Blocklist

This section allows you to manage the blocklist of your emails.


### Bulk create blocklists

Create multiple blocklists in a specific Project or Organization using the `region` parameter.

**Usage:**

```
scw tem blocklists create [arg=value ...]
```


**Args:**

| Name | | Description |
|------|---|-------------|
| domain-id | | Domain ID linked to the blocklist |
| emails.{index} | | Email blocked by the blocklist |
| type | One of: `unknown_type`, `mailbox_full`, `mailbox_not_found` | Type of blocklist |
| reason | | Reason to block the email |
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |



### Delete a blocklist

You must specify the blocklist you want to delete by the `region` and `blocklist_id`.

**Usage:**

```
scw tem blocklists delete [arg=value ...]
```


**Args:**

| Name | | Description |
|------|---|-------------|
| blocklist-id | Required | ID of the blocklist to delete |
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |



### List blocklists

Retrieve the list of blocklists.

**Usage:**

```
scw tem blocklists list [arg=value ...]
```


**Args:**

| Name | | Description |
|------|---|-------------|
| order-by | One of: `created_at_desc`, `created_at_asc`, `ends_at_desc`, `ends_at_asc` | (Optional) List blocklist corresponding to specific criteria |
| domain-id | | (Optional) Filter by a domain ID |
| email | | (Optional) Filter by an email address |
| type | One of: `unknown_type`, `mailbox_full`, `mailbox_not_found` | (Optional) Filter by a blocklist type |
| custom | | (Optional) Filter by custom blocklist (true) or automatic Transactional Email blocklist (false) |
| region | Default: `fr-par`<br />One of: `fr-par`, `all` | Region to target. If none is passed will use default region from the config |



## Domain management commands

This section lists your domains, shows you to manage them, and gives you information about them.
Expand Down Expand Up @@ -311,7 +387,7 @@ scw tem email list [arg=value ...]
| subject | | (Optional) List emails with this subject |
| search | | (Optional) List emails by searching to all fields |
| order-by | One of: `created_at_desc`, `created_at_asc`, `updated_at_desc`, `updated_at_asc`, `status_desc`, `status_asc`, `mail_from_desc`, `mail_from_asc`, `mail_rcpt_desc`, `mail_rcpt_asc`, `subject_desc`, `subject_asc` | (Optional) List emails corresponding to specific criteria |
| flags.{index} | One of: `unknown_flag`, `soft_bounce`, `hard_bounce`, `spam`, `mailbox_full`, `mailbox_not_found`, `greylisted`, `send_before_expiration` | (Optional) List emails containing only specific flags |
| flags.{index} | One of: `unknown_flag`, `soft_bounce`, `hard_bounce`, `spam`, `mailbox_full`, `mailbox_not_found`, `greylisted`, `send_before_expiration`, `blocklisted` | (Optional) List emails containing only specific flags |
| region | Default: `fr-par`<br />One of: `fr-par`, `all` | Region to target. If none is passed will use default region from the config |


Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ require (
github.com/mattn/go-isatty v0.0.20
github.com/moby/buildkit v0.13.2
github.com/opencontainers/go-digest v1.0.0
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20250108093124-1be16fad27b2
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20250113175114-44bd5547ea5b
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
github.com/spf13/cobra v1.8.1
github.com/spf13/pflag v1.0.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,8 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20250108093124-1be16fad27b2 h1:zPlwMJ1eKWpII1TWrasa7/Q+mC1KumZlxyqTQrhHKA8=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20250108093124-1be16fad27b2/go.mod h1:kzh+BSAvpoyHHdHBCDhmSWtBc1NbLMZ2lWHqnBoxFks=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20250113175114-44bd5547ea5b h1:x15N6mLN/5Yp/MACKBocLUKRPDnM8ZtMOUpVIXKt3lg=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20250113175114-44bd5547ea5b/go.mod h1:kzh+BSAvpoyHHdHBCDhmSWtBc1NbLMZ2lWHqnBoxFks=
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA=
Expand Down
Loading

0 comments on commit 97eb2ff

Please sign in to comment.