haproxy-route-policy

HAProxy route policy charm

Channel Revision Published Runs on
latest/edge 9 26 Apr 2026
Ubuntu 24.04
juju deploy haproxy-route-policy --channel edge
Show information

Platform:

Ubuntu
24.04

charms.haproxy_route_policy.v0.haproxy_route_policy

haproxy-route-policy interface library.

This interface is used between the HAProxy charm (requirer) and the haproxy-route-policy charm (provider).

The requirer publishes route policy requests under backend_requests as a list of HAProxy backend objects. The provider publishes approved entries under approved_requests and additionally exposes policy_backend_port and provider unit addresses for policy web UI routing.


def valid_domain_with_wildcard(value: str)

Validate if value is a valid domain that can include a wildcard.

Arguments

value

The value to validate.

Description

The wildcard character (*) can't be at the TLD level, for example *.com is not valid. This is supported natively by the library ( e.g domain("com") will raise a ValidationError ).

def valid_domain(value: str)

Validate if value is a valid domain without wildcards.

class HaproxyRoutePolicyInvalidRelationDataError

Description

Raised when relation data validation for haproxy-route-policy fails. None

class HaproxyRoutePolicyBackendRequest

Data model representing a single backend request from the requirer.

Attributes

relation_id
The relation ID of the request.
backend_name
The name of the HAProxy backend.
hostname_acls
List of hostname ACLs for the backend.
paths
List of paths for the backend.
port
Port number for the backend.

class HaproxyRoutePolicyRequirerAppData

Data model representing the requirer application data for haproxy-route-policy.

Attributes

backend_requests
List of backend requests to be evaluated by the policy service.

Methods

HaproxyRoutePolicyRequirerAppData. validate_unique_backend_names( self )

Description

Ensure that backend names are unique across all requests. None

class HaproxyRoutePolicyProviderAppData

Description

haproxy-route-policy provider app databag schema. None

class HaproxyRoutePolicyProvider

Description

haproxy-route-policy provider implementation. None

Methods

HaproxyRoutePolicyProvider. __init__( self , charm: CharmBase , relation_name: str )

Initialize provider helper.

Arguments

charm

The charm instance using this helper.

relation_name

Name of the relation endpoint.

HaproxyRoutePolicyProvider. relation( self )

Description

Return the first relation for this endpoint, if any. None

HaproxyRoutePolicyProvider. set_approved_backend_requests( self , approved_requests , policy_backend_port: int )

Description

Set and publish approved backend requests. None

class HaproxyRoutePolicyRequirer

Description

haproxy-route-policy requirer implementation. None

Methods

HaproxyRoutePolicyRequirer. __init__( self , charm: CharmBase , relation_name: str )

Initialize requirer helper.

Arguments

charm

The charm instance using this helper.

relation_name

Name of the relation endpoint.

requests

Optional initial request backend list to publish.

HaproxyRoutePolicyRequirer. relation( self )

Description

Return the first relation for this endpoint, if any. None

HaproxyRoutePolicyRequirer. provide_haproxy_route_policy_requests( self , backend_requests , proxied_endpoint )

Description

Set and publish route policy requests. None