Skip to content

Commit

Permalink
Merge pull request #102 from Gmerold/TELCO-722-creating-fiveg-n4-inte…
Browse files Browse the repository at this point in the history
…rface

Adding info about the fiveg_n4 interface
  • Loading branch information
simskij authored Sep 15, 2023
2 parents cc5941d + b272d50 commit 5d86a5a
Show file tree
Hide file tree
Showing 6 changed files with 174 additions and 5 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,13 @@ To quickly get started, see the [template interface](https://github.com/canonica

### Telco

| Category | Interface | Status |
|------------|:-------------------------------------------------|:-------------------------------------------------------------------:|
| Charmed 5G | [`fiveg_nrf`](interfaces/fiveg_nrf/v0/README.md) | ![Status: Draft](https://img.shields.io/badge/Status-Draft-orange) |
| | [`fiveg_n2`](interfaces/fiveg_n2/v0/README.md) | ![Status: Draft](https://img.shields.io/badge/Status-Draft-orange) |
| | [`fiveg_n3`](interfaces/fiveg_n3/v0/README.md) | ![Status: Draft](https://img.shields.io/badge/Status-Draft-orange) |
| Category | Interface | Status |
|------------|:--------------------------------------------------|:-------------------------------------------------------------------:|
| Charmed 5G | [`fiveg_nrf`](interfaces/fiveg_nrf/v0/README.md) | ![Status: Draft](https://img.shields.io/badge/Status-Draft-orange) |
| | [`fiveg_n2`](interfaces/fiveg_n2/v0/README.md) | ![Status: Draft](https://img.shields.io/badge/Status-Draft-orange) |
| | [`fiveg_n3`](interfaces/fiveg_n3/v0/README.md) | ![Status: Draft](https://img.shields.io/badge/Status-Draft-orange) |
| | [`fiveg_n4`](interfaces/fiveg_n4/v0/README.md) | ![Status: Draft](https://img.shields.io/badge/Status-Draft-orange) |


For a more detailed explanation of statuses and how they should be used, see [the legend](https://github.com/canonical/charm-relation-interfaces/blob/main/LEGEND.md).

Expand Down
49 changes: 49 additions & 0 deletions docs/json_schemas/fiveg_n4/v0/provider.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"title": "ProviderSchema",
"description": "Provider schema for fiveg_n4.",
"type": "object",
"properties": {
"unit": {
"$ref": "#/definitions/BaseModel"
},
"app": {
"$ref": "#/definitions/FivegN4ProviderAppData"
}
},
"required": [
"app"
],
"definitions": {
"BaseModel": {
"title": "BaseModel",
"type": "object",
"properties": {}
},
"FivegN4ProviderAppData": {
"title": "FivegN4ProviderAppData",
"type": "object",
"properties": {
"upf_hostname": {
"title": "Upf Hostname",
"description": "Name of the host exposing the UPF's N4 interface.",
"examples": [
"upf.uplane-cloud.canonical.com"
],
"type": "string"
},
"upf_port": {
"title": "Upf Port",
"description": "Port on which UPF's N4 interface is exposed.",
"examples": [
8805
],
"type": "integer"
}
},
"required": [
"upf_hostname",
"upf_port"
]
}
}
}
20 changes: 20 additions & 0 deletions docs/json_schemas/fiveg_n4/v0/requirer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"title": "RequirerSchema",
"description": "Requirer schema for fiveg_n4.",
"type": "object",
"properties": {
"unit": {
"$ref": "#/definitions/BaseModel"
},
"app": {
"$ref": "#/definitions/BaseModel"
}
},
"definitions": {
"BaseModel": {
"title": "BaseModel",
"type": "object",
"properties": {}
}
}
}
53 changes: 53 additions & 0 deletions interfaces/fiveg_n4/v0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# `fiveg_n4`

## Usage

Within 5G, the User Plane Function (UPF) supports features and capabilities to facilitate
user plane operation. Examples include: packet routing and forwarding, interconnection
to the Data Network, policy enforcement and data buffering.

The `fiveg_n4` relation interface describes the expected behavior of any charm claiming to be able
to provide or consume the UPF information in order to establish communication over the N4 interface.
In a typical 5G network, the N4 interface is used between UPF and SMF.

## Direction

```mermaid
flowchart TD
Provider -- Hostname, Port --> Requirer
```

As with all Juju relations, the `fiveg_n4` interface consists of two parties: a Provider
and a Requirer.

## Behavior

Both the Requirer and the Provider need to adhere to criteria to be considered compatible
with the interface.

### Provider

- Is expected to provide the hostname and the port of the UPF's N4 interface.

### Requirer

- Is expected to consume the hostname and the port of the UPF's N4 interface in order to establish
communication over that interface.

## Relation Data

[\[Pydantic Schema\]](./schema.py)

#### Example

```yaml
provider:
app: {
"upf_hostname": "upf.uplane-cloud.canonical.com",
"upf_port": "8805"
}
unit: {}
requirer:
app: {}
unit: {}
```
2 changes: 2 additions & 0 deletions interfaces/fiveg_n4/v0/charms.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
providers: []
requirers: []
43 changes: 43 additions & 0 deletions interfaces/fiveg_n4/v0/schema.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
"""This file defines the schemas for the provider and requirer sides of the `fiveg_n4` interface.
It exposes two `interfaces.schema_base.DataBagSchema` subclasses called:
- `ProviderSchema`
- `RequirerSchema`
Examples:
ProviderSchema:
unit: <empty>
app: {
"upf_hostname": "upf.uplane-cloud.canonical.com",
"upf_port": 8805
}
RequirerSchema:
unit: <empty>
app: <empty>
"""

from pydantic import BaseModel, Field

from interface_tester.schema_base import DataBagSchema


class FivegN4ProviderAppData(BaseModel):
upf_hostname: str = Field(
description="Name of the host exposing the UPF's N4 interface.",
examples=["upf.uplane-cloud.canonical.com"]
)
upf_port: int = Field(
description="Port on which UPF's N4 interface is exposed.",
examples=[8805]
)


class ProviderSchema(DataBagSchema):
"""Provider schema for fiveg_n4."""
app: FivegN4ProviderAppData


class RequirerSchema(DataBagSchema):
"""Requirer schema for fiveg_n4."""

0 comments on commit 5d86a5a

Please sign in to comment.