From fbcbd1d9460b5de755b00c786e13b49586104218 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Tue, 25 Feb 2025 10:31:47 +0000 Subject: [PATCH] Generate iaas --- services/iaas/src/stackit/iaas/__init__.py | 2 + .../iaas/src/stackit/iaas/api/default_api.py | 235 ++++++++++++++++++ .../iaas/src/stackit/iaas/models/__init__.py | 2 + .../models/add_volume_to_server_payload.py | 6 +- .../src/stackit/iaas/models/affinity_group.py | 4 +- .../iaas/src/stackit/iaas/models/backup.py | 8 +- .../src/stackit/iaas/models/backup_source.py | 2 +- .../src/stackit/iaas/models/boot_volume.py | 6 +- .../stackit/iaas/models/boot_volume_source.py | 2 +- .../models/create_affinity_group_payload.py | 4 +- .../iaas/models/create_backup_payload.py | 3 +- .../iaas/models/create_image_payload.py | 21 +- .../iaas/models/create_key_pair_payload.py | 9 +- .../models/create_network_area_payload.py | 3 +- .../iaas/models/create_network_payload.py | 3 +- .../stackit/iaas/models/create_nic_payload.py | 3 +- .../stackit/iaas/models/create_protocol.py | 3 +- .../iaas/models/create_public_ip_payload.py | 3 +- .../models/create_security_group_payload.py | 3 +- .../iaas/models/create_server_payload.py | 18 +- .../iaas/models/create_snapshot_payload.py | 8 +- .../iaas/models/create_volume_payload.py | 8 +- .../iaas/src/stackit/iaas/models/image.py | 21 +- .../src/stackit/iaas/models/image_config.py | 29 ++- .../iaas/src/stackit/iaas/models/keypair.py | 9 +- .../iaas/src/stackit/iaas/models/network.py | 7 +- .../src/stackit/iaas/models/network_area.py | 7 +- services/iaas/src/stackit/iaas/models/nic.py | 3 +- .../partial_update_network_area_payload.py | 3 +- .../models/partial_update_network_payload.py | 3 +- .../iaas/src/stackit/iaas/models/protocol.py | 5 +- .../iaas/src/stackit/iaas/models/public_ip.py | 3 +- .../src/stackit/iaas/models/public_network.py | 95 +++++++ .../models/public_network_list_response.py | 97 ++++++++ .../iaas/src/stackit/iaas/models/request.py | 14 +- .../stackit/iaas/models/request_resource.py | 8 +- .../iaas/src/stackit/iaas/models/route.py | 3 +- .../src/stackit/iaas/models/security_group.py | 3 +- .../iaas/src/stackit/iaas/models/server.py | 18 +- .../src/stackit/iaas/models/server_network.py | 2 +- .../iaas/src/stackit/iaas/models/snapshot.py | 8 +- .../models/update_attached_volume_payload.py | 6 +- .../iaas/models/update_backup_payload.py | 8 +- .../iaas/models/update_image_payload.py | 7 +- .../iaas/models/update_key_pair_payload.py | 3 +- .../update_network_area_route_payload.py | 3 +- .../stackit/iaas/models/update_nic_payload.py | 3 +- .../iaas/models/update_public_ip_payload.py | 3 +- .../models/update_security_group_payload.py | 3 +- .../iaas/models/update_server_payload.py | 9 +- .../iaas/models/update_snapshot_payload.py | 3 +- .../iaas/models/update_volume_payload.py | 7 +- .../iaas/src/stackit/iaas/models/volume.py | 8 +- .../stackit/iaas/models/volume_attachment.py | 6 +- .../iaas/models/volume_performance_class.py | 3 +- .../src/stackit/iaas/models/volume_source.py | 4 +- 56 files changed, 662 insertions(+), 108 deletions(-) create mode 100644 services/iaas/src/stackit/iaas/models/public_network.py create mode 100644 services/iaas/src/stackit/iaas/models/public_network_list_response.py diff --git a/services/iaas/src/stackit/iaas/__init__.py b/services/iaas/src/stackit/iaas/__init__.py index 0dc4b778..c411341e 100644 --- a/services/iaas/src/stackit/iaas/__init__.py +++ b/services/iaas/src/stackit/iaas/__init__.py @@ -121,6 +121,8 @@ from stackit.iaas.models.protocol import Protocol from stackit.iaas.models.public_ip import PublicIp from stackit.iaas.models.public_ip_list_response import PublicIpListResponse +from stackit.iaas.models.public_network import PublicNetwork +from stackit.iaas.models.public_network_list_response import PublicNetworkListResponse from stackit.iaas.models.quota import Quota from stackit.iaas.models.quota_list import QuotaList from stackit.iaas.models.quota_list_response import QuotaListResponse diff --git a/services/iaas/src/stackit/iaas/api/default_api.py b/services/iaas/src/stackit/iaas/api/default_api.py index 2a26c2a0..69798872 100644 --- a/services/iaas/src/stackit/iaas/api/default_api.py +++ b/services/iaas/src/stackit/iaas/api/default_api.py @@ -83,6 +83,7 @@ from stackit.iaas.models.project_list_response import ProjectListResponse from stackit.iaas.models.public_ip import PublicIp from stackit.iaas.models.public_ip_list_response import PublicIpListResponse +from stackit.iaas.models.public_network_list_response import PublicNetworkListResponse from stackit.iaas.models.quota_list_response import QuotaListResponse from stackit.iaas.models.request import Request from stackit.iaas.models.rescue_server_payload import RescueServerPayload @@ -19540,6 +19541,7 @@ def list_images( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], + all: Annotated[Optional[StrictBool], Field(description="List all Images.")] = None, label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, @@ -19557,6 +19559,8 @@ def list_images( :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str + :param all: List all Images. + :type all: bool :param label_selector: Filter resources by labels. :type label_selector: str :param _request_timeout: timeout setting for this request. If one @@ -19583,6 +19587,7 @@ def list_images( _param = self._list_images_serialize( project_id=project_id, + all=all, label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, @@ -19612,6 +19617,7 @@ def list_images_with_http_info( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], + all: Annotated[Optional[StrictBool], Field(description="List all Images.")] = None, label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, @@ -19629,6 +19635,8 @@ def list_images_with_http_info( :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str + :param all: List all Images. + :type all: bool :param label_selector: Filter resources by labels. :type label_selector: str :param _request_timeout: timeout setting for this request. If one @@ -19655,6 +19663,7 @@ def list_images_with_http_info( _param = self._list_images_serialize( project_id=project_id, + all=all, label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, @@ -19684,6 +19693,7 @@ def list_images_without_preload_content( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], + all: Annotated[Optional[StrictBool], Field(description="List all Images.")] = None, label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, @@ -19701,6 +19711,8 @@ def list_images_without_preload_content( :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str + :param all: List all Images. + :type all: bool :param label_selector: Filter resources by labels. :type label_selector: str :param _request_timeout: timeout setting for this request. If one @@ -19727,6 +19739,7 @@ def list_images_without_preload_content( _param = self._list_images_serialize( project_id=project_id, + all=all, label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, @@ -19748,6 +19761,7 @@ def list_images_without_preload_content( def _list_images_serialize( self, project_id, + all, label_selector, _request_auth, _content_type, @@ -19770,6 +19784,10 @@ def _list_images_serialize( if project_id is not None: _path_params["projectId"] = project_id # process the query parameters + if all is not None: + + _query_params.append(("all", all)) + if label_selector is not None: _query_params.append(("label_selector", label_selector)) @@ -22266,6 +22284,223 @@ def _list_project_nics_serialize( _request_auth=_request_auth, ) + @validate_call + def list_public_ip_ranges( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PublicNetworkListResponse: + """List all public IP ranges. + + Get a list of all public IP ranges that STACKIT uses. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_public_ip_ranges_serialize( + _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PublicNetworkListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_public_ip_ranges_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PublicNetworkListResponse]: + """List all public IP ranges. + + Get a list of all public IP ranges that STACKIT uses. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_public_ip_ranges_serialize( + _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PublicNetworkListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_public_ip_ranges_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List all public IP ranges. + + Get a list of all public IP ranges that STACKIT uses. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_public_ip_ranges_serialize( + _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PublicNetworkListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_public_ip_ranges_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1beta1/networks/public-ip-ranges", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + @validate_call def list_public_ips( self, diff --git a/services/iaas/src/stackit/iaas/models/__init__.py b/services/iaas/src/stackit/iaas/models/__init__.py index 22b9c3b7..8dcb40fd 100644 --- a/services/iaas/src/stackit/iaas/models/__init__.py +++ b/services/iaas/src/stackit/iaas/models/__init__.py @@ -102,6 +102,8 @@ from stackit.iaas.models.protocol import Protocol from stackit.iaas.models.public_ip import PublicIp from stackit.iaas.models.public_ip_list_response import PublicIpListResponse +from stackit.iaas.models.public_network import PublicNetwork +from stackit.iaas.models.public_network_list_response import PublicNetworkListResponse from stackit.iaas.models.quota import Quota from stackit.iaas.models.quota_list import QuotaList from stackit.iaas.models.quota_list_response import QuotaListResponse diff --git a/services/iaas/src/stackit/iaas/models/add_volume_to_server_payload.py b/services/iaas/src/stackit/iaas/models/add_volume_to_server_payload.py index 2c835df8..8130efcb 100644 --- a/services/iaas/src/stackit/iaas/models/add_volume_to_server_payload.py +++ b/services/iaas/src/stackit/iaas/models/add_volume_to_server_payload.py @@ -29,7 +29,7 @@ class AddVolumeToServerPayload(BaseModel): """ delete_on_termination: Optional[StrictBool] = Field( - default=False, + default=None, description="Delete the volume during the termination of the server. Defaults to false.", alias="deleteOnTermination", ) @@ -122,9 +122,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "deleteOnTermination": ( - obj.get("deleteOnTermination") if obj.get("deleteOnTermination") is not None else False - ), + "deleteOnTermination": obj.get("deleteOnTermination"), "serverId": obj.get("serverId"), "volumeId": obj.get("volumeId"), } diff --git a/services/iaas/src/stackit/iaas/models/affinity_group.py b/services/iaas/src/stackit/iaas/models/affinity_group.py index 86807607..9ecd3787 100644 --- a/services/iaas/src/stackit/iaas/models/affinity_group.py +++ b/services/iaas/src/stackit/iaas/models/affinity_group.py @@ -37,7 +37,9 @@ class AffinityGroup(BaseModel): name: Annotated[str, Field(strict=True, max_length=63)] = Field( description="The name for a General Object. Matches Names and also UUIDs." ) - policy: StrictStr = Field(description="The affinity group policy.") + policy: StrictStr = Field( + 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`." + ) __properties: ClassVar[List[str]] = ["id", "members", "name", "policy"] @field_validator("id") diff --git a/services/iaas/src/stackit/iaas/models/backup.py b/services/iaas/src/stackit/iaas/models/backup.py index 0a3e8719..e5fe212e 100644 --- a/services/iaas/src/stackit/iaas/models/backup.py +++ b/services/iaas/src/stackit/iaas/models/backup.py @@ -39,7 +39,8 @@ class Backup(BaseModel): default=None, description="Universally Unique Identifier (UUID)." ) labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." @@ -48,7 +49,10 @@ class Backup(BaseModel): snapshot_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, description="Universally Unique Identifier (UUID).", alias="snapshotId" ) - status: Optional[StrictStr] = Field(default=None, description="The status of a backup object.") + status: Optional[StrictStr] = Field( + default=None, + description="The status of a backup object. Possible values: `AVAILABLE`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`.", + ) updated_at: Optional[datetime] = Field( default=None, description="Date-time when resource was last updated.", alias="updatedAt" ) diff --git a/services/iaas/src/stackit/iaas/models/backup_source.py b/services/iaas/src/stackit/iaas/models/backup_source.py index 1c1f86fd..0af211e9 100644 --- a/services/iaas/src/stackit/iaas/models/backup_source.py +++ b/services/iaas/src/stackit/iaas/models/backup_source.py @@ -31,7 +31,7 @@ class BackupSource(BaseModel): id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( description="Universally Unique Identifier (UUID)." ) - type: StrictStr = Field(description="The source types of a backup.") + type: StrictStr = Field(description="The source types of a backup. Possible values: `volume`, `snapshot`.") __properties: ClassVar[List[str]] = ["id", "type"] @field_validator("id") diff --git a/services/iaas/src/stackit/iaas/models/boot_volume.py b/services/iaas/src/stackit/iaas/models/boot_volume.py index 2cb17ef4..fe453a13 100644 --- a/services/iaas/src/stackit/iaas/models/boot_volume.py +++ b/services/iaas/src/stackit/iaas/models/boot_volume.py @@ -38,7 +38,7 @@ class BootVolume(BaseModel): """ delete_on_termination: Optional[StrictBool] = Field( - default=False, + default=None, description="Delete the volume during the termination of the server. Defaults to false.", alias="deleteOnTermination", ) @@ -134,9 +134,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "deleteOnTermination": ( - obj.get("deleteOnTermination") if obj.get("deleteOnTermination") is not None else False - ), + "deleteOnTermination": obj.get("deleteOnTermination"), "id": obj.get("id"), "performanceClass": obj.get("performanceClass"), "size": obj.get("size"), diff --git a/services/iaas/src/stackit/iaas/models/boot_volume_source.py b/services/iaas/src/stackit/iaas/models/boot_volume_source.py index 8242a3d4..fcbc9db8 100644 --- a/services/iaas/src/stackit/iaas/models/boot_volume_source.py +++ b/services/iaas/src/stackit/iaas/models/boot_volume_source.py @@ -31,7 +31,7 @@ class BootVolumeSource(BaseModel): id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( description="Universally Unique Identifier (UUID)." ) - type: StrictStr = Field(description="The source types of a boot volume.") + type: StrictStr = Field(description="The source types of a boot volume. Possible values: `image`, `volume`.") __properties: ClassVar[List[str]] = ["id", "type"] @field_validator("id") diff --git a/services/iaas/src/stackit/iaas/models/create_affinity_group_payload.py b/services/iaas/src/stackit/iaas/models/create_affinity_group_payload.py index c067ce72..67fd3c02 100644 --- a/services/iaas/src/stackit/iaas/models/create_affinity_group_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_affinity_group_payload.py @@ -37,7 +37,9 @@ class CreateAffinityGroupPayload(BaseModel): name: Annotated[str, Field(strict=True, max_length=63)] = Field( description="The name for a General Object. Matches Names and also UUIDs." ) - policy: StrictStr = Field(description="The affinity group policy.") + policy: StrictStr = Field( + 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`." + ) __properties: ClassVar[List[str]] = ["id", "members", "name", "policy"] @field_validator("id") diff --git a/services/iaas/src/stackit/iaas/models/create_backup_payload.py b/services/iaas/src/stackit/iaas/models/create_backup_payload.py index 734f6962..c3eddc73 100644 --- a/services/iaas/src/stackit/iaas/models/create_backup_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_backup_payload.py @@ -31,7 +31,8 @@ class CreateBackupPayload(BaseModel): """ labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." diff --git a/services/iaas/src/stackit/iaas/models/create_image_payload.py b/services/iaas/src/stackit/iaas/models/create_image_payload.py index 1cd178d4..1b9514f0 100644 --- a/services/iaas/src/stackit/iaas/models/create_image_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_image_payload.py @@ -45,12 +45,15 @@ class CreateImagePayload(BaseModel): created_at: Optional[datetime] = Field( default=None, description="Date-time when resource was created.", alias="createdAt" ) - disk_format: StrictStr = Field(description="Object that represents a disk format.", alias="diskFormat") + disk_format: StrictStr = Field( + description="Object that represents a disk format. Possible values: `raw`, `qcow2`, `iso`.", alias="diskFormat" + ) id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, description="Universally Unique Identifier (UUID)." ) labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) min_disk_size: Optional[StrictInt] = Field(default=None, description="Size in Gigabyte.", alias="minDiskSize") min_ram: Optional[StrictInt] = Field(default=None, description="Size in Megabyte.", alias="minRam") @@ -61,8 +64,14 @@ class CreateImagePayload(BaseModel): default=None, description="Universally Unique Identifier (UUID)." ) protected: Optional[StrictBool] = None - scope: Optional[StrictStr] = Field(default=None, description="Scope of an Image.") - status: Optional[StrictStr] = Field(default=None, description="The status of an image object.") + scope: Optional[StrictStr] = Field( + default=None, description="Scope of an Image. Possible values: `public`, `local`, `projects`, `organization`." + ) + size: Optional[StrictInt] = Field(default=None, description="Size in bytes.") + status: Optional[StrictStr] = Field( + default=None, + description="The status of an image object. Possible values: `AVAILABLE`, `CREATING`, `DEACTIVATED`, `DELETED`, `DELETING`, `ERROR`.", + ) updated_at: Optional[datetime] = Field( default=None, description="Date-time when resource was last updated.", alias="updatedAt" ) @@ -79,6 +88,7 @@ class CreateImagePayload(BaseModel): "owner", "protected", "scope", + "size", "status", "updatedAt", ] @@ -150,6 +160,7 @@ 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( [ @@ -158,6 +169,7 @@ def to_dict(self) -> Dict[str, Any]: "id", "owner", "scope", + "size", "status", "updated_at", ] @@ -199,6 +211,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "owner": obj.get("owner"), "protected": obj.get("protected"), "scope": obj.get("scope"), + "size": obj.get("size"), "status": obj.get("status"), "updatedAt": obj.get("updatedAt"), } diff --git a/services/iaas/src/stackit/iaas/models/create_key_pair_payload.py b/services/iaas/src/stackit/iaas/models/create_key_pair_payload.py index ab9e2391..59d8bc83 100644 --- a/services/iaas/src/stackit/iaas/models/create_key_pair_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_key_pair_payload.py @@ -36,7 +36,8 @@ class CreateKeyPairPayload(BaseModel): default=None, description="Object that represents an SSH keypair MD5 fingerprint." ) labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, @@ -73,9 +74,11 @@ def name_validate_regular_expression(cls, value): @field_validator("public_key") def public_key_validate_regular_expression(cls, value): """Validates the regular expression""" - if not re.match(r"^(ssh-rsa|ssh-ed25519)\s+[A-Za-z0-9+\/]+[=]{0,3}(\s+.+)?\s*$", value): + if not re.match( + r"^(ssh-rsa|ssh-ed25519|ecdsa-sha2-nistp(256|384|521))\s+[A-Za-z0-9+\/]+[=]{0,3}(\s+.+)?\s*$", value + ): raise ValueError( - r"must validate the regular expression /^(ssh-rsa|ssh-ed25519)\s+[A-Za-z0-9+\/]+[=]{0,3}(\s+.+)?\s*$/" + r"must validate the regular expression /^(ssh-rsa|ssh-ed25519|ecdsa-sha2-nistp(256|384|521))\s+[A-Za-z0-9+\/]+[=]{0,3}(\s+.+)?\s*$/" ) return value diff --git a/services/iaas/src/stackit/iaas/models/create_network_area_payload.py b/services/iaas/src/stackit/iaas/models/create_network_area_payload.py index ecb3ebac..0733001e 100644 --- a/services/iaas/src/stackit/iaas/models/create_network_area_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_network_area_payload.py @@ -32,7 +32,8 @@ class CreateNetworkAreaPayload(BaseModel): address_family: CreateAreaAddressFamily = Field(alias="addressFamily") labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) name: Annotated[str, Field(strict=True, max_length=63)] = Field( description="The name for a General Object. Matches Names and also UUIDs." diff --git a/services/iaas/src/stackit/iaas/models/create_network_payload.py b/services/iaas/src/stackit/iaas/models/create_network_payload.py index d204f7d7..da8c62e8 100644 --- a/services/iaas/src/stackit/iaas/models/create_network_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_network_payload.py @@ -32,7 +32,8 @@ class CreateNetworkPayload(BaseModel): address_family: Optional[CreateNetworkAddressFamily] = Field(default=None, alias="addressFamily") labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) name: Annotated[str, Field(strict=True, max_length=63)] = Field( description="The name for a General Object. Matches Names and also UUIDs." diff --git a/services/iaas/src/stackit/iaas/models/create_nic_payload.py b/services/iaas/src/stackit/iaas/models/create_nic_payload.py index 88c646f9..ad1a50e3 100644 --- a/services/iaas/src/stackit/iaas/models/create_nic_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_nic_payload.py @@ -53,7 +53,8 @@ class CreateNicPayload(BaseModel): default=None, description="Object that represents an IPv6 address." ) labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) mac: Optional[Annotated[str, Field(strict=True)]] = Field( default=None, description="Object that represents an MAC address." diff --git a/services/iaas/src/stackit/iaas/models/create_protocol.py b/services/iaas/src/stackit/iaas/models/create_protocol.py index 3227dda8..5626ace2 100644 --- a/services/iaas/src/stackit/iaas/models/create_protocol.py +++ b/services/iaas/src/stackit/iaas/models/create_protocol.py @@ -43,7 +43,8 @@ class CreateProtocol(BaseModel): ) # data type: str oneof_schema_2_validator: Optional[StrictStr] = Field( - default=None, description="The protocol name which the rule should match." + default=None, + description="The protocol name which the rule should match. Possible values: `ah`, `dccp`, `egp`, `esp`, `gre`, `icmp`, `igmp`, `ipip`, `ipv6-encap`, `ipv6-frag`, `ipv6-icmp`, `ipv6-nonxt`, `ipv6-opts`, `ipv6-route`, `ospf`, `pgm`, `rsvp`, `sctp`, `tcp`, `udp`, `udplite`, `vrrp`.", ) actual_instance: Optional[Union[int, str]] = None one_of_schemas: Set[str] = {"int", "str"} diff --git a/services/iaas/src/stackit/iaas/models/create_public_ip_payload.py b/services/iaas/src/stackit/iaas/models/create_public_ip_payload.py index 897e0b41..98b25c31 100644 --- a/services/iaas/src/stackit/iaas/models/create_public_ip_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_public_ip_payload.py @@ -35,7 +35,8 @@ class CreatePublicIPPayload(BaseModel): default=None, description="Object that represents an IP address." ) labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) network_interface: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, diff --git a/services/iaas/src/stackit/iaas/models/create_security_group_payload.py b/services/iaas/src/stackit/iaas/models/create_security_group_payload.py index 8686b37f..bc9d92a9 100644 --- a/services/iaas/src/stackit/iaas/models/create_security_group_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_security_group_payload.py @@ -41,7 +41,8 @@ class CreateSecurityGroupPayload(BaseModel): default=None, description="Universally Unique Identifier (UUID)." ) labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) name: Annotated[str, Field(strict=True, max_length=63)] = Field( description="The name for a General Object. Matches Names and also UUIDs." diff --git a/services/iaas/src/stackit/iaas/models/create_server_payload.py b/services/iaas/src/stackit/iaas/models/create_server_payload.py index ece0666c..53fef3b3 100644 --- a/services/iaas/src/stackit/iaas/models/create_server_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_server_payload.py @@ -62,11 +62,12 @@ class CreateServerPayload(BaseModel): image_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, description="Universally Unique Identifier (UUID).", alias="imageId" ) - keypair_name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( + keypair_name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, description="The SSH keypair used during the server creation.", alias="keypairName" ) labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) launched_at: Optional[datetime] = Field( default=None, description="Date-time when resource was launched.", alias="launchedAt" @@ -82,7 +83,9 @@ class CreateServerPayload(BaseModel): description="The list of network interfaces (NICs) attached to the server. Only shown when detailed information is requested.", ) power_status: Optional[StrictStr] = Field( - default=None, description="The power status of a server.", alias="powerStatus" + default=None, + description="The power status of a server. Possible values: `CRASHED`, `ERROR`, `RUNNING`, `STOPPED`.", + alias="powerStatus", ) security_groups: Optional[List[Annotated[str, Field(strict=True, max_length=63)]]] = Field( default=None, description="The initial security groups for the server creation.", alias="securityGroups" @@ -94,7 +97,10 @@ class CreateServerPayload(BaseModel): description="A list of service account mails. Only shown when detailed information is requested.", alias="serviceAccountMails", ) - status: Optional[StrictStr] = Field(default=None, description="The status of a server object.") + status: Optional[StrictStr] = Field( + default=None, + description="The status of a server object. Possible values: `ACTIVE`, `BACKING-UP`, `CREATING`, `DEALLOCATED`, `DEALLOCATING`, `DELETED`, `DELETING`, `ERROR`, `INACTIVE`, `MIGRATING`, `REBOOT`, `REBOOTING`, `REBUILD`, `REBUILDING`, `RESCUE`, `RESCUING`, `RESIZING`, `RESTORING`, `SNAPSHOTTING`, `STARTING`, `STOPPING`, `UNRESCUING`, `UPDATING`.", + ) updated_at: Optional[datetime] = Field( default=None, description="Date-time when resource was last updated.", alias="updatedAt" ) @@ -173,8 +179,8 @@ def keypair_name_validate_regular_expression(cls, value): if value is None: return value - if not re.match(r"^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$", value): - raise ValueError(r"must validate the regular expression /^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$/") + if not re.match(r"^[A-Za-z0-9@._-]*$", value): + raise ValueError(r"must validate the regular expression /^[A-Za-z0-9@._-]*$/") return value @field_validator("machine_type") diff --git a/services/iaas/src/stackit/iaas/models/create_snapshot_payload.py b/services/iaas/src/stackit/iaas/models/create_snapshot_payload.py index 19ff3de0..88918d3a 100644 --- a/services/iaas/src/stackit/iaas/models/create_snapshot_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_snapshot_payload.py @@ -36,13 +36,17 @@ class CreateSnapshotPayload(BaseModel): default=None, description="Universally Unique Identifier (UUID)." ) labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." ) size: Optional[StrictInt] = Field(default=None, description="Size in Gigabyte.") - status: Optional[StrictStr] = Field(default=None, description="The status of a snapshot object.") + status: Optional[StrictStr] = Field( + default=None, + description="The status of a snapshot object. Possible values: `AVAILABLE`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`, `UNMANAGING`, `UPDATING`.", + ) updated_at: Optional[datetime] = Field( default=None, description="Date-time when resource was last updated.", alias="updatedAt" ) diff --git a/services/iaas/src/stackit/iaas/models/create_volume_payload.py b/services/iaas/src/stackit/iaas/models/create_volume_payload.py index d7ed3e7d..b7f49e74 100644 --- a/services/iaas/src/stackit/iaas/models/create_volume_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_volume_payload.py @@ -55,7 +55,8 @@ class CreateVolumePayload(BaseModel): ) image_config: Optional[ImageConfig] = Field(default=None, alias="imageConfig") labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." @@ -70,7 +71,10 @@ class CreateVolumePayload(BaseModel): ) size: Optional[StrictInt] = Field(default=None, description="Size in Gigabyte.") source: Optional[VolumeSource] = None - status: Optional[StrictStr] = Field(default=None, description="The status of a volume object.") + status: Optional[StrictStr] = Field( + default=None, + description="The status of a volume object. Possible values: `ATTACHED`, `ATTACHING`, `AVAILABLE`, `AWAITING-TRANSFER`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `DETACHING`, `DOWNLOADING`, `ERROR`, `ERROR_BACKING-UP`, `ERROR_DELETING`, `ERROR_RESIZING`, `ERROR_RESTORING-BACKUP`, `MAINTENANCE`, `RESERVED`, `RESIZING`, `RESTORING-BACKUP`, `RETYPING`, `UPLOADING`.", + ) updated_at: Optional[datetime] = Field( default=None, description="Date-time when resource was last updated.", alias="updatedAt" ) diff --git a/services/iaas/src/stackit/iaas/models/image.py b/services/iaas/src/stackit/iaas/models/image.py index b9ab3131..b85afa23 100644 --- a/services/iaas/src/stackit/iaas/models/image.py +++ b/services/iaas/src/stackit/iaas/models/image.py @@ -45,12 +45,15 @@ class Image(BaseModel): created_at: Optional[datetime] = Field( default=None, description="Date-time when resource was created.", alias="createdAt" ) - disk_format: StrictStr = Field(description="Object that represents a disk format.", alias="diskFormat") + disk_format: StrictStr = Field( + description="Object that represents a disk format. Possible values: `raw`, `qcow2`, `iso`.", alias="diskFormat" + ) id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, description="Universally Unique Identifier (UUID)." ) labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) min_disk_size: Optional[StrictInt] = Field(default=None, description="Size in Gigabyte.", alias="minDiskSize") min_ram: Optional[StrictInt] = Field(default=None, description="Size in Megabyte.", alias="minRam") @@ -61,8 +64,14 @@ class Image(BaseModel): default=None, description="Universally Unique Identifier (UUID)." ) protected: Optional[StrictBool] = None - scope: Optional[StrictStr] = Field(default=None, description="Scope of an Image.") - status: Optional[StrictStr] = Field(default=None, description="The status of an image object.") + scope: Optional[StrictStr] = Field( + default=None, description="Scope of an Image. Possible values: `public`, `local`, `projects`, `organization`." + ) + size: Optional[StrictInt] = Field(default=None, description="Size in bytes.") + status: Optional[StrictStr] = Field( + default=None, + description="The status of an image object. Possible values: `AVAILABLE`, `CREATING`, `DEACTIVATED`, `DELETED`, `DELETING`, `ERROR`.", + ) updated_at: Optional[datetime] = Field( default=None, description="Date-time when resource was last updated.", alias="updatedAt" ) @@ -79,6 +88,7 @@ class Image(BaseModel): "owner", "protected", "scope", + "size", "status", "updatedAt", ] @@ -150,6 +160,7 @@ 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( [ @@ -158,6 +169,7 @@ def to_dict(self) -> Dict[str, Any]: "id", "owner", "scope", + "size", "status", "updated_at", ] @@ -199,6 +211,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "owner": obj.get("owner"), "protected": obj.get("protected"), "scope": obj.get("scope"), + "size": obj.get("size"), "status": obj.get("status"), "updatedAt": obj.get("updatedAt"), } diff --git a/services/iaas/src/stackit/iaas/models/image_config.py b/services/iaas/src/stackit/iaas/models/image_config.py index e3914bdb..39780ea5 100644 --- a/services/iaas/src/stackit/iaas/models/image_config.py +++ b/services/iaas/src/stackit/iaas/models/image_config.py @@ -27,7 +27,12 @@ class ImageConfig(BaseModel): Properties to set hardware and scheduling settings for an Image. """ - boot_menu: Optional[StrictBool] = Field(default=False, description="Enables the BIOS bootmenu.", alias="bootMenu") + architecture: Optional[StrictStr] = Field( + default=None, description="Represents CPU architecture. The default for new images is x86." + ) + boot_menu: Optional[StrictBool] = Field( + default=None, description="Enables the BIOS bootmenu. The default for new images is disabled.", alias="bootMenu" + ) cdrom_bus: Optional[StrictStr] = Field( default=None, description="Sets CDROM bus controller type.", alias="cdromBus" ) @@ -48,15 +53,20 @@ class ImageConfig(BaseModel): rescue_device: Optional[StrictStr] = Field( default=None, description="Sets the device when the image is used as a rescue image.", alias="rescueDevice" ) - secure_boot: Optional[StrictBool] = Field(default=False, description="Enables Secure Boot.", alias="secureBoot") - uefi: Optional[StrictBool] = Field(default=False, description="Enables UEFI boot.") + secure_boot: Optional[StrictBool] = Field( + default=None, description="Enables Secure Boot. The default for new images is disabled.", alias="secureBoot" + ) + uefi: Optional[StrictBool] = Field( + default=None, description="Configure UEFI boot. The default for new images is enabled." + ) video_model: Optional[StrictStr] = Field(default=None, description="Sets Graphic device model.", alias="videoModel") virtio_scsi: Optional[StrictBool] = Field( - default=False, - description="Enables the use of VirtIO SCSI to provide block device access. By default instances use VirtIO Block.", + default=None, + description="Enables the use of VirtIO SCSI to provide block device access. By default servers use VirtIO Block.", alias="virtioScsi", ) __properties: ClassVar[List[str]] = [ + "architecture", "bootMenu", "cdromBus", "diskBus", @@ -162,7 +172,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "bootMenu": obj.get("bootMenu") if obj.get("bootMenu") is not None else False, + "architecture": obj.get("architecture"), + "bootMenu": obj.get("bootMenu"), "cdromBus": obj.get("cdromBus"), "diskBus": obj.get("diskBus"), "nicModel": obj.get("nicModel"), @@ -171,10 +182,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "operatingSystemVersion": obj.get("operatingSystemVersion"), "rescueBus": obj.get("rescueBus"), "rescueDevice": obj.get("rescueDevice"), - "secureBoot": obj.get("secureBoot") if obj.get("secureBoot") is not None else False, - "uefi": obj.get("uefi") if obj.get("uefi") is not None else False, + "secureBoot": obj.get("secureBoot"), + "uefi": obj.get("uefi"), "videoModel": obj.get("videoModel"), - "virtioScsi": obj.get("virtioScsi") if obj.get("virtioScsi") is not None else False, + "virtioScsi": obj.get("virtioScsi"), } ) return _obj diff --git a/services/iaas/src/stackit/iaas/models/keypair.py b/services/iaas/src/stackit/iaas/models/keypair.py index d11d1d03..40444be2 100644 --- a/services/iaas/src/stackit/iaas/models/keypair.py +++ b/services/iaas/src/stackit/iaas/models/keypair.py @@ -36,7 +36,8 @@ class Keypair(BaseModel): default=None, description="Object that represents an SSH keypair MD5 fingerprint." ) labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, @@ -73,9 +74,11 @@ def name_validate_regular_expression(cls, value): @field_validator("public_key") def public_key_validate_regular_expression(cls, value): """Validates the regular expression""" - if not re.match(r"^(ssh-rsa|ssh-ed25519)\s+[A-Za-z0-9+\/]+[=]{0,3}(\s+.+)?\s*$", value): + if not re.match( + r"^(ssh-rsa|ssh-ed25519|ecdsa-sha2-nistp(256|384|521))\s+[A-Za-z0-9+\/]+[=]{0,3}(\s+.+)?\s*$", value + ): raise ValueError( - r"must validate the regular expression /^(ssh-rsa|ssh-ed25519)\s+[A-Za-z0-9+\/]+[=]{0,3}(\s+.+)?\s*$/" + r"must validate the regular expression /^(ssh-rsa|ssh-ed25519|ecdsa-sha2-nistp(256|384|521))\s+[A-Za-z0-9+\/]+[=]{0,3}(\s+.+)?\s*$/" ) return value diff --git a/services/iaas/src/stackit/iaas/models/network.py b/services/iaas/src/stackit/iaas/models/network.py index a80a3832..d9f98f26 100644 --- a/services/iaas/src/stackit/iaas/models/network.py +++ b/services/iaas/src/stackit/iaas/models/network.py @@ -48,7 +48,8 @@ class Network(BaseModel): description="The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway.", ) labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) name: StrictStr nameservers: Optional[Annotated[List[Annotated[str, Field(strict=True)]], Field(max_length=3)]] = Field( @@ -68,7 +69,9 @@ class Network(BaseModel): routed: Optional[StrictBool] = Field( default=None, description="Shows if the network is routed and therefore accessible from other networks." ) - state: StrictStr = Field(description="The state of a resource object.") + state: StrictStr = Field( + description="The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`." + ) updated_at: Optional[datetime] = Field( default=None, description="Date-time when resource was last updated.", alias="updatedAt" ) diff --git a/services/iaas/src/stackit/iaas/models/network_area.py b/services/iaas/src/stackit/iaas/models/network_area.py index b64832bf..59c2e378 100644 --- a/services/iaas/src/stackit/iaas/models/network_area.py +++ b/services/iaas/src/stackit/iaas/models/network_area.py @@ -39,13 +39,16 @@ class NetworkArea(BaseModel): ) ipv4: Optional[NetworkAreaIPv4] = None labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) name: StrictStr project_count: Annotated[int, Field(strict=True, ge=0)] = Field( description="The amount of projects currently referencing a specific area.", alias="projectCount" ) - state: StrictStr = Field(description="The state of a resource object.") + state: StrictStr = Field( + description="The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`." + ) updated_at: Optional[datetime] = Field( default=None, description="Date-time when resource was last updated.", alias="updatedAt" ) diff --git a/services/iaas/src/stackit/iaas/models/nic.py b/services/iaas/src/stackit/iaas/models/nic.py index 96ba52b1..1ae289a9 100644 --- a/services/iaas/src/stackit/iaas/models/nic.py +++ b/services/iaas/src/stackit/iaas/models/nic.py @@ -53,7 +53,8 @@ class NIC(BaseModel): default=None, description="Object that represents an IPv6 address." ) labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) mac: Optional[Annotated[str, Field(strict=True)]] = Field( default=None, description="Object that represents an MAC address." diff --git a/services/iaas/src/stackit/iaas/models/partial_update_network_area_payload.py b/services/iaas/src/stackit/iaas/models/partial_update_network_area_payload.py index aab8c6da..f3f14c54 100644 --- a/services/iaas/src/stackit/iaas/models/partial_update_network_area_payload.py +++ b/services/iaas/src/stackit/iaas/models/partial_update_network_area_payload.py @@ -32,7 +32,8 @@ class PartialUpdateNetworkAreaPayload(BaseModel): address_family: Optional[UpdateAreaAddressFamily] = Field(default=None, alias="addressFamily") labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." diff --git a/services/iaas/src/stackit/iaas/models/partial_update_network_payload.py b/services/iaas/src/stackit/iaas/models/partial_update_network_payload.py index 9a1f541a..5f75a270 100644 --- a/services/iaas/src/stackit/iaas/models/partial_update_network_payload.py +++ b/services/iaas/src/stackit/iaas/models/partial_update_network_payload.py @@ -32,7 +32,8 @@ class PartialUpdateNetworkPayload(BaseModel): address_family: Optional[UpdateNetworkAddressFamily] = Field(default=None, alias="addressFamily") labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." diff --git a/services/iaas/src/stackit/iaas/models/protocol.py b/services/iaas/src/stackit/iaas/models/protocol.py index c0732308..4e174c6f 100644 --- a/services/iaas/src/stackit/iaas/models/protocol.py +++ b/services/iaas/src/stackit/iaas/models/protocol.py @@ -27,7 +27,10 @@ class Protocol(BaseModel): The schema for a protocol of a security group rule. """ - name: Optional[StrictStr] = Field(default=None, description="The protocol name which the rule should match.") + name: Optional[StrictStr] = Field( + default=None, + description="The protocol name which the rule should match. Possible values: `ah`, `dccp`, `egp`, `esp`, `gre`, `icmp`, `igmp`, `ipip`, `ipv6-encap`, `ipv6-frag`, `ipv6-icmp`, `ipv6-nonxt`, `ipv6-opts`, `ipv6-route`, `ospf`, `pgm`, `rsvp`, `sctp`, `tcp`, `udp`, `udplite`, `vrrp`.", + ) number: Optional[Annotated[int, Field(le=255, strict=True, ge=0)]] = Field( default=None, description="The protocol number which the rule should match." ) diff --git a/services/iaas/src/stackit/iaas/models/public_ip.py b/services/iaas/src/stackit/iaas/models/public_ip.py index 1ac17ce7..9e08080a 100644 --- a/services/iaas/src/stackit/iaas/models/public_ip.py +++ b/services/iaas/src/stackit/iaas/models/public_ip.py @@ -35,7 +35,8 @@ class PublicIp(BaseModel): default=None, description="Object that represents an IP address." ) labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) network_interface: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, diff --git a/services/iaas/src/stackit/iaas/models/public_network.py b/services/iaas/src/stackit/iaas/models/public_network.py new file mode 100644 index 00000000..45983a29 --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/public_network.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + 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 +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing_extensions import Annotated, Self + + +class PublicNetwork(BaseModel): + """ + Public network. + """ + + cidr: Annotated[str, Field(strict=True)] = Field(description="Classless Inter-Domain Routing (CIDR).") + __properties: ClassVar[List[str]] = ["cidr"] + + @field_validator("cidr") + def cidr_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match( + r"^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$", + value, + ): + raise ValueError( + r"must validate the regular expression /^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$/" + ) + return value + + 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 PublicNetwork 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 PublicNetwork from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"cidr": obj.get("cidr")}) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/public_network_list_response.py b/services/iaas/src/stackit/iaas/models/public_network_list_response.py new file mode 100644 index 00000000..397ad308 --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/public_network_list_response.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + 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 +from typing_extensions import Self + +from stackit.iaas.models.public_network import PublicNetwork + + +class PublicNetworkListResponse(BaseModel): + """ + Public network list response. + """ + + items: List[PublicNetwork] = Field(description="A list of public networks.") + __properties: ClassVar[List[str]] = ["items"] + + 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 PublicNetworkListResponse 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, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item in self.items: + if _item: + _items.append(_item.to_dict()) + _dict["items"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PublicNetworkListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "items": ( + [PublicNetwork.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + ) + } + ) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/request.py b/services/iaas/src/stackit/iaas/models/request.py index 25fbafa8..e24a3e06 100644 --- a/services/iaas/src/stackit/iaas/models/request.py +++ b/services/iaas/src/stackit/iaas/models/request.py @@ -31,13 +31,21 @@ class Request(BaseModel): """ details: Optional[StrictStr] = None - request_action: StrictStr = Field(description="Object that represents a resource action.", alias="requestAction") + request_action: StrictStr = Field( + description="Object that represents a resource action. Possible values: `CREATE`, `DELETE`, `UPDATE`.", + alias="requestAction", + ) request_id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( description="Identifier (ID) representing a single API request.", alias="requestId" ) - request_type: StrictStr = Field(description="Object that represents a resource type.", alias="requestType") + request_type: StrictStr = Field( + description="Object that represents a resource type. Possible values: `BACKUP`, `IMAGE`, `NETWORK`, `NETWORKAREA`, `NIC`, `PROJECT`, `ROUTE`, `SERVER`, `SERVICEACCOUNT`, `SNAPSHOT`, `VIRTUALIP`, `VOLUME`.", + alias="requestType", + ) resources: List[RequestResource] - status: StrictStr = Field(description="The state of a resource object.") + status: StrictStr = Field( + description="The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`." + ) __properties: ClassVar[List[str]] = ["details", "requestAction", "requestId", "requestType", "resources", "status"] @field_validator("request_id") diff --git a/services/iaas/src/stackit/iaas/models/request_resource.py b/services/iaas/src/stackit/iaas/models/request_resource.py index 630aa7a3..9b7b108f 100644 --- a/services/iaas/src/stackit/iaas/models/request_resource.py +++ b/services/iaas/src/stackit/iaas/models/request_resource.py @@ -31,8 +31,12 @@ class RequestResource(BaseModel): id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( description="Universally Unique Identifier (UUID)." ) - status: StrictStr = Field(description="The state of a resource object.") - type: StrictStr = Field(description="Object that represents a resource type.") + status: StrictStr = Field( + description="The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`." + ) + type: StrictStr = Field( + description="Object that represents a resource type. Possible values: `BACKUP`, `IMAGE`, `NETWORK`, `NETWORKAREA`, `NIC`, `PROJECT`, `ROUTE`, `SERVER`, `SERVICEACCOUNT`, `SNAPSHOT`, `VIRTUALIP`, `VOLUME`." + ) __properties: ClassVar[List[str]] = ["id", "status", "type"] @field_validator("id") diff --git a/services/iaas/src/stackit/iaas/models/route.py b/services/iaas/src/stackit/iaas/models/route.py index 538db068..39358d34 100644 --- a/services/iaas/src/stackit/iaas/models/route.py +++ b/services/iaas/src/stackit/iaas/models/route.py @@ -33,7 +33,8 @@ class Route(BaseModel): default=None, description="Date-time when resource was created.", alias="createdAt" ) labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) nexthop: Annotated[str, Field(strict=True)] = Field(description="Object that represents an IP address.") prefix: Annotated[str, Field(strict=True)] = Field(description="Classless Inter-Domain Routing (CIDR).") diff --git a/services/iaas/src/stackit/iaas/models/security_group.py b/services/iaas/src/stackit/iaas/models/security_group.py index 8c46c39a..8814a099 100644 --- a/services/iaas/src/stackit/iaas/models/security_group.py +++ b/services/iaas/src/stackit/iaas/models/security_group.py @@ -41,7 +41,8 @@ class SecurityGroup(BaseModel): default=None, description="Universally Unique Identifier (UUID)." ) labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) name: Annotated[str, Field(strict=True, max_length=63)] = Field( description="The name for a General Object. Matches Names and also UUIDs." diff --git a/services/iaas/src/stackit/iaas/models/server.py b/services/iaas/src/stackit/iaas/models/server.py index b1ea23a1..0ffc1f41 100644 --- a/services/iaas/src/stackit/iaas/models/server.py +++ b/services/iaas/src/stackit/iaas/models/server.py @@ -62,11 +62,12 @@ class Server(BaseModel): image_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, description="Universally Unique Identifier (UUID).", alias="imageId" ) - keypair_name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( + keypair_name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, description="The SSH keypair used during the server creation.", alias="keypairName" ) labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) launched_at: Optional[datetime] = Field( default=None, description="Date-time when resource was launched.", alias="launchedAt" @@ -82,7 +83,9 @@ class Server(BaseModel): description="The list of network interfaces (NICs) attached to the server. Only shown when detailed information is requested.", ) power_status: Optional[StrictStr] = Field( - default=None, description="The power status of a server.", alias="powerStatus" + default=None, + description="The power status of a server. Possible values: `CRASHED`, `ERROR`, `RUNNING`, `STOPPED`.", + alias="powerStatus", ) security_groups: Optional[List[Annotated[str, Field(strict=True, max_length=63)]]] = Field( default=None, description="The initial security groups for the server creation.", alias="securityGroups" @@ -94,7 +97,10 @@ class Server(BaseModel): description="A list of service account mails. Only shown when detailed information is requested.", alias="serviceAccountMails", ) - status: Optional[StrictStr] = Field(default=None, description="The status of a server object.") + status: Optional[StrictStr] = Field( + default=None, + description="The status of a server object. Possible values: `ACTIVE`, `BACKING-UP`, `CREATING`, `DEALLOCATED`, `DEALLOCATING`, `DELETED`, `DELETING`, `ERROR`, `INACTIVE`, `MIGRATING`, `REBOOT`, `REBOOTING`, `REBUILD`, `REBUILDING`, `RESCUE`, `RESCUING`, `RESIZING`, `RESTORING`, `SNAPSHOTTING`, `STARTING`, `STOPPING`, `UNRESCUING`, `UPDATING`.", + ) updated_at: Optional[datetime] = Field( default=None, description="Date-time when resource was last updated.", alias="updatedAt" ) @@ -173,8 +179,8 @@ def keypair_name_validate_regular_expression(cls, value): if value is None: return value - if not re.match(r"^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$", value): - raise ValueError(r"must validate the regular expression /^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$/") + if not re.match(r"^[A-Za-z0-9@._-]*$", value): + raise ValueError(r"must validate the regular expression /^[A-Za-z0-9@._-]*$/") return value @field_validator("machine_type") diff --git a/services/iaas/src/stackit/iaas/models/server_network.py b/services/iaas/src/stackit/iaas/models/server_network.py index a72b8dd6..50547b2d 100644 --- a/services/iaas/src/stackit/iaas/models/server_network.py +++ b/services/iaas/src/stackit/iaas/models/server_network.py @@ -217,7 +217,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "networkId": obj.get("networkId"), "networkName": obj.get("networkName"), "nicId": obj.get("nicId"), - "nicSecurity": obj.get("nicSecurity") if obj.get("nicSecurity") is not None else True, + "nicSecurity": obj.get("nicSecurity"), "publicIp": obj.get("publicIp"), "securityGroups": obj.get("securityGroups"), } diff --git a/services/iaas/src/stackit/iaas/models/snapshot.py b/services/iaas/src/stackit/iaas/models/snapshot.py index 2c13cc7b..236c2c43 100644 --- a/services/iaas/src/stackit/iaas/models/snapshot.py +++ b/services/iaas/src/stackit/iaas/models/snapshot.py @@ -36,13 +36,17 @@ class Snapshot(BaseModel): default=None, description="Universally Unique Identifier (UUID)." ) labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." ) size: Optional[StrictInt] = Field(default=None, description="Size in Gigabyte.") - status: Optional[StrictStr] = Field(default=None, description="The status of a snapshot object.") + status: Optional[StrictStr] = Field( + default=None, + description="The status of a snapshot object. Possible values: `AVAILABLE`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`, `UNMANAGING`, `UPDATING`.", + ) updated_at: Optional[datetime] = Field( default=None, description="Date-time when resource was last updated.", alias="updatedAt" ) diff --git a/services/iaas/src/stackit/iaas/models/update_attached_volume_payload.py b/services/iaas/src/stackit/iaas/models/update_attached_volume_payload.py index 27fa3cfd..acb29f41 100644 --- a/services/iaas/src/stackit/iaas/models/update_attached_volume_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_attached_volume_payload.py @@ -29,7 +29,7 @@ class UpdateAttachedVolumePayload(BaseModel): """ delete_on_termination: Optional[StrictBool] = Field( - default=False, + default=None, description="Delete the volume during the termination of the server. Defaults to false.", alias="deleteOnTermination", ) @@ -122,9 +122,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "deleteOnTermination": ( - obj.get("deleteOnTermination") if obj.get("deleteOnTermination") is not None else False - ), + "deleteOnTermination": obj.get("deleteOnTermination"), "serverId": obj.get("serverId"), "volumeId": obj.get("volumeId"), } diff --git a/services/iaas/src/stackit/iaas/models/update_backup_payload.py b/services/iaas/src/stackit/iaas/models/update_backup_payload.py index 40d22103..743ae981 100644 --- a/services/iaas/src/stackit/iaas/models/update_backup_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_backup_payload.py @@ -39,7 +39,8 @@ class UpdateBackupPayload(BaseModel): default=None, description="Universally Unique Identifier (UUID)." ) labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." @@ -48,7 +49,10 @@ class UpdateBackupPayload(BaseModel): snapshot_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, description="Universally Unique Identifier (UUID).", alias="snapshotId" ) - status: Optional[StrictStr] = Field(default=None, description="The status of a backup object.") + status: Optional[StrictStr] = Field( + default=None, + description="The status of a backup object. Possible values: `AVAILABLE`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`.", + ) updated_at: Optional[datetime] = Field( default=None, description="Date-time when resource was last updated.", alias="updatedAt" ) diff --git a/services/iaas/src/stackit/iaas/models/update_image_payload.py b/services/iaas/src/stackit/iaas/models/update_image_payload.py index 7e612777..57ae742c 100644 --- a/services/iaas/src/stackit/iaas/models/update_image_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_image_payload.py @@ -40,10 +40,13 @@ class UpdateImagePayload(BaseModel): config: Optional[ImageConfig] = None disk_format: Optional[StrictStr] = Field( - default=None, description="Object that represents a disk format.", alias="diskFormat" + default=None, + description="Object that represents a disk format. Possible values: `raw`, `qcow2`, `iso`.", + alias="diskFormat", ) labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) min_disk_size: Optional[StrictInt] = Field(default=None, description="Size in Gigabyte.", alias="minDiskSize") min_ram: Optional[StrictInt] = Field(default=None, description="Size in Megabyte.", alias="minRam") diff --git a/services/iaas/src/stackit/iaas/models/update_key_pair_payload.py b/services/iaas/src/stackit/iaas/models/update_key_pair_payload.py index dca572d1..3b3e4b92 100644 --- a/services/iaas/src/stackit/iaas/models/update_key_pair_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_key_pair_payload.py @@ -28,7 +28,8 @@ class UpdateKeyPairPayload(BaseModel): """ labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) __properties: ClassVar[List[str]] = ["labels"] diff --git a/services/iaas/src/stackit/iaas/models/update_network_area_route_payload.py b/services/iaas/src/stackit/iaas/models/update_network_area_route_payload.py index 347e2ffc..c581fd09 100644 --- a/services/iaas/src/stackit/iaas/models/update_network_area_route_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_network_area_route_payload.py @@ -28,7 +28,8 @@ class UpdateNetworkAreaRoutePayload(BaseModel): """ labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) __properties: ClassVar[List[str]] = ["labels"] diff --git a/services/iaas/src/stackit/iaas/models/update_nic_payload.py b/services/iaas/src/stackit/iaas/models/update_nic_payload.py index ee8d64e2..38fa165a 100644 --- a/services/iaas/src/stackit/iaas/models/update_nic_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_nic_payload.py @@ -34,7 +34,8 @@ class UpdateNicPayload(BaseModel): default=None, description="A list of IPs or CIDR notations.", alias="allowedAddresses" ) labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." diff --git a/services/iaas/src/stackit/iaas/models/update_public_ip_payload.py b/services/iaas/src/stackit/iaas/models/update_public_ip_payload.py index 583599da..a1bdd23d 100644 --- a/services/iaas/src/stackit/iaas/models/update_public_ip_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_public_ip_payload.py @@ -35,7 +35,8 @@ class UpdatePublicIPPayload(BaseModel): default=None, description="Object that represents an IP address." ) labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) network_interface: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, diff --git a/services/iaas/src/stackit/iaas/models/update_security_group_payload.py b/services/iaas/src/stackit/iaas/models/update_security_group_payload.py index 8709a3d1..0d55adf8 100644 --- a/services/iaas/src/stackit/iaas/models/update_security_group_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_security_group_payload.py @@ -32,7 +32,8 @@ class UpdateSecurityGroupPayload(BaseModel): default=None, description="Description Object. Allows string up to 127 Characters." ) labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." diff --git a/services/iaas/src/stackit/iaas/models/update_server_payload.py b/services/iaas/src/stackit/iaas/models/update_server_payload.py index 7a5a1dd0..c6ab6bd0 100644 --- a/services/iaas/src/stackit/iaas/models/update_server_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_server_payload.py @@ -29,10 +29,11 @@ class UpdateServerPayload(BaseModel): """ labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( - default=None, description="The name for a General Object. Matches Names and also UUIDs." + default=None, description="The name for a Server." ) __properties: ClassVar[List[str]] = ["labels", "name"] @@ -42,8 +43,8 @@ def name_validate_regular_expression(cls, value): if value is None: return value - if not re.match(r"^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$", value): - raise ValueError(r"must validate the regular expression /^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$/") + if not re.match(r"^[A-Za-z0-9]+((-|\.)[A-Za-z0-9]+)*$", value): + raise ValueError(r"must validate the regular expression /^[A-Za-z0-9]+((-|\.)[A-Za-z0-9]+)*$/") return value model_config = ConfigDict( diff --git a/services/iaas/src/stackit/iaas/models/update_snapshot_payload.py b/services/iaas/src/stackit/iaas/models/update_snapshot_payload.py index ac9f2ac6..974a8cfd 100644 --- a/services/iaas/src/stackit/iaas/models/update_snapshot_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_snapshot_payload.py @@ -29,7 +29,8 @@ class UpdateSnapshotPayload(BaseModel): """ labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." diff --git a/services/iaas/src/stackit/iaas/models/update_volume_payload.py b/services/iaas/src/stackit/iaas/models/update_volume_payload.py index 416c7f6d..f9810ab8 100644 --- a/services/iaas/src/stackit/iaas/models/update_volume_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_volume_payload.py @@ -30,13 +30,14 @@ class UpdateVolumePayload(BaseModel): Object that represents an update request body of a volume. """ - bootable: Optional[StrictBool] = Field(default=False, description="Indicates if a volume is bootable.") + bootable: Optional[StrictBool] = Field(default=None, description="Indicates if a volume is bootable.") description: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, description="Description Object. Allows string up to 127 Characters." ) image_config: Optional[ImageConfig] = Field(default=None, alias="imageConfig") labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." @@ -106,7 +107,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "bootable": obj.get("bootable") if obj.get("bootable") is not None else False, + "bootable": obj.get("bootable"), "description": obj.get("description"), "imageConfig": ( ImageConfig.from_dict(obj["imageConfig"]) if obj.get("imageConfig") is not None else None diff --git a/services/iaas/src/stackit/iaas/models/volume.py b/services/iaas/src/stackit/iaas/models/volume.py index 95c7881d..c66a5109 100644 --- a/services/iaas/src/stackit/iaas/models/volume.py +++ b/services/iaas/src/stackit/iaas/models/volume.py @@ -55,7 +55,8 @@ class Volume(BaseModel): ) image_config: Optional[ImageConfig] = Field(default=None, alias="imageConfig") labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." @@ -70,7 +71,10 @@ class Volume(BaseModel): ) size: Optional[StrictInt] = Field(default=None, description="Size in Gigabyte.") source: Optional[VolumeSource] = None - status: Optional[StrictStr] = Field(default=None, description="The status of a volume object.") + status: Optional[StrictStr] = Field( + default=None, + description="The status of a volume object. Possible values: `ATTACHED`, `ATTACHING`, `AVAILABLE`, `AWAITING-TRANSFER`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `DETACHING`, `DOWNLOADING`, `ERROR`, `ERROR_BACKING-UP`, `ERROR_DELETING`, `ERROR_RESIZING`, `ERROR_RESTORING-BACKUP`, `MAINTENANCE`, `RESERVED`, `RESIZING`, `RESTORING-BACKUP`, `RETYPING`, `UPLOADING`.", + ) updated_at: Optional[datetime] = Field( default=None, description="Date-time when resource was last updated.", alias="updatedAt" ) diff --git a/services/iaas/src/stackit/iaas/models/volume_attachment.py b/services/iaas/src/stackit/iaas/models/volume_attachment.py index 94b3a019..4a59811c 100644 --- a/services/iaas/src/stackit/iaas/models/volume_attachment.py +++ b/services/iaas/src/stackit/iaas/models/volume_attachment.py @@ -29,7 +29,7 @@ class VolumeAttachment(BaseModel): """ delete_on_termination: Optional[StrictBool] = Field( - default=False, + default=None, description="Delete the volume during the termination of the server. Defaults to false.", alias="deleteOnTermination", ) @@ -122,9 +122,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "deleteOnTermination": ( - obj.get("deleteOnTermination") if obj.get("deleteOnTermination") is not None else False - ), + "deleteOnTermination": obj.get("deleteOnTermination"), "serverId": obj.get("serverId"), "volumeId": obj.get("volumeId"), } diff --git a/services/iaas/src/stackit/iaas/models/volume_performance_class.py b/services/iaas/src/stackit/iaas/models/volume_performance_class.py index c5608e5c..01e2a511 100644 --- a/services/iaas/src/stackit/iaas/models/volume_performance_class.py +++ b/services/iaas/src/stackit/iaas/models/volume_performance_class.py @@ -33,7 +33,8 @@ class VolumePerformanceClass(BaseModel): ) iops: Optional[StrictInt] = Field(default=None, description="Input/Output Operations per second.") labels: Optional[Dict[str, Any]] = Field( - default=None, description="Object that represents the labels of an object." + default=None, + description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) name: Annotated[str, Field(strict=True, max_length=63)] = Field( description="The name for a General Object. Matches Names and also UUIDs." diff --git a/services/iaas/src/stackit/iaas/models/volume_source.py b/services/iaas/src/stackit/iaas/models/volume_source.py index a2252f53..d1eefc67 100644 --- a/services/iaas/src/stackit/iaas/models/volume_source.py +++ b/services/iaas/src/stackit/iaas/models/volume_source.py @@ -31,7 +31,9 @@ class VolumeSource(BaseModel): id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( description="Universally Unique Identifier (UUID)." ) - type: StrictStr = Field(description="The source types of a volume.") + type: StrictStr = Field( + description="The source types of a volume. Possible values: `image`, `volume`, `snapshot`, `backup`." + ) __properties: ClassVar[List[str]] = ["id", "type"] @field_validator("id")