Skip to main content

YY cloudns API python client

Project description

This client is a python binding for the YY cloudns API.

Installation

To install cloudns, simply:

$ pip install cloudns

Quick Start

This client supports all functions defined in the API. To use those functions, first create a User object, then call methods on it.

>>> import cloundns
>>> u = cloundns.User('dw_foo', '8AFBE6DEA02407989AF4DD4C97BB6E25')
>>> u.get_all_zones()
...
>>> u.get_all_records('yyclouds.com')
...

Since most api function requires a zone to work on, you can create a zone from a User and call methods on zone. Zone contains the most frequently used functions from the API.

>>> z = u.zone('yyclouds.com')
>>> z.create_record('test-foo', '8.8.8.8', 'tel')
>>> z.get_records_by_name('test-foo')
...
>>> z.delete_records_by_name('test-foo')
...

This client does very strict error checking. Everything from HTTP error to bad response from cloudns server will raise an exception. All exceptions raised by cloudns will be a subclass of CloudnsError.

>>> r = z.create_record('test-foo', '8.8.8.8', 'uni'); z.delete_record_by_id(r.rid)
... # Will raise exception. Pending record can not be deleted.

Documentation

Cloudns API documentation is available at http://www.nsbeta.info/doc/YY-DNS-API.pdf

Cloudns python client documentation is available at https://cloudns.readthedocs.org/

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

cloudns-1.1.0.1.tar.gz (7.2 kB view hashes)

Uploaded Source

Supported by

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