Class: DnsProvider

DnsProvider(optionsopt)

Abstract DNS provider implementation.

This class should be inherited from to implement DNS specific implementations. Any method in this class that throws must be overridded. Methods that do not throw may be optionally overridden.

Constructor

new DnsProvider(optionsopt)

Constructor.

Parameters:
Name Type Attributes Description
options Ojbect <optional>

Options for the instance.

Properties
Name Type Attributes Description
clOptions Object <optional>

Command line options if called from a script.

logger Object <optional>

Logger to use. Or, pass loggerOptions to get your own logger.

loggerOptions Object <optional>

Options for the logger. See module:logger.getLogger for details.

Methods

init(providerOptions) → {Promise}

Initialize class

Override for implementation specific initialization needs (read info from cloud provider, read database, etc.). Called at the start of processing.

Parameters:
Name Type Description
providerOptions Object

Provider specific options.

Returns:

A promise which will be resolved when init is complete.

Type
Promise

(abstract) update(instances) → {Promise}

Updates DNS records with the given instances

Parameters:
Name Type Description
instances Object

Array of instances, each having the form

{
    name: name for instance,
    ip: ip address,
    port: port
}
Returns:

A promise which will be resolved with the instance ID of the elected primary.

Type
Promise