Skip to content

Commit bb69946

Browse files
authored
feat(tem): add name filter to domain listing (#2563)
1 parent e3b9d76 commit bb69946

File tree

3 files changed

+264
-0
lines changed

3 files changed

+264
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ USAGE:
88
ARGS:
99
[project-id]
1010
[status.{index}] (unknown | checked | unchecked | invalid | locked | revoked | pending)
11+
[name]
1112
[organization-id]
1213
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
1314

docs/commands/tem.md

Lines changed: 257 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,257 @@
1+
<!-- DO NOT EDIT: this file is automatically generated using scw-doc-gen -->
2+
# Documentation for `scw tem`
3+
Tem
4+
5+
- [Domain management commands](#domain-management-commands)
6+
- [Ask for an immediate check of a domain (DNS check)](#ask-for-an-immediate-check-of-a-domain-(dns-check))
7+
- [Register a domain in a project](#register-a-domain-in-a-project)
8+
- [Get information about a domain](#get-information-about-a-domain)
9+
- [List domains in a project and/or in an organization](#list-domains-in-a-project-andor-in-an-organization)
10+
- [Revoke a domain](#revoke-a-domain)
11+
- [Email management commands](#email-management-commands)
12+
- [Try to cancel an email if it has not yet been sent](#try-to-cancel-an-email-if-it-has-not-yet-been-sent)
13+
- [Send an email](#send-an-email)
14+
- [Get information about an email](#get-information-about-an-email)
15+
- [Get statistics on the email statuses](#get-statistics-on-the-email-statuses)
16+
- [List emails sent from a domain and/or for a project and/or for an organization](#list-emails-sent-from-a-domain-andor-for-a-project-andor-for-an-organization)
17+
18+
19+
## Domain management commands
20+
21+
Domain management commands.
22+
23+
24+
### Ask for an immediate check of a domain (DNS check)
25+
26+
Ask for an immediate check of a domain (DNS check).
27+
28+
**Usage:**
29+
30+
```
31+
scw tem domain check <domain-id ...> [arg=value ...]
32+
```
33+
34+
35+
**Args:**
36+
37+
| Name | | Description |
38+
|------|---|-------------|
39+
| domain-id | Required | ID of the domain to check |
40+
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
41+
42+
43+
44+
### Register a domain in a project
45+
46+
Register a domain in a project.
47+
48+
**Usage:**
49+
50+
```
51+
scw tem domain create [arg=value ...]
52+
```
53+
54+
55+
**Args:**
56+
57+
| Name | | Description |
58+
|------|---|-------------|
59+
| project-id | | Project ID to use. If none is passed the default project ID will be used |
60+
| domain-name | | |
61+
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
62+
63+
64+
65+
### Get information about a domain
66+
67+
Get information about a domain.
68+
69+
**Usage:**
70+
71+
```
72+
scw tem domain get <domain-id ...> [arg=value ...]
73+
```
74+
75+
76+
**Args:**
77+
78+
| Name | | Description |
79+
|------|---|-------------|
80+
| domain-id | Required | ID of the domain |
81+
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
82+
83+
84+
85+
### List domains in a project and/or in an organization
86+
87+
List domains in a project and/or in an organization.
88+
89+
**Usage:**
90+
91+
```
92+
scw tem domain list [arg=value ...]
93+
```
94+
95+
96+
**Args:**
97+
98+
| Name | | Description |
99+
|------|---|-------------|
100+
| project-id | | |
101+
| status.{index} | One of: `unknown`, `checked`, `unchecked`, `invalid`, `locked`, `revoked`, `pending` | |
102+
| name | | |
103+
| organization-id | | |
104+
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
105+
106+
107+
108+
### Revoke a domain
109+
110+
Revoke a domain.
111+
112+
**Usage:**
113+
114+
```
115+
scw tem domain revoke <domain-id ...> [arg=value ...]
116+
```
117+
118+
119+
**Args:**
120+
121+
| Name | | Description |
122+
|------|---|-------------|
123+
| domain-id | Required | ID of the domain to revoke |
124+
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
125+
126+
127+
128+
## Email management commands
129+
130+
Email management commands.
131+
132+
133+
### Try to cancel an email if it has not yet been sent
134+
135+
Try to cancel an email if it has not yet been sent.
136+
137+
**Usage:**
138+
139+
```
140+
scw tem email cancel <email-id ...> [arg=value ...]
141+
```
142+
143+
144+
**Args:**
145+
146+
| Name | | Description |
147+
|------|---|-------------|
148+
| email-id | Required | ID of the email to cancel |
149+
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
150+
151+
152+
153+
### Send an email
154+
155+
Send an email.
156+
157+
**Usage:**
158+
159+
```
160+
scw tem email create [arg=value ...]
161+
```
162+
163+
164+
**Args:**
165+
166+
| Name | | Description |
167+
|------|---|-------------|
168+
| from.email | | Email address |
169+
| from.name | | Optional display name |
170+
| to.{index}.email | | Email address |
171+
| to.{index}.name | | Optional display name |
172+
| cc.{index}.email | | Email address |
173+
| cc.{index}.name | | Optional display name |
174+
| bcc.{index}.email | | Email address |
175+
| bcc.{index}.name | | Optional display name |
176+
| subject | | Message subject |
177+
| text | | Text content |
178+
| html | | HTML content |
179+
| project-id | | Project ID to use. If none is passed the default project ID will be used |
180+
| attachments.{index}.name | | Filename of the attachment |
181+
| attachments.{index}.type | | MIME type of the attachment (Currently only allow, text files, pdf and html files) |
182+
| attachments.{index}.content | | Content of the attachment, encoded in base64 |
183+
| send-before | | Maximum date to deliver mail |
184+
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
185+
186+
187+
188+
### Get information about an email
189+
190+
Get information about an email.
191+
192+
**Usage:**
193+
194+
```
195+
scw tem email get <email-id ...> [arg=value ...]
196+
```
197+
198+
199+
**Args:**
200+
201+
| Name | | Description |
202+
|------|---|-------------|
203+
| email-id | Required | ID of the email to retrieve |
204+
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
205+
206+
207+
208+
### Get statistics on the email statuses
209+
210+
Get statistics on the email statuses.
211+
212+
**Usage:**
213+
214+
```
215+
scw tem email get-statistics [arg=value ...]
216+
```
217+
218+
219+
**Args:**
220+
221+
| Name | | Description |
222+
|------|---|-------------|
223+
| project-id | | Optional, count emails for this project |
224+
| domain-id | | Optional, count emails send from this domain (must be coherent with the `project_id` and the `organization_id`) |
225+
| since | | Optional, count emails created after this date |
226+
| until | | Optional, count emails created before this date |
227+
| mail-from | | Optional, count emails sent with this `mail_from` sender's address |
228+
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
229+
230+
231+
232+
### List emails sent from a domain and/or for a project and/or for an organization
233+
234+
List emails sent from a domain and/or for a project and/or for an organization.
235+
236+
**Usage:**
237+
238+
```
239+
scw tem email list [arg=value ...]
240+
```
241+
242+
243+
**Args:**
244+
245+
| Name | | Description |
246+
|------|---|-------------|
247+
| project-id | | Optional ID of the project in which to list the emails |
248+
| domain-id | | Optional ID of the domain for which to list the emails |
249+
| since | | Optional, list emails created after this date |
250+
| until | | Optional, list emails created before this date |
251+
| mail-from | | Optional, list emails sent with this `mail_from` sender's address |
252+
| mail-to | | Optional, list emails sent with this `mail_to` recipient's address |
253+
| statuses.{index} | One of: `unknown`, `new`, `sending`, `sent`, `failed`, `canceled` | Optional, list emails having any of this status |
254+
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
255+
256+
257+

internal/namespaces/tem/v1alpha1/tem_cli.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,12 @@ func temDomainList() *core.Command {
467467
Positional: false,
468468
EnumValues: []string{"unknown", "checked", "unchecked", "invalid", "locked", "revoked", "pending"},
469469
},
470+
{
471+
Name: "name",
472+
Required: false,
473+
Deprecated: false,
474+
Positional: false,
475+
},
470476
{
471477
Name: "organization-id",
472478
Required: false,

0 commit comments

Comments
 (0)