Class DNS¶
-
class
proteus.api.dns.
DNS
(proteus_client=None)[source]¶ Bases:
object
Proteus DNS Management Class
Parameters: - proteus_client : instance of
proteus.api.client.ProteusClient
-
_find_zone
(zonename, view=None, view_name=None)[source]¶ Find last zone from zonename
Parameters: - zonename (str) – Zonename i.e. ‘subdomain.domain.tld’
- view (
proteus.objects.apientity.View
) – View Object (can be None when view_name is not None) - view_name (str) – View Name (can be None, when view is not None)
Returns: See: [1]
-
_get_record
(hostname, zonename, view=None, view_name=None, rec_type='HostRecord')[source]¶ Generic method to retrieve the Proteus Resource Records
Parameters: - hostname : string
- zonename : string
- view :
proteus.objects.apientity.View
- view_name : string
- rec_type : string [ should be one of
proteus.api.constants.DNS_ALLTYPES
]
Returns: - Depends on the result of Proteus call but can be one of these:
See: [1]
-
_get_records_by_zone
(zone=None, record_type='Zone')[source]¶ Retrieve a list of Resource Records from Proteus
Parameters: - zone (
proteus.objects.apientity.Zone
) – Zone - record_type (str (use constants from
proteus.api.constants
) – Record type to retreive
Returns: - Depending on the input type it can return:
- zone (
-
get_cname_record
(hostname, zonename, view=None, view_name=None)[source]¶ Retrieve CNAME Record from Proteus
Parameters: - hostname (str) – the hostname
- zonename (str) – Name of the Zone i.e. ‘subzone.domain.tld’
- view (
proteus.objects.apientity.View
) – View name (can be None when view_name is not None) - view_name (str) – View Name (can be None when view is not None)
Returns:
-
get_hinfo_record
(hostname, zonename, view=None, view_name=None)[source]¶ Retrieve HINFO Record from Proteus
Parameters: - hostname (str) – the hostname
- zonename (str) – Name of the Zone i.e. ‘subzone.domain.tld’
- view (
proteus.objects.apientity.View
) – View name (can be None when view_name is not None) - view_name (str) – View Name (can be None when view is not None)
Returns:
-
get_host_record
(hostname, zonename, view=None, view_name=None)[source]¶ Retrieve Host Record from Proteus
Parameters: - hostname (str) – the hostname
- zonename (str) – Name of the Zone i.e. ‘subzone.domain.tld’
- view (
proteus.objects.apientity.View
) – View name (can be None when view_name is not None) - view_name (str) – View Name (can be None when view is not None)
Returns:
-
get_mx_record
(hostname, zonename, view=None, view_name=None)[source]¶ Retrieve Mailexchanger Record from Proteus
Parameters: - hostname (str) – the hostname
- zonename (str) – Name of the Zone i.e. ‘subzone.domain.tld’
- view (
proteus.objects.apientity.View
) – View name (can be None when view_name is not None) - view_name (str) – View Name (can be None when view is not None)
Returns:
-
get_srv_record
(hostname, zonename, view=None, view_name=None)[source]¶ Retrieve SRV Record from Proteus
Parameters: - hostname (str) – the hostname
- zonename (str) – Name of the Zone i.e. ‘subzone.domain.tld’
- view (
proteus.objects.apientity.View
) – View name (can be None when view_name is not None) - view_name (str) – View Name (can be None when view is not None)
Returns:
-
get_txt_record
(hostname, zonename, view=None, view_name=None)[source]¶ Retrieve TXT Record from Proteus
Parameters: - hostname (str) – the hostname
- zonename (str) – Name of the Zone i.e. ‘subzone.domain.tld’
- view (
proteus.objects.apientity.View
) – View name (can be None when view_name is not None) - view_name (str) – View Name (can be None when view is not None)
Returns:
-
get_views
()[source]¶ Get a list of all Views in Proteus
Returns: - list of
proteus.objects.apientity.View
- list of
-
get_zone
(zone_name=None, view=None, view_name=None)[source]¶ Get a Zone Record from Proteus
Parameters: - zone_name : string
- view :
proteus.objects.apientity.View
- view_name : string
Returns:
-
get_zone_list
(zonename, view=None, view_name=None, rec_type=['Zone', 'HostRecord', 'MXRecord', 'TXTRecord', 'AliasRecord', 'HINFORecord', 'SRVRecord'])[source]¶ Retrieves a list of resource records for a special zone from Proteus
Parameters: - zonename (str) – Name of the Zone i.e. ‘subzone.domain.tld’
- view (
proteus.objects.apientity.View
) – View (can be None when view_name is not None) - view_name (str) – Name of the View (can be None when view is not None)
- rec_type (str (use one of the constants of
proteus.api.constants
or use DNS_ALLTYPES)) – Type of Record to return
Returns: - Depending on the input type it can return:
- or when rec_type is DNS_ALLTYPES:
- return a mixed list of all types above
- proteus_client : instance of
Footnotes
[1] | (1, 2) Private Method, only for use inside the class |