Tenant Service Operator
Platform:
| Channel | Revision | Published | Runs on |
|---|---|---|---|
| latest/edge | 5 | 29 May 2026 |
juju deploy tenant-service --channel edge
charms.tenant_service.v0.tenant_service_info
-
- Last updated 28 May 2026
- Revision Library version 0.1
Interface library for sharing tenant-service info.
This library provides a Python API for both providing and requesting tenant-service deployment info, such as the HTTP service URL.
Getting Started
To use the library from the provider side:
In the charmcraft.yaml of the charm, add:
provides:
tenant-service-info:
interface: tenant_service_info
Then, to initialise the library:
from charms.tenant_service.v0.tenant_service_info import TenantServiceInfoProvider
class TenantServiceCharm(CharmBase):
def __init__(self, *args):
self.tenant_service_info_provider = TenantServiceInfoProvider(self)
self.framework.observe(
self.tenant_service_info_provider.on.ready,
self._on_tenant_service_info_ready,
)
def _on_tenant_service_info_ready(self, event):
self.tenant_service_info_provider.publish_info(service_url="http://svc:8080")
To use from the requirer side:
In the charmcraft.yaml of the charm, add:
requires:
tenant-service-info:
interface: tenant_service_info
optional: true
Then, to initialise the library:
from charms.tenant_service.v0.tenant_service_info import TenantServiceInfoRequirer
class SomeCharm(CharmBase):
def __init__(self, *args):
self.tenant_service_info = TenantServiceInfoRequirer(self)
self.framework.observe(
self.tenant_service_info.on.tenant_service_info_changed,
self._on_tenant_service_info_changed,
)
Index
class ProviderData
Description
Data published by the tenant-service into the relation databag. None
class TenantServiceInfoReadyEvent
Description
Event emitted when the provider populates the relation with info. None
class TenantServiceInfoRemovedEvent
Description
Event emitted when the relation is removed or data is no longer available. None
class TenantServiceInfoProviderEvents
Description
Events for TenantServiceInfoProvider. None
class TenantServiceInfoRequirerEvents
Description
Events for TenantServiceInfoRequirer. None
class TenantServiceInfoProvider
Description
Provider side of the tenant-service-info relation. None
Methods
TenantServiceInfoProvider. __init__( self , charm: CharmBase , relation_name: str )
TenantServiceInfoProvider. update_relations_app_data( self , service_url: str , grpc_url: str )
Description
Write service_url and grpc_url into all active relation databags. None
class TenantServiceInfoRequirer
Description
Requirer side of the tenant-service-info relation. None
Methods
TenantServiceInfoRequirer. __init__( self , charm: CharmBase , relation_name: str )
TenantServiceInfoRequirer. is_ready( self )
Description
Return True if the relation exists and contains valid data. None
TenantServiceInfoRequirer. get_provider_data( self )
Description
Return parsed ProviderData, or None if unavailable or invalid. None
TenantServiceInfoRequirer. get_service_url( self )
Description
Return the tenant-service HTTP URL, or None if unavailable. None
TenantServiceInfoRequirer. get_grpc_url( self )
Description
Return the tenant-service gRPC URL, or None if unavailable. None