Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite70d141

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 parent7562d0d commite70d141

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
fromstackit.loadbalancer.models.options_tcpimportOptionsTCP
7373
fromstackit.loadbalancer.models.options_udpimportOptionsUDP
7474
fromstackit.loadbalancer.models.plan_detailsimportPlanDetails
75+
fromstackit.loadbalancer.models.security_groupimportSecurityGroup
7576
fromstackit.loadbalancer.models.server_name_indicatorimportServerNameIndicator
7677
fromstackit.loadbalancer.models.session_persistenceimportSessionPersistence
7778
fromstackit.loadbalancer.models.statusimportStatus

‎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
fromstackit.loadbalancer.models.options_tcpimportOptionsTCP
5454
fromstackit.loadbalancer.models.options_udpimportOptionsUDP
5555
fromstackit.loadbalancer.models.plan_detailsimportPlanDetails
56+
fromstackit.loadbalancer.models.security_groupimportSecurityGroup
5657
fromstackit.loadbalancer.models.server_name_indicatorimportServerNameIndicator
5758
fromstackit.loadbalancer.models.session_persistenceimportSessionPersistence
5859
fromstackit.loadbalancer.models.statusimportStatus

‎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
fromstackit.loadbalancer.models.load_balancer_errorimportLoadBalancerError
2626
fromstackit.loadbalancer.models.load_balancer_optionsimportLoadBalancerOptions
2727
fromstackit.loadbalancer.models.networkimportNetwork
28+
fromstackit.loadbalancer.models.security_groupimportSecurityGroup
2829
fromstackit.loadbalancer.models.target_poolimportTargetPool
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+
ifself.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
ifobj.get("targetPools")isnotNone
231243
elseNone
232244
),
245+
"targetSecurityGroup": (
246+
SecurityGroup.from_dict(obj["targetSecurityGroup"])
247+
ifobj.get("targetSecurityGroup")isnotNone
248+
elseNone
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
fromstackit.loadbalancer.models.load_balancer_errorimportLoadBalancerError
2626
fromstackit.loadbalancer.models.load_balancer_optionsimportLoadBalancerOptions
2727
fromstackit.loadbalancer.models.networkimportNetwork
28+
fromstackit.loadbalancer.models.security_groupimportSecurityGroup
2829
fromstackit.loadbalancer.models.target_poolimportTargetPool
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+
ifself.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
ifobj.get("targetPools")isnotNone
231243
elseNone
232244
),
245+
"targetSecurityGroup": (
246+
SecurityGroup.from_dict(obj["targetSecurityGroup"])
247+
ifobj.get("targetSecurityGroup")isnotNone
248+
elseNone
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__importannotations
15+
16+
importjson
17+
importpprint
18+
fromtypingimportAny,ClassVar,Dict,List,Optional,Set
19+
20+
frompydanticimportBaseModel,ConfigDict,Field,StrictStr
21+
fromtyping_extensionsimportSelf
22+
23+
24+
classSecurityGroup(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+
defto_str(self)->str:
40+
"""Returns the string representation of the model using alias"""
41+
returnpprint.pformat(self.model_dump(by_alias=True))
42+
43+
defto_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+
returnjson.dumps(self.to_dict())
47+
48+
@classmethod
49+
deffrom_json(cls,json_str:str)->Optional[Self]:
50+
"""Create an instance of SecurityGroup from a JSON string"""
51+
returncls.from_dict(json.loads(json_str))
52+
53+
defto_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+
deffrom_dict(cls,obj:Optional[Dict[str,Any]])->Optional[Self]:
74+
"""Create an instance of SecurityGroup from a dict"""
75+
ifobjisNone:
76+
returnNone
77+
78+
ifnotisinstance(obj,dict):
79+
returncls.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
fromstackit.loadbalancer.models.load_balancer_errorimportLoadBalancerError
2626
fromstackit.loadbalancer.models.load_balancer_optionsimportLoadBalancerOptions
2727
fromstackit.loadbalancer.models.networkimportNetwork
28+
fromstackit.loadbalancer.models.security_groupimportSecurityGroup
2829
fromstackit.loadbalancer.models.target_poolimportTargetPool
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+
ifself.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
ifobj.get("targetPools")isnotNone
231243
elseNone
232244
),
245+
"targetSecurityGroup": (
246+
SecurityGroup.from_dict(obj["targetSecurityGroup"])
247+
ifobj.get("targetSecurityGroup")isnotNone
248+
elseNone
249+
),
233250
"version":obj.get("version"),
234251
}
235252
)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp