Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(domain): add support for bind source and axfr source #1965

Merged
merged 2 commits into from
Oct 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ ARGS:
[changes.{index}.delete.id-fields.data]
[changes.{index}.delete.id-fields.ttl]
[return-all-records] Whether or not to return all the records
[disallow-new-zone-creation] Forbid the creation of the target zone if not existing (default action is yes)
[serial] Don't use the autoincremenent serial but the provided one (0 to keep the same)

FLAGS:
-h, --help help for bulk-update
Expand Down
15 changes: 11 additions & 4 deletions cmd/scw/testdata/test-all-usage-dns-zone-import-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@ USAGE:
scw dns zone import <dns-zone ...> [arg=value ...]

ARGS:
dns-zone The DNS zone to import
[content]
[project-id] Project ID to use. If none is passed the default project ID will be used
[format] (unknown_raw_format | bind)
dns-zone The DNS zone to import
[project-id] Project ID to use. If none is passed the default project ID will be used
[bind-source.content]
[axfr-source.name-server]
[axfr-source.tsig-key.name]
[axfr-source.tsig-key.key]
[axfr-source.tsig-key.algorithm]

DEPRECATED ARGS:
[content]
[format] (unknown_raw_format | bind)

FLAGS:
-h, --help help for import
Expand Down
11 changes: 9 additions & 2 deletions docs/commands/dns.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ scw dns record bulk-update <dns-zone ...> [arg=value ...]
| changes.{index}.delete.id-fields.data | | |
| changes.{index}.delete.id-fields.ttl | | |
| return-all-records | | Whether or not to return all the records |
| disallow-new-zone-creation | | Forbid the creation of the target zone if not existing (default action is yes) |
| serial | | Don't use the autoincremenent serial but the provided one (0 to keep the same) |



Expand Down Expand Up @@ -673,9 +675,14 @@ scw dns zone import <dns-zone ...> [arg=value ...]
| Name | | Description |
|------|---|-------------|
| dns-zone | Required | The DNS zone to import |
| content | | |
| ~~content~~ | Deprecated | |
| project-id | | Project ID to use. If none is passed the default project ID will be used |
| format | One of: `unknown_raw_format`, `bind` | |
| ~~format~~ | Deprecated<br />One of: `unknown_raw_format`, `bind` | |
| bind-source.content | | |
| axfr-source.name-server | | |
| axfr-source.tsig-key.name | | |
| axfr-source.tsig-key.key | | |
| axfr-source.tsig-key.algorithm | | |



Expand Down
48 changes: 46 additions & 2 deletions internal/namespaces/domain/v2beta1/domain_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,20 @@ All edits will be versioned.
Deprecated: false,
Positional: false,
},
{
Name: "disallow-new-zone-creation",
Short: `Forbid the creation of the target zone if not existing (default action is yes)`,
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "serial",
Short: `Don't use the autoincremenent serial but the provided one (0 to keep the same)`,
Required: false,
Deprecated: false,
Positional: false,
},
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*domain.UpdateDNSZoneRecordsRequest)
Expand Down Expand Up @@ -964,17 +978,47 @@ func dnsZoneImport() *core.Command {
{
Name: "content",
Required: false,
Deprecated: false,
Deprecated: true,
Positional: false,
},
core.ProjectIDArgSpec(),
{
Name: "format",
Required: false,
Deprecated: false,
Deprecated: true,
Positional: false,
EnumValues: []string{"unknown_raw_format", "bind"},
},
{
Name: "bind-source.content",
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "axfr-source.name-server",
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "axfr-source.tsig-key.name",
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "axfr-source.tsig-key.key",
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "axfr-source.tsig-key.algorithm",
Required: false,
Deprecated: false,
Positional: false,
},
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*domain.ImportRawDNSZoneRequest)
Expand Down