Gateway API Integrator
| Channel | Revision | Published | Runs on |
|---|---|---|---|
| latest/stable | 127 | 13 Jan 2026 | |
| latest/stable | 14 | 01 Jul 2024 | |
| latest/edge | 136 | 18 Feb 2026 | |
| latest/edge | 14 | 27 Jun 2024 |
juju deploy gateway-api-integrator
Deploy universal operators easily with Juju, the Universal Operator Lifecycle Manager.
Platform:
charms.gateway_api_integrator.v0.gateway_route
-
- Last updated 25 Feb 2026
- Revision Library version 0.4
gateway-route interface library.
Getting Started
To get started using the library, you just need to fetch the library using charmcraft.
cd some-charm
charmcraft fetch-lib charms.gateway_api_integrator.v0.gateway_route
In the metadata.yaml of the charm, add the following:
requires:
gateway-route:
interface: gateway-route
limit: 1
Then, to initialise the library:
from charms.gateway_api_integrator.v0.gateway_route import GatewayRouteRequirer
class SomeCharm(CharmBase):
def __init__(self, *args):
# ...
# There are 2 ways you can use the requirer implementation:
# 1. To initialize the requirer with parameters:
self.gateway_route_requirer = GatewayRouteRequirer(self,
relation_name=<required>,
name=<optional>,
model=<optional>,
port=<optional>,
hostname=<optional>,
paths=<optional>,
)
# 2.To initialize the requirer with no parameters, i.e
# self.gateway_route_requirer = GatewayRouteRequirer(self)
# This will simply initialize the requirer class and it won't perform any action.
# Afterwards regardless of how you initialized the requirer you can call the
# provide_gateway_route_requirements method anywhere in your charm to update the requirer data.
# The method takes the same number of parameters as the requirer class.
# provide_gateway_route_requirements(name=, model=, ...)
self.framework.observe(
self.framework.on.config_changed, self._on_config_changed
)
self.framework.observe(
self.gateway_route_requirer.on.ready, self._on_endpoints_ready
)
self.framework.observe(
self.gateway_route_requirer.on.removed, self._on_endpoints_removed
)
def _on_config_changed(self, event: ConfigChangedEvent) -> None:
self.gateway_route_requirer.provide_gateway_route_requirements(...)
def _on_endpoints_ready(self, _: EventBase) -> None:
# Handle endpoints ready event
...
def _on_endpoints_removed(self, _: EventBase) -> None:
# Handle endpoints removed event
...
Index
class DataValidationError
Description
Raised when data validation fails. None
class GatewayRouteInvalidRelationDataError
Description
Raised when data validation of the gateway-route relation fails. None
def valid_fqdn(value: str)
Validate if value is a valid fqdn. TLDs are not allowed.
Arguments
The value to validate.
class RequirerApplicationData
Configuration model for Gateway route requirer application data.
Attributes
class GatewayRouteProviderAppData
gateway-route provider databag schema.
Attributes
class GatewayRouteRequirerData
gateway-route requirer data.
Attributes
class GatewayRouteDataAvailableEvent
GatewayRouteDataAvailableEvent custom event.
Description
This event indicates that the requirers data are available.
class GatewayRouteDataRemovedEvent
GatewayRouteDataRemovedEvent custom event.
Description
This event indicates that one of the endpoints was removed.
class GatewayRouteProviderEvents
List of events that the gateway-route requirer charm can leverage.
Attributes
class GatewayRouteProvider
Gateway-route interface provider implementation.
Attributes
Methods
GatewayRouteProvider. __init__( self , charm: CharmBase , relation_name: str , raise_on_validation_error: bool )
Initialize the GatewayRouteProvider.
Arguments
The charm that is instantiating the library.
The name of the relation.
Whether the library should raise GatewayRouteInvalidRelationDataError when requirer data validation fails. If this is set to True the provider charm needs to also catch and handle the thrown exception.
GatewayRouteProvider. relation( self )
Description
The list of Relation instances associated with this endpoint. None
GatewayRouteProvider. get_data( self , relation )
Fetch requirer data.
Arguments
The relation instance to fetch data from.
Returns
Validated data from the gateway-route requirer.
GatewayRouteProvider. publish_endpoints( self , endpoints , relation: Relation )
Publish to the app databag the proxied endpoints.
Arguments
The list of proxied endpoints to publish.
The relation with the requirer application.
class GatewayRouteEnpointsReadyEvent
Description
GatewayRouteEnpointsReadyEvent custom event. None
class GatewayRouteEndpointsRemovedEvent
Description
GatewayRouteEndpointsRemovedEvent custom event. None
class GatewayRouteRequirerEvents
List of events that the gateway-route requirer charm can leverage.
Attributes
class GatewayRouteRequirer
gateway-route interface requirer implementation.
Attributes
Methods
GatewayRouteRequirer. __init__( self , charm: CharmBase , relation_name: str , name , model , port , hostname , paths )
Initialize the GatewayRouteRequirer.
Arguments
The charm that is instantiating the library.
The name of the relation to bind to.
The name of the service to route traffic to.
The model of the service to route traffic to.
The port the service is listening on.
Hostname of this service.
List of URL paths to route to this service.
GatewayRouteRequirer. provide_gateway_route_requirements( self , name: str , model: str , port: int , hostname , paths )
Update gateway-route requirements data in the relation.
Arguments
The name of the service to route traffic to.
The model of the service to route traffic to.
The port the service is listening on.
Hostname of this service.
List of URL paths to route to this service.
GatewayRouteRequirer. update_relation_data( self )
Description
Update the application data in the relation. None
GatewayRouteRequirer. get_routed_endpoints( self )
The full ingress URL to reach the current unit.
Returns
The provider URLs or an empty list if the URLs aren't available yet or are not valid.