IP4Block class - Platform - BlueCat Gateway - 18.6.1

Gateway Administration Guide

prodname
BlueCat Gateway
version_custom
18.6.1

classip4_block.IP4Block(api, api_entity)

Bases: ip4_block.IP4BlockNetwork, bluecat.configuration.IP4SpaceConfiguration, bluecat.configuration.IP4SpaceConfigurationBlockNet

Instantiate an IPv4 block.

Parameters Description
api API instance used by the entity to communicate with BAM.
api_entity The entity returned by the BAM API.

add_dhcp_deployment_role(server_interface, role_type, properties='')

Adds a DHCP deployment role to a specified object.

Parameters Description
server_interface The object ID/server interface object to which the role is to be deployed.
role_type The type of DHCP role to be added. Possible roles are: MASTER NONE.
properties A string containing options including: inherited - either true or false; indicates whether or not the deployment role was inherited.
secondaryServerInterfaceId The object ID of the secondary server interface for a DHCP failover.

Returns: The added DHCPdeployment role object.

add_dns_deployment_role(server_interface, role_type, properties='')

Adds a DNS deployment role to a specified object.

Parameters Description
server_interface The object ID/server interface object to which the role is to be deployed.
role_type he 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 A string containing options including: inherited - either true or false; indicates whether or not the deployment role was inherited.

add_ip4_block_by_cidr(cidr, properties='')

Create a new ip4 child block using CIDR.

Parameters Description
cidr The CIDR notation defining the block. For example, 10.10/16.
properties A string containing options.

Returns: Returns an APIEntity for the created IPv4 block object.

add_ip4_block_by_range(start, end, properties='')

Create a new ip4 child block by defining an address range.

Parameters Description
start An IP address defining the lowest address or start of the block.
end An IP address defining the highest address or end of the block.
properties A string containing options.

Returns: Returns an APIEntity for the created IPv4 block object.

add_ip4_network(cidr, properties='')

Adds an IPv4 network using CIDR notation.

Parameters Description
soap (cidr) The CIDR notation defining the network. For example, 10.10.10/24.
properties A string containing options.

Returns: Returns an APIEntity for the created IPv4 block object.

add_parent_block(block_or_network_ids)

Creates an IPv4 or IPv6 block from a list of IPv4 or IPv6 blocks or networks. All blocks and networks must have the same parent but do not need to be contiguous.

Parameters Description
block_or_network_ids An array containing the object IDs of IPv4 or IPv6 blocks or networks.

assign_ip4_address(address, mac_address, hostinfo, action, properties='')

Assign an IPv4 address (e.g. ‘192.168.0.1’).

Parameters Description
address For example, 192.168.0.1
mac_address For example, 00-00-00-00-00-01
hostinfo A string containing host information for the address in the following format:

hostname,viewId,reverseFlag,sameAsZoneFlag[, hostname,viewId,reverseFlag,sameAsZoneFlag,...]

where:

hostname
The Fully Qualified Domain Name (FQDN) for the host record to be added.
viewId

The object ID of the view under which this host should be created.

reverseFlag
The flag indicating if a reverse record should be created. The possible values are true or false.
sameAsZoneFlag
The flag indicating if record should be created as same as zone record. The possible values are true or false.

The comma-separated parameters may be repeated in the order shown above. The string must not end with a comma.

action MAKE_STATIC / MAKE_RESERVED / MAKE_DHCP_RESERV
properties A string containing options.

Returns: Returns an APIEntity for the assigned IPv4 address object.

assign_next_available_ip4_address(mac_address, hostinfo, action, properties='')

Assigns next available IPv4 address.

Parameters Description
mac_address For example, 00-00-00-00-00-01
hostinfo A string containing host information for the address in the following format:

hostname,viewId,reverseFlag,sameAsZoneFlag[, hostname,viewId,reverseFlag,sameAsZoneFlag,...]

where:

hostname
The Fully Qualified Domain Name (FQDN) for the host record to be added.
viewId

The object ID of the view under which this host should be created.

reverseFlag
The flag indicating if a reverse record should be created. The possible values are true or false.
sameAsZoneFlag
The flag indicating if record should be created as same as zone record. The possible values are true or false.

The comma-separated parameters may be repeated in the order shown above. The string must not end with a comma.

action MAKE_STATIC / MAKE_RESERVED / MAKE_DHCP_RESERVED
properties A string containing options. Properties include:
excludeDHCPRange
This specifies whether IP addresses in DHCP ranges should be excluded from assignment.

The value is either true or false, default value is false.

Returns: Returns an APIEntity for the assigned IPv4 address object.

delete()

Delete the entity from the BAM database.

dump()

Dump out details of the deployment role to stdout. Useful for debug.

get_access_rights()

Get an iterator for all access rights for an Entity.

get_child_by_name(name, entity_type)

Get a specific named immediate child entity of a given type.

get_children_of_type(entity_type)

Get a specific named immediate child entity of a given type.

Parameter Description
entity_type Entity type to search for.

Returns: Generator object iterating over all children of specified type.

get_deployment_roles(types=None)

Get deployment roles for the entity.

Parameter Description
types An optional list of deployment role types (documented in the deployment_role class). If the list is empty all types are returned.

get_dhcp_deployment_role(server_interface)

Retrieves the DHCP deployment role assigned to a specified object.

