Class Record_2 (4.0.0)

Create a Resource Record object.

Package

@google-cloud/dns

Example

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

Parameters
NameDescription
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>;
Returns
TypeDescription
Promise<DeleteRecordResponse>

delete(callback)

delete(callback: CreateChangeCallback): void;
Parameter
NameDescription
callback CreateChangeCallback
Returns
TypeDescription
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.

Parameters
NameDescription
zone Zone

The zone.

type string

The record type, e.g. A, AAAA, MX.

bindData RecordMetadata

Metadata parsed from dns-zonefile. Properties vary based on the type of record.

Returns
TypeDescription
Record_2

{Record}

toJSON()

toJSON(): RecordObject;

Serialize the record instance to the format the API expects.

Returns
TypeDescription
RecordObject

{object}

toString()

toString(): string;

Convert the record to a string, formatted for a zone file.

Returns
TypeDescription
string

{string}