IP Block Management#

This file contains info obtained from Node.fetch_route_planner_status().

class mafic.IPRoutePlannerType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)#

Bases: Enum

The type of IP route planner.

More info about what planner to use can be found in the lavalink docs.

BALANCING_IP = 'BalancingIPRoutePlanner'#

IP address used is selected randomly.

This represents LoadBalance in config.

NANO_IP = 'NanoIPRoutePlanner'#

IP address used is switched on clock update.

This reprersents NanoSwitch in config.

ROTATING_IP = 'RotatingIPRoutePlanner'#

IP address used is switched on ban.

This represents RotateOnBan in config.

ROTATING_NANO_IP = 'RotatingNanoIPRoutePlanner'#

IP address used is switched on clock update, rotates to a different block on ban.

This represents RotatingNanoSwitch in config.

class mafic.IPBlockType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)#

Bases: Enum

The type of IP block.

V4 = 'Inet4Address'#

Represents an IPv4 address.

V6 = 'Inet6Address'#

Represents an IPv6 address.

Attributes
class mafic.IPBlock(data)#

Bases: object

Represents an IP block.

size#

The size of the block - the number of addresses in the block.

Type:

int

type#

The type of the block.

Type:

IPBlockType

Attributes
class mafic.FailingAddress(data)#

Bases: object

Represents a failing IP address.

address#

The IP address.

Type:

str

time#

The time the address was added to the list of failing addresses.

Type:

datetime.datetime

class mafic.BaseIPRoutePlannerStatus(data)#

Bases: ABC

An abstract base class representing the status of an IP route planner.

failing_addresses#

The list of failing addresses.

Type:

list[FailingAddress]

ip_block#

The IP block.

Type:

IPBlock

type#

The type of route planner.

Type:

IPRoutePlannerType

class mafic.BalancingIPRoutePlannerStatus(data)#

Bases: BaseIPRoutePlannerStatus

Represents the status of a balancing IP route planner.

type#

The type of route planner. This will always be IPRoutePlannerType.BALANCING_IP.

Type:

Literal[IPRoutePlannerType.BALANCING_IP]

current_address_index#

The index of the current address.

Type:

int

ip_index#

The offset of the current IP block in the IP block list.

Type:

int

rotate_index#

The number of rotations.

Type:

int

class mafic.NanoIPRoutePlannerStatus(data)#

Bases: BaseIPRoutePlannerStatus

Represents the status of a nano IP route planner.

type#

The type of route planner. This will always be IPRoutePlannerType.NANO_IP.

Type:

Literal[IPRoutePlannerType.NANO_IP]

current_address_index#

The index of the current address.

Type:

int

class mafic.RotatingIPRoutePlannerStatus(data)#

Bases: BaseIPRoutePlannerStatus

Represents the status of a rotating IP route planner.

type#

The type of route planner. This will always be IPRoutePlannerType.ROTATING_IP.

Type:

Literal[IPRoutePlannerType.ROTATING_IP]

current_address#

The current IP address.

Type:

str

ip_index#

The offset of the current IP address.

Type:

int

rotate_index#

The number of rotations.

Type:

int

class mafic.RotatingNanoIPRoutePlannerStatus(data)#

Bases: BaseIPRoutePlannerStatus

Represents the status of a rotating nano IP route planner.

type#

The type of route planner. This will always be IPRoutePlannerType.ROTATING_NANO_IP.

Type:

Literal[IPRoutePlannerType.ROTATING_NANO_IP]

block_index#

The index of the current block.

Type:

int

current_address_index#

The index of the current address.

Type:

int

mafic.ip.RoutePlannerStatus#

Represents the status of an IP route planner. This can be one of the following:

To determine the type of route planner, check the BaseIPRoutePlannerStatus.type attribute.

alias of Union[RotatingIPRoutePlannerStatus, NanoIPRoutePlannerStatus, RotatingNanoIPRoutePlannerStatus, BalancingIPRoutePlannerStatus]