Skip to content

Commit 7ad7b3c

Browse files
authored
Merge branch 'master' into v1.5968.0
2 parents 419ad55 + 8bf0ad0 commit 7ad7b3c

File tree

108 files changed

+96949
-29523
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+96949
-29523
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Create multiple blocklists in a specific Project or Organization using the `region` parameter.
4+
5+
USAGE:
6+
scw tem blocklists create [arg=value ...]
7+
8+
ARGS:
9+
[domain-id] Domain ID linked to the blocklist
10+
[emails.{index}] Email blocked by the blocklist
11+
[type] Type of blocklist (unknown_type | mailbox_full | mailbox_not_found)
12+
[reason] Reason to block the email
13+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
14+
15+
FLAGS:
16+
-h, --help help for create
17+
18+
GLOBAL FLAGS:
19+
-c, --config string The path to the config file
20+
-D, --debug Enable debug mode
21+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
22+
-p, --profile string The config profile to use
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
You must specify the blocklist you want to delete by the `region` and `blocklist_id`.
4+
5+
USAGE:
6+
scw tem blocklists delete [arg=value ...]
7+
8+
ARGS:
9+
blocklist-id ID of the blocklist to delete
10+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
11+
12+
FLAGS:
13+
-h, --help help for delete
14+
15+
GLOBAL FLAGS:
16+
-c, --config string The path to the config file
17+
-D, --debug Enable debug mode
18+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
19+
-p, --profile string The config profile to use
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Retrieve the list of blocklists.
4+
5+
USAGE:
6+
scw tem blocklists list [arg=value ...]
7+
8+
ARGS:
9+
[order-by] (Optional) List blocklist corresponding to specific criteria (created_at_desc | created_at_asc | ends_at_desc | ends_at_asc)
10+
[domain-id] (Optional) Filter by a domain ID
11+
[email] (Optional) Filter by an email address
12+
[type] (Optional) Filter by a blocklist type (unknown_type | mailbox_full | mailbox_not_found)
13+
[custom] (Optional) Filter by custom blocklist (true) or automatic Transactional Email blocklist (false)
14+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | all)
15+
16+
FLAGS:
17+
-h, --help help for list
18+
19+
GLOBAL FLAGS:
20+
-c, --config string The path to the config file
21+
-D, --debug Enable debug mode
22+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
23+
-p, --profile string The config profile to use

cmd/scw/testdata/test-all-usage-tem-blocklists-usage.golden

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
This section allows you to manage the blocklist of your emails.
44

55
USAGE:
6-
scw tem blocklists
6+
scw tem blocklists <command>
7+
8+
AVAILABLE COMMANDS:
9+
create Bulk create blocklists
10+
delete Delete a blocklist
11+
list List blocklists
712

813
FLAGS:
914
-h, --help help for blocklists
@@ -13,3 +18,5 @@ GLOBAL FLAGS:
1318
-D, --debug Enable debug mode
1419
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
1520
-p, --profile string The config profile to use
21+
22+
Use "scw tem blocklists [command] --help" for more information about a command.

docs/commands/tem.md

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
This API allows you to manage your Transactional Email services.
44

