forked from canonical/charm-relation-interfaces
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.py
32 lines (24 loc) · 839 Bytes
/
schema.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""This file defines the schemas for the provider and requirer sides of the `fiveg_nrf` interface.
It exposes two interfaces.schema_base.DataBagSchema subclasses called:
- ProviderSchema
- RequirerSchema
Examples:
ProviderSchema:
unit: <empty>
app: {"url": "https://nrf-example.com:1234"}
RequirerSchema:
unit: <empty>
app: <empty>
"""
from pydantic import BaseModel, AnyHttpUrl, Field
from interface_tester.schema_base import DataBagSchema
class MyProviderAppData(BaseModel):
url: AnyHttpUrl = Field(
description="url to reach the NRF.",
examples=["https://nrf-example.com:1234"]
)
class ProviderSchema(DataBagSchema):
"""Provider schema for fiveg_nrf."""
app: MyProviderAppData
class RequirerSchema(DataBagSchema):
"""Requirer schema for fiveg_nrf."""