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__ | @param api_key: API key or username to used (required) @type api_key: C{str} |
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 | No summary |
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 | iterate_zones | Return a generator to iterate over available zones. |
Method | iterate_records | Return a generator to iterate over records for the provided zone. |
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. |
@param api_key: API key or username to used (required) @type api_key: C{str} @param api_secret: Secret password to be used (required) @type api_secret: C{str} @rtype: C{None}
>>> driver = DummyDNSDriver('key', 'secret') >>> driver.list_record_types() [0] @inherits: L{DNSDriver.list_record_types}
>>> driver = DummyDNSDriver('key', 'secret') >>> driver.list_zones() [] @inherits: L{DNSDriver.list_zones}
>>> driver = DummyDNSDriver('key', 'secret') >>> zone = driver.create_zone(domain='apache.org', type='master', ... ttl=100) >>> list(zone.list_records()) [] >>> record = driver.create_record(name='libcloud', zone=zone, ... type=RecordType.A, data='127.0.0.1') >>> list(zone.list_records()) #doctest: +ELLIPSIS [<Record: zone=id-apache.org, name=libcloud, type=A...>]
>>> driver = DummyDNSDriver('key', 'secret') >>> driver.get_zone(zone_id='foobar') ... #doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): ZoneDoesNotExistError: @inherits: L{DNSDriver.get_zone}
>>> driver = DummyDNSDriver('key', 'secret') >>> driver.get_record(zone_id='doesnotexist', record_id='exists') ... #doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): ZoneDoesNotExistError: @inherits: L{DNSDriver.get_record}
>>> 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: @inherits: L{DNSDriver.create_zone}
>>> 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: @inherits: L{DNSDriver.create_record}
>>> 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: @inherits: L{DNSDriver.delete_zone}
>>> 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: @inherits: L{DNSDriver.delete_record}