Skip to content

Commit 8e0d328

Browse files
Generate loadbalancer
1 parent 1666049 commit 8e0d328

File tree

3 files changed

+51
-3
lines changed

3 files changed

+51
-3
lines changed

services/loadbalancer/src/stackit/loadbalancer/models/create_load_balancer_payload.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ class CreateLoadBalancerPayload(BaseModel):
5858
default=None,
5959
description="There is a maximum listener count of 20. Port and protocol limitations: - UDP listeners cannot have the same port. - TCP-derived listeners cannot have the same port. A TCP-derived listener is any listener that listens on a TCP port. As of now those are: TCP, TCP_PROXY, and PROTOCOL_TLS_PASSTHROUGH. The only exception is, if all listeners for the same port are PROTOCOL_TLS_PASSTHROUGH. - PROTOCOL_TLS_PASSTHROUGH listeners cannot have the same port and at least one common domain name. - PROTOCOL_TLS_PASSTHROUGH listeners can have the same domain name and different ports though (e.g. ports 443 and 8443 for domain example.com). - PROTOCOL_TLS_PASSTHROUGH listeners without a domain name serve as a default listener and you can have only one default listener. ",
6060
)
61+
load_balancer_security_group: Optional[SecurityGroup] = Field(
62+
default=None,
63+
description="Security Group permitting network traffic from the LoadBalancer to the targets. Useful when disableTargetSecurityGroupAssignment=true to manually assign target security groups to targets.",
64+
alias="loadBalancerSecurityGroup",
65+
)
6166
name: Optional[Annotated[str, Field(strict=True)]] = Field(
6267
default=None, description="Load balancer name. Not changeable after creation."
6368
)
@@ -85,7 +90,7 @@ class CreateLoadBalancerPayload(BaseModel):
8590
)
8691
target_security_group: Optional[SecurityGroup] = Field(
8792
default=None,
88-
description="Security Group permitting network traffic from the LoadBalancer to the targets. Useful when disableTargetSecurityGroupAssignment=true to manually assign target security groups to targets.",
93+
description="Security Group that allows the targets to receive traffic from the LoadBalancer. Useful when disableTargetSecurityGroupAssignment=true to manually assign target security groups to targets.",
8994
alias="targetSecurityGroup",
9095
)
9196
version: Optional[StrictStr] = Field(
@@ -97,6 +102,7 @@ class CreateLoadBalancerPayload(BaseModel):
97102
"errors",
98103
"externalAddress",
99104
"listeners",
105+
"loadBalancerSecurityGroup",
100106
"name",
101107
"networks",
102108
"options",
@@ -167,10 +173,12 @@ def to_dict(self) -> Dict[str, Any]:
167173
* OpenAPI `readOnly` fields are excluded.
168174
* OpenAPI `readOnly` fields are excluded.
169175
* OpenAPI `readOnly` fields are excluded.
176+
* OpenAPI `readOnly` fields are excluded.
170177
"""
171178
excluded_fields: Set[str] = set(
172179
[
173180
"errors",
181+
"load_balancer_security_group",
174182
"private_address",
175183
"region",
176184
"status",
@@ -197,6 +205,9 @@ def to_dict(self) -> Dict[str, Any]:
197205
if _item:
198206
_items.append(_item.to_dict())
199207
_dict["listeners"] = _items
208+
# override the default output from pydantic by calling `to_dict()` of load_balancer_security_group
209+
if self.load_balancer_security_group:
210+
_dict["loadBalancerSecurityGroup"] = self.load_balancer_security_group.to_dict()
200211
# override the default output from pydantic by calling `to_dict()` of each item in networks (list)
201212
_items = []
202213
if self.networks:
@@ -242,6 +253,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
242253
if obj.get("listeners") is not None
243254
else None
244255
),
256+
"loadBalancerSecurityGroup": (
257+
SecurityGroup.from_dict(obj["loadBalancerSecurityGroup"])
258+
if obj.get("loadBalancerSecurityGroup") is not None
259+
else None
260+
),
245261
"name": obj.get("name"),
246262
"networks": (
247263
[Network.from_dict(_item) for _item in obj["networks"]] if obj.get("networks") is not None else None

services/loadbalancer/src/stackit/loadbalancer/models/load_balancer.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ class LoadBalancer(BaseModel):
5858
default=None,
5959
description="There is a maximum listener count of 20. Port and protocol limitations: - UDP listeners cannot have the same port. - TCP-derived listeners cannot have the same port. A TCP-derived listener is any listener that listens on a TCP port. As of now those are: TCP, TCP_PROXY, and PROTOCOL_TLS_PASSTHROUGH. The only exception is, if all listeners for the same port are PROTOCOL_TLS_PASSTHROUGH. - PROTOCOL_TLS_PASSTHROUGH listeners cannot have the same port and at least one common domain name. - PROTOCOL_TLS_PASSTHROUGH listeners can have the same domain name and different ports though (e.g. ports 443 and 8443 for domain example.com). - PROTOCOL_TLS_PASSTHROUGH listeners without a domain name serve as a default listener and you can have only one default listener. ",
6060
)
61+
load_balancer_security_group: Optional[SecurityGroup] = Field(
62+
default=None,
63+
description="Security Group permitting network traffic from the LoadBalancer to the targets. Useful when disableTargetSecurityGroupAssignment=true to manually assign target security groups to targets.",
64+
alias="loadBalancerSecurityGroup",
65+
)
6166
name: Optional[Annotated[str, Field(strict=True)]] = Field(
6267
default=None, description="Load balancer name. Not changeable after creation."
6368
)
@@ -85,7 +90,7 @@ class LoadBalancer(BaseModel):
8590
)
8691
target_security_group: Optional[SecurityGroup] = Field(
8792
default=None,
88-
description="Security Group permitting network traffic from the LoadBalancer to the targets. Useful when disableTargetSecurityGroupAssignment=true to manually assign target security groups to targets.",
93+
description="Security Group that allows the targets to receive traffic from the LoadBalancer. Useful when disableTargetSecurityGroupAssignment=true to manually assign target security groups to targets.",
8994
alias="targetSecurityGroup",
9095
)
9196
version: Optional[StrictStr] = Field(
@@ -97,6 +102,7 @@ class LoadBalancer(BaseModel):
97102
"errors",
98103
"externalAddress",
99104
"listeners",
105+
"loadBalancerSecurityGroup",
100106
"name",
101107
"networks",
102108
"options",
@@ -167,10 +173,12 @@ def to_dict(self) -> Dict[str, Any]:
167173
* OpenAPI `readOnly` fields are excluded.
168174
* OpenAPI `readOnly` fields are excluded.
169175
* OpenAPI `readOnly` fields are excluded.
176+
* OpenAPI `readOnly` fields are excluded.
170177
"""
171178
excluded_fields: Set[str] = set(
172179
[
173180
"errors",
181+
"load_balancer_security_group",
174182
"private_address",
175183
"region",
176184
"status",
@@ -197,6 +205,9 @@ def to_dict(self) -> Dict[str, Any]:
197205
if _item:
198206
_items.append(_item.to_dict())
199207
_dict["listeners"] = _items
208+
# override the default output from pydantic by calling `to_dict()` of load_balancer_security_group
209+
if self.load_balancer_security_group:
210+
_dict["loadBalancerSecurityGroup"] = self.load_balancer_security_group.to_dict()
200211
# override the default output from pydantic by calling `to_dict()` of each item in networks (list)
201212
_items = []
202213
if self.networks:
@@ -242,6 +253,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
242253
if obj.get("listeners") is not None
243254
else None
244255
),
256+
"loadBalancerSecurityGroup": (
257+
SecurityGroup.from_dict(obj["loadBalancerSecurityGroup"])
258+
if obj.get("loadBalancerSecurityGroup") is not None
259+
else None
260+
),
245261
"name": obj.get("name"),
246262
"networks": (
247263
[Network.from_dict(_item) for _item in obj["networks"]] if obj.get("networks") is not None else None

services/loadbalancer/src/stackit/loadbalancer/models/update_load_balancer_payload.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ class UpdateLoadBalancerPayload(BaseModel):
5858
default=None,
5959
description="There is a maximum listener count of 20. Port and protocol limitations: - UDP listeners cannot have the same port. - TCP-derived listeners cannot have the same port. A TCP-derived listener is any listener that listens on a TCP port. As of now those are: TCP, TCP_PROXY, and PROTOCOL_TLS_PASSTHROUGH. The only exception is, if all listeners for the same port are PROTOCOL_TLS_PASSTHROUGH. - PROTOCOL_TLS_PASSTHROUGH listeners cannot have the same port and at least one common domain name. - PROTOCOL_TLS_PASSTHROUGH listeners can have the same domain name and different ports though (e.g. ports 443 and 8443 for domain example.com). - PROTOCOL_TLS_PASSTHROUGH listeners without a domain name serve as a default listener and you can have only one default listener. ",
6060
)
61+
load_balancer_security_group: Optional[SecurityGroup] = Field(
62+
default=None,
63+
description="Security Group permitting network traffic from the LoadBalancer to the targets. Useful when disableTargetSecurityGroupAssignment=true to manually assign target security groups to targets.",
64+
alias="loadBalancerSecurityGroup",
65+
)
6166
name: Optional[Annotated[str, Field(strict=True)]] = Field(
6267
default=None, description="Load balancer name. Not changeable after creation."
6368
)
@@ -85,7 +90,7 @@ class UpdateLoadBalancerPayload(BaseModel):
8590
)
8691
target_security_group: Optional[SecurityGroup] = Field(
8792
default=None,
88-
description="Security Group permitting network traffic from the LoadBalancer to the targets. Useful when disableTargetSecurityGroupAssignment=true to manually assign target security groups to targets.",
93+
description="Security Group that allows the targets to receive traffic from the LoadBalancer. Useful when disableTargetSecurityGroupAssignment=true to manually assign target security groups to targets.",
8994
alias="targetSecurityGroup",
9095
)
9196
version: Optional[StrictStr] = Field(
@@ -97,6 +102,7 @@ class UpdateLoadBalancerPayload(BaseModel):
97102
"errors",
98103
"externalAddress",
99104
"listeners",
105+
"loadBalancerSecurityGroup",
100106
"name",
101107
"networks",
102108
"options",
@@ -167,10 +173,12 @@ def to_dict(self) -> Dict[str, Any]:
167173
* OpenAPI `readOnly` fields are excluded.
168174
* OpenAPI `readOnly` fields are excluded.
169175
* OpenAPI `readOnly` fields are excluded.
176+
* OpenAPI `readOnly` fields are excluded.
170177
"""
171178
excluded_fields: Set[str] = set(
172179
[
173180
"errors",
181+
"load_balancer_security_group",
174182
"private_address",
175183
"region",
176184
"status",
@@ -197,6 +205,9 @@ def to_dict(self) -> Dict[str, Any]:
197205
if _item:
198206
_items.append(_item.to_dict())
199207
_dict["listeners"] = _items
208+
# override the default output from pydantic by calling `to_dict()` of load_balancer_security_group
209+
if self.load_balancer_security_group:
210+
_dict["loadBalancerSecurityGroup"] = self.load_balancer_security_group.to_dict()
200211
# override the default output from pydantic by calling `to_dict()` of each item in networks (list)
201212
_items = []
202213
if self.networks:
@@ -242,6 +253,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
242253
if obj.get("listeners") is not None
243254
else None
244255
),
256+
"loadBalancerSecurityGroup": (
257+
SecurityGroup.from_dict(obj["loadBalancerSecurityGroup"])
258+
if obj.get("loadBalancerSecurityGroup") is not None
259+
else None
260+
),
245261
"name": obj.get("name"),
246262
"networks": (
247263
[Network.from_dict(_item) for _item in obj["networks"]] if obj.get("networks") is not None else None

0 commit comments

Comments
 (0)