Skip to content

Commit 8b6759c

Browse files
feat(dom): add more filters on ListDNSZones to ease VPC sync (#3359)
Co-authored-by: Jules Castéran <[email protected]>
1 parent bd304ae commit 8b6759c

File tree

3 files changed

+55
-8
lines changed

3 files changed

+55
-8
lines changed

cmd/scw/testdata/test-all-usage-dns-zone-list-usage.golden

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,18 @@ USAGE:
66
scw dns zone list [arg=value ...]
77

88
ARGS:
9-
[project-id] Project ID on which to filter the returned DNS zones
10-
[order-by] Sort order of the returned DNS zones (domain_asc | domain_desc | subdomain_asc | subdomain_desc)
11-
[domain] Domain on which to filter the returned DNS zones
12-
[dns-zone] DNS zone on which to filter the returned DNS zones
13-
[organization-id] Organization ID on which to filter the returned DNS zones
9+
[project-id] Project ID on which to filter the returned DNS zones
10+
[order-by] Sort order of the returned DNS zones (domain_asc | domain_desc | subdomain_asc | subdomain_desc | created_at_asc | created_at_desc | updated_at_asc | updated_at_desc)
11+
[domain] Domain on which to filter the returned DNS zones
12+
[dns-zones.{index}] DNS zones on which to filter the returned DNS zones
13+
[created-after] Only list DNS zones created after this date
14+
[created-before] Only list DNS zones created before this date
15+
[updated-after] Only list DNS zones updated after this date
16+
[updated-before] Only list DNS zones updated before this date
17+
[organization-id] Organization ID on which to filter the returned DNS zones
18+
19+
DEPRECATED ARGS:
20+
[dns-zone] DNS zone on which to filter the returned DNS zones
1421

1522
FLAGS:
1623
-h, --help help for list

docs/commands/dns.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,9 +689,14 @@ scw dns zone list [arg=value ...]
689689
| Name | | Description |
690690
|------|---|-------------|
691691
| project-id | | Project ID on which to filter the returned DNS zones |
692-
| order-by | One of: `domain_asc`, `domain_desc`, `subdomain_asc`, `subdomain_desc` | Sort order of the returned DNS zones |
692+
| order-by | One of: `domain_asc`, `domain_desc`, `subdomain_asc`, `subdomain_desc`, `created_at_asc`, `created_at_desc`, `updated_at_asc`, `updated_at_desc` | Sort order of the returned DNS zones |
693693
| domain | | Domain on which to filter the returned DNS zones |
694-
| dns-zone | | DNS zone on which to filter the returned DNS zones |
694+
| ~~dns-zone~~ | Deprecated | DNS zone on which to filter the returned DNS zones |
695+
| dns-zones.{index} | | DNS zones on which to filter the returned DNS zones |
696+
| created-after | | Only list DNS zones created after this date |
697+
| created-before | | Only list DNS zones created before this date |
698+
| updated-after | | Only list DNS zones updated after this date |
699+
| updated-before | | Only list DNS zones updated before this date |
695700
| organization-id | | Organization ID on which to filter the returned DNS zones |
696701

697702

internal/namespaces/domain/v2beta1/domain_cli.go

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func dnsZoneList() *core.Command {
126126
Required: false,
127127
Deprecated: false,
128128
Positional: false,
129-
EnumValues: []string{"domain_asc", "domain_desc", "subdomain_asc", "subdomain_desc"},
129+
EnumValues: []string{"domain_asc", "domain_desc", "subdomain_asc", "subdomain_desc", "created_at_asc", "created_at_desc", "updated_at_asc", "updated_at_desc"},
130130
},
131131
{
132132
Name: "domain",
@@ -139,6 +139,41 @@ func dnsZoneList() *core.Command {
139139
Name: "dns-zone",
140140
Short: `DNS zone on which to filter the returned DNS zones`,
141141
Required: false,
142+
Deprecated: true,
143+
Positional: false,
144+
},
145+
{
146+
Name: "dns-zones.{index}",
147+
Short: `DNS zones on which to filter the returned DNS zones`,
148+
Required: false,
149+
Deprecated: false,
150+
Positional: false,
151+
},
152+
{
153+
Name: "created-after",
154+
Short: `Only list DNS zones created after this date`,
155+
Required: false,
156+
Deprecated: false,
157+
Positional: false,
158+
},
159+
{
160+
Name: "created-before",
161+
Short: `Only list DNS zones created before this date`,
162+
Required: false,
163+
Deprecated: false,
164+
Positional: false,
165+
},
166+
{
167+
Name: "updated-after",
168+
Short: `Only list DNS zones updated after this date`,
169+
Required: false,
170+
Deprecated: false,
171+
Positional: false,
172+
},
173+
{
174+
Name: "updated-before",
175+
Short: `Only list DNS zones updated before this date`,
176+
Required: false,
142177
Deprecated: false,
143178
Positional: false,
144179
},

0 commit comments

Comments
 (0)