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
| Parameters | |
|---|---|
| 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>;| Returns | |
|---|---|
| Type | Description |
Promise<DeleteRecordResponse> |
|
delete(callback)
delete(callback: CreateChangeCallback): void;| Parameter | |
|---|---|
| Name | Description |
callback |
CreateChangeCallback
|
| Returns | |
|---|---|
| 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.
| Parameters | |
|---|---|
| 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. |
| Returns | |
|---|---|
| Type | Description |
Record_2 |
{Record} |
toJSON()
toJSON(): RecordObject;Serialize the record instance to the format the API expects.
| Returns | |
|---|---|
| Type | Description |
RecordObject |
{object} |
toString()
toString(): string;Convert the record to a string, formatted for a zone file.
| Returns | |
|---|---|
| Type | Description |
string |
{string} |