SoftLayer.dns¶
DNS Manager/helpers
license: | MIT, see LICENSE for more details. |
---|
-
class
SoftLayer.managers.dns.
DNSManager
(client)[source]¶ Manage SoftLayer DNS.
See product information here: http://www.softlayer.com/DOMAIN-SERVICES
Parameters: client (SoftLayer.API.BaseClient) – 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, TXT, etc.)
- data – the record’s value
- ttl (integer) – the TTL or time-to-live value (default: 60)
-
create_record_mx
(zone_id, record, data, ttl=60, priority=10)[source]¶ Create a mx resource record on a domain.
Parameters: - id (integer) – the zone’s ID
- record – the name of the record to add
- data – the record’s value
- ttl (integer) – the TTL or time-to-live value (default: 60)
- priority (integer) – the priority of the target host
-
create_record_ptr
(record, data, ttl=60)[source]¶ Create a reverse record.
Parameters: - record – the public ip address of device for which you would like to manage reverse DNS.
- data – the record’s value
- ttl (integer) – the TTL or time-to-live value (default: 60)
-
create_record_srv
(zone_id, record, data, protocol, port, service, ttl=60, priority=20, weight=10)[source]¶ Create a resource record on a domain.
Parameters: - id (integer) – the zone’s ID
- record – the name of the record to add
- data – the record’s value
- protocol (string) – the protocol of the service, usually either TCP or UDP.
- port (integer) – the TCP or UDP port on which the service is to be found.
- service (string) – the symbolic name of the desired service.
- ttl (integer) – the TTL or time-to-live value (default: 60)
- priority (integer) – the priority of the target host (default: 20)
- weight (integer) – relative weight for records with same priority (default: 10)
-
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) – time in seconds
- data (str) – the records data
- host (str) – record’s host
- record_type (str) – 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:
-