Skip to content

Generator: Update SDK /services/alb #1273

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## Release (2025-XX-YY)
- `core`: [v0.2.0](core/CHANGELOG.md#v020-2025-06-12)
- **Feature:** Allow setting custom token endpoint url in configuration
- `alb`: [v0.3.0](services/alb/CHANGELOG.md#v030-2025-06-12)
- **Feature:** Add new fields `disable_target_security_group_assignment` and `target_security_group` in `LoadBalancer`, `CreateLoadBalancerPayload` and `UpdateLoadBalancerPayload` Models
- `iaas`: [v0.5.3](services/iaas/CHANGELOG.md#v053-2025-06-12)
- Increase max length of description from 127 to 255 for
- Security groups: `BaseSecurityGroupRule`, `CreateSecurityGroupPayload`, `CreateSecurityGroupRulePayload`, `SecurityGroup`, `SecurityGroupRule`, `UpdateSecurityGroupPayload`
Expand Down
3 changes: 3 additions & 0 deletions services/alb/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## v0.3.0 (2025-06-12)
- **Feature:** Add new fields `disable_target_security_group_assignment` and `target_security_group` in `LoadBalancer`, `CreateLoadBalancerPayload` and `UpdateLoadBalancerPayload` Models

## v0.2.1 (2025-06-02)
- **Improvement:** Adjusted `GetQuotaResponse` and `RESTResponseType` message

Expand Down
4 changes: 2 additions & 2 deletions services/alb/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "stackit-alb"

[tool.poetry]
name = "stackit-alb"
version = "v0.2.1"
version = "v0.3.0"
authors = [
"STACKIT Developer Tools <developer-tools@stackit.cloud>",
]
Expand Down Expand Up @@ -105,4 +105,4 @@ per-file-ignores = """
# E501: long descriptions/string values might lead to lines that are too long
# B028: stacklevel for deprecation warning is irrelevant
./src/stackit/*/api/default_api.py: F841,B028,E501
"""
"""
1 change: 1 addition & 0 deletions services/alb/src/stackit/alb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
from stackit.alb.models.protocol_options_https import ProtocolOptionsHTTPS
from stackit.alb.models.query_parameter import QueryParameter
from stackit.alb.models.rule import Rule
from stackit.alb.models.security_group import SecurityGroup
from stackit.alb.models.status import Status
from stackit.alb.models.target import Target
from stackit.alb.models.target_pool import TargetPool
Expand Down
1 change: 1 addition & 0 deletions services/alb/src/stackit/alb/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
from stackit.alb.models.protocol_options_https import ProtocolOptionsHTTPS
from stackit.alb.models.query_parameter import QueryParameter
from stackit.alb.models.rule import Rule
from stackit.alb.models.security_group import SecurityGroup
from stackit.alb.models.status import Status
from stackit.alb.models.target import Target
from stackit.alb.models.target_pool import TargetPool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,21 @@
import re
from typing import Any, ClassVar, Dict, List, Optional, Set

from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
from pydantic import (
BaseModel,
ConfigDict,
Field,
StrictBool,
StrictStr,
field_validator,
)
from typing_extensions import Annotated, Self

from stackit.alb.models.listener import Listener
from stackit.alb.models.load_balancer_error import LoadBalancerError
from stackit.alb.models.load_balancer_options import LoadBalancerOptions
from stackit.alb.models.network import Network
from stackit.alb.models.security_group import SecurityGroup
from stackit.alb.models.target_pool import TargetPool


Expand All @@ -33,6 +41,11 @@ class CreateLoadBalancerPayload(BaseModel):
CreateLoadBalancerPayload
"""

disable_target_security_group_assignment: Optional[StrictBool] = Field(
default=None,
description="Disable target security group assignemt to allow targets outside of the given network. Connectivity to targets need to be ensured by the customer, including routing and Security Groups (targetSecurityGroup can be assigned). Not changeable after creation.",
alias="disableTargetSecurityGroupAssignment",
)
errors: Optional[List[LoadBalancerError]] = Field(
default=None, description="Reports all errors a application load balancer has."
)
Expand Down Expand Up @@ -67,11 +80,17 @@ class CreateLoadBalancerPayload(BaseModel):
description="List of all target pools which will be used in the application load balancer. Limited to 20.",
alias="targetPools",
)
target_security_group: Optional[SecurityGroup] = Field(
default=None,
description="Security Group permitting network traffic from the LoadBalancer to the targets. Useful when disableTargetSecurityGroupAssignment=true to manually assign target security groups to targets.",
alias="targetSecurityGroup",
)
version: Optional[StrictStr] = Field(
default=None,
description="Application 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 application load balancer resource that changes during updates of the load balancers. On updates this field specified the application 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 application 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 application 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.",
)
__properties: ClassVar[List[str]] = [
"disableTargetSecurityGroupAssignment",
"errors",
"externalAddress",
"listeners",
Expand All @@ -83,6 +102,7 @@ class CreateLoadBalancerPayload(BaseModel):
"region",
"status",
"targetPools",
"targetSecurityGroup",
"version",
]

Expand Down Expand Up @@ -143,13 +163,15 @@ def to_dict(self) -> Dict[str, Any]:
* OpenAPI `readOnly` fields are excluded.
* OpenAPI `readOnly` fields are excluded.
* OpenAPI `readOnly` fields are excluded.
* OpenAPI `readOnly` fields are excluded.
"""
excluded_fields: Set[str] = set(
[
"errors",
"private_address",
"region",
"status",
"target_security_group",
]
)

Expand Down Expand Up @@ -189,6 +211,9 @@ def to_dict(self) -> Dict[str, Any]:
if _item:
_items.append(_item.to_dict())
_dict["targetPools"] = _items
# override the default output from pydantic by calling `to_dict()` of target_security_group
if self.target_security_group:
_dict["targetSecurityGroup"] = self.target_security_group.to_dict()
return _dict

@classmethod
Expand All @@ -202,6 +227,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:

_obj = cls.model_validate(
{
"disableTargetSecurityGroupAssignment": obj.get("disableTargetSecurityGroupAssignment"),
"errors": (
[LoadBalancerError.from_dict(_item) for _item in obj["errors"]]
if obj.get("errors") is not None
Expand All @@ -227,6 +253,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if obj.get("targetPools") is not None
else None
),
"targetSecurityGroup": (
SecurityGroup.from_dict(obj["targetSecurityGroup"])
if obj.get("targetSecurityGroup") is not None
else None
),
"version": obj.get("version"),
}
)
Expand Down
33 changes: 32 additions & 1 deletion services/alb/src/stackit/alb/models/load_balancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,21 @@
import re
from typing import Any, ClassVar, Dict, List, Optional, Set

from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
from pydantic import (
BaseModel,
ConfigDict,
Field,
StrictBool,
StrictStr,
field_validator,
)
from typing_extensions import Annotated, Self

from stackit.alb.models.listener import Listener
from stackit.alb.models.load_balancer_error import LoadBalancerError
from stackit.alb.models.load_balancer_options import LoadBalancerOptions
from stackit.alb.models.network import Network
from stackit.alb.models.security_group import SecurityGroup
from stackit.alb.models.target_pool import TargetPool


Expand All @@ -33,6 +41,11 @@ class LoadBalancer(BaseModel):
LoadBalancer
"""

disable_target_security_group_assignment: Optional[StrictBool] = Field(
default=None,
description="Disable target security group assignemt to allow targets outside of the given network. Connectivity to targets need to be ensured by the customer, including routing and Security Groups (targetSecurityGroup can be assigned). Not changeable after creation.",
alias="disableTargetSecurityGroupAssignment",
)
errors: Optional[List[LoadBalancerError]] = Field(
default=None, description="Reports all errors a application load balancer has."
)
Expand Down Expand Up @@ -67,11 +80,17 @@ class LoadBalancer(BaseModel):
description="List of all target pools which will be used in the application load balancer. Limited to 20.",
alias="targetPools",
)
target_security_group: Optional[SecurityGroup] = Field(
default=None,
description="Security Group permitting network traffic from the LoadBalancer to the targets. Useful when disableTargetSecurityGroupAssignment=true to manually assign target security groups to targets.",
alias="targetSecurityGroup",
)
version: Optional[StrictStr] = Field(
default=None,
description="Application 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 application load balancer resource that changes during updates of the load balancers. On updates this field specified the application 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 application 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 application 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.",
)
__properties: ClassVar[List[str]] = [
"disableTargetSecurityGroupAssignment",
"errors",
"externalAddress",
"listeners",
Expand All @@ -83,6 +102,7 @@ class LoadBalancer(BaseModel):
"region",
"status",
"targetPools",
"targetSecurityGroup",
"version",
]

Expand Down Expand Up @@ -143,13 +163,15 @@ def to_dict(self) -> Dict[str, Any]:
* OpenAPI `readOnly` fields are excluded.
* OpenAPI `readOnly` fields are excluded.
* OpenAPI `readOnly` fields are excluded.
* OpenAPI `readOnly` fields are excluded.
"""
excluded_fields: Set[str] = set(
[
"errors",
"private_address",
"region",
"status",
"target_security_group",
]
)

Expand Down Expand Up @@ -189,6 +211,9 @@ def to_dict(self) -> Dict[str, Any]:
if _item:
_items.append(_item.to_dict())
_dict["targetPools"] = _items
# override the default output from pydantic by calling `to_dict()` of target_security_group
if self.target_security_group:
_dict["targetSecurityGroup"] = self.target_security_group.to_dict()
return _dict

@classmethod
Expand All @@ -202,6 +227,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:

_obj = cls.model_validate(
{
"disableTargetSecurityGroupAssignment": obj.get("disableTargetSecurityGroupAssignment"),
"errors": (
[LoadBalancerError.from_dict(_item) for _item in obj["errors"]]
if obj.get("errors") is not None
Expand All @@ -227,6 +253,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if obj.get("targetPools") is not None
else None
),
"targetSecurityGroup": (
SecurityGroup.from_dict(obj["targetSecurityGroup"])
if obj.get("targetSecurityGroup") is not None
else None
),
"version": obj.get("version"),
}
)
Expand Down
82 changes: 82 additions & 0 deletions services/alb/src/stackit/alb/models/security_group.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# coding: utf-8

"""
Application Load Balancer API

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 application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee.

The version of the OpenAPI document: 2beta2.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501 docstring might be too long

from __future__ import annotations

import json
import pprint
from typing import Any, ClassVar, Dict, List, Optional, Set

from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing_extensions import Self


class SecurityGroup(BaseModel):
"""
SecurityGroup
"""

id: Optional[StrictStr] = Field(default=None, description="ID of the security Group")
name: Optional[StrictStr] = Field(default=None, description="Name of the security Group")
__properties: ClassVar[List[str]] = ["id", "name"]

model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)

def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))

def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())

@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of SecurityGroup from a JSON string"""
return cls.from_dict(json.loads(json_str))

def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:

* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([])

_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict

@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of SecurityGroup from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate({"id": obj.get("id"), "name": obj.get("name")})
return _obj
Loading
Loading