Welcome to python-proteus’s documentation!¶
Contents:
proteus Package¶
proteus
Package¶
proteus.api Package¶
proteus.api.client Module¶
Class ProteusClientApi¶
-
class
proteus.api.client.
ProteusClientApi
(api_url=None, api_user=None, api_password=None)[source]¶ Bases:
object
Low Level Proteus SOAP Wrapper Class
Constructor
Parameters: - api_url : string
- api_user : string
- api_password : string
- Example:
>>> from proteus.api import ProteusClientApi >>> pc=ProteusClientApi( 'http://proteus.domain.tld/', 'username', 'password')
-
_get_entities
(parent_id, entity_type, start=1, count=1)[source]¶ Get a list of Proteus Entities
Parameters: - parent_id : int
- entity_type : string [ use one of the TYPE_* constants from
proteus.api.constants
] - start : int [1-based]
- count : int
Returns: APIEntityArray
-
_get_entity_by_name
(parent_id, entity_name, entity_type)[source]¶ Wrapper for Proteus SOAP API Method getEntityByName
Parameters: - parent_id : int
- entity_name : string
- entity_type : string [ use one of the TYPE_* constants from
proteus.api.constants
]
Returns: APIEntity
Class ProteusClient¶
-
class
proteus.api.client.
ProteusClient
(api_url=None, api_user=None, api_password=None, config_name=None)[source]¶ Bases:
proteus.api.client.ProteusClientApi
Usable Proteus Client
Parameters: - api_url : string
- api_user : string
- api_password : string
- config_name : string
- Example:
>>> from proteus.api import ProteusClientApi >>> pc=ProteusClientApi( 'http://proteus.domain.tld/', 'username', 'password', 'proteus_configuration_object_name')
-
Configuration
¶ Configuration Property
-
DNS
¶ DNS Class Property
Constants Module¶
Proteus Configuration Constant¶
-
TYPE_CONFIGURATION
¶ - Corresponding Proteus SOAP API Type:
- Configuration
Proteus DNS Constants¶
-
TYPE_VIEW
¶ - Corresponding Proteus SOAP API Type:
- View
-
TYPE_ZONE
¶ - Corresponding Proteus SOAP API Type:
- Zone
-
TYPE_HOSTRECORD
¶ - Corresponding Proteus SOAP API Type:
- HostRecord
-
TYPE_MXRECORD
¶ - Corresponding Proteus SOAP API Type:
- MXRecord
-
TYPE_TXTRECORD
¶ - Corresponding Proteus SOAP API Type:
- TextRecord
-
TYPE_CNAMERECORD
¶ - Corresponding Proteus SOAP API Type:
- AliasRecord
-
TYPE_HINFORECORD
¶ - Corresponding Proteus SOAP API Type:
- HINFORecord
Special Lists of Proteus Types¶
-
DNS_ALLTYPES
¶ - Include all Proteus DNS Types
- TYPE_ZONE
- TYPE_HOSTRECORD
- TYPE_MXRECORD
- TYPE_TXTRECORD
- TYPE_CNAMERECORD
- TYPE_HINFORECORD
-
ALL_TYPES
¶ - Include all Proteus Data Types
- TYPE_CONFIGURATION
- TYPE_VIEW
- TYPE_HOSTRECORD
- TYPE_MXRECORD
- TYPE_TXTRECORD
- TYPE_CNAMERECORD
- TYPE_HINFORECORD
- TYPE_IP4BLOCK
Module DNS¶
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 |
objects Package¶
objects
Package¶
apientity
Module¶
-
class
proteus.objects.apientity.
APIObject
(*args, **kwargs)[source]¶ Bases:
object
Factory for creating the correct APIEntity Python Objects