Skip to content

Commit bc3c628

Browse files
Generate vpn
1 parent 4d6d0db commit bc3c628

4 files changed

Lines changed: 23 additions & 7 deletions

File tree

services/vpn/oas_commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
b7d1b614138d667d378a5fd45e2a91539a7fb02e
1+
46de1033aa6379af6341423c3ff0e4cfb54f8350

services/vpn/src/stackit/vpn/models/bgp_filter_rule_match.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class BGPFilterRuleMatch(BaseModel):
2929
""" # noqa: E501
3030

3131
as_path_contains_any: Optional[
32-
Annotated[List[Annotated[int, Field(le=4294967294, strict=True, ge=64512)]], Field(max_length=10)]
32+
Annotated[List[Annotated[int, Field(le=4294967294, strict=True, ge=1)]], Field(max_length=10)]
3333
] = Field(
3434
default=None,
3535
description="Matches if the AS-PATH contains any one of the listed ASNs (logical OR within the list). Treated as an unordered set; ordering is not preserved by the storage layer. When combined with firstASN, both conditions must hold (logical AND, consistent with the rest of the match block). If firstASN is also listed here, its presence as the first hop is sufficient to satisfy this list; no duplicate hop is required. ",
@@ -39,7 +39,7 @@ class BGPFilterRuleMatch(BaseModel):
3939
default=None,
4040
description="Matches if the route carries any one of these BGP standard communities (logical OR within the list). Format is 'asn:value' per RFC 1997 (both halves must fit in a uint32, i.e. 0..4294967295). Extended, large and well-known communities are not supported. ",
4141
)
42-
first_asn: Optional[Annotated[int, Field(le=4294967294, strict=True, ge=64512)]] = Field(
42+
first_asn: Optional[Annotated[int, Field(le=4294967294, strict=True, ge=1)]] = Field(
4343
default=None,
4444
description="Matches if the first ASN (immediate neighbor) in the AS-PATH equals this ASN. Combines with asPathContainsAny using logical AND: when both are set, the first ASN must equal firstASN AND the path must additionally contain at least one ASN from asPathContainsAny. ",
4545
alias="firstASN",

services/vpn/src/stackit/vpn/models/bgp_tunnel_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ class BGPTunnelConfig(BaseModel):
3333
description="UUID of the BGPFilter to apply to incoming routes from this tunnel's BGP neighbor. The filter must exist in the same gateway. Multiple tunnels may reference the same BGPFilter; in that case the rules' 'match.peer' field can be used to scope behavior per neighbor. Outbound filtering is not yet supported; use gateway.bgp.overrideAdvertisedRoutes to control what is advertised. ",
3434
alias="inboundFilterId",
3535
)
36-
remote_asn: Annotated[int, Field(le=4294967294, strict=True, ge=64512)] = Field(
37-
description="ASN for private use (reserved by IANA), both 16Bit and 32Bit ranges are valid (RFC 6996). ",
36+
remote_asn: Annotated[int, Field(le=4294967294, strict=True, ge=1)] = Field(
37+
description='Number of an Autonomous System. Both 16Bit and 32Bit ranges are supported, excluding values reserved by: * RFC 7607 (0) * RFC 6793 (23456, AS_TRANS) * RFC 7300 (65535 and 4294967295, the "Last ASNs") ',
3838
alias="remoteAsn",
3939
)
4040
__properties: ClassVar[List[str]] = ["inboundFilterId", "remoteAsn"]

services/vpn/src/stackit/vpn/models/network_config.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515

1616
import json
1717
import pprint
18+
import re # noqa: F401
1819
from typing import Any, ClassVar, Dict, List, Optional, Set
1920
from uuid import UUID
2021

21-
from pydantic import BaseModel, ConfigDict, Field
22+
from pydantic import BaseModel, ConfigDict, Field, field_validator
2223
from pydantic_core import to_jsonable_python
2324
from typing_extensions import Annotated, Self
2425

@@ -28,7 +29,7 @@ class NetworkConfig(BaseModel):
2829
NetworkConfig
2930
""" # noqa: E501
3031

31-
predefined_network_prefix: Optional[List[Annotated[str, Field(strict=True)]]] = Field(
32+
predefined_network_prefix: Optional[Annotated[str, Field(strict=True)]] = Field(
3233
default=None,
3334
description="The IPv4 network prefix (CIDR notation) allocated for the VPN gateway. Must have a prefix length of /28 or larger. Once the gateway is created, is not possible to change this attribute. ",
3435
alias="predefinedNetworkPrefix",
@@ -38,6 +39,21 @@ class NetworkConfig(BaseModel):
3839
)
3940
__properties: ClassVar[List[str]] = ["predefinedNetworkPrefix", "routingTableId"]
4041

42+
@field_validator("predefined_network_prefix")
43+
def predefined_network_prefix_validate_regular_expression(cls, value):
44+
"""Validates the regular expression"""
45+
if value is None:
46+
return value
47+
48+
if not isinstance(value, str):
49+
value = str(value)
50+
51+
if not re.match(r"^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}(\/([0-9]|[1-2][0-9]|3[0-2]))?$", value):
52+
raise ValueError(
53+
r"must validate the regular expression /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}(\/([0-9]|[1-2][0-9]|3[0-2]))?$/"
54+
)
55+
return value
56+
4157
model_config = ConfigDict(
4258
validate_by_name=True,
4359
validate_by_alias=True,

0 commit comments

Comments
 (0)