Hydra

  • Identity Charmers
Channel Revision Published Runs on
latest/stable 276 24 Apr 2024
Ubuntu 22.04
latest/edge 320 20 Oct 2024
Ubuntu 22.04
0.3/edge 320 07 Nov 2024
Ubuntu 22.04
0.2/stable 285 26 Jun 2024
Ubuntu 22.04
0.2/edge 285 09 May 2024
Ubuntu 22.04
0.1/edge 270 24 Nov 2023
Ubuntu 22.04
juju deploy hydra
Show information

Platform:

charms.hydra.v0.hydra_endpoints

Interface library for sharing hydra endpoints.

This library provides a Python API for both requesting and providing public and admin endpoints.

Getting Started

To get started using the library, you need to fetch the library using charmcraft.

cd some-charm
charmcraft fetch-lib charms.hydra.v0.hydra_endpoints

To use the library from the requirer side: In the metadata.yaml of the charm, add the following:

requires:
  hydra-endpoint-info:
    interface: hydra_endpoints
    limit: 1

Then, to initialise the library:

from charms.hydra.v0.hydra_endpoints import (
    HydraEndpointsRelationError,
    HydraEndpointsRequirer,
)
Class SomeCharm(CharmBase):
    def __init__(self, *args):
        self.hydra_endpoints_relation = HydraEndpointsRequirer(self)
        self.framework.observe(self.on.some_event_emitted, self.some_event_function)
    def some_event_function():
        # fetch the relation info
        try:
            hydra_data = self.hydra_endpoints_relation.get_hydra_endpoints()
        except HydraEndpointsRelationError as error:
            ...

class HydraEndpointsRelationReadyEvent

Description

Event to notify the charm that the relation is ready. None

class HydraEndpointsProviderEvents

Description

Event descriptor for events raised by HydraEndpointsProvider. None

class HydraEndpointsProvider

Description

Provider side of the hydra-endpoint-info relation. None

Methods

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

HydraEndpointsProvider. send_endpoint_relation_data( self , admin_endpoint: str , public_endpoint: str )

Description

Updates relation with endpoints info. None

class HydraEndpointsRelationError

Description

Base class for the relation exceptions. None

class HydraEndpointsRelationMissingError

Description

Raised when the relation is missing. None

Methods

HydraEndpointsRelationMissingError. __init__( self )

class HydraEndpointsRelationDataMissingError

Description

Raised when information is missing from the relation. None

Methods

HydraEndpointsRelationDataMissingError. __init__( self , message: str )

class HydraEndpointsRequirer

Description

Requirer side of the hydra-endpoint-info relation. None

Methods

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

HydraEndpointsRequirer. get_hydra_endpoints( self )

Description

Get the hydra endpoints. None