Channel Revision Published Runs on
1/stable 84 26 Jun 2025
Ubuntu 20.04
1/candidate 87 26 Jun 2025
Ubuntu 20.04
1/beta 87 10 Jun 2025
Ubuntu 20.04
1/edge 87 13 May 2025
Ubuntu 20.04
2/edge 95 27 Jun 2025
Ubuntu 24.04
juju deploy catalogue-k8s --channel 1/stable
Show information

Platform:

charms.catalogue_k8s.v1.catalogue

Charm for providing services catalogues to bundles or sets of charms.

This charm library contains two classes (CatalogueProvider and CatalogueConsumer) that handle both sides of the catalogue relation interface.

CatalogueConsumer

The Consumer allows sending catalogue items to a Catalogue charm.

Adding it to your charm is very simple:

```
from charms.catalogue_k8s.v1.catalogue import (
    CatalogueConsumer,
    CatalogueItem,
)

...
    self.catalogue = CatalogueConsumer(
        charm=self,
        relation_name="catalogue",  # optional
        item=CatalogueItem(
            name="myapp",
            url=myapp_url,
            icon="rainbow",
            description="This is a rainbow app!"
        )
    )
```

The relevant events listeners are already registered by the CatalogueConsumer object.
CatalogueProvider

The Provider helps you receive catalogue items from other charms to display them however you like.

To implement this in your charm:

```
from charms.catalogue_k8s.v1.catalogue import CatalogueProvider

...
    self.catalogue = CatalogueProvider(
        charm=self,
        relation_name="catalogue",  # optional
    )
```


The relevant events listeners are already registered by the CatalogueProvider object.

class CatalogueItem

CatalogueItem represents an application entry sent to a catalogue.

Description

The icon is an iconify mdi string; see https://icon-sets.iconify.design/mdi.

Methods

CatalogueItem. __init__( self , name: str , url: str , icon: str , description: str )

class CatalogueConsumer

Description

CatalogueConsumer is used to send over a CatalogueItem. None

Methods

CatalogueConsumer. __init__( self , charm , relation_name: str , item )

CatalogueConsumer. update_item( self , item: CatalogueItem )

Description

Update the catalogue item. None

CatalogueConsumer. unit_address( self , relation )

Return the unit address of the consumer, on which it is reachable.

Description

Requires ingress to be connected for it to be routable.

class CatalogueItemsChangedEvent

Description

Event emitted when the catalogue entries change. None

Methods

CatalogueItemsChangedEvent. __init__( self , handle , items )

CatalogueItemsChangedEvent. snapshot( self )

Description

Save catalogue entries information. None

CatalogueItemsChangedEvent. restore( self , snapshot )

Description

Restore catalogue entries information. None

class CatalogueEvents

Description

Events raised by CatalogueConsumer. None

class CatalogueProvider

Description

CatalogueProvider is the side of the relation that serves the actual service catalogue. None

Methods

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

CatalogueProvider. items( self )

Description

A list of apps sent over relation data. None