54 lines
839 B
Python
54 lines
839 B
Python
import strawberry
|
|
|
|
|
|
@strawberry.type
|
|
class RouterTlsConfig:
|
|
cert_resolver: str
|
|
|
|
|
|
@strawberry.type
|
|
class Router:
|
|
id: str
|
|
entry_points: list[str]
|
|
service: str
|
|
rule: str
|
|
tls_config: "RouterTlsConfig"
|
|
|
|
|
|
@strawberry.type
|
|
class Server:
|
|
url: str
|
|
port: str
|
|
scheme: str
|
|
|
|
|
|
@strawberry.type
|
|
class LoadBalancer:
|
|
servers: list["Server"]
|
|
|
|
|
|
@strawberry.type
|
|
class Service:
|
|
id: str
|
|
load_balancer: "LoadBalancer"
|
|
|
|
|
|
@strawberry.type
|
|
class HttpConfiguration:
|
|
routers: list["Router"]
|
|
services: list["Service"]
|
|
|
|
|
|
def get_http_configuration() -> "HttpConfiguration":
|
|
return HttpConfiguration(routers=[], services=[])
|
|
|
|
|
|
@strawberry.type
|
|
class Query:
|
|
http_configuration: "HttpConfiguration" = strawberry.field(
|
|
resolver=get_http_configuration
|
|
)
|
|
|
|
|
|
schema = strawberry.Schema(query=Query)
|