Skip to main content

A module to manage Digital Ocean API

Project description

ClientDOAPI

This is a module to manage Digital Ocean API v2

You can manage:

  • Account info
  • Domains (Create, get, delete)
  • Domain records (Create, Get record ID, Delete)
  • TODO: other endpoints available from DO

API Reference from Digital Ocean

Example:

Get info from account

import clientdoapi as cdo
import json

client = cdoapi.ClientDOApi("tokenfromDigitalOcean")

try:
    info = client.get_account_info()
    print(info.droplet_limit)
    print(info.email)
    print(info.uuid)
    #or get the object as a dictionary:
    info_dict = info.to_json()
    #so you can dump it to json
    json_obj = json.dumps(info_dict)
except Exception as identifier:
    print(identifier)

Create Domain

try:
     #Returns a DomainDO object with ne info created
     new_domain = client.create_domain("testmydomain.com", "123.45.6.7")
     print(f"name: {new_domain.name}")
     print(f"name: {new_domain.ttl}")

 except Exception as e:
     print(e)

Project details


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
clientdoapi-0.0.5-py3-none-any.whl (17.5 kB) Copy SHA256 hash SHA256 Wheel py3
clientdoapi-0.0.5.tar.gz (4.8 kB) Copy SHA256 hash SHA256 Source None

Supported by

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