Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding fiveg gnb identity relation interface #103

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,12 @@ To quickly get started, see the [template interface](https://github.com/canonica

| Category | Interface | Status |
|------------|:--------------------------------------------------|:-------------------------------------------------------------------:|
| Charmed 5G | [`fiveg_nrf`](interfaces/fiveg_nrf/v0/README.md) | ![Status: Draft](https://img.shields.io/badge/Status-Draft-orange) |
| Charmed 5G | [`fiveg_gnb_identity`](interfaces/fiveg_gnb_identity/v0/README.md) | ![Status: Draft](https://img.shields.io/badge/Status-Draft-orange) |
| | [`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) |
| | [`sdcore_management`](interfaces/sdcore_management/v0/README.md) | ![Status: Draft](https://img.shields.io/badge/Status-Draft-orange) |
| | [`sdcore_management`](interfaces/sdcore_management/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_gnb_identity/v0/provider.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"title": "ProviderSchema",
"description": "The schema for the provider side of the fiveg_gnb_identity interface.",
"type": "object",
"properties": {
"unit": {
"$ref": "#/definitions/BaseModel"
},
"app": {
"$ref": "#/definitions/FivegGnbIdentityProviderAppData"
}
},
"required": [
"app"
],
"definitions": {
"BaseModel": {
"title": "BaseModel",
"type": "object",
"properties": {}
},
"FivegGnbIdentityProviderAppData": {
"title": "FivegGnbIdentityProviderAppData",
"type": "object",
"properties": {
"gnb_name": {
"title": "Gnb Name",
"description": "Name of the gnB.",
"examples": [
"gnb001"
],
"type": "string"
},
"tac": {
"title": "Tac",
"description": "Tracking Area Code",
"examples": [
"0001"
],
"type": "string"
}
},
"required": [
"gnb_name",
"tac"
]
}
}
}
20 changes: 20 additions & 0 deletions docs/json_schemas/fiveg_gnb_identity/v0/requirer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"title": "RequirerSchema",
"description": "The schema for the requirer side of the fiveg_gnb_identity interface.",
"type": "object",
"properties": {
"unit": {
"$ref": "#/definitions/BaseModel"
},
"app": {
"$ref": "#/definitions/BaseModel"
}
},
"definitions": {
"BaseModel": {
"title": "BaseModel",
"type": "object",
"properties": {}
}
}
}
49 changes: 49 additions & 0 deletions interfaces/fiveg_gnb_identity/v0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# `fiveg_gnb_identity`

## Usage

Within 5G, the gNodeB (a 5G base station) identity needs to be known by other components.

The `fiveg_gnb_identity` relation interface describes the expected behavior of any charm claiming to be able to provide or consume the gNodeB identity information.

In a typical 5G network, the provider of this interface would be a gNodeB. The requirer of this interface would be the NMS (Network Management System).

## Direction

```mermaid
flowchart TD
Provider -- gNodeB Name, TAC --> Requirer
```

As with all Juju relations, the `fiveg_gnb_identity` 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 name of the gNodeB and TAC (Traking Area Code).


### Requirer

- Is expected to use the name of the gNodeB name and TAC (Traking Area Code).

## Relation Data

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

#### Example

```yaml
provider:
app: {
"gnb_name": "gnb001",
"tac": "001"
}
unit: {}
requirer:
app: {}
unit: {}
```
2 changes: 2 additions & 0 deletions interfaces/fiveg_gnb_identity/v0/charms.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
providers: []
requirers: []
40 changes: 40 additions & 0 deletions interfaces/fiveg_gnb_identity/v0/schema.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
"""This file defines the schemas for the provider and requirer sides of the `fiveg_gnb_identity` relation interface.

It must expose two interfaces.schema_base.DataBagSchema subclasses called:
- ProviderSchema
- RequirerSchema

Examples:
ProviderSchema:
unit: <empty>
app: {
"gnb_name": "gnb001",
"tac": "0001"
}
RequirerSchema:
unit: <empty>
app: <empty>
"""

from interface_tester.schema_base import DataBagSchema
from pydantic import BaseModel, Field

patriciareinoso marked this conversation as resolved.
Show resolved Hide resolved

class FivegGnbIdentityProviderAppData(BaseModel):
gnb_name: str = Field(
description="Name of the gnB.",
examples=["gnb001"]
)
tac: str = Field(
description="Tracking Area Code",
examples=["0001"]
)

patriciareinoso marked this conversation as resolved.
Show resolved Hide resolved

class ProviderSchema(DataBagSchema):
"""The schema for the provider side of the fiveg_gnb_identity interface."""
app: FivegGnbIdentityProviderAppData

patriciareinoso marked this conversation as resolved.
Show resolved Hide resolved

class RequirerSchema(DataBagSchema):
"""The schema for the requirer side of the fiveg_gnb_identity interface."""