55
- [Blocklist](#blocklist)
6+
=======
7+
- [Bulk create blocklists](#bulk-create-blocklists)
8+
- [Delete a blocklist](#delete-a-blocklist)
9+
- [List blocklists](#list-blocklists)
610
- [Domain management commands](#domain-management-commands)
711
- [Domain DNS check](#domain-dns-check)
812
- [Register a domain in a project](#register-a-domain-in-a-project)
@@ -31,15 +35,70 @@ This API allows you to manage your Transactional Email services.
3135

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

34-
This section allows you to manage the blocklist of your emails.
38+
### Bulk create blocklists
39+
40+
Create multiple blocklists in a specific Project or Organization using the `region` parameter.
3541

3642
**Usage:**
3743

3844
```
39-
scw tem blocklists
45+
scw tem blocklists create [arg=value ...]
46+
```
47+
48+
49+
**Args:**
50+
51+
| Name | | Description |
52+
|------|---|-------------|
53+
| domain-id | | Domain ID linked to the blocklist |
54+
| emails.{index} | | Email blocked by the blocklist |
55+
| type | One of: `unknown_type`, `mailbox_full`, `mailbox_not_found` | Type of blocklist |
56+
| reason | | Reason to block the email |
57+
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
58+
59+
60+
61+
### Delete a blocklist
62+
63+
You must specify the blocklist you want to delete by the `region` and `blocklist_id`.
64+
65+
**Usage:**
66+
67+
scw tem blocklists delete [arg=value ...]
4068
```
4169
4270
71+
**Args:**
72+
73+
| Name | | Description |
74+
|------|---|-------------|
75+
| blocklist-id | Required | ID of the blocklist to delete |
76+
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
77+
78+
79+
80+
### List blocklists
81+
82+
Retrieve the list of blocklists.
83+
84+
**Usage:**
85+
86+
```
87+
scw tem blocklists list [arg=value ...]
88+
```
89+
90+
91+
**Args:**
92+
93+
| Name | | Description |
94+
|------|---|-------------|
95+
| order-by | One of: `created_at_desc`, `created_at_asc`, `ends_at_desc`, `ends_at_asc` | (Optional) List blocklist corresponding to specific criteria |
96+
| domain-id | | (Optional) Filter by a domain ID |
97+
| email | | (Optional) Filter by an email address |
98+
| type | One of: `unknown_type`, `mailbox_full`, `mailbox_not_found` | (Optional) Filter by a blocklist type |
99+
| custom | | (Optional) Filter by custom blocklist (true) or automatic Transactional Email blocklist (false) |
100+
| region | Default: `fr-par`<br />One of: `fr-par`, `all` | Region to target. If none is passed will use default region from the config |
101+
43102
44103
## Domain management commands
45104

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ toolchain go1.22.2
77
require (
88
github.com/alecthomas/assert v1.0.0
99
github.com/aws/aws-sdk-go-v2 v1.32.8
10-
github.com/aws/aws-sdk-go-v2/service/s3 v1.72.2
10+
github.com/aws/aws-sdk-go-v2/service/s3 v1.72.3
1111
github.com/buildpacks/pack v0.34.2
1212
github.com/c-bata/go-prompt v0.2.6
1313
github.com/charmbracelet/bubbletea v1.2.4

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.8 h1:cWno7lefS
9696
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.8/go.mod h1:tPD+VjU3ABTBoEJ3nctu5Nyg4P4yjqSH5bJGGkY4+XE=
9797
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.8 h1:/Mn7gTedG86nbpjT4QEKsN1D/fThiYe1qvq7WsBGNHg=
9898
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.8/go.mod h1:Ae3va9LPmvjj231ukHB6UeT8nS7wTPfC3tMZSZMwNYg=
99-
github.com/aws/aws-sdk-go-v2/service/s3 v1.72.2 h1:a7aQ3RW+ug4IbhoQp29NZdc7vqrzKZZfWZSaQAXOZvQ=
100-
github.com/aws/aws-sdk-go-v2/service/s3 v1.72.2/go.mod h1:xMekrnhmJ5aqmyxtmALs7mlvXw5xRh+eYjOjvrIIFJ4=
99+
github.com/aws/aws-sdk-go-v2/service/s3 v1.72.3 h1:WZOmJfCDV+4tYacLxpiojoAdT5sxTfB3nTqQNtZu+J4=
100+
github.com/aws/aws-sdk-go-v2/service/s3 v1.72.3/go.mod h1:xMekrnhmJ5aqmyxtmALs7mlvXw5xRh+eYjOjvrIIFJ4=
101101
github.com/aws/aws-sdk-go-v2/service/sso v1.20.2 h1:XOPfar83RIRPEzfihnp+U6udOveKZJvPQ76SKWrLRHc=
102102
github.com/aws/aws-sdk-go-v2/service/sso v1.20.2/go.mod h1:Vv9Xyk1KMHXrR3vNQe8W5LMFdTjSeWk0gBZBzvf3Qa0=
103103
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.2 h1:pi0Skl6mNl2w8qWZXcdOyg197Zsf4G97U7Sso9JXGZE=

internal/namespaces/rdb/v1/custom_acl_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
func Test_AddACL(t *testing.T) {
1212
t.Run("Simple", core.Test(&core.TestConfig{
1313
Commands: rdb.GetCommands(),
14-
BeforeFunc: createInstance("PostgreSQL-12"),
14+
BeforeFunc: core.BeforeFuncCombine(fetchLatestEngine("PostgreSQL"), createInstance("{{.latestEngine}}")),
1515
Cmd: "scw rdb acl add 1.2.3.4 instance-id={{ .Instance.ID }} --wait",
1616
Check: core.TestCheckCombine(
1717
core.TestCheckGolden(),
@@ -25,7 +25,7 @@ func Test_AddACL(t *testing.T) {
2525

2626
t.Run("Simple with description", core.Test(&core.TestConfig{
2727
Commands: rdb.GetCommands(),
28-
BeforeFunc: createInstance("PostgreSQL-12"),
28+
BeforeFunc: core.BeforeFuncCombine(fetchLatestEngine("PostgreSQL"), createInstance("{{.latestEngine}}")),
2929
Cmd: "scw rdb acl add 1.2.3.4 instance-id={{ .Instance.ID }} description=some-unique-description --wait",
3030
Check: core.TestCheckCombine(
3131
core.TestCheckGolden(),
@@ -39,7 +39,7 @@ func Test_AddACL(t *testing.T) {
3939

4040
t.Run("Multiple", core.Test(&core.TestConfig{
4141
Commands: rdb.GetCommands(),
42-
BeforeFunc: createInstance("PostgreSQL-12"),
42+
BeforeFunc: core.BeforeFuncCombine(fetchLatestEngine("PostgreSQL"), createInstance("{{.latestEngine}}")),
4343
Cmd: "scw rdb acl add 1.2.3.4 192.168.1.0/30 10.10.10.10 instance-id={{ .Instance.ID }} --wait",
4444
Check: core.TestCheckCombine(
4545
core.TestCheckGolden(),
@@ -53,7 +53,7 @@ func Test_AddACL(t *testing.T) {
5353

5454
t.Run("Multiple with description", core.Test(&core.TestConfig{
5555
Commands: rdb.GetCommands(),
56-
BeforeFunc: createInstance("PostgreSQL-12"),
56+
BeforeFunc: core.BeforeFuncCombine(fetchLatestEngine("PostgreSQL"), createInstance("{{.latestEngine}}")),
5757
Cmd: "scw rdb acl add 1.2.3.4 192.168.1.0/30 10.10.10.10 instance-id={{ .Instance.ID }} description=some-unique-description --wait",
5858
Check: core.TestCheckCombine(
5959
core.TestCheckGolden(),
@@ -69,7 +69,7 @@ func Test_AddACL(t *testing.T) {
6969
func Test_DeleteACL(t *testing.T) {
7070
t.Run("Simple", core.Test(&core.TestConfig{
7171
Commands: rdb.GetCommands(),
72-
BeforeFunc: createInstance("PostgreSQL-12"),
72+
BeforeFunc: core.BeforeFuncCombine(fetchLatestEngine("PostgreSQL"), createInstance("{{.latestEngine}}")),
7373
Cmd: "scw rdb acl delete 0.0.0.0/0 instance-id={{ .Instance.ID }} --wait",
7474
Check: core.TestCheckCombine(
7575
core.TestCheckGolden(),
@@ -84,7 +84,7 @@ func Test_DeleteACL(t *testing.T) {
8484
t.Run("Multiple when set", core.Test(&core.TestConfig{
8585
Commands: rdb.GetCommands(),
8686
BeforeFunc: core.BeforeFuncCombine(
87-
createInstance("PostgreSQL-12"),
87+
fetchLatestEngine("PostgreSQL"), createInstance("{{.latestEngine}}"),
8888
core.ExecBeforeCmd("scw rdb acl add 1.2.3.4 192.168.1.0/32 10.10.10.10 instance-id={{ .Instance.ID }} --wait"),
8989
),
9090
Cmd: "scw rdb acl delete 1.2.3.4/32 192.168.1.0/32 10.10.10.10/32 instance-id={{ .Instance.ID }} --wait",
@@ -101,7 +101,7 @@ func Test_DeleteACL(t *testing.T) {
101101
t.Run("Multiple when not set", core.Test(&core.TestConfig{
102102
Commands: rdb.GetCommands(),
103103
BeforeFunc: core.BeforeFuncCombine(
104-
createInstance("PostgreSQL-12"),
104+
fetchLatestEngine("PostgreSQL"), createInstance("{{.latestEngine}}"),
105105
core.ExecBeforeCmd("scw rdb acl add 192.168.1.0/32 instance-id={{ .Instance.ID }} --wait"),
106106
),
107107
Cmd: "scw rdb acl delete 1.2.3.4/32 192.168.1.0/32 10.10.10.10/32 instance-id={{ .Instance.ID }} --wait",
@@ -119,7 +119,7 @@ func Test_DeleteACL(t *testing.T) {
119119
func Test_SetACL(t *testing.T) {
120120
t.Run("Simple", core.Test(&core.TestConfig{
121121
Commands: rdb.GetCommands(),
122-
BeforeFunc: createInstance("PostgreSQL-12"),
122+
BeforeFunc: core.BeforeFuncCombine(fetchLatestEngine("PostgreSQL"), createInstance("{{.latestEngine}}")),
123123
Cmd: "scw rdb acl set 1.2.3.4 instance-id={{ .Instance.ID }} descriptions.0=something --wait",
124124
Check: core.TestCheckCombine(
125125
core.TestCheckGolden(),
@@ -136,7 +136,7 @@ func Test_SetACL(t *testing.T) {
136136
t.Run("Multiple", core.Test(&core.TestConfig{
137137
Commands: rdb.GetCommands(),
138138
BeforeFunc: core.BeforeFuncCombine(
139-
createInstance("PostgreSQL-12"),
139+
fetchLatestEngine("PostgreSQL"), createInstance("{{.latestEngine}}"),
140140
core.ExecBeforeCmd("scw rdb acl add 1.2.3.4 192.168.1.0/32 10.10.10.10 instance-id={{ .Instance.ID }} --wait"),
141141
),
142142
Cmd: "scw rdb acl set 1.2.3.4 192.168.1.0/31 11.11.11.11 instance-id={{ .Instance.ID }} descriptions.0=first descriptions.1=second descriptions.2=third --wait",

internal/namespaces/rdb/v1/custom_endpoint_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func Test_EndpointCreate(t *testing.T) {
3737
Commands: cmds,
3838
BeforeFunc: core.BeforeFuncCombine(
3939
createPN(),
40-
createInstance("PostgreSQL-15"),
40+
fetchLatestEngine("PostgreSQL"), createInstance("{{.latestEngine}}"),
4141
),
4242
Cmd: "scw rdb endpoint create {{ .Instance.ID }} private-network.private-network-id={{ .PN.ID }} private-network.service-ip={{ .IPNet }} --wait",
4343
Check: core.TestCheckCombine(
@@ -58,7 +58,7 @@ func Test_EndpointCreate(t *testing.T) {
5858
Commands: cmds,
5959
BeforeFunc: core.BeforeFuncCombine(
6060
createPN(),
61-
createInstance("PostgreSQL-15"),
61+
fetchLatestEngine("PostgreSQL"), createInstance("{{.latestEngine}}"),
6262
),
6363
Cmd: "scw rdb endpoint create {{ .Instance.ID }} private-network.private-network-id={{ .PN.ID }} private-network.enable-ipam=true --wait",
6464
Check: core.TestCheckCombine(
@@ -127,7 +127,7 @@ func Test_EndpointDelete(t *testing.T) {
127127
t.Run("All", core.Test(&core.TestConfig{
128128
Commands: cmds,
129129
BeforeFunc: core.BeforeFuncCombine(
130-
createInstance("PostgreSQL-15"),
130+
fetchLatestEngine("PostgreSQL"), createInstance("{{.latestEngine}}"),
131131
listEndpointsInMeta(),
132132
),
133133
Cmd: "scw rdb endpoint delete {{ .PublicEndpoint.ID }} instance-id={{ .Instance.ID }} --wait",

0 commit comments

Comments
 (0)