Skip to content

Commit 4e4080d

Browse files
Generate dns
1 parent c7340e3 commit 4e4080d

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

services/dns/src/stackit/dns/models/create_record_set_payload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class CreateRecordSetPayload(BaseModel):
3333
default=None, description="user comment"
3434
)
3535
name: Annotated[str, Field(min_length=1, strict=True, max_length=253)] = Field(
36-
description="name of the record which should be a valid domain according to rfc1035 Section 2.3.4"
36+
description="name of the record which should be a valid domain according to rfc1035 Section 2.3.4. For APEX records (same as zone name), the zone name itself has to be put in here."
3737
)
3838
records: List[RecordPayload] = Field(description="records")
3939
ttl: Optional[Annotated[int, Field(le=99999999, strict=True, ge=60)]] = Field(

services/dns/src/stackit/dns/models/record_set.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class RecordSet(BaseModel):
4545
)
4646
id: StrictStr = Field(description="rr set id")
4747
name: Annotated[str, Field(min_length=1, strict=True, max_length=253)] = Field(
48-
description="name of the record which should be a valid domain according to rfc1035 Section 2.3.4"
48+
description="name of the record which should be a valid domain according to rfc1035 Section 2.3.4. For APEX records (same as zone name), the zone name itself has to be put in here."
4949
)
5050
records: Annotated[List[Record], Field(min_length=1)] = Field(description="records")
5151
state: StrictStr = Field(description="record set state")
@@ -93,9 +93,28 @@ def state_validate_enum(cls, value):
9393
@field_validator("type")
9494
def type_validate_enum(cls, value):
9595
"""Validates the enum"""
96-
if value not in set(["A", "AAAA", "SOA", "CNAME", "NS", "MX", "TXT", "SRV", "PTR", "ALIAS", "DNAME", "CAA"]):
96+
if value not in set(
97+
[
98+
"A",
99+
"AAAA",
100+
"SOA",
101+
"CNAME",
102+
"NS",
103+
"MX",
104+
"TXT",
105+
"SRV",
106+
"PTR",
107+
"ALIAS",
108+
"DNAME",
109+
"CAA",
110+
"CSYNC",
111+
"HINFO",
112+
"SSHFP",
113+
"HTTPS",
114+
]
115+
):
97116
raise ValueError(
98-
"must be one of enum values ('A', 'AAAA', 'SOA', 'CNAME', 'NS', 'MX', 'TXT', 'SRV', 'PTR', 'ALIAS', 'DNAME', 'CAA')"
117+
"must be one of enum values ('A', 'AAAA', 'SOA', 'CNAME', 'NS', 'MX', 'TXT', 'SRV', 'PTR', 'ALIAS', 'DNAME', 'CAA', 'CSYNC', 'HINFO', 'SSHFP', 'HTTPS')"
99118
)
100119
return value
101120

0 commit comments

Comments
 (0)