SD-CORE 5G UPF

  • By Canonical Telco
Channel Revision Published Runs on
latest/edge 68 07 Dec 2023
Ubuntu 22.04
1.4/edge 147 02 May 2024
Ubuntu 22.04
1.3/edge 96 04 Apr 2024
Ubuntu 22.04
juju deploy sdcore-upf --channel edge
Show information

Platform:

charms.sdcore_upf.v0.fiveg_n3

Library for the fiveg_n3 relation.

This library offers a way of providing and consuming an IP address of the SDCORE's UPF. In a typical 5G network, UPF's IP address is consumed by the gNodeBs, in order to establish communication over the N3 interface.

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

cd some-charm
charmcraft fetch-lib charms.sdcore_upf.v0.fiveg_n3

Add the following libraries to the charm's requirements.txt file:

  • pydantic
  • pytest-interface-tester

Charms providing the fiveg_n3 relation should use N3Provides. Typical usage of this class would look something like:

```python
...
from charms.sdcore_upf.v0.fiveg_n3 import N3Provides
...

class SomeProviderCharm(CharmBase):

    def __init__(self, *args):
        ...
        self.fiveg_n3 = N3Provides(charm=self, relation_name="fiveg_n3")
        ...
        self.framework.observe(self.fiveg_n3.on.fiveg_n3_request, self._on_fiveg_n3_request)

    def _on_fiveg_n3_request(self, event):
        ...
        self.fiveg_n3.publish_upf_information(
            relation_id=event.relation_id,
            upf_ip_address=ip_address,
        )
```

And a corresponding section in charm's `metadata.yaml`:
```
provides:
    fiveg_n3:  # Relation name
        interface: fiveg_n3  # Relation interface
```

Charms that require the fiveg_n3 relation should use N3Requires. Typical usage of this class would look something like:

```python
...
from charms.sdcore_upf.v0.fiveg_n3 import N3Requires
...

class SomeRequirerCharm(CharmBase):

    def __init__(self, *args):
        ...
        self.fiveg_n3 = N3Requires(charm=self, relation_name="fiveg_n3")
        ...
        self.framework.observe(self.upf.on.fiveg_n3_available, self._on_fiveg_n3_available)

    def _on_fiveg_n3_available(self, event):
        upf_ip_address = event.upf_ip_address
        # Do something with the UPF's IP address
```

And a corresponding section in charm's `metadata.yaml`:
```
requires:
    fiveg_n3:  # Relation name
        interface: fiveg_n3  # Relation interface
```

class ProviderAppData

Description

Provider app data for fiveg_n3. None

class ProviderSchema

Description

Provider schema for fiveg_n3. None

def data_matches_provider_schema(data: dict)

Returns whether data matches provider schema.

Arguments

data (dict)

Data to be validated.

Returns

True if data matches provider schema, False otherwise.

class FiveGN3RequestEvent

Description

Dataclass for the fiveg_n3 request event. None

Methods

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

Description

Sets relation id. None

FiveGN3RequestEvent. snapshot( self )

Description

Returns event data. None

FiveGN3RequestEvent. restore( self , snapshot )

Description

Restores event data. None

class N3ProviderCharmEvents

Description

Custom events for the N3Provider. None

class N3Provides

Description

Class to be instantiated by provider of the fiveg_n3. None

Methods

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

Observes relation joined event.

Arguments

charm

Juju charm

relation_name (str)

Relation name

N3Provides. publish_upf_information( self , relation_id: int , upf_ip_address: str )

Sets UPF's IP address in the relation data.

Arguments

relation_id (str)

Relation ID

upf_ip_address (str)

UPF's IP address

class N3AvailableEvent

Description

Dataclass for the fiveg_n3 available event. None

Methods

N3AvailableEvent. __init__( self , handle , upf_ip_address: str )

Description

Sets certificate. None

N3AvailableEvent. snapshot( self )

Description

Returns event data. None

N3AvailableEvent. restore( self , snapshot )

Description

Restores event data. None

class N3RequirerCharmEvents

Description

Custom events for the N3Requirer. None

class N3Requires

Description

Class to be instantiated by requirer of the fiveg_n3. None

Methods

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

Observes relation joined and relation changed events.

Arguments

charm

Juju charm

relation_name (str)

Relation name