SoftLayer.dns

DNS Manager/helpers

copyright:
  1. 2013, SoftLayer Technologies, Inc. All rights reserved.
license:

MIT, see LICENSE for more details.

class SoftLayer.managers.dns.DNSManager(client)[source]

DNSManager initialization.

Parameters:client (SoftLayer.API.Client) – the client instance
client = None

A valid SoftLayer.API.Client object that will be used for all actions.

create_record(zone_id, 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
  • type – the type of record (A, AAAA, CNAME, MX, SRV, 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(id)[source]

Delete a zone by its ID.

Parameters: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, type=None, **kwargs)[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
  • 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 arguments (limit, offset, etc.)
Returns:A list of dictionaries representing the matching zones.
record = None

Reference to the SoftLayer.Dns_Domain_ResourceRecord API object.

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:
resolvers = []

A list of resolver functions. Used primarily by the CLI to provide a variety of methods for uniquely identifying an object such as zone name.

service = None

Reference to the SoftLayer_Dns_Domain API object.

Project Versions

Previous topic

SoftLayer.cci

Next topic

SoftLayer.firewall

This Page