diff --git a/src/dns/caas.js b/src/dns/caas.js index 607d46577..999d63613 100644 --- a/src/dns/caas.js +++ b/src/dns/caas.js @@ -6,7 +6,8 @@ exports = module.exports = { addSubdomain: addSubdomain, delSubdomain: delSubdomain, updateSubdomain: updateSubdomain, - getChangeStatus: getChangeStatus + getChangeStatus: getChangeStatus, + getSubdomain: getSubdomain }; var assert = require('assert'), diff --git a/src/subdomains.js b/src/subdomains.js index eef740b39..9cad347a5 100644 --- a/src/subdomains.js +++ b/src/subdomains.js @@ -15,7 +15,8 @@ module.exports = exports = { add: add, remove: remove, status: status, - update: update + update: update, + get: get }; // choose which subdomain backend we use for test purpose we use route53 @@ -38,6 +39,18 @@ function add(record, callback) { }); } +function get(subdomain, type, callback) { + assert.strictEqual(typeof subdomain, 'string'); + assert.strictEqual(typeof type, 'string'); + assert.strictEqual(typeof callback, 'function'); + + api().getSubdomain(config.zoneName(), subdomain, type, function (error, values) { + if (error) return callback(error); + + callback(null, values); + }); +} + function update(record, callback) { assert.strictEqual(typeof record, 'object'); assert.strictEqual(typeof callback, 'function');