Skip to content

Commit 4b382c2

Browse files
Generator: Update SDK /services/iaas (#671)
* Generate iaas * chore(doc): add changelog entries --------- Co-authored-by: Ruben Hoenle <Ruben.Hoenle@stackit.cloud>
1 parent f7c4866 commit 4b382c2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+672
-108
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
- `Nodepool`: `maximum` and `minimum` must be <= 1000
99
- `dns`: [v0.3.0](services/dns/CHANGELOG.md#v030-2025-02-27)
1010
- Add support for extensions
11+
- `iaas`: [v0.3.0](services/iaas/CHANGELOG.md#v030-2025-02-27)
12+
- **Feature:** Add method to list all public ip ranges: `list_public_ip_ranges`
13+
- Add size attribute to image model
14+
- Add CPU architecture attribute to image config model
1115

1216
## Release (2025-02-11)
1317

services/iaas/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v0.3.0 (2025-02-27)
2+
3+
- **Feature:** Add method to list all public ip ranges: `list_public_ip_ranges`
4+
- Add size attribute to image model
5+
- Add CPU architecture attribute to image config model
6+
17
## v0.2.1 (2025-01-14)
28

39
- **Bugfix**: `configuration.py` region adjustment was missing

services/iaas/src/stackit/iaas/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@
121121
from stackit.iaas.models.protocol import Protocol
122122
from stackit.iaas.models.public_ip import PublicIp
123123
from stackit.iaas.models.public_ip_list_response import PublicIpListResponse
124+
from stackit.iaas.models.public_network import PublicNetwork
125+
from stackit.iaas.models.public_network_list_response import PublicNetworkListResponse
124126
from stackit.iaas.models.quota import Quota
125127
from stackit.iaas.models.quota_list import QuotaList
126128
from stackit.iaas.models.quota_list_response import QuotaListResponse

services/iaas/src/stackit/iaas/api/default_api.py

Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
from stackit.iaas.models.project_list_response import ProjectListResponse
8484
from stackit.iaas.models.public_ip import PublicIp
8585
from stackit.iaas.models.public_ip_list_response import PublicIpListResponse
86+
from stackit.iaas.models.public_network_list_response import PublicNetworkListResponse
8687
from stackit.iaas.models.quota_list_response import QuotaListResponse
8788
from stackit.iaas.models.request import Request
8889
from stackit.iaas.models.rescue_server_payload import RescueServerPayload
@@ -19540,6 +19541,7 @@ def list_images(
1954019541
str,
1954119542
Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."),
1954219543
],
19544+
all: Annotated[Optional[StrictBool], Field(description="List all Images.")] = None,
1954319545
label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None,
1954419546
_request_timeout: Union[
1954519547
None,
@@ -19557,6 +19559,8 @@ def list_images(
1955719559

1955819560
:param project_id: The identifier (ID) of a STACKIT Project. (required)
1955919561
:type project_id: str
19562+
:param all: List all Images.
19563+
:type all: bool
1956019564
:param label_selector: Filter resources by labels.
1956119565
:type label_selector: str
1956219566
:param _request_timeout: timeout setting for this request. If one
@@ -19583,6 +19587,7 @@ def list_images(
1958319587

1958419588
_param = self._list_images_serialize(
1958519589
project_id=project_id,
19590+
all=all,
1958619591
label_selector=label_selector,
1958719592
_request_auth=_request_auth,
1958819593
_content_type=_content_type,
@@ -19612,6 +19617,7 @@ def list_images_with_http_info(
1961219617
str,
1961319618
Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."),
1961419619
],
19620+
all: Annotated[Optional[StrictBool], Field(description="List all Images.")] = None,
1961519621
label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None,
1961619622
_request_timeout: Union[
1961719623
None,
@@ -19629,6 +19635,8 @@ def list_images_with_http_info(
1962919635

1963019636
:param project_id: The identifier (ID) of a STACKIT Project. (required)
1963119637
:type project_id: str
19638+
:param all: List all Images.
19639+
:type all: bool
1963219640
:param label_selector: Filter resources by labels.
1963319641
:type label_selector: str
1963419642
:param _request_timeout: timeout setting for this request. If one
@@ -19655,6 +19663,7 @@ def list_images_with_http_info(
1965519663

1965619664
_param = self._list_images_serialize(
1965719665
project_id=project_id,
19666+
all=all,
1965819667
label_selector=label_selector,
1965919668
_request_auth=_request_auth,
1966019669
_content_type=_content_type,
@@ -19684,6 +19693,7 @@ def list_images_without_preload_content(
1968419693
str,
1968519694
Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."),
1968619695
],
19696+
all: Annotated[Optional[StrictBool], Field(description="List all Images.")] = None,
1968719697
label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None,
1968819698
_request_timeout: Union[
1968919699
None,
@@ -19701,6 +19711,8 @@ def list_images_without_preload_content(
1970119711

1970219712
:param project_id: The identifier (ID) of a STACKIT Project. (required)
1970319713
:type project_id: str
19714+
:param all: List all Images.
19715+
:type all: bool
1970419716
:param label_selector: Filter resources by labels.
1970519717
:type label_selector: str
1970619718
:param _request_timeout: timeout setting for this request. If one
@@ -19727,6 +19739,7 @@ def list_images_without_preload_content(
1972719739

1972819740
_param = self._list_images_serialize(
1972919741
project_id=project_id,
19742+
all=all,
1973019743
label_selector=label_selector,
1973119744
_request_auth=_request_auth,
1973219745
_content_type=_content_type,
@@ -19748,6 +19761,7 @@ def list_images_without_preload_content(
1974819761
def _list_images_serialize(
1974919762
self,
1975019763
project_id,
19764+
all,
1975119765
label_selector,
1975219766
_request_auth,
1975319767
_content_type,
@@ -19770,6 +19784,10 @@ def _list_images_serialize(
1977019784
if project_id is not None:
1977119785
_path_params["projectId"] = project_id
1977219786
# process the query parameters
19787+
if all is not None:
19788+
19789+
_query_params.append(("all", all))
19790+
1977319791
if label_selector is not None:
1977419792

1977519793
_query_params.append(("label_selector", label_selector))
@@ -22266,6 +22284,223 @@ def _list_project_nics_serialize(
2226622284
_request_auth=_request_auth,
2226722285
)
2226822286

22287+
@validate_call
22288+
def list_public_ip_ranges(
22289+
self,
22290+
_request_timeout: Union[
22291+
None,
22292+
Annotated[StrictFloat, Field(gt=0)],
22293+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
22294+
] = None,
22295+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
22296+
_content_type: Optional[StrictStr] = None,
22297+
_headers: Optional[Dict[StrictStr, Any]] = None,
22298+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
22299+
) -> PublicNetworkListResponse:
22300+
"""List all public IP ranges.
22301+
22302+
Get a list of all public IP ranges that STACKIT uses.
22303+
22304+
:param _request_timeout: timeout setting for this request. If one
22305+
number provided, it will be total request
22306+
timeout. It can also be a pair (tuple) of
22307+
(connection, read) timeouts.
22308+
:type _request_timeout: int, tuple(int, int), optional
22309+
:param _request_auth: set to override the auth_settings for an a single
22310+
request; this effectively ignores the
22311+
authentication in the spec for a single request.
22312+
:type _request_auth: dict, optional
22313+
:param _content_type: force content-type for the request.
22314+
:type _content_type: str, Optional
22315+
:param _headers: set to override the headers for a single
22316+
request; this effectively ignores the headers
22317+
in the spec for a single request.
22318+
:type _headers: dict, optional
22319+
:param _host_index: set to override the host_index for a single
22320+
request; this effectively ignores the host_index
22321+
in the spec for a single request.
22322+
:type _host_index: int, optional
22323+
:return: Returns the result object.
22324+
""" # noqa: E501 docstring might be too long
22325+
22326+
_param = self._list_public_ip_ranges_serialize(
22327+
_request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
22328+
)
22329+
22330+
_response_types_map: Dict[str, Optional[str]] = {
22331+
"200": "PublicNetworkListResponse",
22332+
"400": "Error",
22333+
"401": "Error",
22334+
"403": "Error",
22335+
"404": "Error",
22336+
"500": "Error",
22337+
}
22338+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
22339+
response_data.read()
22340+
return self.api_client.response_deserialize(
22341+
response_data=response_data,
22342+
response_types_map=_response_types_map,
22343+
).data
22344+
22345+
@validate_call
22346+
def list_public_ip_ranges_with_http_info(
22347+
self,
22348+
_request_timeout: Union[
22349+
None,
22350+
Annotated[StrictFloat, Field(gt=0)],
22351+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
22352+
] = None,
22353+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
22354+
_content_type: Optional[StrictStr] = None,
22355+
_headers: Optional[Dict[StrictStr, Any]] = None,
22356+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
22357+
) -> ApiResponse[PublicNetworkListResponse]:
22358+
"""List all public IP ranges.
22359+
22360+
Get a list of all public IP ranges that STACKIT uses.
22361+
22362+
:param _request_timeout: timeout setting for this request. If one
22363+
number provided, it will be total request
22364+
timeout. It can also be a pair (tuple) of
22365+
(connection, read) timeouts.
22366+
:type _request_timeout: int, tuple(int, int), optional
22367+
:param _request_auth: set to override the auth_settings for an a single
22368+
request; this effectively ignores the
22369+
authentication in the spec for a single request.
22370+
:type _request_auth: dict, optional
22371+
:param _content_type: force content-type for the request.
22372+
:type _content_type: str, Optional
22373+
:param _headers: set to override the headers for a single
22374+
request; this effectively ignores the headers
22375+
in the spec for a single request.
22376+
:type _headers: dict, optional
22377+
:param _host_index: set to override the host_index for a single
22378+
request; this effectively ignores the host_index
22379+
in the spec for a single request.
22380+
:type _host_index: int, optional
22381+
:return: Returns the result object.
22382+
""" # noqa: E501 docstring might be too long
22383+
22384+
_param = self._list_public_ip_ranges_serialize(
22385+
_request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
22386+
)
22387+
22388+
_response_types_map: Dict[str, Optional[str]] = {
22389+
"200": "PublicNetworkListResponse",
22390+
"400": "Error",
22391+
"401": "Error",
22392+
"403": "Error",
22393+
"404": "Error",
22394+
"500": "Error",
22395+
}
22396+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
22397+
response_data.read()
22398+
return self.api_client.response_deserialize(
22399+
response_data=response_data,
22400+
response_types_map=_response_types_map,
22401+
)
22402+
22403+
@validate_call
22404+
def list_public_ip_ranges_without_preload_content(
22405+
self,
22406+
_request_timeout: Union[
22407+
None,
22408+
Annotated[StrictFloat, Field(gt=0)],
22409+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
22410+
] = None,
22411+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
22412+
_content_type: Optional[StrictStr] = None,
22413+
_headers: Optional[Dict[StrictStr, Any]] = None,
22414+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
22415+
) -> RESTResponseType:
22416+
"""List all public IP ranges.
22417+
22418+
Get a list of all public IP ranges that STACKIT uses.
22419+
22420+
:param _request_timeout: timeout setting for this request. If one
22421+
number provided, it will be total request
22422+
timeout. It can also be a pair (tuple) of
22423+
(connection, read) timeouts.
22424+
:type _request_timeout: int, tuple(int, int), optional
22425+
:param _request_auth: set to override the auth_settings for an a single
22426+
request; this effectively ignores the
22427+
authentication in the spec for a single request.
22428+
:type _request_auth: dict, optional
22429+
:param _content_type: force content-type for the request.
22430+
:type _content_type: str, Optional
22431+
:param _headers: set to override the headers for a single
22432+
request; this effectively ignores the headers
22433+
in the spec for a single request.
22434+
:type _headers: dict, optional
22435+
:param _host_index: set to override the host_index for a single
22436+
request; this effectively ignores the host_index
22437+
in the spec for a single request.
22438+
:type _host_index: int, optional
22439+
:return: Returns the result object.
22440+
""" # noqa: E501 docstring might be too long
22441+
22442+
_param = self._list_public_ip_ranges_serialize(
22443+
_request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
22444+
)
22445+
22446+
_response_types_map: Dict[str, Optional[str]] = {
22447+
"200": "PublicNetworkListResponse",
22448+
"400": "Error",
22449+
"401": "Error",
22450+
"403": "Error",
22451+
"404": "Error",
22452+
"500": "Error",
22453+
}
22454+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
22455+
return response_data.response
22456+
22457+
def _list_public_ip_ranges_serialize(
22458+
self,
22459+
_request_auth,
22460+
_content_type,
22461+
_headers,
22462+
_host_index,
22463+
) -> RequestSerialized:
22464+
22465+
_host = None
22466+
22467+
_collection_formats: Dict[str, str] = {}
22468+
22469+
_path_params: Dict[str, str] = {}
22470+
_query_params: List[Tuple[str, str]] = []
22471+
_header_params: Dict[str, Optional[str]] = _headers or {}
22472+
_form_params: List[Tuple[str, str]] = []
22473+
_files: Dict[str, Union[str, bytes]] = {}
22474+
_body_params: Optional[bytes] = None
22475+
22476+
# process the path parameters
22477+
# process the query parameters
22478+
# process the header parameters
22479+
# process the form parameters
22480+
# process the body parameter
22481+
22482+
# set the HTTP header `Accept`
22483+
if "Accept" not in _header_params:
22484+
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
22485+
22486+
# authentication setting
22487+
_auth_settings: List[str] = []
22488+
22489+
return self.api_client.param_serialize(
22490+
method="GET",
22491+
resource_path="/v1beta1/networks/public-ip-ranges",
22492+
path_params=_path_params,
22493+
query_params=_query_params,
22494+
header_params=_header_params,
22495+
body=_body_params,
22496+
post_params=_form_params,
22497+
files=_files,
22498+
auth_settings=_auth_settings,
22499+
collection_formats=_collection_formats,
22500+
_host=_host,
22501+
_request_auth=_request_auth,
22502+
)
22503+
2226922504
@validate_call
2227022505
def list_public_ips(
2227122506
self,

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@
102102
from stackit.iaas.models.protocol import Protocol
103103
from stackit.iaas.models.public_ip import PublicIp
104104
from stackit.iaas.models.public_ip_list_response import PublicIpListResponse
105+
from stackit.iaas.models.public_network import PublicNetwork
106+
from stackit.iaas.models.public_network_list_response import PublicNetworkListResponse
105107
from stackit.iaas.models.quota import Quota
106108
from stackit.iaas.models.quota_list import QuotaList
107109
from stackit.iaas.models.quota_list_response import QuotaListResponse

services/iaas/src/stackit/iaas/models/add_volume_to_server_payload.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class AddVolumeToServerPayload(BaseModel):
2929
"""
3030

3131
delete_on_termination: Optional[StrictBool] = Field(
32-
default=False,
32+
default=None,
3333
description="Delete the volume during the termination of the server. Defaults to false.",
3434
alias="deleteOnTermination",
3535
)
@@ -122,9 +122,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
122122

123123
_obj = cls.model_validate(
124124
{
125-
"deleteOnTermination": (
126-
obj.get("deleteOnTermination") if obj.get("deleteOnTermination") is not None else False
127-
),
125+
"deleteOnTermination": obj.get("deleteOnTermination"),
128126
"serverId": obj.get("serverId"),
129127
"volumeId": obj.get("volumeId"),
130128
}

services/iaas/src/stackit/iaas/models/affinity_group.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ class AffinityGroup(BaseModel):
3737
name: Annotated[str, Field(strict=True, max_length=63)] = Field(
3838
description="The name for a General Object. Matches Names and also UUIDs."
3939
)
40-
policy: StrictStr = Field(description="The affinity group policy.")
40+
policy: StrictStr = Field(
41+
description="The affinity group policy. `hard-affinity`: All servers in this group will be hosted on the same compute node. `soft-affinity`: All servers in this group will be hosted on as few compute nodes as possible. `hard-anti-affinity`: All servers in this group will be hosted on different compute nodes. `soft-anti-affinity`: All servers in this group will be hosted on as many compute nodes as possible. Possible values: `hard-anti-affinity`, `hard-affinity`, `soft-anti-affinity`, `soft-affinity`."
42+
)
4143
__properties: ClassVar[List[str]] = ["id", "members", "name", "policy"]
4244

4345
@field_validator("id")

0 commit comments

Comments
 (0)