Create a Resource Record object.
Package
@google-cloud/dnsExample
const {DNS} = require('@google-cloud/dns'); const dns = new DNS(); const zone = dns.zone('my-awesome-zone');
const record = zone.record('a', { name: 'example.com.', ttl: 86400, data: '1.2.3.4' });
Constructors
(constructor)(zone, type, metadata)
constructor
(
zone
:
Zone
,
type
:
string
,
metadata
:
RecordMetadata
);
Constructs a new instance of the Record
class
Properties
data
data
?:
{};
metadata
metadata
:
RecordMetadata
;
rrdatas
rrdatas
?:
Array
< {}>;
type
type
:
string
;
zone_
zone_
:
Zone
;
Methods
delete()
delete
()
:
Promise<DeleteRecordResponse>
;
Promise
< DeleteRecordResponse
>
delete(callback)
delete
(
callback
:
CreateChangeCallback
)
:
void
;
callback
CreateChangeCallback
void
fromZoneRecord_(zone, type, bindData)
static
fromZoneRecord_
(
zone
:
Zone
,
type
:
string
,
bindData
:
RecordMetadata
)
:
Record
;
Create a Record instance from a resource record set in a zone file.
zone
Zone
The zone.
type
string
The record type, e.g. A
, AAAA
, MX
.
bindData
Record
{Record}
toJSON()
toJSON
()
:
RecordObject
;
Serialize the record instance to the format the API expects.
RecordObject
{object}
toString()
toString
()
:
string
;
Convert the record to a string, formatted for a zone file.
string
{string}

