Part of libcloud.dns.drivers.dummy View Source View In Hierarchy
Dummy DNS driver.
>>> from libcloud.dns.drivers.dummy import DummyDNSDriver >>> driver = DummyDNSDriver('key', 'secret') >>> driver.name 'Dummy DNS Provider'
Method | __init__ | |
Method | list_record_types | >>> driver = DummyDNSDriver('key', 'secret') >>> driver.list_record_types() [0] |
Method | list_zones | >>> driver = DummyDNSDriver('key', 'secret') >>> driver.list_zones() [] |
Method | list_records | Return a list of records for the provided zone. |
Method | get_zone | No summary |
Method | get_record | No summary |
Method | create_zone | No summary |
Method | create_record | No summary |
Method | delete_zone | No summary |
Method | delete_record | No summary |
Inherited from DNSDriver:
Method | update_zone | Update en existing zone. |
Method | update_record | Update an existing record. |
Method | _string_to_record_type | Return a string representation of a DNS record type to a libcloud RecordType ENUM. |
Inherited from BaseDriver (via DNSDriver):
Method | _ex_connection_class_kwargs | Return extra connection keyword arguments which are passed to the Connection class constructor. |
Parameters | key | API key or username to used (type: str) |
secret | Secret password to be used (type: str) | |
secure | Weither to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default. (type: bool) | |
host | Override hostname used for connections. (type: str) | |
port | Override port used for connections. (type: int) | |
api_version | Optional API version. Only used by drivers which support multiple API versions. (type: str) |
>>> driver = DummyDNSDriver('key', 'secret') >>> driver.list_record_types() [0]
>>> driver = DummyDNSDriver('key', 'secret') >>> driver.list_zones() []
Parameters | zone | Zone to list records for. (type: Zone ) |
Returns | A list of Record instances. |
>>> driver = DummyDNSDriver('key', 'secret') >>> driver.get_zone(zone_id='foobar') ... #doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): ZoneDoesNotExistError:
>>> driver = DummyDNSDriver('key', 'secret') >>> driver.get_record(zone_id='doesnotexist', record_id='exists') ... #doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): ZoneDoesNotExistError:
>>> driver = DummyDNSDriver('key', 'secret') >>> zone = driver.create_zone(domain='apache.org', type='master', ... ttl=100) >>> zone <Zone: domain=apache.org, ttl=100, provider=Dummy DNS Provider ...> >>> zone = driver.create_zone(domain='apache.org', type='master', ... ttl=100) ... #doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): ZoneAlreadyExistsError:
>>> driver = DummyDNSDriver('key', 'secret') >>> zone = driver.create_zone(domain='apache.org', type='master', ... ttl=100) >>> record = driver.create_record(name='libcloud', zone=zone, ... type=RecordType.A, data='127.0.0.1') >>> record #doctest: +ELLIPSIS <Record: zone=id-apache.org, name=libcloud, type=A, data=127.0.0.1...> >>> record = driver.create_record(name='libcloud', zone=zone, ... type=RecordType.A, data='127.0.0.1') ... #doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): RecordAlreadyExistsError:
>>> driver = DummyDNSDriver('key', 'secret') >>> zone = driver.create_zone(domain='apache.org', type='master', ... ttl=100) >>> driver.delete_zone(zone) True >>> driver.delete_zone(zone) #doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): ZoneDoesNotExistError:
>>> driver = DummyDNSDriver('key', 'secret') >>> zone = driver.create_zone(domain='apache.org', type='master', ... ttl=100) >>> record = driver.create_record(name='libcloud', zone=zone, ... type=RecordType.A, data='127.0.0.1') >>> driver.delete_record(record) True >>> driver.delete_record(record) #doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): RecordDoesNotExistError: