Skip to content

Commit e70d141

Browse files
Generator: Update SDK /services/loadbalancer (#1255)
* Generate loadbalancer * Update CHANGELOG.md and pyproject.toml --------- Co-authored-by: Marcel Jacek <Marcel.Jacek@stackit.cloud>
1 parent 7562d0d commit e70d141

File tree

9 files changed

+141
-1
lines changed

9 files changed

+141
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
## Release (2025-XX-YY)
2+
- `loadbalanccer`: [v0.3.0](services/loadbalancer/CHANGELOG.md#v030-2025-06-10)
3+
- **Feature:** Add new field `target_security_group` in `LoadBalancer` Model
24
- `resourcemanager`: [v0.5.0](services/resourcemanager/CHANGELOG.md#v050-2025-06-04)
35
- **Feature:** Delete Organization labels using the new method `DeleteOrganizationLabels`
46
- **Feature:** Delete Project labels using the new method `DeleteProjectLabels`

services/loadbalancer/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## v0.3.0 (2025-06-10)
2+
- **Feature:** Add new field `target_security_group` in `LoadBalancer` Model
3+
14
## v0.2.4 (2025-06-02)
25
- **Improvement:** Adjusted `GetQuotaResponse` and `RESTResponseType` message
36

services/loadbalancer/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "stackit-loadbalancer"
33

44
[tool.poetry]
55
name = "stackit-loadbalancer"
6-
version = "v0.2.4"
6+
version = "v0.3.0"
77
authors = [
88
"STACKIT Developer Tools <developer-tools@stackit.cloud>",
99
]

services/loadbalancer/src/stackit/loadbalancer/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
from stackit.loadbalancer.models.options_tcp import OptionsTCP
7373
from stackit.loadbalancer.models.options_udp import OptionsUDP
7474
from stackit.loadbalancer.models.plan_details import PlanDetails
75+
from stackit.loadbalancer.models.security_group import SecurityGroup
7576
from stackit.loadbalancer.models.server_name_indicator import ServerNameIndicator
7677
from stackit.loadbalancer.models.session_persistence import SessionPersistence
7778
from stackit.loadbalancer.models.status import Status

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
from stackit.loadbalancer.models.options_tcp import OptionsTCP
5454
from stackit.loadbalancer.models.options_udp import OptionsUDP
5555
from stackit.loadbalancer.models.plan_details import PlanDetails
56+
from stackit.loadbalancer.models.security_group import SecurityGroup
5657
from stackit.loadbalancer.models.server_name_indicator import ServerNameIndicator
5758
from stackit.loadbalancer.models.session_persistence import SessionPersistence
5859
from stackit.loadbalancer.models.status import Status

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from stackit.loadbalancer.models.load_balancer_error import LoadBalancerError
2626
from stackit.loadbalancer.models.load_balancer_options import LoadBalancerOptions
2727
from stackit.loadbalancer.models.network import Network
28+
from stackit.loadbalancer.models.security_group import SecurityGroup
2829
from stackit.loadbalancer.models.target_pool import TargetPool
2930

3031

@@ -70,6 +71,11 @@ class CreateLoadBalancerPayload(BaseModel):
7071
description="List of all target pools which will be used in the load balancer. Limited to 20.",
7172
alias="targetPools",
7273
)
74+
target_security_group: Optional[SecurityGroup] = Field(
75+
default=None,
76+
description="Security Group permitting network traffic from the LoadBalancer to the targets.",
77+
alias="targetSecurityGroup",
78+
)
7379
version: Optional[StrictStr] = Field(
7480
default=None,
7581
description="Load balancer resource version. Must be empty or unset for creating load balancers, non-empty for updating load balancers. Semantics: While retrieving load balancers, this is the current version of this load balancer resource that changes during updates of the load balancers. On updates this field specified the load balancer version you calculated your update for instead of the future version to enable concurrency safe updates. Update calls will then report the new version in their result as you would see with a load balancer retrieval call later. There exist no total order of the version, so you can only compare it for equality, but not for less/greater than another version. Since the creation of load balancer is always intended to create the first version of it, there should be no existing version. That's why this field must by empty of not present in that case.",
@@ -86,6 +92,7 @@ class CreateLoadBalancerPayload(BaseModel):
8692
"region",
8793
"status",
8894
"targetPools",
95+
"targetSecurityGroup",
8996
"version",
9097
]
9198

@@ -146,13 +153,15 @@ def to_dict(self) -> Dict[str, Any]:
146153
* OpenAPI `readOnly` fields are excluded.
147154
* OpenAPI `readOnly` fields are excluded.
148155
* OpenAPI `readOnly` fields are excluded.
156+
* OpenAPI `readOnly` fields are excluded.
149157
"""
150158
excluded_fields: Set[str] = set(
151159
[
152160
"errors",
153161
"private_address",
154162
"region",
155163
"status",
164+
"target_security_group",
156165
]
157166
)
158167

@@ -192,6 +201,9 @@ def to_dict(self) -> Dict[str, Any]:
192201
if _item:
193202
_items.append(_item.to_dict())
194203
_dict["targetPools"] = _items
204+
# override the default output from pydantic by calling `to_dict()` of target_security_group
205+
if self.target_security_group:
206+
_dict["targetSecurityGroup"] = self.target_security_group.to_dict()
195207
return _dict
196208

197209
@classmethod
@@ -230,6 +242,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
230242
if obj.get("targetPools") is not None
231243
else None
232244
),
245+
"targetSecurityGroup": (
246+
SecurityGroup.from_dict(obj["targetSecurityGroup"])
247+
if obj.get("targetSecurityGroup") is not None
248+
else None
249+
),
233250
"version": obj.get("version"),
234251
}
235252
)

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from stackit.loadbalancer.models.load_balancer_error import LoadBalancerError
2626
from stackit.loadbalancer.models.load_balancer_options import LoadBalancerOptions
2727
from stackit.loadbalancer.models.network import Network
28+
from stackit.loadbalancer.models.security_group import SecurityGroup
2829
from stackit.loadbalancer.models.target_pool import TargetPool
2930

3031

@@ -70,6 +71,11 @@ class LoadBalancer(BaseModel):
7071
description="List of all target pools which will be used in the load balancer. Limited to 20.",
7172
alias="targetPools",
7273
)
74+
target_security_group: Optional[SecurityGroup] = Field(
75+
default=None,
76+
description="Security Group permitting network traffic from the LoadBalancer to the targets.",
77+
alias="targetSecurityGroup",
78+
)
7379
version: Optional[StrictStr] = Field(
7480
default=None,
7581
description="Load balancer resource version. Must be empty or unset for creating load balancers, non-empty for updating load balancers. Semantics: While retrieving load balancers, this is the current version of this load balancer resource that changes during updates of the load balancers. On updates this field specified the load balancer version you calculated your update for instead of the future version to enable concurrency safe updates. Update calls will then report the new version in their result as you would see with a load balancer retrieval call later. There exist no total order of the version, so you can only compare it for equality, but not for less/greater than another version. Since the creation of load balancer is always intended to create the first version of it, there should be no existing version. That's why this field must by empty of not present in that case.",
@@ -86,6 +92,7 @@ class LoadBalancer(BaseModel):
8692
"region",
8793
"status",
8894
"targetPools",
95+
"targetSecurityGroup",
8996
"version",
9097
]
9198

@@ -146,13 +153,15 @@ def to_dict(self) -> Dict[str, Any]:
146153
* OpenAPI `readOnly` fields are excluded.
147154
* OpenAPI `readOnly` fields are excluded.
148155
* OpenAPI `readOnly` fields are excluded.
156+
* OpenAPI `readOnly` fields are excluded.
149157
"""
150158
excluded_fields: Set[str] = set(
151159
[
152160
"errors",
153161
"private_address",
154162
"region",
155163
"status",
164+
"target_security_group",
156165
]
157166
)
158167

@@ -192,6 +201,9 @@ def to_dict(self) -> Dict[str, Any]:
192201
if _item:
193202
_items.append(_item.to_dict())
194203
_dict["targetPools"] = _items
204+
# override the default output from pydantic by calling `to_dict()` of target_security_group
205+
if self.target_security_group:
206+
_dict["targetSecurityGroup"] = self.target_security_group.to_dict()
195207
return _dict
196208

197209
@classmethod
@@ -230,6 +242,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
230242
if obj.get("targetPools") is not None
231243
else None
232244
),
245+
"targetSecurityGroup": (
246+
SecurityGroup.from_dict(obj["targetSecurityGroup"])
247+
if obj.get("targetSecurityGroup") is not None
248+
else None
249+
),
233250
"version": obj.get("version"),
234251
}
235252
)
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# coding: utf-8
2+
3+
"""
4+
Load Balancer API
5+
6+
This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee.
7+
8+
The version of the OpenAPI document: 2.0.0
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
10+
11+
Do not edit the class manually.
12+
""" # noqa: E501 docstring might be too long
13+
14+
from __future__ import annotations
15+
16+
import json
17+
import pprint
18+
from typing import Any, ClassVar, Dict, List, Optional, Set
19+
20+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
21+
from typing_extensions import Self
22+
23+
24+
class SecurityGroup(BaseModel):
25+
"""
26+
SecurityGroup
27+
"""
28+
29+
id: Optional[StrictStr] = Field(default=None, description="ID of the security Group")
30+
name: Optional[StrictStr] = Field(default=None, description="Name of the security Group")
31+
__properties: ClassVar[List[str]] = ["id", "name"]
32+
33+
model_config = ConfigDict(
34+
populate_by_name=True,
35+
validate_assignment=True,
36+
protected_namespaces=(),
37+
)
38+
39+
def to_str(self) -> str:
40+
"""Returns the string representation of the model using alias"""
41+
return pprint.pformat(self.model_dump(by_alias=True))
42+
43+
def to_json(self) -> str:
44+
"""Returns the JSON representation of the model using alias"""
45+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46+
return json.dumps(self.to_dict())
47+
48+
@classmethod
49+
def from_json(cls, json_str: str) -> Optional[Self]:
50+
"""Create an instance of SecurityGroup from a JSON string"""
51+
return cls.from_dict(json.loads(json_str))
52+
53+
def to_dict(self) -> Dict[str, Any]:
54+
"""Return the dictionary representation of the model using alias.
55+
56+
This has the following differences from calling pydantic's
57+
`self.model_dump(by_alias=True)`:
58+
59+
* `None` is only added to the output dict for nullable fields that
60+
were set at model initialization. Other fields with value `None`
61+
are ignored.
62+
"""
63+
excluded_fields: Set[str] = set([])
64+
65+
_dict = self.model_dump(
66+
by_alias=True,
67+
exclude=excluded_fields,
68+
exclude_none=True,
69+
)
70+
return _dict
71+
72+
@classmethod
73+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
74+
"""Create an instance of SecurityGroup from a dict"""
75+
if obj is None:
76+
return None
77+
78+
if not isinstance(obj, dict):
79+
return cls.model_validate(obj)
80+
81+
_obj = cls.model_validate({"id": obj.get("id"), "name": obj.get("name")})
82+
return _obj

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from stackit.loadbalancer.models.load_balancer_error import LoadBalancerError
2626
from stackit.loadbalancer.models.load_balancer_options import LoadBalancerOptions
2727
from stackit.loadbalancer.models.network import Network
28+
from stackit.loadbalancer.models.security_group import SecurityGroup
2829
from stackit.loadbalancer.models.target_pool import TargetPool
2930

3031

@@ -70,6 +71,11 @@ class UpdateLoadBalancerPayload(BaseModel):
7071
description="List of all target pools which will be used in the load balancer. Limited to 20.",
7172
alias="targetPools",
7273
)
74+
target_security_group: Optional[SecurityGroup] = Field(
75+
default=None,
76+
description="Security Group permitting network traffic from the LoadBalancer to the targets.",
77+
alias="targetSecurityGroup",
78+
)
7379
version: Optional[StrictStr] = Field(
7480
default=None,
7581
description="Load balancer resource version. Must be empty or unset for creating load balancers, non-empty for updating load balancers. Semantics: While retrieving load balancers, this is the current version of this load balancer resource that changes during updates of the load balancers. On updates this field specified the load balancer version you calculated your update for instead of the future version to enable concurrency safe updates. Update calls will then report the new version in their result as you would see with a load balancer retrieval call later. There exist no total order of the version, so you can only compare it for equality, but not for less/greater than another version. Since the creation of load balancer is always intended to create the first version of it, there should be no existing version. That's why this field must by empty of not present in that case.",
@@ -86,6 +92,7 @@ class UpdateLoadBalancerPayload(BaseModel):
8692
"region",
8793
"status",
8894
"targetPools",
95+
"targetSecurityGroup",
8996
"version",
9097
]
9198

