Forced Network Rule

class qarnot.forced_network_rule.ForcedNetworkRule(inbound: bool, proto: str, port: str | None = None, to: str | None = None, public_host: str | None = None, public_port: str | None = None, forwarder: str | None = None, priority: str | None = None, description: str | None = None, to_qbox: bool | None = None, to_payload: bool | None = None)[source]

Bases: object

Forced Network Rule

Note

For internal usage only

__init__(inbound: bool, proto: str, port: str | None = None, to: str | None = None, public_host: str | None = None, public_port: str | None = None, forwarder: str | None = None, priority: str | None = None, description: str | None = None, to_qbox: bool | None = None, to_payload: bool | None = None)[source]
inbound
Type:

bool

Whether it concerns inbound or outbound traffic.

proto
Type:

str

Allowed protocol (tcp or udp).

port
Type:

str

Inbound port on the running instance.

to
Type:

str

For inbound rules, allowed source address.

public_host
Type:

str

For outbound rules, allowed destination address.

public_port
Type:

str

Outbound port allowed in the destination address.

forwarder
Type:

str

Type of forwarder used.

priority
Type:

str

Priority of the rule.

description
Type:

str

Description of the rule to help debugging.

to_qbox
Type:

bool

Whether the network endpoint to access is on the qbox.

to_payload
Type:

bool

Whether the network endpoint to access is in the payload.

classmethod from_json(json: Dict[str, str | bool])[source]

Create the forced network rule from json.

Parameters:

json (dict) – Dictionary representing the forced network rule

Returns:

The created ForcedNetworkRule