Skip to main content

Unofficial Client for Hosting.de API

Project description

Unofficial Hosting.de API Client

Python3 library for accessing the hosting.de dns api.

PyPI version

Disclaimer

This is a very basic unofficial client for the hosting.de API. I have only implemented very few functions that I need for another hobby project. I am not in any way connected to hosting.de other then being a paying customer.

I'd be happy to give up this library for an official and supported library.

I have built this library to use it for ddns scripts and let's encrypt wildcard certificate requests.

Validation and sanitizing of any inputs is expected to be done at higher level.

USE THIS LIBRARY AT YOUR OWN RISK, DO NOT USE IN PRODUCTION. DO NOT EXPECT SUPPORT.

DNS

I have only implemented functions and data structures for the DNS API.

API functions

The only API functions that I have implemented so far are:

There are also helpers to aid with correct data structes for these functions

Custom functions

In addition to the API functions provided by hosting.de, I added some functions for common simple use cases. These functions are useful for operations that only affect a single hostname and record type.

Single API call

  • addRecord(self, zoneConfigName, recordName, recordType, value, ttl=600)
  • updateKnownRecord(self, zoneConfigName, recordName, recordType, newValue, oldValue, ttl=600)
  • getRecordsToDelete(self, recordName, recordType)
  • getRecordsToDeleteByFilter(self, filter)

Multiple API calls (Lookup values first)

  • deleteRecords(self, zoneConfigName, recordName, recordType)
  • updateRecord(self, recordName, recordType, newValue, ttl=None)

Known Issues

  • No warning handling from responses

Dependencies

  • requests
  • urllib3

Install

Easy

pip install no-hostingde-api

Developer

git clone https://github.com/DimeOne/no-hostingde-api.git
cd hostingde-api
python setup.py develop

Examples

Adding IPv4 IP:

from hostingde.api.dns import DnsApiClient
client = DnsApiClient("MySecretLongApiKey")
client.AddRecord("dev.example.org", "demo.dev.example.org", "A", "127.0.0.1", ttl=8400)

Adding IPv6 IP:

from hostingde.api.dns import DnsApiClient
client = DnsApiClient("MySecretLongApiKey")
client.AddRecord("dev.example.org", "demo.dev.example.org", "AAAA", "AFFE::1", ttl=8400)

Update IPv4 IP:

from hostingde.api.dns import DnsApiClient
client = DnsApiClient("MySecretLongApiKey")
client.UpdateRecord("demo.dev.example.org", "A", "AFFE::1")

In this case the zoneConfigName and TTL are used from the first previous record, ttl can be specified. Value is only updated if there is more than one record or the current value differs from the new value.

Build

python setup.py sdist
python setup.py bdist_wheel

References

Project details


Release history Release notifications

This version
History Node

0.1.4

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
no_hostingde_api-0.1.4-py2.py3-none-any.whl (6.5 kB) Copy SHA256 hash SHA256 Wheel py2.py3 May 17, 2018
no-hostingde-api-0.1.4.tar.gz (6.1 kB) Copy SHA256 hash SHA256 Source None May 17, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page