Skip to content

Import DNS Zone

POST
/enum.api.v1.DnsService/ImportZone

ImportZone bulk-loads a BIND zone file into the zone. With dry_run it returns the changes it would make without applying them.

object
projectId
string
zoneId
string
zoneData

Zone_data is a BIND zone file.

string
dryRun

Dry_run computes and returns the changes without applying them.

boolean
mode

Mode defaults to MERGE when unspecified.

string format: enum
Allowed values: IMPORT_MODE_UNSPECIFIED IMPORT_MODE_MERGE IMPORT_MODE_REPLACE IMPORT_MODE_PRUNE

OK

object
changes
Array<object>
object
action
string format: enum
Allowed values: RECORD_SET_CHANGE_ACTION_UNSPECIFIED RECORD_SET_CHANGE_ACTION_CREATE RECORD_SET_CHANGE_ACTION_UPDATE RECORD_SET_CHANGE_ACTION_DELETE RECORD_SET_CHANGE_ACTION_UNCHANGED
name
string
type
string
ttl
integer format: int32
records
Array<object>
object
content

Rdata in presentation format (e.g. “192.0.2.1”, “10 mail.example.com.”).

string
disabled
boolean
warnings
Array<string>
applied

Applied is false for a dry run.

boolean

invalid_argument: the zone file cannot be parsed or its records conflict. Records that are invalid on their own are skipped and listed in warnings instead.

Messages:

  • validation error: <field>: <reason>
  • parse zone file: <reason>
  • CNAME at <name> cannot coexist with other record types
  • multiple CNAME records at <name>; a name may have only one CNAME
  • ALIAS at <name> cannot coexist with A, AAAA, or CNAME
object
code

Error code, such as invalid_argument or not_found.

string
message

Human-readable error message.

string

unauthenticated: the token is missing, invalid, or expired.

Messages:

  • missing authorization header
  • invalid authorization header format
  • authentication failed
object
code

Error code, such as invalid_argument or not_found.

string
message

Human-readable error message.

string

permission_denied: the token has no access to this project or method.

Messages:

  • not authorized
object
code

Error code, such as invalid_argument or not_found.

string
message

Human-readable error message.

string

not_found: the resource does not exist.

Messages:

  • resource not found
object
code

Error code, such as invalid_argument or not_found.

string
message

Human-readable error message.

string

resource_exhausted: a rate limit or quota is reached.

Messages:

  • rate limit exceeded: wait for the number of seconds in Retry-After.
  • dns.records quota exceeded: limit <n>, in use <n>, requested <n>: the project has reached its record quota.
object
code

Error code, such as invalid_argument or not_found.

string
message

Human-readable error message.

string

internal: something failed on our side.

Messages:

  • internal error
object
code

Error code, such as invalid_argument or not_found.

string
message

Human-readable error message.

string