# `certbot_dns_digitalocean.dns_digitalocean`

DNS Authenticator for DigitalOcean.

class `certbot_dns_digitalocean.dns_digitalocean.``Authenticator`(*args, **kwargs)

  Bases: `certbot.plugins.dns_common.DNSAuthenticator`

  DNS Authenticator for DigitalOcean

  This Authenticator uses the DigitalOcean API to fulfill a dns-01 challenge.

  classmethod `add_parser_arguments`(add)

    Add plugin arguments to the CLI argument parser.

    NOTE: If some of your flags interact with others, you can use cli.report_config_interaction to register this to ensure values are correctly saved/overridable during renewal.

    Parameters: | add (callable) – Function that proxies calls to `argparse.ArgumentParser.add_argument` prepending options with unique plugin name prefix.

  `_setup_credentials`()

    Establish credentials, prompting if necessary.

  `_perform`(domain, validation_name, validation)

    Performs a dns-01 challenge by creating a DNS TXT record.

    Parameters:

    - domain (str) – The domain being validated.
    - validation_domain_name (str) – The validation record domain name.
    - validation (str) – The validation record content.

    Raises: | errors.PluginError – If the challenge cannot be performed

  `_cleanup`(domain, validation_name, validation)

    Deletes the DNS TXT record which would have been created by `_perform_achall`.

    Fails gracefully if no such record exists.

    Parameters:

    - domain (str) – The domain being validated.
    - validation_domain_name (str) – The validation record domain name.
    - validation (str) – The validation record content.

class `certbot_dns_digitalocean.dns_digitalocean.``_DigitalOceanClient`(token)

  Bases: `object`

  Encapsulates all communication with the DigitalOcean API.

  `add_txt_record`(domain_name, record_name, record_content)

    Add a TXT record using the supplied information.

    Parameters:

    - domain_name (str) – The domain to use to associate the record with.
    - record_name (str) – The record name (typically beginning with ‘_acme-challenge.’).
    - record_content (str) – The record content (typically the challenge validation).

    Raises: | certbot.errors.PluginError – if an error occurs communicating with the DigitalOcean API

  `del_txt_record`(domain_name, record_name, record_content)

    Delete a TXT record using the supplied information.

    Note that both the record’s name and content are used to ensure that similar records created concurrently (e.g., due to concurrent invocations of this plugin) are not deleted.

    Failures are logged, but not raised.

    Parameters:

    - domain_name (str) – The domain to use to associate the record with.
    - record_name (str) – The record name (typically beginning with ‘_acme-challenge.’).
    - record_content (str) – The record content (typically the challenge validation).

  `_find_domain`(domain_name)

    Find the domain object for a given domain name.

    Parameters: | domain_name (str) – The domain name for which to find the corresponding Domain.
    Returns: | The Domain, if found.
    Return type: | `Domain`
    Raises: | certbot.errors.PluginError – if no matching Domain is found.