diff --git a/README.md b/README.md index e0b40713..55c4fbfb 100644 --- a/README.md +++ b/README.md @@ -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). diff --git a/docs/json_schemas/fiveg_n4/v0/provider.json b/docs/json_schemas/fiveg_n4/v0/provider.json new file mode 100644 index 00000000..c520d5b8 --- /dev/null +++ b/docs/json_schemas/fiveg_n4/v0/provider.json @@ -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" + ] + } + } +} \ No newline at end of file diff --git a/docs/json_schemas/fiveg_n4/v0/requirer.json b/docs/json_schemas/fiveg_n4/v0/requirer.json new file mode 100644 index 00000000..f0013996 --- /dev/null +++ b/docs/json_schemas/fiveg_n4/v0/requirer.json @@ -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": {} + } + } +} \ No newline at end of file diff --git a/interfaces/fiveg_n4/v0/README.md b/interfaces/fiveg_n4/v0/README.md new file mode 100644 index 00000000..33f1bebb --- /dev/null +++ b/interfaces/fiveg_n4/v0/README.md @@ -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: {} +``` diff --git a/interfaces/fiveg_n4/v0/charms.yaml b/interfaces/fiveg_n4/v0/charms.yaml new file mode 100644 index 00000000..d6d06c41 --- /dev/null +++ b/interfaces/fiveg_n4/v0/charms.yaml @@ -0,0 +1,2 @@ +providers: [] +requirers: [] diff --git a/interfaces/fiveg_n4/v0/schema.py b/interfaces/fiveg_n4/v0/schema.py new file mode 100644 index 00000000..c7336dfa --- /dev/null +++ b/interfaces/fiveg_n4/v0/schema.py @@ -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: + app: { + "upf_hostname": "upf.uplane-cloud.canonical.com", + "upf_port": 8805 + } + + RequirerSchema: + unit: + app: +""" + +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."""