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
| Name | Description |
|---|---|
| zone | Zone
|
| type | string
|
| metadata | RecordMetadata
|
Properties
data
data
?:
{};
metadata
metadata
:
RecordMetadata
;
rrdatas
rrdatas
?:
Array
< {}>;
type
type
:
string
;
zone_
zone_
:
Zone
;
Methods
delete()
delete
()
:
Promise<DeleteRecordResponse>
;
| Type | Description |
|---|---|
| Promise < DeleteRecordResponse > |
delete(callback)
delete
(
callback
:
CreateChangeCallback
)
:
void
;
| Name | Description |
|---|---|
| callback | CreateChangeCallback
|
| Type | Description |
|---|---|
| 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.
| Name | Description |
| zone | Zone
The zone. |
| type | string
The record type, e.g. |
| bindData | RecordMetadata
Metadata parsed from dns-zonefile. Properties vary based on the type of record. |
| Type | Description |
|---|---|
| Record | {Record} |
toJSON()
toJSON
()
:
RecordObject
;
Serialize the record instance to the format the API expects.
| Type | Description |
|---|---|
| RecordObject | {object} |
toString()
toString
()
:
string
;
Convert the record to a string, formatted for a zone file.
| Type | Description |
|---|---|
| string | {string} |

