flaretool.ddns package

Submodules

flaretool.ddns.DdnsService module

flaretool.ddns.errors module

exception flaretool.ddns.errors.DdnsAuthenticationError(result, status, currentIp, updateIp, domain)

Bases: DdnsError

exception flaretool.ddns.errors.DdnsError(result, status, currentIp, updateIp, domain)

Bases: FlareToolError

flaretool.ddns.models module

class flaretool.ddns.models.DdnsInfo(*, result: int, status: str, currentIp: str | None = None, updateIp: str, domain: str)

Bases: BaseDataModel

Represents the Dynamic DNS (DDNS) information.

result

The result code of the DDNS update.

Type:

int

status

The status of the DDNS update.

Type:

str

currentIp

The current IP address associated with the domain.

Type:

str

updateIp

The IP address that was updated.

Type:

str

domain

The domain associated with the DDNS update.

Type:

str

currentIp: str | None
domain: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

result: int
status: str
updateIp: str

Module contents

class flaretool.ddns.DdnsService

Bases: object

Service class for Dynamic DNS (DDNS) functionality.

Warning

This class may undergo updates and its usage may change in the near future.

update_ddns(host: str, ip: str = None) DdnsInfo

Update the Dynamic DNS (DDNS) for the specified host.

Parameters:
  • host (str) – The host to update the DDNS for.

  • ip (str, optional) – The IP address to set for the host. If not provided, the current IP will be used.

Returns:

The updated DDNS information.

Return type:

DdnsInfo

Raises:

Example

>>> service = DdnsService()
>>> info = service.update_ddns("example", "192.168.0.100")
>>> print(info)
DdnsInfo(result=200, status='success', currentIp='192.168.0.99', updateIp='192.168.0.100', domain='example.○○○.○○')