Skip to main content

Python client for the Domainrobot JSON API (InterNetX/AutoDNS)

Project description

Python Domainrobot (InternetX/AutoDNS) Library

Documentation Status Coverage Status

Python client for the Domainrobot JSON API (InterNetX/AutoDNS).

Installation

pip install domainrobot

Quick start

from domainrobot import Domainrobot

client = Domainrobot(
    username="user",
    password="pass",
    context=4,
)

# ping
client.hello.ping()

# list domains
result = client.domain.list(
    {"filters": [{"key": "name", "value": "*.com", "operator": "LIKE"}]},
    keys=["status", "expire"],
)
for domain in result.data:
    print(domain["name"])

client.close()

Context manager

with Domainrobot(username="user", password="pass", context=4) as client:
    result = client.domain.info("example.com")
    print(result.data)

Common examples

Domain

# register
client.domain.create({
    "name": "example.com",
    "ownerc": {"id": 1},
    "adminc": {"id": 1},
    "techc": {"id": 1},
})

# transfer
client.domain.transfer({
    "name": "example.com",
    "authinfo": "secret",
})

# create cancelation
client.domain.cancelation_create("example.com", {
    "type": "DELETE",
    "execution": "EXPIRE",
})

Contact

# create
result = client.contact.create({
    "type": "PERSON",
    "fname": "John",
    "lname": "Doe",
    "email": "john@example.com",
    "country": "DE",
    "city": "Munich",
    "pcode": "80333",
    "address": ["Marienplatz 1"],
    "phone": "+49-89-12345",
})
contact_id = result.data[0]["id"]

# update
client.contact.update(contact_id, {"fname": "Jane"})

Certificate

# prepare order (check CSR)
client.certificate.prepare_order({"plain": "-----BEGIN CERTIFICATE REQUEST-----\n..."})

# order
client.certificate.create({
    "product": "BASIC_SSL",
    "csr": "-----BEGIN CERTIFICATE REQUEST-----\n...",
    "adminContact": {"id": 1},
    "technicalContact": {"id": 1},
})

Zone

# create
client.zone.create({
    "origin": "example.com",
    "soa": {"email": "admin@example.com", "refresh": 43200, "retry": 7200, "expire": 1209600, "ttl": 86400},
    "main": {"address": "1.2.3.4"},
})

# stream update (add/remove records)
client.zone.stream("example.com", {
    "adds": [{"name": "www", "type": "A", "value": "1.2.3.4", "ttl": 3600}],
    "rems": [],
})

Error handling

from domainrobot import Domainrobot, DomainrobotApiError, DomainrobotTransportError

try:
    client.domain.info("nonexistent.example")
except DomainrobotApiError as e:
    print(f"API error {e.status_code}: {e}")
    print(e.messages)
except DomainrobotTransportError as e:
    print(f"Connection error: {e}")

Custom headers

Every method accepts an optional headers parameter:

client.domain.info("example.com", headers={"X-Domainrobot-Demo": "true"})

Available services

Service Attribute Key endpoints
Account client.account info, update
BackupMx client.backup_mx create, info, delete, list
Certificate client.certificate create, info, reissue, delete, renew, revoke, list
Contact client.contact create, info, update, delete, list
Domain client.domain create, info, update, list, transfer, renew, restore
DomainStudio client.domain_studio search
Hello client.hello ping
Job client.job info, list, cancel, confirm
MailProxy client.mail_proxy create, info, update, delete, list
Poll client.poll info, confirm
Redirect client.redirect create, info, update, delete, list
Session client.session login, logout
SslContact client.ssl_contact create, info, update, delete, list
Subscription client.subscription create, update, delete, list
TransferOut client.transfer_out list, answer
User client.user create, info, update, delete, list
Zone client.zone create, info, update, delete, list, stream, import_zone

License

GPL-3.0-or-later

Project details


Download files

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

Source Distribution

domainrobot-0.0.1.tar.gz (26.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

domainrobot-0.0.1-py3-none-any.whl (27.7 kB view details)

Uploaded Python 3

File details

Details for the file domainrobot-0.0.1.tar.gz.

File metadata

  • Download URL: domainrobot-0.0.1.tar.gz
  • Upload date:
  • Size: 26.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for domainrobot-0.0.1.tar.gz
Algorithm Hash digest
SHA256 278f82165b1157e83315deba5210723b706ce174cb13dfa00026d76da0e3d6d3
MD5 74a885c3d74876c7df834df0eee3b84d
BLAKE2b-256 a86d0bbd46ab5bf2717a4447f01539753c6a963a9310a8bbb7cb6d225998190c

See more details on using hashes here.

Provenance

The following attestation bundles were made for domainrobot-0.0.1.tar.gz:

Publisher: publish.yml on DigitalTolk/domainrobot-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file domainrobot-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: domainrobot-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 27.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for domainrobot-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 179e42fd2285680085498e01d56e24dec93b17540ba67eacd211356ef3992638
MD5 c223b19a42ac370f66271ed38284fbeb
BLAKE2b-256 705c3672dcfcd7079b74168e4f074c899990b24a45a68703ceefec1e9f8183ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for domainrobot-0.0.1-py3-none-any.whl:

Publisher: publish.yml on DigitalTolk/domainrobot-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page