Constructor
new Record(type, metadata)
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
type |
string |
The record type, e.g. |
||||||||||||
metadata |
object |
The metadata of this record. Properties
|
Members
(nullable) data :Array.<object>
metadata :object
Properties:
Name | Type | Description |
---|---|---|
name |
string | |
data |
Array.<string> | |
metadata.ttl |
number |
type :string
Methods
delete(callbackopt) → {Promise.<DeleteRecordResponse>}
Delete this record by creating a change on your zone. This is a convenience method for:
zone.createChange({
delete: record
}, (err, change, apiResponse) => {});
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
DeleteRecordCallback |
<optional> |
Callback function. |
- Source:
- See:
Example
const {DNS} = require('@google-cloud/dns');
const dns = new DNS();
const zone = dns.zone('zone-id');
const record = zone.record('a', {
name: 'example.com.',
ttl: 86400,
data: '1.2.3.4'
});
record.delete((err, change, apiResponse) => {
if (!err) {
// Delete change modification was created.
}
});
//-
// If the callback is omitted, we'll return a Promise.
//-
record.delete().then((data) => {
const change = data[0];
const apiResponse = data[1];
});
toJSON() → {object}
Serialize the record instance to the format the API expects.
toString() → {string}
Convert the record to a string, formatted for a zone file.