Parameter Description
server_interface The server interface to which the role is assigned.

Returns: Returns the DHCP deployment role assigned to the specified object.

get_dns_deployment_role(server_interface)

Retrieves a DNS deployment role from a specified object.

Parameter Description
server_interface The object ID/server interface object to which the DNS deployment role is assigned.

Returns: Returns the DHCP deployment role assigned to the specified object.

get_entity_by_cidr(cidr, entity_type='IP4Block')

Returns an IPv4 Block object by calling the block using CIDR notation.

Parameter Description
cidr CIDR notation defining the block to be returned. For example, 10.10/16.
entity_type The type of object returned: IPBlock.

Returns: The specified IPv4 block object from the database.

get_id()

Get the BAM ID of an entity.

get_ip4_address(address)

Get an IPv4 address by name (e.g. ‘192.168.0.1’). These are direct children of configurations.

Parameter Description
address The IPv4 address string.

Returns: Returns the requested APIEntity of IPv4 Address object.

get_ip4_blocks()

Get the IPv4 blocks directly underneath the current configuration or block. Note that blocks form the nodes of a tree with networks being the leaves.

Returns: Returns an iterator of DHCPv4 range objects from the database.

get_ip4_networks()

Get all immediate child IPv4 networks.

Returns: Iterator of network instances or empty list.

get_ip4_networks_by_hint(ip_prefix)

Search for IPv4 networks using their ip prefix in the configuration or block. Returns an array of IPv4 networks found under the container object. Currently only allows hints using ip prefix.

Parameter Description
ip_prefix The beginning ip prefix of the networks you wish to find. For example, ‘172’, ‘192.27’, ‘100.100.100.’

Returns: Returns an array of IPv4 networks based on the input argument or returns an empty list if no results are found.

get_ip_range_by_ip(entity_type, address)

Use this method to find the Configuration, IPv4 Block, IPv4 Network, or DHCP Range containing a specified address. You can specify the type of object to be returned, or you can leave the type of object empty to find the most direct container for the object.

Parameter Description
entity_type The type of object containing the IPv4 or IPv6 address. Specify ObjectTypes.IP4Block, ObjectTypes.IP4Network, or ObjectTypes.DHCP4Range to find the block, network, or range containing the IPv4 address. Specify an empty string (“”) to return the most direct container for the IPv4 address.
address An IPv4 address.

Returns: Returns an APIEntity for the object containing the specified address. If no object is found, returns an empty APIEntity. If ObjectTypes.IP4Block, ObjectTypes.IP4Network, or ObjectTypes.DHCP4Range is specified as the type parameter, returns an object of the specified type. If an empty string (“”) is specified as the type parameter, returns the most direct container for the IPv4 address.

get_linked_entities(entity_type)

Get all the linked entities of a given type.

Returns: Iterator for a given type entities.

get_name()

Get the BAM name of the entity.

get_next_available_ip4_address()

Gets next available IPv4 address in current configuration :

Returns: Returns the next available IPv4 address in an existing network as a string.

get_next_available_ip4_network(size, is_larger_allowed=False, auto_create=True)

Returns the next available (unused) network within a configuration or block.

Parameter Description
size The size of the network, expressed as a power of 2.
is_larger_allowed Indicates whether to return larger networks than those specified with the size parameter.
auto_create Indicates whether the next available network should be created if it does not exist.

Returns: Returns the next available (unused) network or None.

get_next_available_ip_range(size, entity_type, properties='')

Returns the existing next available IPv4 range or, if the next available IP range does not exist and autoCreate was set to true, the newly created IPv4 range.

Parameter Description
size The size of the range, expressed as a power of 2.
entity_type The type of the range object to be fetched. Currently IPv4 block and network are supported.
properties A string containing options.

Returns: Returns the next available (unused) block or network within a configuration or block.

get_next_available_ip_ranges(size, max_results, properties='')

Finds or creates unused IPv4 Networks of the specified size.

Parameter Description
size The size of the range, expressed as a power of 2.
max_results The number of networks to be found or created.
properties A string containing options.

Returns: A list of newly created IPv4Networks.

get_parent()

Get the parent entity or None if the entity is at the top of the hierarchy.

get_parent_configuration()

Walk up the entity hierarchy and return the Configuration entity; if none was found, returns None; if starting entity is configuration, returns itself.

Returns: An iterator of parent configuration objects.

get_parent_of_type(entity_type)

Walk up the entity hierarchy and return the first parent entity of the given type or, if none was found, raise PortalException.

get_properties()

Get the properties in the form of a dictionary containing one entry per property.

get_property()

Get a single named property or None if not defined.

get_type()

Get the BAM type of the entity.

get_url()

Get URL.

is_null()

Is this the null entity? (ID == 0).

link_entity(entity_id, properties='')

Link caller Entity object with another whose ID is ‘entity_id’. This method can be called by any side of a linking relationship between Entity objects.

Parameters Description
entity_id The ID of the Entity object to be linked, or to link.
properties Adds object properties, including user-defined fields.

Returns: The caller Entity object.

name

Get the BAM name of the entity.

refresh()

Downloads an updated object from BAM.

set_name(new_name)

Set the BAM name of the entity.

set_property(name, value)

Set a property value. The change is not persisted until update() is called.

update()

Persist any changes to the entity to the BAM database.