View class - Platform - BlueCat Gateway - 20.12.1

Gateway Administration Guide

prodname
BlueCat Gateway
version_custom
20.12.1

class view.View(api, api_entity)

Bases: bluecat.dns.DNS

A DNS view.

add_alias_record(absolute_name, linked_record, ttl=-1, properties='')

Add a new CNAME record for an existing host record. This method adds the record under a zone.

Parameter Description
absolute_name The FQDN of the alias. If you are adding a record in a zone that is linked to a incremental Naming Policy, a single hash (#) sign must be added at the appropriate location in the FQDN. Depending on the policy order value, the location of the single hash (#) sign varies.
linked_record The name of the record to which this alias will link.
ttl The time-to-live value for the record. TTL is ignored by default.
properties Adds object properties, including comments and user-defined fields.

Returns: An instance of the alias_record.

Example:
api = g.user.get_api()              # get api object
configuration_name = 'test_config'  # configuration name
view_name = 'test_view'             # view name

configuration = api.get_configuration(configuration_name)
view = configuration.get_view(view_name)

alias_record = view.add_alias_record('test_alias.zone_name', 
'test_record')

add_dns_deployment_option(dns_option, value, properties='')

Parameter Description
dns_option The name of the DNS option being added.
ttl The value being assigned to the option.
properties Adds object properties, including comments and user-defined fields.

Returns: Instance of DNSOption added.

add_dns_deployment_role(server_interface, role_type, properties='')

Adds a DNS deployment role to a specified object.

Parameter Description
server_interface The object ID/server interface object to which the role is to be added.
role_type The type of DNS role to be added. The type must be one of: NONE MASTER MASTER_HIDDEN SLAVE SLAVE_STEALTH FORWARDER STUB RECURSION AD_MASTER.
properties Adds object properties, including the view associated with this DNS deployment role and user-defined fields.

add_enum_zone(prefix, deployable=False, properties='')

Add a new ENUM zone.

Parameter Description
prefix The number prefix for the ENUM zone.
deployable Sets whether this zone is deployable. Default is False.
properties Adds object properties, including user-defined fields.

Returns: An instance of ENUM zone.

add_external_host_record(absolute_name, properties='')

Add a new External Host record. This method adds the record under a zone.

Parameter Description
absolute_name FQDN for the host record.
properties Adds object properties, including comments and user-defined fields.

Returns: An instance of the external_host_record.

Example:
api = g.user.get_api()              # get api object
configuration_name = 'test_config'  # configuration name
view_name = 'test_view'             # view name

configuration = api.get_configuration(configuration_name)
view = configuration.get_view(view_name)

external_record = view.add_external_host_record
('test_name.bluecatexternal.com')

add_generic_record(absolute_name, record_type, rdata, ttl=-1, properties='')

Add a new Generic record of specified type.

Parameter Description
absolute_name The FQDN of the record. If you are adding a record in a zone that is linked to a incremental Naming Policy, a single hash (#) sign must be added at the appropriate location in the FQDN. Depending on the policy order value, the location of the single hash (#) sign varies.
record_type The type of record being added. Valid settings for this parameter are the generic resource record types supported in Address Manager: A6, AAAA, AFSDB, APL, CERT, DNAME, DNSKEY, DS, ISDN, KEY, KX, LOC, MB, MG, MINFO, MR, NS, NSAP, PX, RP, RT, SINK, SSHFP, WKS, and X25.
rdata The data for the resource record in BIND format (for example, for A records, A 10.0.0.4).
ttl The time-to-live value for the record. TTL is ignored by default.
properties Adds object properties, including comments and user-defined fields.

Returns: An instance of the generic_record.

Example:
api = g.user.get_api()              # get api object
configuration_name = 'test_config'  # configuration name
view_name = 'test_view'             # view name

configuration = api.get_configuration(configuration_name)
view = configuration.get_view(view_name)

generic_record = view.add_generic_record('test_generic_record.test_zone', 
'A', '10.0.0.222')

add_hinfo_record(absolute_name, cpu, os, ttl=-1, properties='')

Add a new Host Info HINFO record.

Parameter Description
absolute_name The FQDN of the HINFO record. If you are adding a record in a zone that is linked to a incremental Naming Policy, a single hash (#) sign must be added at the appropriate location in the FQDN. Depending on the policy order value, the location of the single hash (#) sign varies.
cpu A string providing central processing unit information.
os A string providing operating system information.
ttl The time-to-live value for the record. TTL is ignored by default.
properties Adds object properties, including comments and user-defined fields.

Returns: An instance of the host_record.

Example:
api = g.user.get_api()              # get api object
configuration_name = 'test_config'  # configuration name
view_name = 'test_view'             # view name

configuration = api.get_configuration(configuration_name)
view = configuration.get_view(view_name)

hinfo_record = view.add_hinfo_record('test_hinfo_record.test_zone', 
'cpu1', 'windows7')

add_host_record(absolute_name, addresses, ttl=-1, properties='')

Add a Host record.

Parameter Description
absolute_name The FQDN for the host record.
addresses A list of comma-separated IP addresses (for example, 10.0.0.5,130.4.5.2).
ttl The time-to-live value for the record. To ignore the ttl, set this value to -1.
properties Adds object properties, including comments and user-defined fields.

Returns: An instance of the host_record.

Example:
api = g.user.get_api()              # get api object
configuration_name = 'test_config'  # configuration name
view_name = 'test_view'             # view name

configuration = api.get_configuration(configuration_name)
view = configuration.get_view(view_name)

host_record = view.add_host_record('new.test_hostrecord.com', 
['172.27.19.102'])

add_mx_record(absolute_name, priority, linked_record_name, ttl=-1, properties='')

Add a new Mail Exchanger MX record. This method adds the record under a zone.

Parameter Description
absolute_name The FQDN for the record. If you are adding a record in a zone that is linked to a incremental Naming Policy, a single hash (#) sign must be added at the appropriate location in the FQDN. Depending on the policy order value, the location of the single hash (#) sign varies.
priority Specifies which mail server to send clients to first when multiple matching MX records are present. Multiple MX records with equal priority values are referred to in a round-robin fashion.
txt The text data for the record.
ttl The time-to-live value for the record. TTL is ignored by default.
properties Adds object properties, including comments and user-defined fields.

Returns: An instance of the mx_record.

Example:
api = g.user.get_api()              # get api object
configuration_name = 'test_config'  # configuration name
view_name = 'test_view'             # view name

configuration = api.get_configuration(configuration_name)
view = configuration.get_view(view_name)

mx_record = view.add_mx_record('test_name.test_zone', 1, 
'host_record.test.zone')

add_naptr_record(absolute_name, order, preference, service, regexp, replacement, flags, ttl=-1, properties='')

Add a new NAPTR record.

Parameter Description
absolute_name The FQDN for the record. If you are adding a record in a zone that is linked to a incremental Naming Policy, a single hash (#) sign must be added at the appropriate location in the FQDN. Depending on the policy order value, the location of the single hash (#) sign varies.
order Specifies the order in which NAPTR records are read if several are present and are possible matches. The lower ordervalue takes precedence.
preference Specifies the order in which NAPTR records are read if the ordervalues are the same in multiple records. The lower preferencevalue takes precedence.
service Specifies the service used for the NAPTR record. Valid settings for this parameter are listed in ENUM Services in the BlueCat Address Managerâ„¢ (BAM) API Guide.
regexp A regular expression, enclosed in double quotation marks, used to transform the client data. If a regular expression is not specified, a domain name must be specified in the replacement parameter.
replacement Specifies a domain name as an alternative to the regexp. This parameter replaces client data with a domain name.
flags An optional parameter used to set flag values for the record.
ttl The time-to-live value for the record. TTL is ignored by default.
properties Adds object properties, including comments and user-defined fields.

Returns: An instance of naptr_record.

Example:
api = g.user.get_api()              # get api object
configuration_name = 'test_config'  # configuration name
view_name = 'test_view'             # view name

configuration = api.get_configuration(configuration_name)
view = configuration.get_view(view_name)

naptr_record = view.add_naptr_record('test_naptr.test_zone', order=1, preference=1,
service='voice_tel', regexp='*', replacement=TEST_ZONE, flags='')

add_resource_record(absolute_name, record_type, rdata, ttl=-1, properties='')

Generic method for adding resource records of any type.

Parameter Description
absolute_name The FQDN for the record. If you are adding a record in a zone that is linked to a incremental Naming Policy, a single hash (#) sign must be added at the appropriate location in the FQDN. Depending on the policy order value, the location of the single hash (#) sign varies.
record_type The type of record being added. Supported types using this method: AliasRecord HINFORecord HostRecord MXRecord TXTRecord.
rdata The data for the resource record in BIND format (for example, for A records, A 10.0.0.4). You can specify either a single IPv4 or IPv6 address for the record.
ttl The time-to-live value for the record. TTL is ignored by default.
properties Adds object properties, including comments and user-defined fields.

Returns: An instance of the resource record type that was added.

Example:
api = g.user.get_api()              # get api object
configuration_name = 'test_config'  # configuration name
view_name = 'test_view'             # view name

configuration = api.get_configuration(configuration_name)
view = configuration.get_view(view_name)

resource_record = zone.add_resource_record('test_name', view.AliasRecord, 10.0.0.2)

add_srv_record(absolute_name, priority, port, weight, linked_record_name, ttl=-1, properties='')

Add a new SRV record. This method adds the record under a zone.

Parameter Description
absolute_name The FQDN for the record. If you are adding a record in a zone that is linked to a incremental Naming Policy, a single hash (#) sign must be added at the appropriate location in the FQDN. Depending on the policy order value, the location of the single hash (#) sign varies.
priority Specifies which SRV record to use when multiple matching SRV records are present. The record with the lowest value takes precedence.
port The TCP/UDP port on which the service is available.
weight If two matching SRV records within a zone have equal priority, the weight value is checked. If the weight value for one object is higher than the other, the record with the highest weight has its resource records returned first.
linked_record_name The FQDN of the host record to which this SRV record is linked.
ttl The time-to-live value for the record. TTL is ignored by default.
properties Adds object properties, including comments and user-defined fields.

Returns: An instance of srv_record.

Example:
api = g.user.get_api()              # get api object
configuration_name = 'test_config'  # configuration name
view_name = 'test_view'             # view name

configuration = api.get_configuration(configuration_name)
view = configuration.get_view(view_name)

srv_record = view.add_srv_record('test_srv_record.test_zone', 1, 500, 1, 
'test_host_record.test_zone')

add_text_record(absolute_name, txt, ttl=-1, properties='')

Add a new text record.
Warning: This method has been deprecated, use add_txt_record instead.
Parameter Description
absolute_name The FQDN for the record. If you are adding a record in a zone that is linked to a incremental Naming Policy, a single hash (#) sign must be added at the appropriate location in the FQDN. Depending on the policy order value, the location of the single hash (#) sign varies.
txt The text data for the record.
ttl The time-to-live value for the record. TTL is ignored by default.
properties Adds object properties, including comments and user-defined fields.

Returns: An instance of txt_record.

add_txt_record(absolute_name, txt, ttl=-1, properties='')

Add a new text record.

Parameter Description
absolute_name (string, required) The FQDN for the record. If you are adding a record in a zone that is linked to a incremental Naming Policy, a single hash (#) sign must be added at the appropriate location in the FQDN. Depending on the policy order value, the location of the single hash (#) sign varies.
txt (string, required) The text data for the record.
ttl (integer, required) The time-to-live value for the record. TTL is ignored by default.
properties (string, required) Adds object properties, including comments and user-defined fields.

Returns: An instance of txt_record.

Example:
api = g.user.get_api()              # get api object
configuration_name = 'test_config'  # configuration name
view_name = 'test_view'             # view name

configuration = api.get_configuration(configuration_name)
view = configuration.get_view(view_name)

text_record = view.add_text_record('test_text_record.test_zone', 
'example')

add_zone(absolute_name, deployable=False, template=0, **kwargs)

Adds DNS zones.

Parameter Description
absolute_name Fully qualified name of the DNS zone to add (eg. example.com).
deployable Boolean. Default is False.
template ID of the associated network template.
kwargs Keyword arguments of user-defined fields and values.

Returns: Zone instance of the new DNS zone.

get_alias_record(absolute_name)

Get an alias record.

Parameter Description
absolute_name The FQDN of the host record to get.

Returns: An instance of alias_record.

get_enum_zone(prefix)

Get Enum Zone with the specified prefix.

Parameter Description
prefix  

Returns: An instance of alias_record.

get_enum_zones()

Get list of all enum zones in this view.

get_external_host_record(absolute_name)

Get an external host record.

Parameter Description
absolute_name The FQDN of the host record to get.

Returns: An instance of external_host_record.

get_generic_record(absolute_name)

Get a generic record.

Parameter Description
absolute_name The FQDN of the host record to get.

Returns: Get an external the generic record.

get_hinfo_record(absolute_name)

Get a host info record.

Parameter Description
absolute_name The FQDN of the host record to get.

Returns: Get an external the host info record.

get_host_record(absolute_name)

Get a host record.

Parameter Description
absolute_name The FQDN of the host record to get.

Returns: Get an external the host record.

get_mx_record(absolute_name)

Get a MX record.

Parameter Description
absolute_name The FQDN of the host record to get.

Returns: An instance of MX record.

get_naptr_record(absolute_name

Get a NAPTR record.

Parameter Description
absolute_name The FQDN of the host record to get.

Returns: Get an external the naptr record.

get_resource_record(absolute_name, resource_type)

Searches a Tag by name.

Parameter Description
absolute_name Name of the Tag.
resource_type The type of resource record to get.

Returns: An instance of the specified resource record type.

get_srv_record(absolute_name)

Get a SRV record.

Parameter Description
absolute_name The FQDN of the host record to get.

Returns: An instance of srv_record.

get_text_record(absolute_name)

Get a text record.

Parameter Description
absolute_name The FQDN of the host record to get.

Returns: An instance of txt_record.