-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #102 from Gmerold/TELCO-722-creating-fiveg-n4-inte…
…rface Adding info about the fiveg_n4 interface
- Loading branch information
Showing
6 changed files
with
174 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": {} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: {} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
providers: [] | ||
requirers: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.""" |