Skip to content

EgressPolicy

Network egress policy attached to a runtime.

Shared

class EgressPolicy:
EgressPolicy(mode: EgressMode | str = EgressMode.DENYLIST, allowed_hosts: list[str] = list(), denied_hosts: list[str] = list())
Name Type or value Description
mode EgressMode | str Whether the policy uses an allowlist or denylist.
allowed_hosts list[str] Hosts explicitly allowed by the policy.
denied_hosts list[str] Hosts explicitly denied by the policy.

Serialize this egress policy for an API request.

def to_json() -> dict[str, Any]
  • dict[str, Any]

Create an egress policy from an API response payload.

def from_json(data: dict[str, Any] | None) -> 'EgressPolicy'
Name Type Default Description
data dict[str, Any] | None API response payload.
  • 'EgressPolicy'