---
title: Charmhub | Deploy Hydra using Charmhub - The Open Operator Collection
description: Deploy the latest version of Hydra as a Kubernetes Operator on any cloud.
url: https://charmhub.io/hydra/libraries/hydra_endpoints
---

# Hydra

[Identity Charmers](https://charmhub.io/publisher/identity-charmers "View all packages from Identity Charmers")

* [Identity Charmers](https://charmhub.io/publisher/identity-charmers "View all packages from Identity Charmers")

Platform:

stable 396

```
juju deploy hydra
```

[Learn to deploy on juju >](https://juju.is/docs/juju/manage-applications)

[Toggle side navigation](https://charmhub.io/hydra/libraries/hydra_endpoints#drawer)

## charms.hydra.v0.hydra\_endpoints

* [*Docstrings*Docstrings](https://charmhub.io/hydra/libraries/hydra_endpoints)
  [*Code*Source code](https://charmhub.io/hydra/libraries/hydra_endpoints/source-code)
* + Download

    Fetch library

    ```
    charmcraft fetch-lib charms.hydra.v0.hydra_endpoints
    ```

    [Download hydra\_endpoints.py](https://charmhub.io/hydra/libraries/hydra_endpoints/download)
  + *Last updated* 21 Aug 2023
  + *Revision* Library version 0.5

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:
            ...
```

---

Index

* [class HydraEndpointsRelationReadyEvent](https://charmhub.io/hydra/libraries/hydra_endpoints#hydraendpointsrelationreadyevent)
* [class HydraEndpointsProviderEvents](https://charmhub.io/hydra/libraries/hydra_endpoints#hydraendpointsproviderevents)
* [class HydraEndpointsProvider](https://charmhub.io/hydra/libraries/hydra_endpoints#hydraendpointsprovider)
* + [def \_\_init\_\_(
    self,
    charm,
    relation\_name)](https://charmhub.io/hydra/libraries/hydra_endpoints#hydraendpointsprovider-__init__)
* + [def send\_endpoint\_relation\_data(
    self,
    admin\_endpoint,
    public\_endpoint)](https://charmhub.io/hydra/libraries/hydra_endpoints#hydraendpointsprovider-send_endpoint_relation_data)
* [class HydraEndpointsRelationError](https://charmhub.io/hydra/libraries/hydra_endpoints#hydraendpointsrelationerror)
* [class HydraEndpointsRelationMissingError](https://charmhub.io/hydra/libraries/hydra_endpoints#hydraendpointsrelationmissingerror)
* + [def \_\_init\_\_(
    self)](https://charmhub.io/hydra/libraries/hydra_endpoints#hydraendpointsrelationmissingerror-__init__)
* [class HydraEndpointsRelationDataMissingError](https://charmhub.io/hydra/libraries/hydra_endpoints#hydraendpointsrelationdatamissingerror)
* + [def \_\_init\_\_(
    self,
    message)](https://charmhub.io/hydra/libraries/hydra_endpoints#hydraendpointsrelationdatamissingerror-__init__)
* [class HydraEndpointsRequirer](https://charmhub.io/hydra/libraries/hydra_endpoints#hydraendpointsrequirer)
* + [def \_\_init\_\_(
    self,
    charm,
    relation\_name)](https://charmhub.io/hydra/libraries/hydra_endpoints#hydraendpointsrequirer-__init__)
* + [def get\_hydra\_endpoints(
    self)](https://charmhub.io/hydra/libraries/hydra_endpoints#hydraendpointsrequirer-get_hydra_endpoints)

#### 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
