Infoblox
The Infoblox service that allocates IPAM resources used in GSO products.
AllocationError
_setup_connection()
Set up a new connection with an Infoblox instance.
Returns:
Type | Description |
---|---|
tuple[Connector, IPAMParams]
|
A tuple that has an Infoblox |
Source code in gso/services/infoblox.py
_allocate_network(conn, dns_view, network_view, netmask, containers, comment='')
Allocate a new network in Infoblox.
The function will go over all given containers, and try to allocate a network within the available IP space. If no
space is available, this method raises an AllocationError
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
conn
|
Connector
|
An active Infoblox connection. |
required |
dns_view
|
str
|
The Infoblox |
required |
network_view
|
str
|
The Infoblox |
required |
netmask
|
IPv4Netmask | IPv6Netmask
|
The netmask of the desired network. Can be up to 32 for v4 networks, and 128 for v6 networks. |
required |
containers
|
list[str]
|
A list of network containers in which the network should be allocated, given in CIDR notation. |
required |
comment
|
str | None
|
Optionally, a comment can be added to the network allocation. |
''
|
Source code in gso/services/infoblox.py
create_v4_network_by_ip(dns_view, network_view, network, comment='')
Register an IPv4 network at the given location.
Raises:
Type | Description |
---|---|
AllocationError
|
on failure. |
Source code in gso/services/infoblox.py
create_v6_network_by_ip(dns_view, network_view, network, comment='')
Register an IPv6 network at the given location.
Raises:
Type | Description |
---|---|
AllocationError
|
on failure. |
Source code in gso/services/infoblox.py
hostname_available(hostname)
Check whether a hostname is still available in Infoblox.
Check whether Infoblox already has a infoblox_client.objects.HostRecord
that matches the given hostname.
Danger
This method only checks within the Infoblox instance, and not the rest of the internet. The hostname could therefore still be taken elsewhere.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hostname
|
str
|
The hostname to be checked. |
required |
Source code in gso/services/infoblox.py
allocate_v4_network(service_type, comment='')
Allocate a new IPv4 network in Infoblox.
Allocate an IPv4 network for a specific service type. The service type should be defined in the OSS parameters of GSO, from which the containers and netmask will be used.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
service_type
|
str
|
The service type for which the network is allocated. |
required |
comment
|
str | None
|
A comment to be added to the allocated network in Infoblox. |
''
|
Source code in gso/services/infoblox.py
allocate_v6_network(service_type, comment='')
Allocate a new IPv6 network in Infoblox.
Allocate an IPv6 network for a specific service type. The service type should be defined in the OSS parameters of GSO, from which the containers and netmask will be used.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
service_type
|
str
|
The service type for which the network is allocated. |
required |
comment
|
str | None
|
A comment to be added to the allocated network in Infoblox. |
''
|
Source code in gso/services/infoblox.py
find_network_by_cidr(ip_network)
Find a network in Infoblox by its CIDR.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ip_network
|
IPv4Network | IPv6Network
|
The CIDR that is searched. |
required |
Source code in gso/services/infoblox.py
delete_network(ip_network)
Delete a network in Infoblox.
Delete a network that is allocated in Infoblox, by passing the CIDR to be deleted. The CIDR must exactly match an existing entry in Infoblox.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ip_network
|
IPv4Network | IPv6Network
|
The network that should get deleted. |
required |
Source code in gso/services/infoblox.py
allocate_host(hostname, service_type, cname_aliases, comment)
Allocate a new host record in Infoblox.
Create a new host record in Infoblox, by providing a hostname, and the service type that is associated with this new
host. Most likely to be a loopback interface. If the hostname is not available in Infoblox (due to a potential
collision) this method raises an AllocationError
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hostname
|
str
|
The FQDN of the new host |
required |
service_type
|
str
|
The service type from which IP resources should be used. |
required |
cname_aliases
|
list[str]
|
A list of any CNAME aliases that should be associated with this host. Most often this will be a single loopback address. |
required |
comment
|
str
|
A comment that is added to the host record in Infoblox, should be the |
required |
Source code in gso/services/infoblox.py
create_host_by_ip(hostname, service_type, comment, *, ipv4_address=None, ipv6_address=None)
Create a new host record with a given IPv4 and IPv6 address.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hostname
|
str
|
The FQDN of the new host. |
required |
service_type
|
str
|
The relevant service type, used to deduce the correct |
required |
comment
|
str
|
The comment stored in this Infoblox record, most likely the relevant |
required |
ipv4_address
|
IPv4AddressType | None
|
The IPv4 address of the new host. |
None
|
ipv6_address
|
IPv6AddressType | None
|
The IPv6 address of the new host. |
None
|
Source code in gso/services/infoblox.py
find_host_by_ip(ip_addr)
Find a host record in Infoblox by its associated IP address.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ip_addr
|
IPv4Address | IPv6Address
|
The IP address of a host that is searched for. |
required |
Source code in gso/services/infoblox.py
find_host_by_fqdn(fqdn)
Find a host record by its associated FQDN.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fqdn
|
str
|
The FQDN of a host that is searched for. |
required |
Source code in gso/services/infoblox.py
find_v6_host_by_fqdn(fqdn)
Find a host record by its associated FQDN.
This specific method will return the IPv6 variant of a record, if it exists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fqdn
|
str
|
The FQDN of a host that is searched for. |
required |
Source code in gso/services/infoblox.py
delete_host_by_ip(ip_addr)
Delete a host from Infoblox.
Delete a host record in Infoblox, by providing the IP address that is associated with the record.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ip_addr
|
IPv4AddressType | IPv6Address
|
The IP address of the host record that should get deleted. |
required |
Source code in gso/services/infoblox.py
delete_host_by_fqdn(fqdn)
Delete a host from Infoblox.
Delete a host record in Infoblox, by providing the FQDN that is associated with the record.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fqdn
|
str
|
The FQDN of the host record that should get deleted. |
required |