Vultr Driver Documentation¶
Vultr was built by the same team that created Choopa.com and GameServers.com, has tackled hosting solutions, delivering industry leading performance and reliability while building out one highly available worldwide network.
Read more at: https://www.vultr.com/about/
Instantiating the driver¶
from libcloud.dns.types import Provider
from libcloud.dns.providers import get_driver
cls = get_driver(Provider.VULTR)
driver = cls(key='api_key')
API Docs¶
-
class
libcloud.dns.drivers.vultr.
VultrDNSDriver
(key, secret=None, secure=True, host=None, port=None, **kwargs)[source]¶ Parameters: - key (
str
) – API key or username to used (required) - secret (
str
) – Secret password to be used (required) - secure (
bool
) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default. - host (
str
) – Override hostname used for connections. - port (
int
) – Override port used for connections.
Returns: None
-
connectionCls
¶ alias of
VultrDNSConnection
-
create_record
(name, zone, type, data, extra=None)[source]¶ Create a new record.
Parameters: - name (
str
) – Record name without the domain name (e.g. www). Note: If you want to create a record for a base domain name, you should specify empty string (‘’) for this argument. - zone (
Zone
) – Zone where the requested record is created. - type (
RecordType
) – DNS record type (A, AAAA, …). - data (
str
) – Data for the record (depends on the record type). - extra (
dict
) – Extra attributes (driver specific). (optional)
Return type: Record
- name (
-
create_zone
(domain, type='master', ttl=None, extra=None)[source]¶ Returns a Zone object.
Parameters: - domain (
str
) – Zone domain name, (e.g. example.com). - type (
str
) – Zone type (master / slave). - ttl (
int
) – TTL for new records. (optional) - extra – (optional) Extra attributes (driver specific). (e.g. {‘serverip’:‘127.0.0.1’})
- domain (
-
delete_record
(record)[source]¶ Delete a record.
Parameters: record ( Record
) – Record to delete.Return type: bool
-
delete_zone
(zone)[source]¶ Delete a zone.
Note: This will delete all the records belonging to this zone.
Parameters: zone ( Zone
) – Zone to delete.Return type: bool
-
ex_record_exists
(record_id, records_list)[source]¶ Parameters: - record_id (
str
) – Name of the Record object. - records_list (
list
) – A list containing Record objects
Return type: bool
- record_id (
-
ex_zone_exists
(zone_id, zones_list)[source]¶ Function to check if a Zone object exists.
Parameters: - zone_id (
str
) – Name of the Zone object. - zones_list (
list
) – A list containing Zone objects
Return type: Returns True or False
- zone_id (
-
export_zone_to_bind_format
(zone)¶ Export Zone object to the BIND compatible format.
Parameters: zone ( Zone
) – Zone to export.Returns: Zone data in BIND compatible format. Return type: str
-
export_zone_to_bind_zone_file
(zone, file_path)¶ Export Zone object to the BIND compatible format and write result to a file.
Parameters: - zone (
Zone
) – Zone to export. - file_path (
str
) – File path where the output will be saved.
- zone (
-
get_record
(zone_id, record_id)[source]¶ Returns a Record instance.
Parameters: - zone_id (
str
) – name of the required zone - record_id (
str
) – ID of the required record
Return type: class: Record - zone_id (
-
get_zone
(zone_id)[source]¶ Returns a Zone instance.
Parameters: zone_id ( str
) – name of the zone user wants to get.Return type: Zone
-
iterate_records
(zone)¶ Return a generator to iterate over records for the provided zone.
Parameters: zone ( Zone
) – Zone to list records for.Return type: generator
ofRecord
-
iterate_zones
()¶ Return a generator to iterate over available zones.
Return type: generator
ofZone
-
list_record_types
()¶ Return a list of RecordType objects supported by the provider.
Returns: list
ofRecordType
-
list_records
(zone)[source]¶ Returns a list of records for the provided zone.
Parameters: zone (Zone) – zone to list records for Return type: list of :class: Record
-
list_zones
()[source]¶ Return a list of records for the provided zone.
Parameters: zone ( Zone
) – Zone to list records for.Returns: list
ofRecord
-
update_record
(record, name, type, data, extra=None)¶ Update an existing record.
Parameters: - record (
Record
) – Record to update. - name (
str
) – Record name without the domain name (e.g. www). Note: If you want to create a record for a base domain name, you should specify empty string (‘’) for this argument. - type (
RecordType
) – DNS record type (A, AAAA, …). - data (
str
) – Data for the record (depends on the record type). - extra (
dict
) – (optional) Extra attributes (driver specific).
Return type: Record
- record (
-
update_zone
(zone, domain, type='master', ttl=None, extra=None)¶ Update an existing zone.
Parameters: - zone (
Zone
) – Zone to update. - domain (
str
) – Zone domain name (e.g. example.com) - type (
str
) – Zone type (master / slave). - ttl (
int
) – TTL for new records. (optional) - extra (
dict
) – Extra attributes (driver specific). (optional)
Return type: Zone
- zone (
- key (