magma-orc8r-certifier

  • Canonical Telco
Channel Revision Published Runs on
latest/stable 65 30 May 2023
Ubuntu 22.04 Ubuntu 20.04
latest/stable 55 07 Mar 2023
Ubuntu 22.04 Ubuntu 20.04
latest/beta 40 20 Oct 2022
Ubuntu 20.04
latest/edge 64 05 May 2023
Ubuntu 22.04 Ubuntu 20.04
latest/edge 56 14 Mar 2023
Ubuntu 22.04 Ubuntu 20.04
1.8/stable 65 30 May 2023
Ubuntu 22.04
1.8/candidate 65 30 May 2023
Ubuntu 22.04
1.8/beta 65 30 May 2023
Ubuntu 22.04
1.8/edge 65 30 May 2023
Ubuntu 22.04
1.6/stable 55 24 Feb 2023
Ubuntu 20.04
1.6/candidate 55 24 Feb 2023
Ubuntu 20.04
1.6/beta 55 24 Feb 2023
Ubuntu 20.04
1.6/edge 55 24 Feb 2023
Ubuntu 20.04
juju deploy magma-orc8r-certifier
Show information

Platform:

charms.magma_orc8r_certifier.v0.cert_root_ca

Cert RootCA Library.

This library offers ways of providing and consuming a rootCA certificate.

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

cd some-charm
charmcraft fetch-lib charms.magma_orc8r_certifier.v0.cert_root_ca

Charms providing rootCA certificate should use CertRootCAProvides. Typical usage of this class would look something like:

```python
...
from charms.magma_orc8r_certifier.v0.cert_root_ca import CertRootCAProvides
...

class SomeProviderCharm(CharmBase):

    def __init__(self, *args):
        ...
        self.cert_root_ca = CertRootCAProvides(charm=self, relationship_name="cert-root-ca")
        ...
        self.framework.observe(
            self.cert_root_ca.on.certificate_request, self._on_certificate_request
        )

    def _on_certificate_request(self, event):
        ...
        self.cert_root_ca.set_certificate(
            relation_id=event.relation_id,
            certificate=certificate,
        )
```

And a corresponding section in charm's `metadata.yaml`:
```
provides:
    cert-root-ca:  # Relation name
        interface: cert-root-ca  # Relation interface
```

Charms that require rootCA certificate should use CertRootCARequires. Typical usage of this class would look something like:

```python
...
from charms.magma_orc8r_certifier.v0.cert_root_ca import CertRootCARequires
...

class SomeRequirerCharm(CharmBase):

    def __init__(self, *args):
        ...
        self.cert_root_ca = CertRootCARequires(charm=self, relationship_name="cert-root-ca")
        ...
        self.framework.observe(
            self.cert_root_ca.on.certificate_available, self._on_certificate_available
        )

    def _on_certificate_available(self, event):
        certificate = event.certificate
        # Do something with the certificate
```

And a corresponding section in charm's `metadata.yaml`:
```
requires:
    cert-root-ca:  # Relation name
        interface: cert-root-ca  # Relation interface
```

class CertificateRequestEvent

Description

Dataclass for Certificate request events. None

Methods

CertificateRequestEvent. __init__( self , handle , relation_id: int )

Description

Sets relation id. None

CertificateRequestEvent. snapshot( self )

Description

Returns event data. None

CertificateRequestEvent. restore( self , snapshot )

Description

Restores event data. None

class CertRootCAProviderCharmEvents

Description

All custom events for the CertRootProvider. None

class CertRootCAProvides

Description

Class to be instantiated by provider of root certificate. None

Methods

CertRootCAProvides. __init__( self , charm: CharmBase , relationship_name: str )

Observes relation joined event.

Arguments

charm

Juju charm

relationship_name (str)

Relation name

CertRootCAProvides. set_certificate( self , relation_id: int , certificate: str )

Sets private key in relation data.

Arguments

relation_id (str)

Relation ID

certificate (str)

Certificate

Returns

None

class CertificateAvailableEvent

Description

Dataclass for Certificate available events. None

Methods

CertificateAvailableEvent. __init__( self , handle , certificate: str )

Description

Sets certificate. None

CertificateAvailableEvent. snapshot( self )

Description

Returns event data. None

CertificateAvailableEvent. restore( self , snapshot )

Description

Restores event data. None

class CertRootCARequirerCharmEvents

Description

All custom events for the CertRootRequirer. None

class CertRootCARequires

Description

Class to be instantiated by requirer of rootCA certificate. None

Methods

CertRootCARequires. __init__( self , charm: CharmBase , relationship_name: str )

Observes relation joined and relation changed events.

Arguments

charm

Juju charm

relationship_name (str)

Relation name