cloudflare
Version:
The official TypeScript library for the Cloudflare API
2,013 lines • 143 kB
TypeScript
import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as RecordsAPI from 'cloudflare/resources/dns/records';
import { V4PagePaginationArray, type V4PagePaginationArrayParams } from 'cloudflare/pagination';
export declare class Records extends APIResource {
/**
* Create a new DNS record for a zone.
*
* Notes:
*
* - A/AAAA records cannot exist on the same name as CNAME records.
* - NS records cannot exist on the same name as any other record type.
* - Domain names are always represented in Punycode, even if Unicode characters
* were used when creating the record.
*/
create(params: RecordCreateParams, options?: Core.RequestOptions): Core.APIPromise<Record>;
/**
* Overwrite an existing DNS record. Notes:
*
* - A/AAAA records cannot exist on the same name as CNAME records.
* - NS records cannot exist on the same name as any other record type.
* - Domain names are always represented in Punycode, even if Unicode characters
* were used when creating the record.
*/
update(dnsRecordId: string, params: RecordUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Record>;
/**
* List, search, sort, and filter a zones' DNS records.
*/
list(params: RecordListParams, options?: Core.RequestOptions): Core.PagePromise<RecordsV4PagePaginationArray, Record>;
/**
* Delete DNS Record
*/
delete(dnsRecordId: string, params: RecordDeleteParams, options?: Core.RequestOptions): Core.APIPromise<RecordDeleteResponse>;
/**
* Update an existing DNS record. Notes:
*
* - A/AAAA records cannot exist on the same name as CNAME records.
* - NS records cannot exist on the same name as any other record type.
* - Domain names are always represented in Punycode, even if Unicode characters
* were used when creating the record.
*/
edit(dnsRecordId: string, params: RecordEditParams, options?: Core.RequestOptions): Core.APIPromise<Record>;
/**
* You can export your
* [BIND config](https://en.wikipedia.org/wiki/Zone_file "Zone file") through this
* endpoint.
*
* See
* [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/import-and-export/ "Import and export records")
* for more information.
*/
export(params: RecordExportParams, options?: Core.RequestOptions): Core.APIPromise<string>;
/**
* DNS Record Details
*/
get(dnsRecordId: string, params: RecordGetParams, options?: Core.RequestOptions): Core.APIPromise<Record>;
/**
* You can upload your
* [BIND config](https://en.wikipedia.org/wiki/Zone_file "Zone file") through this
* endpoint. It assumes that cURL is called from a location with bind_config.txt
* (valid BIND config) present.
*
* See
* [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/import-and-export/ "Import and export records")
* for more information.
*/
import(params: RecordImportParams, options?: Core.RequestOptions): Core.APIPromise<RecordImportResponse>;
/**
* Scan for common DNS records on your domain and automatically add them to your
* zone. Useful if you haven't updated your nameservers yet.
*/
scan(params: RecordScanParams, options?: Core.RequestOptions): Core.APIPromise<RecordScanResponse>;
}
export declare class RecordsV4PagePaginationArray extends V4PagePaginationArray<Record> {
}
export interface ARecord {
/**
* A valid IPv4 address.
*/
content: string;
/**
* DNS record name (or @ for the zone apex) in Punycode.
*/
name: string;
/**
* Record type.
*/
type: 'A';
/**
* Identifier
*/
id?: string;
/**
* Comments or notes about the DNS record. This field has no effect on DNS
* responses.
*/
comment?: string;
/**
* When the record was created.
*/
created_on?: string;
/**
* Whether this record can be modified/deleted (true means it's managed by
* Cloudflare).
*/
locked?: boolean;
/**
* Extra Cloudflare-specific information about the record.
*/
meta?: RecordMetadata;
/**
* When the record was last modified.
*/
modified_on?: string;
/**
* Whether the record can be proxied by Cloudflare or not.
*/
proxiable?: boolean;
/**
* Whether the record is receiving the performance and security benefits of
* Cloudflare.
*/
proxied?: boolean;
/**
* Custom tags for the DNS record. This field has no effect on DNS responses.
*/
tags?: Array<RecordTags>;
/**
* Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
* Value must be between 60 and 86400, with the minimum reduced to 30 for
* Enterprise zones.
*/
ttl?: TTL;
/**
* Identifier
*/
zone_id?: string;
/**
* The domain of the record.
*/
zone_name?: string;
}
export interface AAAARecord {
/**
* A valid IPv6 address.
*/
content: string;
/**
* DNS record name (or @ for the zone apex) in Punycode.
*/
name: string;
/**
* Record type.
*/
type: 'AAAA';
/**
* Identifier
*/
id?: string;
/**
* Comments or notes about the DNS record. This field has no effect on DNS
* responses.
*/
comment?: string;
/**
* When the record was created.
*/
created_on?: string;
/**
* Whether this record can be modified/deleted (true means it's managed by
* Cloudflare).
*/
locked?: boolean;
/**
* Extra Cloudflare-specific information about the record.
*/
meta?: RecordMetadata;
/**
* When the record was last modified.
*/
modified_on?: string;
/**
* Whether the record can be proxied by Cloudflare or not.
*/
proxiable?: boolean;
/**
* Whether the record is receiving the performance and security benefits of
* Cloudflare.
*/
proxied?: boolean;
/**
* Custom tags for the DNS record. This field has no effect on DNS responses.
*/
tags?: Array<RecordTags>;
/**
* Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
* Value must be between 60 and 86400, with the minimum reduced to 30 for
* Enterprise zones.
*/
ttl?: TTL;
/**
* Identifier
*/
zone_id?: string;
/**
* The domain of the record.
*/
zone_name?: string;
}
export interface CAARecord {
/**
* Components of a CAA record.
*/
data: CAARecord.Data;
/**
* DNS record name (or @ for the zone apex) in Punycode.
*/
name: string;
/**
* Record type.
*/
type: 'CAA';
/**
* Identifier
*/
id?: string;
/**
* Comments or notes about the DNS record. This field has no effect on DNS
* responses.
*/
comment?: string;
/**
* Formatted CAA content. See 'data' to set CAA properties.
*/
content?: string;
/**
* When the record was created.
*/
created_on?: string;
/**
* Whether this record can be modified/deleted (true means it's managed by
* Cloudflare).
*/
locked?: boolean;
/**
* Extra Cloudflare-specific information about the record.
*/
meta?: RecordMetadata;
/**
* When the record was last modified.
*/
modified_on?: string;
/**
* Whether the record can be proxied by Cloudflare or not.
*/
proxiable?: boolean;
/**
* Custom tags for the DNS record. This field has no effect on DNS responses.
*/
tags?: Array<RecordTags>;
/**
* Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
* Value must be between 60 and 86400, with the minimum reduced to 30 for
* Enterprise zones.
*/
ttl?: TTL;
/**
* Identifier
*/
zone_id?: string;
/**
* The domain of the record.
*/
zone_name?: string;
}
export declare namespace CAARecord {
/**
* Components of a CAA record.
*/
interface Data {
/**
* Flags for the CAA record.
*/
flags?: number;
/**
* Name of the property controlled by this record (e.g.: issue, issuewild, iodef).
*/
tag?: string;
/**
* Value of the record. This field's semantics depend on the chosen tag.
*/
value?: string;
}
}
export interface CERTRecord {
/**
* Components of a CERT record.
*/
data: CERTRecord.Data;
/**
* DNS record name (or @ for the zone apex) in Punycode.
*/
name: string;
/**
* Record type.
*/
type: 'CERT';
/**
* Identifier
*/
id?: string;
/**
* Comments or notes about the DNS record. This field has no effect on DNS
* responses.
*/
comment?: string;
/**
* Formatted CERT content. See 'data' to set CERT properties.
*/
content?: string;
/**
* When the record was created.
*/
created_on?: string;
/**
* Whether this record can be modified/deleted (true means it's managed by
* Cloudflare).
*/
locked?: boolean;
/**
* Extra Cloudflare-specific information about the record.
*/
meta?: RecordMetadata;
/**
* When the record was last modified.
*/
modified_on?: string;
/**
* Whether the record can be proxied by Cloudflare or not.
*/
proxiable?: boolean;
/**
* Custom tags for the DNS record. This field has no effect on DNS responses.
*/
tags?: Array<RecordTags>;
/**
* Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
* Value must be between 60 and 86400, with the minimum reduced to 30 for
* Enterprise zones.
*/
ttl?: TTL;
/**
* Identifier
*/
zone_id?: string;
/**
* The domain of the record.
*/
zone_name?: string;
}
export declare namespace CERTRecord {
/**
* Components of a CERT record.
*/
interface Data {
/**
* Algorithm.
*/
algorithm?: number;
/**
* Certificate.
*/
certificate?: string;
/**
* Key Tag.
*/
key_tag?: number;
/**
* Type.
*/
type?: number;
}
}
export interface CNAMERecord {
/**
* A valid hostname. Must not match the record's name.
*/
content: unknown;
/**
* DNS record name (or @ for the zone apex) in Punycode.
*/
name: string;
/**
* Record type.
*/
type: 'CNAME';
/**
* Identifier
*/
id?: string;
/**
* Comments or notes about the DNS record. This field has no effect on DNS
* responses.
*/
comment?: string;
/**
* When the record was created.
*/
created_on?: string;
/**
* Whether this record can be modified/deleted (true means it's managed by
* Cloudflare).
*/
locked?: boolean;
/**
* Extra Cloudflare-specific information about the record.
*/
meta?: RecordMetadata;
/**
* When the record was last modified.
*/
modified_on?: string;
/**
* Whether the record can be proxied by Cloudflare or not.
*/
proxiable?: boolean;
/**
* Whether the record is receiving the performance and security benefits of
* Cloudflare.
*/
proxied?: boolean;
/**
* Custom tags for the DNS record. This field has no effect on DNS responses.
*/
tags?: Array<RecordTags>;
/**
* Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
* Value must be between 60 and 86400, with the minimum reduced to 30 for
* Enterprise zones.
*/
ttl?: TTL;
/**
* Identifier
*/
zone_id?: string;
/**
* The domain of the record.
*/
zone_name?: string;
}
export interface DNSKEYRecord {
/**
* Components of a DNSKEY record.
*/
data: DNSKEYRecord.Data;
/**
* DNS record name (or @ for the zone apex) in Punycode.
*/
name: string;
/**
* Record type.
*/
type: 'DNSKEY';
/**
* Identifier
*/
id?: string;
/**
* Comments or notes about the DNS record. This field has no effect on DNS
* responses.
*/
comment?: string;
/**
* Formatted DNSKEY content. See 'data' to set DNSKEY properties.
*/
content?: string;
/**
* When the record was created.
*/
created_on?: string;
/**
* Whether this record can be modified/deleted (true means it's managed by
* Cloudflare).
*/
locked?: boolean;
/**
* Extra Cloudflare-specific information about the record.
*/
meta?: RecordMetadata;
/**
* When the record was last modified.
*/
modified_on?: string;
/**
* Whether the record can be proxied by Cloudflare or not.
*/
proxiable?: boolean;
/**
* Custom tags for the DNS record. This field has no effect on DNS responses.
*/
tags?: Array<RecordTags>;
/**
* Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
* Value must be between 60 and 86400, with the minimum reduced to 30 for
* Enterprise zones.
*/
ttl?: TTL;
/**
* Identifier
*/
zone_id?: string;
/**
* The domain of the record.
*/
zone_name?: string;
}
export declare namespace DNSKEYRecord {
/**
* Components of a DNSKEY record.
*/
interface Data {
/**
* Algorithm.
*/
algorithm?: number;
/**
* Flags.
*/
flags?: number;
/**
* Protocol.
*/
protocol?: number;
/**
* Public Key.
*/
public_key?: string;
}
}
export interface DSRecord {
/**
* Components of a DS record.
*/
data: DSRecord.Data;
/**
* DNS record name (or @ for the zone apex) in Punycode.
*/
name: string;
/**
* Record type.
*/
type: 'DS';
/**
* Identifier
*/
id?: string;
/**
* Comments or notes about the DNS record. This field has no effect on DNS
* responses.
*/
comment?: string;
/**
* Formatted DS content. See 'data' to set DS properties.
*/
content?: string;
/**
* When the record was created.
*/
created_on?: string;
/**
* Whether this record can be modified/deleted (true means it's managed by
* Cloudflare).
*/
locked?: boolean;
/**
* Extra Cloudflare-specific information about the record.
*/
meta?: RecordMetadata;
/**
* When the record was last modified.
*/
modified_on?: string;
/**
* Whether the record can be proxied by Cloudflare or not.
*/
proxiable?: boolean;
/**
* Custom tags for the DNS record. This field has no effect on DNS responses.
*/
tags?: Array<RecordTags>;
/**
* Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
* Value must be between 60 and 86400, with the minimum reduced to 30 for
* Enterprise zones.
*/
ttl?: TTL;
/**
* Identifier
*/
zone_id?: string;
/**
* The domain of the record.
*/
zone_name?: string;
}
export declare namespace DSRecord {
/**
* Components of a DS record.
*/
interface Data {
/**
* Algorithm.
*/
algorithm?: number;
/**
* Digest.
*/
digest?: string;
/**
* Digest Type.
*/
digest_type?: number;
/**
* Key Tag.
*/
key_tag?: number;
}
}
export interface HTTPSRecord {
/**
* Components of a HTTPS record.
*/
data: HTTPSRecord.Data;
/**
* DNS record name (or @ for the zone apex) in Punycode.
*/
name: string;
/**
* Record type.
*/
type: 'HTTPS';
/**
* Identifier
*/
id?: string;
/**
* Comments or notes about the DNS record. This field has no effect on DNS
* responses.
*/
comment?: string;
/**
* Formatted HTTPS content. See 'data' to set HTTPS properties.
*/
content?: string;
/**
* When the record was created.
*/
created_on?: string;
/**
* Whether this record can be modified/deleted (true means it's managed by
* Cloudflare).
*/
locked?: boolean;
/**
* Extra Cloudflare-specific information about the record.
*/
meta?: RecordMetadata;
/**
* When the record was last modified.
*/
modified_on?: string;
/**
* Whether the record can be proxied by Cloudflare or not.
*/
proxiable?: boolean;
/**
* Custom tags for the DNS record. This field has no effect on DNS responses.
*/
tags?: Array<RecordTags>;
/**
* Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
* Value must be between 60 and 86400, with the minimum reduced to 30 for
* Enterprise zones.
*/
ttl?: TTL;
/**
* Identifier
*/
zone_id?: string;
/**
* The domain of the record.
*/
zone_name?: string;
}
export declare namespace HTTPSRecord {
/**
* Components of a HTTPS record.
*/
interface Data {
/**
* priority.
*/
priority?: number;
/**
* target.
*/
target?: string;
/**
* value.
*/
value?: string;
}
}
export interface LOCRecord {
/**
* Components of a LOC record.
*/
data: LOCRecord.Data;
/**
* DNS record name (or @ for the zone apex) in Punycode.
*/
name: string;
/**
* Record type.
*/
type: 'LOC';
/**
* Identifier
*/
id?: string;
/**
* Comments or notes about the DNS record. This field has no effect on DNS
* responses.
*/
comment?: string;
/**
* Formatted LOC content. See 'data' to set LOC properties.
*/
content?: string;
/**
* When the record was created.
*/
created_on?: string;
/**
* Whether this record can be modified/deleted (true means it's managed by
* Cloudflare).
*/
locked?: boolean;
/**
* Extra Cloudflare-specific information about the record.
*/
meta?: RecordMetadata;
/**
* When the record was last modified.
*/
modified_on?: string;
/**
* Whether the record can be proxied by Cloudflare or not.
*/
proxiable?: boolean;
/**
* Custom tags for the DNS record. This field has no effect on DNS responses.
*/
tags?: Array<RecordTags>;
/**
* Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
* Value must be between 60 and 86400, with the minimum reduced to 30 for
* Enterprise zones.
*/
ttl?: TTL;
/**
* Identifier
*/
zone_id?: string;
/**
* The domain of the record.
*/
zone_name?: string;
}
export declare namespace LOCRecord {
/**
* Components of a LOC record.
*/
interface Data {
/**
* Altitude of location in meters.
*/
altitude?: number;
/**
* Degrees of latitude.
*/
lat_degrees?: number;
/**
* Latitude direction.
*/
lat_direction?: 'N' | 'S';
/**
* Minutes of latitude.
*/
lat_minutes?: number;
/**
* Seconds of latitude.
*/
lat_seconds?: number;
/**
* Degrees of longitude.
*/
long_degrees?: number;
/**
* Longitude direction.
*/
long_direction?: 'E' | 'W';
/**
* Minutes of longitude.
*/
long_minutes?: number;
/**
* Seconds of longitude.
*/
long_seconds?: number;
/**
* Horizontal precision of location.
*/
precision_horz?: number;
/**
* Vertical precision of location.
*/
precision_vert?: number;
/**
* Size of location in meters.
*/
size?: number;
}
}
export interface MXRecord {
/**
* A valid mail server hostname.
*/
content: string;
/**
* DNS record name (or @ for the zone apex) in Punycode.
*/
name: string;
/**
* Required for MX, SRV and URI records; unused by other record types. Records with
* lower priorities are preferred.
*/
priority: number;
/**
* Record type.
*/
type: 'MX';
/**
* Identifier
*/
id?: string;
/**
* Comments or notes about the DNS record. This field has no effect on DNS
* responses.
*/
comment?: string;
/**
* When the record was created.
*/
created_on?: string;
/**
* Whether this record can be modified/deleted (true means it's managed by
* Cloudflare).
*/
locked?: boolean;
/**
* Extra Cloudflare-specific information about the record.
*/
meta?: RecordMetadata;
/**
* When the record was last modified.
*/
modified_on?: string;
/**
* Whether the record can be proxied by Cloudflare or not.
*/
proxiable?: boolean;
/**
* Custom tags for the DNS record. This field has no effect on DNS responses.
*/
tags?: Array<RecordTags>;
/**
* Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
* Value must be between 60 and 86400, with the minimum reduced to 30 for
* Enterprise zones.
*/
ttl?: TTL;
/**
* Identifier
*/
zone_id?: string;
/**
* The domain of the record.
*/
zone_name?: string;
}
export interface NAPTRRecord {
/**
* Components of a NAPTR record.
*/
data: NAPTRRecord.Data;
/**
* DNS record name (or @ for the zone apex) in Punycode.
*/
name: string;
/**
* Record type.
*/
type: 'NAPTR';
/**
* Identifier
*/
id?: string;
/**
* Comments or notes about the DNS record. This field has no effect on DNS
* responses.
*/
comment?: string;
/**
* Formatted NAPTR content. See 'data' to set NAPTR properties.
*/
content?: string;
/**
* When the record was created.
*/
created_on?: string;
/**
* Whether this record can be modified/deleted (true means it's managed by
* Cloudflare).
*/
locked?: boolean;
/**
* Extra Cloudflare-specific information about the record.
*/
meta?: RecordMetadata;
/**
* When the record was last modified.
*/
modified_on?: string;
/**
* Whether the record can be proxied by Cloudflare or not.
*/
proxiable?: boolean;
/**
* Custom tags for the DNS record. This field has no effect on DNS responses.
*/
tags?: Array<RecordTags>;
/**
* Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
* Value must be between 60 and 86400, with the minimum reduced to 30 for
* Enterprise zones.
*/
ttl?: TTL;
/**
* Identifier
*/
zone_id?: string;
/**
* The domain of the record.
*/
zone_name?: string;
}
export declare namespace NAPTRRecord {
/**
* Components of a NAPTR record.
*/
interface Data {
/**
* Flags.
*/
flags?: string;
/**
* Order.
*/
order?: number;
/**
* Preference.
*/
preference?: number;
/**
* Regex.
*/
regex?: string;
/**
* Replacement.
*/
replacement?: string;
/**
* Service.
*/
service?: string;
}
}
export interface NSRecord {
/**
* A valid name server host name.
*/
content: string;
/**
* DNS record name (or @ for the zone apex) in Punycode.
*/
name: string;
/**
* Record type.
*/
type: 'NS';
/**
* Identifier
*/
id?: string;
/**
* Comments or notes about the DNS record. This field has no effect on DNS
* responses.
*/
comment?: string;
/**
* When the record was created.
*/
created_on?: string;
/**
* Whether this record can be modified/deleted (true means it's managed by
* Cloudflare).
*/
locked?: boolean;
/**
* Extra Cloudflare-specific information about the record.
*/
meta?: RecordMetadata;
/**
* When the record was last modified.
*/
modified_on?: string;
/**
* Whether the record can be proxied by Cloudflare or not.
*/
proxiable?: boolean;
/**
* Custom tags for the DNS record. This field has no effect on DNS responses.
*/
tags?: Array<RecordTags>;
/**
* Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
* Value must be between 60 and 86400, with the minimum reduced to 30 for
* Enterprise zones.
*/
ttl?: TTL;
/**
* Identifier
*/
zone_id?: string;
/**
* The domain of the record.
*/
zone_name?: string;
}
export interface PTRRecord {
/**
* Domain name pointing to the address.
*/
content: string;
/**
* DNS record name (or @ for the zone apex) in Punycode.
*/
name: string;
/**
* Record type.
*/
type: 'PTR';
/**
* Identifier
*/
id?: string;
/**
* Comments or notes about the DNS record. This field has no effect on DNS
* responses.
*/
comment?: string;
/**
* When the record was created.
*/
created_on?: string;
/**
* Whether this record can be modified/deleted (true means it's managed by
* Cloudflare).
*/
locked?: boolean;
/**
* Extra Cloudflare-specific information about the record.
*/
meta?: RecordMetadata;
/**
* When the record was last modified.
*/
modified_on?: string;
/**
* Whether the record can be proxied by Cloudflare or not.
*/
proxiable?: boolean;
/**
* Custom tags for the DNS record. This field has no effect on DNS responses.
*/
tags?: Array<RecordTags>;
/**
* Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
* Value must be between 60 and 86400, with the minimum reduced to 30 for
* Enterprise zones.
*/
ttl?: TTL;
/**
* Identifier
*/
zone_id?: string;
/**
* The domain of the record.
*/
zone_name?: string;
}
export type Record = ARecord | AAAARecord | CAARecord | CERTRecord | CNAMERecord | DNSKEYRecord | DSRecord | HTTPSRecord | LOCRecord | MXRecord | NAPTRRecord | NSRecord | PTRRecord | SMIMEARecord | SRVRecord | SSHFPRecord | SVCBRecord | TLSARecord | TXTRecord | URIRecord;
/**
* Extra Cloudflare-specific information about the record.
*/
export interface RecordMetadata {
/**
* Will exist if Cloudflare automatically added this DNS record during initial
* setup.
*/
auto_added?: boolean;
/**
* Where the record originated from.
*/
source?: string;
}
export interface RecordProcessTiming {
/**
* When the file parsing ended.
*/
end_time?: string;
/**
* Processing time of the file in seconds.
*/
process_time?: number;
/**
* When the file parsing started.
*/
start_time?: string;
}
/**
* Individual tag of the form name:value (the name must consist of only letters,
* numbers, underscores and hyphens)
*/
export type RecordTags = string;
export interface SMIMEARecord {
/**
* Components of a SMIMEA record.
*/
data: SMIMEARecord.Data;
/**
* DNS record name (or @ for the zone apex) in Punycode.
*/
name: string;
/**
* Record type.
*/
type: 'SMIMEA';
/**
* Identifier
*/
id?: string;
/**
* Comments or notes about the DNS record. This field has no effect on DNS
* responses.
*/
comment?: string;
/**
* Formatted SMIMEA content. See 'data' to set SMIMEA properties.
*/
content?: string;
/**
* When the record was created.
*/
created_on?: string;
/**
* Whether this record can be modified/deleted (true means it's managed by
* Cloudflare).
*/
locked?: boolean;
/**
* Extra Cloudflare-specific information about the record.
*/
meta?: RecordMetadata;
/**
* When the record was last modified.
*/
modified_on?: string;
/**
* Whether the record can be proxied by Cloudflare or not.
*/
proxiable?: boolean;
/**
* Custom tags for the DNS record. This field has no effect on DNS responses.
*/
tags?: Array<RecordTags>;
/**
* Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
* Value must be between 60 and 86400, with the minimum reduced to 30 for
* Enterprise zones.
*/
ttl?: TTL;
/**
* Identifier
*/
zone_id?: string;
/**
* The domain of the record.
*/
zone_name?: string;
}
export declare namespace SMIMEARecord {
/**
* Components of a SMIMEA record.
*/
interface Data {
/**
* Certificate.
*/
certificate?: string;
/**
* Matching Type.
*/
matching_type?: number;
/**
* Selector.
*/
selector?: number;
/**
* Usage.
*/
usage?: number;
}
}
export interface SRVRecord {
/**
* Components of a SRV record.
*/
data: SRVRecord.Data;
/**
* DNS record name (or @ for the zone apex) in Punycode. For SRV records, the first
* label is normally a service and the second a protocol name, each starting with
* an underscore.
*/
name: string;
/**
* Record type.
*/
type: 'SRV';
/**
* Identifier
*/
id?: string;
/**
* Comments or notes about the DNS record. This field has no effect on DNS
* responses.
*/
comment?: string;
/**
* Priority, weight, port, and SRV target. See 'data' for setting the individual
* component values.
*/
content?: string;
/**
* When the record was created.
*/
created_on?: string;
/**
* Whether this record can be modified/deleted (true means it's managed by
* Cloudflare).
*/
locked?: boolean;
/**
* Extra Cloudflare-specific information about the record.
*/
meta?: RecordMetadata;
/**
* When the record was last modified.
*/
modified_on?: string;
/**
* Whether the record can be proxied by Cloudflare or not.
*/
proxiable?: boolean;
/**
* Custom tags for the DNS record. This field has no effect on DNS responses.
*/
tags?: Array<RecordTags>;
/**
* Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
* Value must be between 60 and 86400, with the minimum reduced to 30 for
* Enterprise zones.
*/
ttl?: TTL;
/**
* Identifier
*/
zone_id?: string;
/**
* The domain of the record.
*/
zone_name?: string;
}
export declare namespace SRVRecord {
/**
* Components of a SRV record.
*/
interface Data {
/**
* @deprecated: A valid hostname. Deprecated in favor of the regular 'name' outside
* the data map. This data map field represents the remainder of the full 'name'
* after the service and protocol.
*/
name?: string;
/**
* The port of the service.
*/
port?: number;
/**
* Required for MX, SRV and URI records; unused by other record types. Records with
* lower priorities are preferred.
*/
priority?: number;
/**
* @deprecated: A valid protocol, prefixed with an underscore. Deprecated in favor
* of the regular 'name' outside the data map. This data map field normally
* represents the second label of that 'name'.
*/
proto?: string;
/**
* @deprecated: A service type, prefixed with an underscore. Deprecated in favor of
* the regular 'name' outside the data map. This data map field normally represents
* the first label of that 'name'.
*/
service?: string;
/**
* A valid hostname.
*/
target?: string;
/**
* The record weight.
*/
weight?: number;
}
}
export interface SSHFPRecord {
/**
* Components of a SSHFP record.
*/
data: SSHFPRecord.Data;
/**
* DNS record name (or @ for the zone apex) in Punycode.
*/
name: string;
/**
* Record type.
*/
type: 'SSHFP';
/**
* Identifier
*/
id?: string;
/**
* Comments or notes about the DNS record. This field has no effect on DNS
* responses.
*/
comment?: string;
/**
* Formatted SSHFP content. See 'data' to set SSHFP properties.
*/
content?: string;
/**
* When the record was created.
*/
created_on?: string;
/**
* Whether this record can be modified/deleted (true means it's managed by
* Cloudflare).
*/
locked?: boolean;
/**
* Extra Cloudflare-specific information about the record.
*/
meta?: RecordMetadata;
/**
* When the record was last modified.
*/
modified_on?: string;
/**
* Whether the record can be proxied by Cloudflare or not.
*/
proxiable?: boolean;
/**
* Custom tags for the DNS record. This field has no effect on DNS responses.
*/
tags?: Array<RecordTags>;
/**
* Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
* Value must be between 60 and 86400, with the minimum reduced to 30 for
* Enterprise zones.
*/
ttl?: TTL;
/**
* Identifier
*/
zone_id?: string;
/**
* The domain of the record.
*/
zone_name?: string;
}
export declare namespace SSHFPRecord {
/**
* Components of a SSHFP record.
*/
interface Data {
/**
* algorithm.
*/
algorithm?: number;
/**
* fingerprint.
*/
fingerprint?: string;
/**
* type.
*/
type?: number;
}
}
export interface SVCBRecord {
/**
* Components of a SVCB record.
*/
data: SVCBRecord.Data;
/**
* DNS record name (or @ for the zone apex) in Punycode.
*/
name: string;
/**
* Record type.
*/
type: 'SVCB';
/**
* Identifier
*/
id?: string;
/**
* Comments or notes about the DNS record. This field has no effect on DNS
* responses.
*/
comment?: string;
/**
* Formatted SVCB content. See 'data' to set SVCB properties.
*/
content?: string;
/**
* When the record was created.
*/
created_on?: string;
/**
* Whether this record can be modified/deleted (true means it's managed by
* Cloudflare).
*/
locked?: boolean;
/**
* Extra Cloudflare-specific information about the record.
*/
meta?: RecordMetadata;
/**
* When the record was last modified.
*/
modified_on?: string;
/**
* Whether the record can be proxied by Cloudflare or not.
*/
proxiable?: boolean;
/**
* Custom tags for the DNS record. This field has no effect on DNS responses.
*/
tags?: Array<RecordTags>;
/**
* Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
* Value must be between 60 and 86400, with the minimum reduced to 30 for
* Enterprise zones.
*/
ttl?: TTL;
/**
* Identifier
*/
zone_id?: string;
/**
* The domain of the record.
*/
zone_name?: string;
}
export declare namespace SVCBRecord {
/**
* Components of a SVCB record.
*/
interface Data {
/**
* priority.
*/
priority?: number;
/**
* target.
*/
target?: string;
/**
* value.
*/
value?: string;
}
}
export interface TLSARecord {
/**
* Components of a TLSA record.
*/
data: TLSARecord.Data;
/**
* DNS record name (or @ for the zone apex) in Punycode.
*/
name: string;
/**
* Record type.
*/
type: 'TLSA';
/**
* Identifier
*/
id?: string;
/**
* Comments or notes about the DNS record. This field has no effect on DNS
* responses.
*/
comment?: string;
/**
* Formatted TLSA content. See 'data' to set TLSA properties.
*/
content?: string;
/**
* When the record was created.
*/
created_on?: string;
/**
* Whether this record can be modified/deleted (true means it's managed by
* Cloudflare).
*/
locked?: boolean;
/**
* Extra Cloudflare-specific information about the record.
*/
meta?: RecordMetadata;
/**
* When the record was last modified.
*/
modified_on?: string;
/**
* Whether the record can be proxied by Cloudflare or not.
*/
proxiable?: boolean;
/**
* Custom tags for the DNS record. This field has no effect on DNS responses.
*/
tags?: Array<RecordTags>;
/**
* Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
* Value must be between 60 and 86400, with the minimum reduced to 30 for
* Enterprise zones.
*/
ttl?: TTL;
/**
* Identifier
*/
zone_id?: string;
/**
* The domain of the record.
*/
zone_name?: string;
}
export declare namespace TLSARecord {
/**
* Components of a TLSA record.
*/
interface Data {
/**
* certificate.
*/
certificate?: string;
/**
* Matching Type.
*/
matching_type?: number;
/**
* Selector.
*/
selector?: number;
/**
* Usage.
*/
usage?: number;
}
}
/**
* Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
* Value must be between 60 and 86400, with the minimum reduced to 30 for
* Enterprise zones.
*/
export type TTL = number | 1;
export interface TXTRecord {
/**
* Text content for the record.
*/
content: string;
/**
* DNS record name (or @ for the zone apex) in Punycode.
*/
name: string;
/**
* Record type.
*/
type: 'TXT';
/**
* Identifier
*/
id?: string;
/**
* Comments or notes about the DNS record. This field has no effect on DNS
* responses.
*/
comment?: string;
/**
* When the record was created.
*/
created_on?: string;
/**
* Whether this record can be modified/deleted (true means it's managed by
* Cloudflare).
*/
locked?: boolean;
/**
* Extra Cloudflare-specific information about the record.
*/
meta?: RecordMetadata;
/**
* When the record was last modified.
*/
modified_on?: string;
/**
* Whether the record can be proxied by Cloudflare or not.
*/
proxiable?: boolean;
/**
* Custom tags for the DNS record. This field has no effect on DNS responses.
*/
tags?: Array<RecordTags>;
/**
* Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
* Value must be between 60 and 86400, with the minimum reduced to 30 for
* Enterprise zones.
*/
ttl?: TTL;
/**
* Identifier
*/
zone_id?: string;
/**
* The domain of the record.
*/
zone_name?: string;
}
export interface URIRecord {
/**
* Components of a URI record.
*/
data: URIRecord.Data;
/**
* DNS record name (or @ for the zone apex) in Punycode.
*/
name: string;
/**
* Required for MX, SRV and URI records; unused by other record types. Records with
* lower priorities are preferred.
*/
priority: number;
/**
* Record type.
*/
type: 'URI';
/**
* Identifier
*/
id?: string;
/**
* Comments or notes about the DNS record. This field has no effect on DNS
* responses.
*/
comment?: string;
/**
* Formatted URI content. See 'data' to set URI properties.
*/
content?: string;
/**
* When the record was created.
*/
created_on?: string;
/**
* Whether this record can be modified/deleted (true means it's managed by
* Cloudflare).
*/
locked?: boolean;
/**
* Extra Cloudflare-specific information about the record.
*/
meta?: RecordMetadata;
/**
* When the record was last modified.
*/
modified_on?: string;
/**
* Whether the record can be proxied by Cloudflare or not.
*/
proxiable?: boolean;
/**
* Custom tags for the DNS record. This field has no effect on DNS responses.
*/
tags?: Array<RecordTags>;
/**
* Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
* Value must be between 60 and 86400, with the minimum reduced to 30 for
* Enterprise zones.
*/
ttl?: TTL;
/**
* Identifier
*/
zone_id?: string;
/**
* The domain of the record.
*/
zone_name?: string;
}
export declare namespace URIRecord {
/**
* Components of a URI record.
*/
interface Data {
/**
* The record content.
*/
content?: string;
/**
* The record weight.
*/
weight?: number;
}
}
export interface RecordDeleteResponse {
/**
* Identifier
*/
id?: string;
}
/**
* Exported BIND zone file.
*/
export type RecordExportResponse = string;
export interface RecordImportResponse {
/**
* Number of DNS records added.
*/
recs_added?: number;
/**
* Total number of DNS records parsed.
*/
total_records_parsed?: number;
}
export interface RecordScanResponse {
/**
* Number of DNS records added.
*/
recs_added?: number;
/**
* Total number of DNS records parsed.
*/
total_records_parsed?: number;
}
export type RecordCreateParams = RecordCreateParams.ARecord | RecordCreateParams.AAAARecord | RecordCreateParams.CAARecord | RecordCreateParams.CERTRecord | RecordCreateParams.CNAMERecord | RecordCreateParams.DNSKEYRecord | RecordCreateParams.DSRecord | RecordCreateParams.HTTPSRecord | RecordCreateParams.LOCRecord | RecordCreateParams.MXRecord | RecordCreateParams.NAPTRRecord | RecordCreateParams.NSRecord | RecordCreateParams.PTRRecord | RecordCreateParams.SMIMEARecord | RecordCreateParams.SRVRecord | RecordCreateParams.SSHFPRecord | RecordCreateParams.SVCBRecord | RecordCreateParams.TLSARecord | RecordCreateParams.TXTRecord | RecordCreateParams.URIRecord;
export declare namespace RecordCreateParams {
interface ARecord {
/**
* Path param: Identifier
*/
zone_id: string;
/**
* Body param: A valid IPv4 address.
*/
content: string;
/**
* Body param: DNS record name (or @ for the zone apex) in Punycode.
*/
name: string;
/**
* Body param: Record type.
*/
type: 'A';
/**
* Body param: Comments or notes about the DNS record. This field has no effect on
* DNS responses.
*/
comment?: string;
/**
* Body param: Whether the record is receiving the performance and security
* benefits of Cloudflare.
*/
proxied?: boolean;
/**
* Body param: Custom tags for the DNS record. This field has no effect on DNS
* responses.
*/
tags?: Array<RecordTags>;
/**
* Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means
* 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30
* for Enterprise zones.
*/
ttl?: TTL;
}
interface AAAARecord {
/**
* Path param: Identifier
*/
zone_id: string;
/**
* Body param: A valid IPv6 address.
*/
content: string;
/**
* Body param: DNS record name (or @ for the zone apex) in Punycode.
*/
name: string;
/**
* Body param: Record type.
*/
type: 'AAAA';
/**
* Body param: Comments or notes about the DNS record. This field has no effect on
* DNS responses.
*/
comment?: string;
/**
* Body param: Whether the record is receiving the performance and security
* benefits of Cloudflare.
*/
proxied?: boolean;
/**
* Body param: Custom tags for the DNS record. This field has no effect on DNS
* responses.
*/
tags?: Array<RecordTags>;
/**
* Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means
* 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30
* for Enterprise zones.
*/
ttl?: TTL;
}
interface CAARecord {
/**
* Path param: Identifier
*/
zone_id: string;
/**
* Body param: Components of a CAA record.
*/
data: RecordCreateParams.CAARecord.Data;
/**
* Body param: DNS record name (or @ for the zone apex) in Punycode.
*/
name: string;
/**
* Body param: Record type.
*/
type: 'CAA';
/**
* Body param: Comments or notes about the DNS record. This field has no effect on
* DNS responses.
*/
comment?: string;
/**
* Body param: Custom tags for the DNS record. This field has no effect on DNS
* responses.
*/
tags?: Array<RecordTags>;
/**
* Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means
* 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30
* for Enterprise zones.
*/
ttl?: TTL;
}
namespace CAARecord {
/**
* Components of a CAA record.
*/
interface Data {
/**
* Flags for the CAA record.
*/
flags?: number;
/**
* Name of the property controlled by this record (e.g.: issue, issuewild, iodef).
*/
tag?: string;
/**
* Value of the record. This field's semantics depend on the chosen tag.
*/
value?: string;
}
}
interface CERTRecord {
/**
* Path param: Identifier
*/
zone_id: string;
/**
* Body param: Components of a CERT record.
*/
data: RecordCreateParams.CERTRecord.Data;
/**
* Body param: DNS record name (or @ for the zone apex) in Punycode.
*/
name: string;
/**
* Body param: Record type.
*/
type: 'CERT';
/**
* Body param: Comments or notes about the DNS record. This field has no effect on
* DNS responses.
*/
comment?: string;
/**
* Body param: Custom tags for the DNS record. This field has no effect on DNS
* responses.
*/
tags?: Array<RecordTags>;
/**
* Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means
* 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30
* for Enterprise zones.
*/
ttl?: TTL;
}
namespace CERTRecord {
/**
* Components of a CERT record.
*/
interface Data {
/**
* Algorithm.
*/
algorithm?: number;
/**
* Certificate.
*/
certificate?: string;
/**
* Key Tag.
*/
key_tag?: number;
/**
* Type.
*/
type?: number;
}
}
interface CNAMERecord {
/**
* Path param: Identifier
*/
zone_id: string;
/**
* Body param: A valid hostname. Must not match the record's name.
*/
content: unknown;
/**
* Body param: DNS record name (or @ for the zone apex) in Punycode.
*/
name: string;
/**
* Body param: Record type.
*/
type: 'CNAME';
/**
* Body param: Comments or notes about the DNS record. This field has no effect on
* DNS responses.
*/
comment?: string;
/**
* Body p