@@ -146,13 +153,15 @@ def to_dict(self) -> Dict[str, Any]:
146153
* OpenAPI `readOnly` fields are excluded.
147154
* OpenAPI `readOnly` fields are excluded.
148155
* OpenAPI `readOnly` fields are excluded.
156+
* OpenAPI `readOnly` fields are excluded.
149157
"""
150158
excluded_fields: Set[str] = set(
151159
[
152160
"errors",
153161
"private_address",
154162
"region",
155163
"status",
164+
"target_security_group",
156165
]
157166
)
158167

@@ -192,6 +201,9 @@ def to_dict(self) -> Dict[str, Any]:
192201
if _item:
193202
_items.append(_item.to_dict())
194203
_dict["targetPools"] = _items
204+
# override the default output from pydantic by calling `to_dict()` of target_security_group
205+
if self.target_security_group:
206+
_dict["targetSecurityGroup"] = self.target_security_group.to_dict()
195207
return _dict
196208

197209
@classmethod
@@ -230,6 +242,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
230242
if obj.get("targetPools") is not None
231243
else None
232244
),
245+
"targetSecurityGroup": (
246+
SecurityGroup.from_dict(obj["targetSecurityGroup"])
247+
if obj.get("targetSecurityGroup") is not None
248+
else None
249+
),
233250
"version": obj.get("version"),
234251
}
235252
)

0 commit comments

Comments
 (0)