SoftLayer.dns¶
DNS Manager/helpers
license: | MIT, see LICENSE for more details. |
---|
- class SoftLayer.managers.dns.DNSManager(client)[source]¶
DNSManager initialization.
Parameters: client (SoftLayer.API.Client) – the client instance - create_record(zone_id, record, record_type, data, ttl=60)[source]¶
Create a resource record on a domain.
Parameters: - id (integer) – the zone’s ID
- record – the name of the record to add
- record_type – the type of record (A, AAAA, CNAME, MX, TXT, etc.)
- data – the record’s value
- ttl (integer) – the TTL or time-to-live value (default: 60)
- create_zone(zone, serial=None)[source]¶
Create a zone for the specified zone.
Parameters: - zone – the zone name to create
- serial – serial value on the zone (default: strftime(%Y%m%d01))
- delete_record(record_id)[source]¶
Delete a resource record by its ID.
Parameters: id (integer) – the record’s ID
- delete_zone(zone_id)[source]¶
Delete a zone by its ID.
Parameters: zone_id (integer) – the zone ID to delete
- dump_zone(zone_id)[source]¶
Retrieve a zone dump in BIND format.
Parameters: id (integer) – The zone ID to dump
- edit_record(record)[source]¶
Update an existing record with the options provided. The provided dict must include an ‘id’ key and value corresponding to the record that should be updated.
Parameters: record (dict) – the record to update
- edit_zone(zone)[source]¶
Update an existing zone with the options provided. The provided dict must include an ‘id’ key and value corresponding to the zone that should be updated.
Parameters: zone (dict) – the zone to update
- get_records(zone_id, ttl=None, data=None, host=None, record_type=None)[source]¶
List, and optionally filter, records within a zone.
Parameters: - zone – the zone name in which to search.
- ttl (int) – optionally, time in seconds:
- data – optionally, the records data
- host – optionally, record’s host
- record_type – optionally, the type of record:
Returns: A list of dictionaries representing the matching records within the specified zone.
- get_zone(zone_id, records=True)[source]¶
Get a zone and its records.
Parameters: zone – the zone name Returns: A dictionary containing a large amount of information about the specified zone.
- list_zones(**kwargs)[source]¶
Retrieve a list of all DNS zones.
Parameters: **kwargs (dict) – response-level options (mask, limit, etc.) Returns: A list of dictionaries representing the matching zones.
- resolve_ids(identifier)¶
Takes a string and tries to resolve to a list of matching ids.
What exactly ‘identifier’ can be depends on the resolvers
Parameters: identifier (string) – identifying string Returns list: