Skip to content

Commit d509f30

Browse files
Generate alb
1 parent 1666049 commit d509f30

File tree

3 files changed

+51
-3
lines changed

3 files changed

+51
-3
lines changed

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ class CreateLoadBalancerPayload(BaseModel):
5555
alias="externalAddress",
5656
)
5757
listeners: Optional[List[Listener]] = Field(default=None, description="There is a maximum listener count of 20. ")
58+
load_balancer_security_group: Optional[SecurityGroup] = Field(
59+
default=None,
60+
description="Security Group permitting network traffic from the LoadBalancer to the targets. Useful when disableTargetSecurityGroupAssignment=true to manually assign target security groups to targets.",
61+
alias="loadBalancerSecurityGroup",
62+
)
5863
name: Optional[Annotated[str, Field(strict=True)]] = Field(
5964
default=None, description="Application Load Balancer name. Not changeable after creation."
6065
)
@@ -82,7 +87,7 @@ class CreateLoadBalancerPayload(BaseModel):
8287
)
8388
target_security_group: Optional[SecurityGroup] = Field(
8489
default=None,
85-
description="Security Group permitting network traffic from the LoadBalancer to the targets. Useful when disableTargetSecurityGroupAssignment=true to manually assign target security groups to targets.",
90+
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.",
8691
alias="targetSecurityGroup",
8792
)
8893
version: Optional[StrictStr] = Field(
@@ -94,6 +99,7 @@ class CreateLoadBalancerPayload(BaseModel):
9499
"errors",
95100
"externalAddress",
96101
"listeners",
102+
"loadBalancerSecurityGroup",
97103
"name",
98104
"networks",
99105
"options",
@@ -164,10 +170,12 @@ def to_dict(self) -> Dict[str, Any]:
164170
* OpenAPI `readOnly` fields are excluded.
165171
* OpenAPI `readOnly` fields are excluded.
166172
* OpenAPI `readOnly` fields are excluded.
173+
* OpenAPI `readOnly` fields are excluded.
167174
"""
168175
excluded_fields: Set[str] = set(
169176
[
170177
"errors",
178+
"load_balancer_security_group",
171179
"private_address",
172180
"region",
173181
"status",
@@ -194,6 +202,9 @@ def to_dict(self) -> Dict[str, Any]:
194202
if _item:
195203
_items.append(_item.to_dict())
196204
_dict["listeners"] = _items
205+
# override the default output from pydantic by calling `to_dict()` of load_balancer_security_group
206+
if self.load_balancer_security_group:
207+
_dict["loadBalancerSecurityGroup"] = self.load_balancer_security_group.to_dict()
197208
# override the default output from pydantic by calling `to_dict()` of each item in networks (list)
198209
_items = []
199210
if self.networks:
@@ -239,6 +250,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
239250
if obj.get("listeners") is not None
240251
else None
241252
),
253+
"loadBalancerSecurityGroup": (
254+
SecurityGroup.from_dict(obj["loadBalancerSecurityGroup"])
255+
if obj.get("loadBalancerSecurityGroup") is not None
256+
else None
257+
),
242258
"name": obj.get("name"),
243259
"networks": (
244260
[Network.from_dict(_item) for _item in obj["networks"]] if obj.get("networks") is not None else None

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ class LoadBalancer(BaseModel):
5555
alias="externalAddress",
5656
)
5757
listeners: Optional[List[Listener]] = Field(default=None, description="There is a maximum listener count of 20. ")
58+
load_balancer_security_group: Optional[SecurityGroup] = Field(
59+
default=None,
60+
description="Security Group permitting network traffic from the LoadBalancer to the targets. Useful when disableTargetSecurityGroupAssignment=true to manually assign target security groups to targets.",
61+
alias="loadBalancerSecurityGroup",
62+
)
5863
name: Optional[Annotated[str, Field(strict=True)]] = Field(
5964
default=None, description="Application Load Balancer name. Not changeable after creation."
6065
)
@@ -82,7 +87,7 @@ class LoadBalancer(BaseModel):
8287
)
8388
target_security_group: Optional[SecurityGroup] = Field(
8489
default=None,
85-
description="Security Group permitting network traffic from the LoadBalancer to the targets. Useful when disableTargetSecurityGroupAssignment=true to manually assign target security groups to targets.",
90+
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.",
8691
alias="targetSecurityGroup",
8792
)
8893
version: Optional[StrictStr] = Field(
@@ -94,6 +99,7 @@ class LoadBalancer(BaseModel):
9499
"errors",
95100
"externalAddress",
96101
"listeners",
102+
"loadBalancerSecurityGroup",
97103
"name",
98104
"networks",
99105
"options",
@@ -164,10 +170,12 @@ def to_dict(self) -> Dict[str, Any]:
164170
* OpenAPI `readOnly` fields are excluded.
165171
* OpenAPI `readOnly` fields are excluded.
166172
* OpenAPI `readOnly` fields are excluded.
173+
* OpenAPI `readOnly` fields are excluded.
167174
"""
168175
excluded_fields: Set[str] = set(
169176
[
170177
"errors",
178+
"load_balancer_security_group",
171179
"private_address",
172180
"region",
173181
"status",
@@ -194,6 +202,9 @@ def to_dict(self) -> Dict[str, Any]:
194202
if _item:
195203
_items.append(_item.to_dict())
196204
_dict["listeners"] = _items
205+
# override the default output from pydantic by calling `to_dict()` of load_balancer_security_group
206+
if self.load_balancer_security_group:
207+
_dict["loadBalancerSecurityGroup"] = self.load_balancer_security_group.to_dict()
197208
# override the default output from pydantic by calling `to_dict()` of each item in networks (list)
198209
_items = []
199210
if self.networks:
@@ -239,6 +250,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
239250
if obj.get("listeners") is not None
240251
else None
241252
),
253+
"loadBalancerSecurityGroup": (
254+
SecurityGroup.from_dict(obj["loadBalancerSecurityGroup"])
255+
if obj.get("loadBalancerSecurityGroup") is not None
256+
else None
257+
),
242258
"name": obj.get("name"),
243259
"networks": (
244260
[Network.from_dict(_item) for _item in obj["networks"]] if obj.get("networks") is not None else None

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ class UpdateLoadBalancerPayload(BaseModel):
5555
alias="externalAddress",
5656
)
5757
listeners: Optional[List[Listener]] = Field(default=None, description="There is a maximum listener count of 20. ")
58+
load_balancer_security_group: Optional[SecurityGroup] = Field(
59+
default=None,
60+
description="Security Group permitting network traffic from the LoadBalancer to the targets. Useful when disableTargetSecurityGroupAssignment=true to manually assign target security groups to targets.",
61+
alias="loadBalancerSecurityGroup",
62+
)
5863
name: Optional[Annotated[str, Field(strict=True)]] = Field(
5964
default=None, description="Application Load Balancer name. Not changeable after creation."
6065
)
@@ -82,7 +87,7 @@ class UpdateLoadBalancerPayload(BaseModel):
8287
)
8388
target_security_group: Optional[SecurityGroup] = Field(
8489
default=None,
85-
description="Security Group permitting network traffic from the LoadBalancer to the targets. Useful when disableTargetSecurityGroupAssignment=true to manually assign target security groups to targets.",
90+
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.",
8691
alias="targetSecurityGroup",
8792
)
8893
version: Optional[StrictStr] = Field(
@@ -94,6 +99,7 @@ class UpdateLoadBalancerPayload(BaseModel):
9499
"errors",
95100
"externalAddress",
96101
"listeners",
102+
"loadBalancerSecurityGroup",
97103
"name",
98104
"networks",
99105
"options",
@@ -164,10 +170,12 @@ def to_dict(self) -> Dict[str, Any]:
164170
* OpenAPI `readOnly` fields are excluded.
165171
* OpenAPI `readOnly` fields are excluded.
166172
* OpenAPI `readOnly` fields are excluded.
173+
* OpenAPI `readOnly` fields are excluded.
167174
"""
168175
excluded_fields: Set[str] = set(
169176
[
170177
"errors",
178+
"load_balancer_security_group",
171179
"private_address",
172180
"region",
173181
"status",
@@ -194,6 +202,9 @@ def to_dict(self) -> Dict[str, Any]:
194202
if _item:
195203
_items.append(_item.to_dict())
196204
_dict["listeners"] = _items
205+
# override the default output from pydantic by calling `to_dict()` of load_balancer_security_group
206+
if self.load_balancer_security_group:
207+
_dict["loadBalancerSecurityGroup"] = self.load_balancer_security_group.to_dict()
197208
# override the default output from pydantic by calling `to_dict()` of each item in networks (list)
198209
_items = []
199210
if self.networks:
@@ -239,6 +250,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
239250
if obj.get("listeners") is not None
240251
else None
241252
),
253+
"loadBalancerSecurityGroup": (
254+
SecurityGroup.from_dict(obj["loadBalancerSecurityGroup"])
255+
if obj.get("loadBalancerSecurityGroup") is not None
256+
else None
257+
),
242258
"name": obj.get("name"),
243259
"networks": (
244260
[Network.from_dict(_item) for _item in obj["networks"]] if obj.get("networks") is not None else None

0 commit comments

Comments
 (0)