221 lines
6.9 KiB
Python
221 lines
6.9 KiB
Python
# generated by datamodel-codegen:
|
|
# filename: schema.tRo.json
|
|
# timestamp: 2026-02-20T04:31:38+00:00
|
|
|
|
from __future__ import annotations
|
|
|
|
from enum import Enum
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field, constr
|
|
|
|
|
|
class ApiVersion(Enum):
|
|
v1alpha1 = 'v1alpha1'
|
|
|
|
|
|
class Kind(Enum):
|
|
NetworkDefaultActionConfig = 'NetworkDefaultActionConfig'
|
|
|
|
|
|
class Ingress(Enum):
|
|
accept = 'accept'
|
|
block = 'block'
|
|
|
|
|
|
class DefaultActionConfigV1Alpha1(BaseModel):
|
|
model_config = ConfigDict(
|
|
extra='forbid',
|
|
)
|
|
apiVersion: ApiVersion = Field(
|
|
...,
|
|
description='apiVersion is the API version of the resource.\n',
|
|
title='apiVersion',
|
|
)
|
|
kind: Kind = Field(
|
|
..., description='kind is the kind of the resource.\n', title='kind'
|
|
)
|
|
ingress: Ingress | None = Field(
|
|
None,
|
|
description='Default action for all not explicitly configured ingress traffic: accept or block.\n',
|
|
title='ingress',
|
|
)
|
|
|
|
|
|
class EthernetChannelsConfig(BaseModel):
|
|
model_config = ConfigDict(
|
|
extra='forbid',
|
|
)
|
|
rx: int | None = Field(None, description='Number of RX channels.\n', title='rx')
|
|
tx: int | None = Field(None, description='Number of TX channels.\n', title='tx')
|
|
other: int | None = Field(
|
|
None, description='Number of other channels.\n', title='other'
|
|
)
|
|
combined: int | None = Field(
|
|
None, description='Number of combined channels.\n', title='combined'
|
|
)
|
|
|
|
|
|
class KindModel(Enum):
|
|
EthernetConfig = 'EthernetConfig'
|
|
|
|
|
|
class EthernetRingsConfig(BaseModel):
|
|
model_config = ConfigDict(
|
|
extra='forbid',
|
|
)
|
|
rx: int | None = Field(None, description='Number of RX rings.\n', title='rx')
|
|
tx: int | None = Field(None, description='Number of TX rings.\n', title='tx')
|
|
rx_mini: int | None = Field(
|
|
None, alias='rx-mini', description='Number of RX mini rings.\n', title='rx-mini'
|
|
)
|
|
rx_jumbo: int | None = Field(
|
|
None,
|
|
alias='rx-jumbo',
|
|
description='Number of RX jumbo rings.\n',
|
|
title='rx-jumbo',
|
|
)
|
|
rx_buf_len: int | None = Field(
|
|
None, alias='rx-buf-len', description='RX buffer length.\n', title='rx-buf-len'
|
|
)
|
|
cqe_size: int | None = Field(
|
|
None, alias='cqe-size', description='CQE size.\n', title='cqe-size'
|
|
)
|
|
tx_push: bool | None = Field(
|
|
None, alias='tx-push', description='TX push enabled.\n', title='tx-push'
|
|
)
|
|
rx_push: bool | None = Field(
|
|
None, alias='rx-push', description='RX push enabled.\n', title='rx-push'
|
|
)
|
|
tx_push_buf_len: int | None = Field(
|
|
None,
|
|
alias='tx-push-buf-len',
|
|
description='TX push buffer length.\n',
|
|
title='tx-push-buf-len',
|
|
)
|
|
tcp_data_split: bool | None = Field(
|
|
None,
|
|
alias='tcp-data-split',
|
|
description='TCP data split enabled.\n',
|
|
title='tcp-data-split',
|
|
)
|
|
|
|
|
|
class IngressRule(BaseModel):
|
|
model_config = ConfigDict(
|
|
extra='forbid',
|
|
)
|
|
subnet: constr(pattern=r'^[0-9a-f.:]+/\d{1,3}$') | None = Field(
|
|
None, description='Subnet defines a source subnet.\n', title='subnet'
|
|
)
|
|
except_: constr(pattern=r'^[0-9a-f.:]+/\d{1,3}$') | None = Field(
|
|
None,
|
|
alias='except',
|
|
description='Except defines a source subnet to exclude from the rule, it gets excluded from the subnet.\n',
|
|
title='except',
|
|
)
|
|
|
|
|
|
class KindModel1(Enum):
|
|
KubeSpanEndpoints = 'KubeSpanEndpoints'
|
|
|
|
|
|
class KubespanEndpointsConfigV1Alpha1(BaseModel):
|
|
model_config = ConfigDict(
|
|
extra='forbid',
|
|
)
|
|
apiVersion: ApiVersion = Field(
|
|
...,
|
|
description='apiVersion is the API version of the resource.\n',
|
|
title='apiVersion',
|
|
)
|
|
kind: KindModel1 = Field(
|
|
..., description='kind is the kind of the resource.\n', title='kind'
|
|
)
|
|
extraAnnouncedEndpoints: list[str] | None = Field(
|
|
None,
|
|
description='A list of extra Wireguard endpoints to announce from this machine.\n\nTalos automatically adds endpoints based on machine addresses, public IP, etc.\nThis field allows to add extra endpoints which are managed outside of Talos, e.g. NAT mapping.\n',
|
|
title='extraAnnouncedEndpoints',
|
|
)
|
|
|
|
|
|
class KindModel2(Enum):
|
|
NetworkRuleConfig = 'NetworkRuleConfig'
|
|
|
|
|
|
class Protocol(Enum):
|
|
tcp = 'tcp'
|
|
udp = 'udp'
|
|
icmp = 'icmp'
|
|
icmpv6 = 'icmpv6'
|
|
|
|
|
|
class RulePortSelector(BaseModel):
|
|
model_config = ConfigDict(
|
|
extra='forbid',
|
|
)
|
|
ports: list[int | str] | None = Field(
|
|
None,
|
|
description='Ports defines a list of port ranges or single ports.\nThe port ranges are inclusive, and should not overlap.\n',
|
|
title='ports',
|
|
)
|
|
protocol: Protocol | None = Field(
|
|
None,
|
|
description='Protocol defines traffic protocol (e.g. TCP or UDP).\n',
|
|
title='protocol',
|
|
)
|
|
|
|
|
|
class EthernetConfigV1Alpha1(BaseModel):
|
|
model_config = ConfigDict(
|
|
extra='forbid',
|
|
)
|
|
apiVersion: ApiVersion = Field(
|
|
...,
|
|
description='apiVersion is the API version of the resource.\n',
|
|
title='apiVersion',
|
|
)
|
|
kind: KindModel = Field(
|
|
..., description='kind is the kind of the resource.\n', title='kind'
|
|
)
|
|
name: str = Field(..., description='Name of the link (interface).\n', title='name')
|
|
features: dict[constr(pattern=r'.*'), bool] | None = Field(
|
|
None,
|
|
description='Configuration for Ethernet features.\n\nSet of features available and whether they can be enabled or disabled is driver specific.\nUse talosctl get ethernetstatus <link> -o yaml to get the list of available features and\ntheir current status.\n',
|
|
title='features',
|
|
)
|
|
rings: EthernetRingsConfig | None = Field(
|
|
None,
|
|
description='Configuration for Ethernet link rings.\n\nThis is similar to ethtool -G command.\n',
|
|
title='rings',
|
|
)
|
|
channels: EthernetChannelsConfig | None = Field(
|
|
None,
|
|
description='Configuration for Ethernet link channels.\n\nThis is similar to ethtool -L command.\n',
|
|
title='channels',
|
|
)
|
|
|
|
|
|
class RuleConfigV1Alpha1(BaseModel):
|
|
model_config = ConfigDict(
|
|
extra='forbid',
|
|
)
|
|
apiVersion: ApiVersion = Field(
|
|
...,
|
|
description='apiVersion is the API version of the resource.\n',
|
|
title='apiVersion',
|
|
)
|
|
kind: KindModel2 = Field(
|
|
..., description='kind is the kind of the resource.\n', title='kind'
|
|
)
|
|
name: str = Field(..., description='Name of the config document.\n', title='name')
|
|
portSelector: RulePortSelector | None = Field(
|
|
None,
|
|
description='Port selector defines which ports and protocols on the host are affected by the rule.\n',
|
|
title='portSelector',
|
|
)
|
|
ingress: list[IngressRule] | None = Field(
|
|
None,
|
|
description='Ingress defines which source subnets are allowed to access the host ports/protocols defined by the portSelector.\n',
|
|
title='ingress',
|
|
)
|