Bind9 K8S

  • OpenStack Charmers
Channel Revision Published Runs on
latest/edge 6 22 Sep 2023
Ubuntu 22.04
juju deploy bind9-k8s --channel edge
Show information

Platform:

charms.bind9_k8s.v0.bind_rndc

BindRndc Provides and Requires module.

This library contains the Requires and Provides classes for handling the bind_rndc interface. Import BindRndcRequires in your charm, with the charm object and the relation name: - self - "dns-backend" Two events are also available to respond to: - bind_rndc_ready - goneaway A basic example showing the usage of this relation follows:

from charms.bind9_k8s.v0.bind_rndc import (
    BindRndcRequires
)
class BindRndcClientCharm(CharmBase):
    def __init__(self, *args):
        super().__init__(*args)
        # BindRndc Requires
        self.bind_rndc = BindRndcRequires(
            self, "dns-backend"
        )
        self.framework.observe(
            self.bind_rndc.on.bind_rndc_ready,
            self._on_bind_rndc_ready
        )
        self.framework.observe(
            self.bind_rndc.on.goneaway,
            self._on_bind_rndc_goneaway
        )
    def _on_bind_rndc_ready(self, event):
        '''React to the Bind Rndc Ready event.
        This event happens when BindRndc relation is added to the
        model, relation is ready and/or relation data is changed.
        '''
        # Do something with the configuration provided by relation.
        pass
    def _on_bind_rndc_goneaway(self, event):
        '''React to the BindRndc goneaway event.
        This event happens when BindRndc relation is removed.
        '''
        # BindRndc Relation has goneaway.
        pass

class BindRndcReadyEvent

Description

Bind rndc ready event. None

Methods

BindRndcReadyEvent. __init__( self , handle , relation_id: int , relation_name: str , algorithm: str , secret: str )

BindRndcReadyEvent. snapshot( self )

Description

Return snapshot data that should be persisted. None

BindRndcReadyEvent. restore( self , snapshot )

Description

Restore the value state from a given snapshot. None

class BindRndcGoneAwayEvent

Description

Bind rndc gone away event. None

class BindRndcRequirerEvents

Description

List of events that the BindRndc requires charm can leverage. None

class BindRndcRequires

Description

Class to be instantiated by the requiring side of the relation. None

Methods

BindRndcRequires. __init__( self , charm , relation_name: str )

BindRndcRequires. host( self , relation )

Description

Return host from relation. None

BindRndcRequires. nonce( self )

Description

Return nonce from stored state. None

BindRndcRequires. get_rndc_key( self , relation )

Description

Get rndc keys. None

BindRndcRequires. reconcile_rndc_key( self , relation )

Description

Reconcile rndc key over the relation. None

class NewBindClientAttachedEvent

Description

New bind client attached event. None

Methods

NewBindClientAttachedEvent. __init__( self , handle , relation_id: int , relation_name: str )

NewBindClientAttachedEvent. snapshot( self )

Description

Return snapshot data that should be persisted. None

NewBindClientAttachedEvent. restore( self , snapshot )

Description

Restore the value state from a given snapshot. None

class BindClientUpdatedEvent

Description

Bind client updated event. None

Methods

BindClientUpdatedEvent. __init__( self , handle , relation_id: int , relation_name: str )

BindClientUpdatedEvent. snapshot( self )

Description

Return snapshot data that should be persisted. None

BindClientUpdatedEvent. restore( self , snapshot )

Description

Restore the value state from a given snapshot. None

class BindRndcProviderEvents

Description

List of events that the BindRndc provider charm can leverage. None

class BindRndcProvides

Description

Class to be instantiated by the providing side of the relation. None

Methods

BindRndcProvides. __init__( self , charm , relation_name: str )

BindRndcProvides. set_host( self , relation , host: str )

Description

Set host on the relation. None

BindRndcProvides. get_rndc_keys( self , relation )

Description

Get rndc keys. None

BindRndcProvides. set_rndc_client_key( self , relation , client: str , algorithm: str , secret )

Add rndc key to the relation.

Description

rndc_keys is a dict of dicts, keyed by client name. Each client has an algorithm and secret property. The secret is a Juju secret id, containing the actual secret needed to communicate over rndc.

BindRndcProvides. remove_rndc_client_key( self , relation , client )

Description

Remove rndc key from the relation. None