From 036326630b43471d4351a60239ecc4805bcd5e6d Mon Sep 17 00:00:00 2001 From: stackit-pipeline <142982727+stackit-pipeline@users.noreply.github.com> Date: Mon, 11 Nov 2024 08:08:25 +0100 Subject: [PATCH] Generate iaasalpha (#51) --- .../src/stackit/iaasalpha/__init__.py | 12 +- .../src/stackit/iaasalpha/api/default_api.py | 3685 +++++++++++++---- .../src/stackit/iaasalpha/models/__init__.py | 12 +- .../models/area_prefix_config_ipv4.py | 2 +- .../iaasalpha/models/create_area_ipv4.py | 2 +- .../iaasalpha/models/create_image_payload.py | 173 + .../iaasalpha/models/create_nic_payload.py | 6 +- .../iaasalpha/models/create_volume_payload.py | 13 +- .../src/stackit/iaasalpha/models/image.py | 173 + .../stackit/iaasalpha/models/image_config.py | 180 + .../iaasalpha/models/image_create_response.py | 95 + .../iaasalpha/models/image_list_response.py | 93 + .../stackit/iaasalpha/models/machine_type.py | 112 + .../models/machine_type_list_response.py | 97 + .../iaasalpha/models/network_area_ipv4.py | 2 +- .../iaasalpha/models/update_area_ipv4.py | 2 +- .../iaasalpha/models/update_image_payload.py | 128 + .../iaasalpha/models/update_nic_payload.py | 6 +- .../iaasalpha/models/update_volume_payload.py | 12 +- .../src/stackit/iaasalpha/models/volume.py | 13 +- .../models/volume_performance_class.py | 14 +- 21 files changed, 3918 insertions(+), 914 deletions(-) create mode 100644 services/iaasalpha/src/stackit/iaasalpha/models/create_image_payload.py create mode 100644 services/iaasalpha/src/stackit/iaasalpha/models/image.py create mode 100644 services/iaasalpha/src/stackit/iaasalpha/models/image_config.py create mode 100644 services/iaasalpha/src/stackit/iaasalpha/models/image_create_response.py create mode 100644 services/iaasalpha/src/stackit/iaasalpha/models/image_list_response.py create mode 100644 services/iaasalpha/src/stackit/iaasalpha/models/machine_type.py create mode 100644 services/iaasalpha/src/stackit/iaasalpha/models/machine_type_list_response.py create mode 100644 services/iaasalpha/src/stackit/iaasalpha/models/update_image_payload.py diff --git a/services/iaasalpha/src/stackit/iaasalpha/__init__.py b/services/iaasalpha/src/stackit/iaasalpha/__init__.py index 6ddbeda..2181b9e 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/__init__.py +++ b/services/iaasalpha/src/stackit/iaasalpha/__init__.py @@ -50,8 +50,9 @@ from stackit.iaasalpha.models.boot_volume_source import BootVolumeSource from stackit.iaasalpha.models.create_area_address_family import CreateAreaAddressFamily from stackit.iaasalpha.models.create_area_ipv4 import CreateAreaIPv4 +from stackit.iaasalpha.models.create_image_payload import CreateImagePayload from stackit.iaasalpha.models.create_key_pair_payload import CreateKeyPairPayload -from stackit.iaasalpha.models.create_nic_payload import CreateNICPayload +from stackit.iaasalpha.models.create_nic_payload import CreateNicPayload from stackit.iaasalpha.models.create_protocol import CreateProtocol from stackit.iaasalpha.models.create_public_ip_payload import CreatePublicIPPayload from stackit.iaasalpha.models.create_security_group_payload import ( @@ -77,8 +78,14 @@ from stackit.iaasalpha.models.get_server_log200_response import GetServerLog200Response from stackit.iaasalpha.models.get_server_log_request import GetServerLogRequest from stackit.iaasalpha.models.icmp_parameters import ICMPParameters +from stackit.iaasalpha.models.image import Image +from stackit.iaasalpha.models.image_config import ImageConfig +from stackit.iaasalpha.models.image_create_response import ImageCreateResponse +from stackit.iaasalpha.models.image_list_response import ImageListResponse from stackit.iaasalpha.models.key_pair_list_response import KeyPairListResponse from stackit.iaasalpha.models.keypair import Keypair +from stackit.iaasalpha.models.machine_type import MachineType +from stackit.iaasalpha.models.machine_type_list_response import MachineTypeListResponse from stackit.iaasalpha.models.network import Network from stackit.iaasalpha.models.network_area import NetworkArea from stackit.iaasalpha.models.network_area_ipv4 import NetworkAreaIPv4 @@ -131,8 +138,9 @@ from stackit.iaasalpha.models.update_attached_volume_payload import ( UpdateAttachedVolumePayload, ) +from stackit.iaasalpha.models.update_image_payload import UpdateImagePayload from stackit.iaasalpha.models.update_key_pair_payload import UpdateKeyPairPayload -from stackit.iaasalpha.models.update_nic_payload import UpdateNICPayload +from stackit.iaasalpha.models.update_nic_payload import UpdateNicPayload from stackit.iaasalpha.models.update_public_ip_payload import UpdatePublicIPPayload from stackit.iaasalpha.models.update_security_group_payload import ( UpdateSecurityGroupPayload, diff --git a/services/iaasalpha/src/stackit/iaasalpha/api/default_api.py b/services/iaasalpha/src/stackit/iaasalpha/api/default_api.py index 07b12d1..d4e55fa 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/api/default_api.py +++ b/services/iaasalpha/src/stackit/iaasalpha/api/default_api.py @@ -33,8 +33,9 @@ from stackit.iaasalpha.models.add_volume_to_server_payload import ( AddVolumeToServerPayload, ) +from stackit.iaasalpha.models.create_image_payload import CreateImagePayload from stackit.iaasalpha.models.create_key_pair_payload import CreateKeyPairPayload -from stackit.iaasalpha.models.create_nic_payload import CreateNICPayload +from stackit.iaasalpha.models.create_nic_payload import CreateNicPayload from stackit.iaasalpha.models.create_public_ip_payload import CreatePublicIPPayload from stackit.iaasalpha.models.create_security_group_payload import ( CreateSecurityGroupPayload, @@ -47,8 +48,13 @@ from stackit.iaasalpha.models.create_volume_payload import CreateVolumePayload from stackit.iaasalpha.models.get_server_log200_response import GetServerLog200Response from stackit.iaasalpha.models.get_server_log_request import GetServerLogRequest +from stackit.iaasalpha.models.image import Image +from stackit.iaasalpha.models.image_create_response import ImageCreateResponse +from stackit.iaasalpha.models.image_list_response import ImageListResponse from stackit.iaasalpha.models.key_pair_list_response import KeyPairListResponse from stackit.iaasalpha.models.keypair import Keypair +from stackit.iaasalpha.models.machine_type import MachineType +from stackit.iaasalpha.models.machine_type_list_response import MachineTypeListResponse from stackit.iaasalpha.models.network import Network from stackit.iaasalpha.models.network_area import NetworkArea from stackit.iaasalpha.models.network_area_list_response import NetworkAreaListResponse @@ -86,8 +92,9 @@ from stackit.iaasalpha.models.update_attached_volume_payload import ( UpdateAttachedVolumePayload, ) +from stackit.iaasalpha.models.update_image_payload import UpdateImagePayload from stackit.iaasalpha.models.update_key_pair_payload import UpdateKeyPairPayload -from stackit.iaasalpha.models.update_nic_payload import UpdateNICPayload +from stackit.iaasalpha.models.update_nic_payload import UpdateNicPayload from stackit.iaasalpha.models.update_public_ip_payload import UpdatePublicIPPayload from stackit.iaasalpha.models.update_security_group_payload import ( UpdateSecurityGroupPayload, @@ -2288,6 +2295,282 @@ def _add_volume_to_server_serialize( _request_auth=_request_auth, ) + @validate_call + def create_image( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + create_image_payload: Annotated[CreateImagePayload, Field(description="Request an image creation.")], + _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, + ) -> ImageCreateResponse: + """Create new Image. + + Create a new Image in a project. This call, if successful, returns a pre-signed URL for the customer to upload the image. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param create_image_payload: Request an image creation. (required) + :type create_image_payload: CreateImagePayload + :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._create_image_serialize( + project_id=project_id, + create_image_payload=create_image_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "ImageCreateResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "429": "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 create_image_with_http_info( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + create_image_payload: Annotated[CreateImagePayload, Field(description="Request an image creation.")], + _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[ImageCreateResponse]: + """Create new Image. + + Create a new Image in a project. This call, if successful, returns a pre-signed URL for the customer to upload the image. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param create_image_payload: Request an image creation. (required) + :type create_image_payload: CreateImagePayload + :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._create_image_serialize( + project_id=project_id, + create_image_payload=create_image_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "ImageCreateResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "429": "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 create_image_without_preload_content( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + create_image_payload: Annotated[CreateImagePayload, Field(description="Request an image creation.")], + _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: + """Create new Image. + + Create a new Image in a project. This call, if successful, returns a pre-signed URL for the customer to upload the image. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param create_image_payload: Request an image creation. (required) + :type create_image_payload: CreateImagePayload + :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._create_image_serialize( + project_id=project_id, + create_image_payload=create_image_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "ImageCreateResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "429": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _create_image_serialize( + self, + project_id, + create_image_payload, + _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 + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if create_image_payload is not None: + _body_params = create_image_payload + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="POST", + resource_path="/v1alpha1/projects/{projectId}/images", + 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 create_key_pair( self, @@ -2551,7 +2834,7 @@ def create_nic( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), ], - create_nic_payload: Annotated[CreateNICPayload, Field(description="Request a network interface creation.")], + create_nic_payload: Annotated[CreateNicPayload, Field(description="Request a network interface creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2571,7 +2854,7 @@ def create_nic( :param network_id: The identifier (ID) of a STACKIT Network. (required) :type network_id: str :param create_nic_payload: Request a network interface creation. (required) - :type create_nic_payload: CreateNICPayload + :type create_nic_payload: CreateNicPayload :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 @@ -2632,7 +2915,7 @@ def create_nic_with_http_info( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), ], - create_nic_payload: Annotated[CreateNICPayload, Field(description="Request a network interface creation.")], + create_nic_payload: Annotated[CreateNicPayload, Field(description="Request a network interface creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2652,7 +2935,7 @@ def create_nic_with_http_info( :param network_id: The identifier (ID) of a STACKIT Network. (required) :type network_id: str :param create_nic_payload: Request a network interface creation. (required) - :type create_nic_payload: CreateNICPayload + :type create_nic_payload: CreateNicPayload :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 @@ -2713,7 +2996,7 @@ def create_nic_without_preload_content( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), ], - create_nic_payload: Annotated[CreateNICPayload, Field(description="Request a network interface creation.")], + create_nic_payload: Annotated[CreateNicPayload, Field(description="Request a network interface creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2733,7 +3016,7 @@ def create_nic_without_preload_content( :param network_id: The identifier (ID) of a STACKIT Network. (required) :type network_id: str :param create_nic_payload: Request a network interface creation. (required) - :type create_nic_payload: CreateNICPayload + :type create_nic_payload: CreateNicPayload :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 @@ -4056,7 +4339,7 @@ def create_virtual_ip( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "VirtualIp", + "202": "VirtualIp", "400": "Error", "401": "Error", "403": "Error", @@ -4138,7 +4421,7 @@ def create_virtual_ip_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "VirtualIp", + "202": "VirtualIp", "400": "Error", "401": "Error", "403": "Error", @@ -4220,7 +4503,7 @@ def create_virtual_ip_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "VirtualIp", + "202": "VirtualIp", "400": "Error", "401": "Error", "403": "Error", @@ -4846,9 +5129,15 @@ def _deallocate_server_serialize( ) @validate_call - def delete_key_pair( + def delete_image( self, - keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + image_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4859,12 +5148,14 @@ def delete_key_pair( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Delete an SSH keypair. + """Delete an Image. - Delete an SSH keypair from a user. + Delete an image that is part of the project. - :param keypair_name: The name of an SSH keypair. (required) - :type keypair_name: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param image_id: The identifier (ID) of a STACKIT Image. (required) + :type image_id: str :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 @@ -4887,7 +5178,270 @@ def delete_key_pair( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_key_pair_serialize( + _param = self._delete_image_serialize( + project_id=project_id, + image_id=image_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "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 delete_image_with_http_info( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + image_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") + ], + _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[None]: + """Delete an Image. + + Delete an image that is part of the project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param image_id: The identifier (ID) of a STACKIT Image. (required) + :type image_id: str + :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._delete_image_serialize( + project_id=project_id, + image_id=image_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "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 delete_image_without_preload_content( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + image_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") + ], + _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: + """Delete an Image. + + Delete an image that is part of the project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param image_id: The identifier (ID) of a STACKIT Image. (required) + :type image_id: str + :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._delete_image_serialize( + project_id=project_id, + image_id=image_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "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 _delete_image_serialize( + self, + project_id, + image_id, + _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 + if project_id is not None: + _path_params["projectId"] = project_id + if image_id is not None: + _path_params["imageId"] = image_id + # 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="DELETE", + resource_path="/v1alpha1/projects/{projectId}/images/{imageId}", + 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 delete_key_pair( + self, + keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], + _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, + ) -> None: + """Delete an SSH keypair. + + Delete an SSH keypair from a user. + + :param keypair_name: The name of an SSH keypair. (required) + :type keypair_name: str + :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._delete_key_pair_serialize( keypair_name=keypair_name, _request_auth=_request_auth, _content_type=_content_type, @@ -7420,9 +7974,15 @@ def _get_attached_volume_serialize( ) @validate_call - def get_key_pair( + def get_image( self, - keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + image_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7432,13 +7992,15 @@ def get_key_pair( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Keypair: - """Get SSH keypair details. + ) -> Image: + """Get details about an image. - Get details about an SSH keypair. + Get details about a specific Image inside a project. - :param keypair_name: The name of an SSH keypair. (required) - :type keypair_name: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param image_id: The identifier (ID) of a STACKIT Image. (required) + :type image_id: str :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 @@ -7461,8 +8023,9 @@ def get_key_pair( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_key_pair_serialize( - keypair_name=keypair_name, + _param = self._get_image_serialize( + project_id=project_id, + image_id=image_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7470,7 +8033,7 @@ def get_key_pair( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Keypair", + "200": "Image", "400": "Error", "401": "Error", "403": "Error", @@ -7485,9 +8048,15 @@ def get_key_pair( ).data @validate_call - def get_key_pair_with_http_info( + def get_image_with_http_info( self, - keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + image_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7497,13 +8066,15 @@ def get_key_pair_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Keypair]: - """Get SSH keypair details. + ) -> ApiResponse[Image]: + """Get details about an image. - Get details about an SSH keypair. + Get details about a specific Image inside a project. - :param keypair_name: The name of an SSH keypair. (required) - :type keypair_name: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param image_id: The identifier (ID) of a STACKIT Image. (required) + :type image_id: str :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 @@ -7526,8 +8097,9 @@ def get_key_pair_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_key_pair_serialize( - keypair_name=keypair_name, + _param = self._get_image_serialize( + project_id=project_id, + image_id=image_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7535,7 +8107,7 @@ def get_key_pair_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Keypair", + "200": "Image", "400": "Error", "401": "Error", "403": "Error", @@ -7550,9 +8122,15 @@ def get_key_pair_with_http_info( ) @validate_call - def get_key_pair_without_preload_content( + def get_image_without_preload_content( self, - keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + image_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7563,12 +8141,14 @@ def get_key_pair_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get SSH keypair details. + """Get details about an image. - Get details about an SSH keypair. + Get details about a specific Image inside a project. - :param keypair_name: The name of an SSH keypair. (required) - :type keypair_name: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param image_id: The identifier (ID) of a STACKIT Image. (required) + :type image_id: str :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 @@ -7591,8 +8171,9 @@ def get_key_pair_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_key_pair_serialize( - keypair_name=keypair_name, + _param = self._get_image_serialize( + project_id=project_id, + image_id=image_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7600,7 +8181,7 @@ def get_key_pair_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Keypair", + "200": "Image", "400": "Error", "401": "Error", "403": "Error", @@ -7610,9 +8191,10 @@ def get_key_pair_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_key_pair_serialize( + def _get_image_serialize( self, - keypair_name, + project_id, + image_id, _request_auth, _content_type, _headers, @@ -7631,8 +8213,10 @@ def _get_key_pair_serialize( _body_params: Optional[bytes] = None # process the path parameters - if keypair_name is not None: - _path_params["keypairName"] = keypair_name + if project_id is not None: + _path_params["projectId"] = project_id + if image_id is not None: + _path_params["imageId"] = image_id # process the query parameters # process the header parameters # process the form parameters @@ -7647,7 +8231,7 @@ def _get_key_pair_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/keypairs/{keypairName}", + resource_path="/v1alpha1/projects/{projectId}/images/{imageId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7661,16 +8245,9 @@ def _get_key_pair_serialize( ) @validate_call - def get_network( + def get_key_pair( self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], + keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7680,15 +8257,13 @@ def get_network( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Network: - """Get network details. + ) -> Keypair: + """Get SSH keypair details. - Get details about a network of a project. + Get details about an SSH keypair. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str + :param keypair_name: The name of an SSH keypair. (required) + :type keypair_name: str :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 @@ -7711,9 +8286,8 @@ def get_network( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_serialize( - project_id=project_id, - network_id=network_id, + _param = self._get_key_pair_serialize( + keypair_name=keypair_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7721,7 +8295,7 @@ def get_network( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Network", + "200": "Keypair", "400": "Error", "401": "Error", "403": "Error", @@ -7736,16 +8310,9 @@ def get_network( ).data @validate_call - def get_network_with_http_info( + def get_key_pair_with_http_info( self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], + keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7755,15 +8322,13 @@ def get_network_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Network]: - """Get network details. + ) -> ApiResponse[Keypair]: + """Get SSH keypair details. - Get details about a network of a project. + Get details about an SSH keypair. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str + :param keypair_name: The name of an SSH keypair. (required) + :type keypair_name: str :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 @@ -7786,9 +8351,8 @@ def get_network_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_serialize( - project_id=project_id, - network_id=network_id, + _param = self._get_key_pair_serialize( + keypair_name=keypair_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7796,7 +8360,7 @@ def get_network_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Network", + "200": "Keypair", "400": "Error", "401": "Error", "403": "Error", @@ -7811,16 +8375,9 @@ def get_network_with_http_info( ) @validate_call - def get_network_without_preload_content( + def get_key_pair_without_preload_content( self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], + keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7831,14 +8388,12 @@ def get_network_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get network details. + """Get SSH keypair details. - Get details about a network of a project. + Get details about an SSH keypair. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str + :param keypair_name: The name of an SSH keypair. (required) + :type keypair_name: str :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 @@ -7861,9 +8416,8 @@ def get_network_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_serialize( - project_id=project_id, - network_id=network_id, + _param = self._get_key_pair_serialize( + keypair_name=keypair_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7871,7 +8425,7 @@ def get_network_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Network", + "200": "Keypair", "400": "Error", "401": "Error", "403": "Error", @@ -7881,10 +8435,9 @@ def get_network_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_network_serialize( + def _get_key_pair_serialize( self, - project_id, - network_id, + keypair_name, _request_auth, _content_type, _headers, @@ -7903,10 +8456,8 @@ def _get_network_serialize( _body_params: Optional[bytes] = None # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if network_id is not None: - _path_params["networkId"] = network_id + if keypair_name is not None: + _path_params["keypairName"] = keypair_name # process the query parameters # process the header parameters # process the form parameters @@ -7921,7 +8472,7 @@ def _get_network_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}", + resource_path="/v1alpha1/keypairs/{keypairName}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7935,20 +8486,13 @@ def _get_network_serialize( ) @validate_call - def get_network_area( + def get_machine_type( self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - area_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], + machine_type: Annotated[str, Field(strict=True, max_length=63, description="STACKIT machine type Name.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7958,15 +8502,15 @@ def get_network_area( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> NetworkArea: - """Get details about a network area. + ) -> MachineType: + """Get details about a machine type. - Get details about a network area in an organization. + Get details about a specific machine type. - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str - :param area_id: The identifier (ID) of a STACKIT Network Area. (required) - :type area_id: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param machine_type: STACKIT machine type Name. (required) + :type machine_type: str :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 @@ -7989,9 +8533,9 @@ def get_network_area( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_area_serialize( - organization_id=organization_id, - area_id=area_id, + _param = self._get_machine_type_serialize( + project_id=project_id, + machine_type=machine_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7999,7 +8543,7 @@ def get_network_area( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkArea", + "200": "MachineType", "400": "Error", "401": "Error", "403": "Error", @@ -8014,20 +8558,13 @@ def get_network_area( ).data @validate_call - def get_network_area_with_http_info( + def get_machine_type_with_http_info( self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - area_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], + machine_type: Annotated[str, Field(strict=True, max_length=63, description="STACKIT machine type Name.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8037,15 +8574,15 @@ def get_network_area_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[NetworkArea]: - """Get details about a network area. + ) -> ApiResponse[MachineType]: + """Get details about a machine type. - Get details about a network area in an organization. + Get details about a specific machine type. - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str - :param area_id: The identifier (ID) of a STACKIT Network Area. (required) - :type area_id: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param machine_type: STACKIT machine type Name. (required) + :type machine_type: str :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 @@ -8068,9 +8605,9 @@ def get_network_area_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_area_serialize( - organization_id=organization_id, - area_id=area_id, + _param = self._get_machine_type_serialize( + project_id=project_id, + machine_type=machine_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8078,7 +8615,7 @@ def get_network_area_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkArea", + "200": "MachineType", "400": "Error", "401": "Error", "403": "Error", @@ -8093,20 +8630,13 @@ def get_network_area_with_http_info( ) @validate_call - def get_network_area_without_preload_content( + def get_machine_type_without_preload_content( self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - area_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], + machine_type: Annotated[str, Field(strict=True, max_length=63, description="STACKIT machine type Name.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8117,14 +8647,14 @@ def get_network_area_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get details about a network area. + """Get details about a machine type. - Get details about a network area in an organization. + Get details about a specific machine type. - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str - :param area_id: The identifier (ID) of a STACKIT Network Area. (required) - :type area_id: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param machine_type: STACKIT machine type Name. (required) + :type machine_type: str :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 @@ -8147,9 +8677,9 @@ def get_network_area_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_area_serialize( - organization_id=organization_id, - area_id=area_id, + _param = self._get_machine_type_serialize( + project_id=project_id, + machine_type=machine_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8157,7 +8687,7 @@ def get_network_area_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkArea", + "200": "MachineType", "400": "Error", "401": "Error", "403": "Error", @@ -8167,10 +8697,10 @@ def get_network_area_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_network_area_serialize( + def _get_machine_type_serialize( self, - organization_id, - area_id, + project_id, + machine_type, _request_auth, _content_type, _headers, @@ -8189,10 +8719,10 @@ def _get_network_area_serialize( _body_params: Optional[bytes] = None # process the path parameters - if organization_id is not None: - _path_params["organizationId"] = organization_id - if area_id is not None: - _path_params["areaId"] = area_id + if project_id is not None: + _path_params["projectId"] = project_id + if machine_type is not None: + _path_params["machineType"] = machine_type # process the query parameters # process the header parameters # process the form parameters @@ -8207,7 +8737,7 @@ def _get_network_area_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/organizations/{organizationId}/network-areas/{areaId}", + resource_path="/v1alpha1/projects/{projectId}/machine-types/{machineType}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -8221,7 +8751,7 @@ def _get_network_area_serialize( ) @validate_call - def get_nic( + def get_network( self, project_id: Annotated[ str, @@ -8231,10 +8761,6 @@ def get_nic( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), ], - nic_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8244,17 +8770,15 @@ def get_nic( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> NIC: - """Get details about a network interface. + ) -> Network: + """Get network details. - Get details about a network interface inside a network. + Get details about a network of a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str :param network_id: The identifier (ID) of a STACKIT Network. (required) :type network_id: str - :param nic_id: The identifier (ID) of a network interface. (required) - :type nic_id: str :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 @@ -8277,10 +8801,9 @@ def get_nic( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_nic_serialize( + _param = self._get_network_serialize( project_id=project_id, network_id=network_id, - nic_id=nic_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8288,7 +8811,7 @@ def get_nic( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NIC", + "200": "Network", "400": "Error", "401": "Error", "403": "Error", @@ -8303,7 +8826,7 @@ def get_nic( ).data @validate_call - def get_nic_with_http_info( + def get_network_with_http_info( self, project_id: Annotated[ str, @@ -8313,10 +8836,6 @@ def get_nic_with_http_info( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), ], - nic_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8326,17 +8845,15 @@ def get_nic_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[NIC]: - """Get details about a network interface. + ) -> ApiResponse[Network]: + """Get network details. - Get details about a network interface inside a network. + Get details about a network of a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str :param network_id: The identifier (ID) of a STACKIT Network. (required) :type network_id: str - :param nic_id: The identifier (ID) of a network interface. (required) - :type nic_id: str :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 @@ -8359,10 +8876,9 @@ def get_nic_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_nic_serialize( + _param = self._get_network_serialize( project_id=project_id, network_id=network_id, - nic_id=nic_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8370,7 +8886,7 @@ def get_nic_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NIC", + "200": "Network", "400": "Error", "401": "Error", "403": "Error", @@ -8385,7 +8901,7 @@ def get_nic_with_http_info( ) @validate_call - def get_nic_without_preload_content( + def get_network_without_preload_content( self, project_id: Annotated[ str, @@ -8395,10 +8911,6 @@ def get_nic_without_preload_content( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), ], - nic_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8409,16 +8921,14 @@ def get_nic_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get details about a network interface. + """Get network details. - Get details about a network interface inside a network. + Get details about a network of a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str :param network_id: The identifier (ID) of a STACKIT Network. (required) :type network_id: str - :param nic_id: The identifier (ID) of a network interface. (required) - :type nic_id: str :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 @@ -8441,10 +8951,9 @@ def get_nic_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_nic_serialize( + _param = self._get_network_serialize( project_id=project_id, network_id=network_id, - nic_id=nic_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8452,7 +8961,7 @@ def get_nic_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NIC", + "200": "Network", "400": "Error", "401": "Error", "403": "Error", @@ -8462,11 +8971,10 @@ def get_nic_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_nic_serialize( + def _get_network_serialize( self, project_id, network_id, - nic_id, _request_auth, _content_type, _headers, @@ -8489,8 +8997,6 @@ def _get_nic_serialize( _path_params["projectId"] = project_id if network_id is not None: _path_params["networkId"] = network_id - if nic_id is not None: - _path_params["nicId"] = nic_id # process the query parameters # process the header parameters # process the form parameters @@ -8505,7 +9011,7 @@ def _get_nic_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}/nics/{nicId}", + resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -8519,7 +9025,7 @@ def _get_nic_serialize( ) @validate_call - def get_organization_request( + def get_network_area( self, organization_id: Annotated[ str, @@ -8527,9 +9033,11 @@ def get_organization_request( min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." ), ], - request_id: Annotated[ + area_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), ], _request_timeout: Union[ None, @@ -8540,15 +9048,15 @@ def get_organization_request( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Request: - """Lookup an organization request ID. + ) -> NetworkArea: + """Get details about a network area. - Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. + Get details about a network area in an organization. :param organization_id: The identifier (ID) of a STACKIT Organization. (required) :type organization_id: str - :param request_id: The identifier (ID) of a STACKIT Request. (required) - :type request_id: str + :param area_id: The identifier (ID) of a STACKIT Network Area. (required) + :type area_id: str :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 @@ -8571,9 +9079,9 @@ def get_organization_request( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_organization_request_serialize( + _param = self._get_network_area_serialize( organization_id=organization_id, - request_id=request_id, + area_id=area_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8581,7 +9089,7 @@ def get_organization_request( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Request", + "200": "NetworkArea", "400": "Error", "401": "Error", "403": "Error", @@ -8596,7 +9104,7 @@ def get_organization_request( ).data @validate_call - def get_organization_request_with_http_info( + def get_network_area_with_http_info( self, organization_id: Annotated[ str, @@ -8604,9 +9112,11 @@ def get_organization_request_with_http_info( min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." ), ], - request_id: Annotated[ + area_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), ], _request_timeout: Union[ None, @@ -8617,15 +9127,15 @@ def get_organization_request_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Request]: - """Lookup an organization request ID. + ) -> ApiResponse[NetworkArea]: + """Get details about a network area. - Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. + Get details about a network area in an organization. :param organization_id: The identifier (ID) of a STACKIT Organization. (required) :type organization_id: str - :param request_id: The identifier (ID) of a STACKIT Request. (required) - :type request_id: str + :param area_id: The identifier (ID) of a STACKIT Network Area. (required) + :type area_id: str :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 @@ -8648,9 +9158,9 @@ def get_organization_request_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_organization_request_serialize( + _param = self._get_network_area_serialize( organization_id=organization_id, - request_id=request_id, + area_id=area_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8658,7 +9168,7 @@ def get_organization_request_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Request", + "200": "NetworkArea", "400": "Error", "401": "Error", "403": "Error", @@ -8673,7 +9183,7 @@ def get_organization_request_with_http_info( ) @validate_call - def get_organization_request_without_preload_content( + def get_network_area_without_preload_content( self, organization_id: Annotated[ str, @@ -8681,9 +9191,11 @@ def get_organization_request_without_preload_content( min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." ), ], - request_id: Annotated[ + area_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), ], _request_timeout: Union[ None, @@ -8695,14 +9207,14 @@ def get_organization_request_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Lookup an organization request ID. + """Get details about a network area. - Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. + Get details about a network area in an organization. :param organization_id: The identifier (ID) of a STACKIT Organization. (required) :type organization_id: str - :param request_id: The identifier (ID) of a STACKIT Request. (required) - :type request_id: str + :param area_id: The identifier (ID) of a STACKIT Network Area. (required) + :type area_id: str :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 @@ -8725,9 +9237,9 @@ def get_organization_request_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_organization_request_serialize( + _param = self._get_network_area_serialize( organization_id=organization_id, - request_id=request_id, + area_id=area_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8735,7 +9247,7 @@ def get_organization_request_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Request", + "200": "NetworkArea", "400": "Error", "401": "Error", "403": "Error", @@ -8745,10 +9257,10 @@ def get_organization_request_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_organization_request_serialize( + def _get_network_area_serialize( self, organization_id, - request_id, + area_id, _request_auth, _content_type, _headers, @@ -8769,8 +9281,8 @@ def _get_organization_request_serialize( # process the path parameters if organization_id is not None: _path_params["organizationId"] = organization_id - if request_id is not None: - _path_params["requestId"] = request_id + if area_id is not None: + _path_params["areaId"] = area_id # process the query parameters # process the header parameters # process the form parameters @@ -8785,7 +9297,7 @@ def _get_organization_request_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/organizations/{organizationId}/requests/{requestId}", + resource_path="/v1alpha1/organizations/{organizationId}/network-areas/{areaId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -8799,12 +9311,20 @@ def _get_organization_request_serialize( ) @validate_call - def get_project_details( + def get_nic( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], + network_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + nic_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8814,13 +9334,17 @@ def get_project_details( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Project: - """Get project details. + ) -> NIC: + """Get details about a network interface. - Get details about a STACKIT project. + Get details about a network interface inside a network. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str + :param network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param nic_id: The identifier (ID) of a network interface. (required) + :type nic_id: str :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 @@ -8843,8 +9367,10 @@ def get_project_details( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_project_details_serialize( + _param = self._get_nic_serialize( project_id=project_id, + network_id=network_id, + nic_id=nic_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8852,7 +9378,7 @@ def get_project_details( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Project", + "200": "NIC", "400": "Error", "401": "Error", "403": "Error", @@ -8867,12 +9393,20 @@ def get_project_details( ).data @validate_call - def get_project_details_with_http_info( + def get_nic_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], + network_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + nic_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8882,13 +9416,17 @@ def get_project_details_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Project]: - """Get project details. + ) -> ApiResponse[NIC]: + """Get details about a network interface. - Get details about a STACKIT project. + Get details about a network interface inside a network. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str + :param network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param nic_id: The identifier (ID) of a network interface. (required) + :type nic_id: str :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 @@ -8911,8 +9449,10 @@ def get_project_details_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_project_details_serialize( + _param = self._get_nic_serialize( project_id=project_id, + network_id=network_id, + nic_id=nic_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8920,7 +9460,7 @@ def get_project_details_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Project", + "200": "NIC", "400": "Error", "401": "Error", "403": "Error", @@ -8935,12 +9475,20 @@ def get_project_details_with_http_info( ) @validate_call - def get_project_details_without_preload_content( + def get_nic_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], + network_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + nic_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8951,12 +9499,16 @@ def get_project_details_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get project details. + """Get details about a network interface. - Get details about a STACKIT project. + Get details about a network interface inside a network. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str + :param network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param nic_id: The identifier (ID) of a network interface. (required) + :type nic_id: str :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 @@ -8979,8 +9531,10 @@ def get_project_details_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_project_details_serialize( + _param = self._get_nic_serialize( project_id=project_id, + network_id=network_id, + nic_id=nic_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8988,7 +9542,7 @@ def get_project_details_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Project", + "200": "NIC", "400": "Error", "401": "Error", "403": "Error", @@ -8998,9 +9552,11 @@ def get_project_details_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_project_details_serialize( + def _get_nic_serialize( self, project_id, + network_id, + nic_id, _request_auth, _content_type, _headers, @@ -9021,6 +9577,10 @@ def _get_project_details_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if network_id is not None: + _path_params["networkId"] = network_id + if nic_id is not None: + _path_params["nicId"] = nic_id # process the query parameters # process the header parameters # process the form parameters @@ -9035,7 +9595,7 @@ def _get_project_details_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/projects/{projectId}", + resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}/nics/{nicId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -9049,11 +9609,13 @@ def _get_project_details_serialize( ) @validate_call - def get_project_request( + def get_organization_request( self, - project_id: Annotated[ + organization_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." + ), ], request_id: Annotated[ str, @@ -9069,12 +9631,12 @@ def get_project_request( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> Request: - """Lookup a project request ID. + """Lookup an organization request ID. - Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. + Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str + :param organization_id: The identifier (ID) of a STACKIT Organization. (required) + :type organization_id: str :param request_id: The identifier (ID) of a STACKIT Request. (required) :type request_id: str :param _request_timeout: timeout setting for this request. If one @@ -9099,8 +9661,8 @@ def get_project_request( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_project_request_serialize( - project_id=project_id, + _param = self._get_organization_request_serialize( + organization_id=organization_id, request_id=request_id, _request_auth=_request_auth, _content_type=_content_type, @@ -9124,11 +9686,13 @@ def get_project_request( ).data @validate_call - def get_project_request_with_http_info( + def get_organization_request_with_http_info( self, - project_id: Annotated[ + organization_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." + ), ], request_id: Annotated[ str, @@ -9144,12 +9708,12 @@ def get_project_request_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[Request]: - """Lookup a project request ID. + """Lookup an organization request ID. - Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. + Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str + :param organization_id: The identifier (ID) of a STACKIT Organization. (required) + :type organization_id: str :param request_id: The identifier (ID) of a STACKIT Request. (required) :type request_id: str :param _request_timeout: timeout setting for this request. If one @@ -9174,8 +9738,8 @@ def get_project_request_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_project_request_serialize( - project_id=project_id, + _param = self._get_organization_request_serialize( + organization_id=organization_id, request_id=request_id, _request_auth=_request_auth, _content_type=_content_type, @@ -9199,11 +9763,13 @@ def get_project_request_with_http_info( ) @validate_call - def get_project_request_without_preload_content( + def get_organization_request_without_preload_content( self, - project_id: Annotated[ + organization_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." + ), ], request_id: Annotated[ str, @@ -9219,12 +9785,12 @@ def get_project_request_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Lookup a project request ID. + """Lookup an organization request ID. - Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. + Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str + :param organization_id: The identifier (ID) of a STACKIT Organization. (required) + :type organization_id: str :param request_id: The identifier (ID) of a STACKIT Request. (required) :type request_id: str :param _request_timeout: timeout setting for this request. If one @@ -9249,8 +9815,8 @@ def get_project_request_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_project_request_serialize( - project_id=project_id, + _param = self._get_organization_request_serialize( + organization_id=organization_id, request_id=request_id, _request_auth=_request_auth, _content_type=_content_type, @@ -9269,9 +9835,9 @@ def get_project_request_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_project_request_serialize( + def _get_organization_request_serialize( self, - project_id, + organization_id, request_id, _request_auth, _content_type, @@ -9291,8 +9857,8 @@ def _get_project_request_serialize( _body_params: Optional[bytes] = None # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id + if organization_id is not None: + _path_params["organizationId"] = organization_id if request_id is not None: _path_params["requestId"] = request_id # process the query parameters @@ -9309,7 +9875,7 @@ def _get_project_request_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/projects/{projectId}/requests/{requestId}", + resource_path="/v1alpha1/organizations/{organizationId}/requests/{requestId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -9323,15 +9889,12 @@ def _get_project_request_serialize( ) @validate_call - def get_public_ip( + def get_project_details( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -9341,15 +9904,13 @@ def get_public_ip( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PublicIp: - """Get details about a public IP. + ) -> Project: + """Get project details. - Get details about a public IP inside a project. + Get details about a STACKIT project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param public_ip_id: The identifier (ID) of a Public IP. (required) - :type public_ip_id: str :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 @@ -9372,9 +9933,8 @@ def get_public_ip( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_public_ip_serialize( + _param = self._get_project_details_serialize( project_id=project_id, - public_ip_id=public_ip_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9382,7 +9942,7 @@ def get_public_ip( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicIp", + "200": "Project", "400": "Error", "401": "Error", "403": "Error", @@ -9397,15 +9957,12 @@ def get_public_ip( ).data @validate_call - def get_public_ip_with_http_info( + def get_project_details_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -9415,15 +9972,13 @@ def get_public_ip_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PublicIp]: - """Get details about a public IP. + ) -> ApiResponse[Project]: + """Get project details. - Get details about a public IP inside a project. + Get details about a STACKIT project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param public_ip_id: The identifier (ID) of a Public IP. (required) - :type public_ip_id: str :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 @@ -9446,9 +10001,8 @@ def get_public_ip_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_public_ip_serialize( + _param = self._get_project_details_serialize( project_id=project_id, - public_ip_id=public_ip_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9456,7 +10010,7 @@ def get_public_ip_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicIp", + "200": "Project", "400": "Error", "401": "Error", "403": "Error", @@ -9471,15 +10025,12 @@ def get_public_ip_with_http_info( ) @validate_call - def get_public_ip_without_preload_content( + def get_project_details_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -9490,14 +10041,12 @@ def get_public_ip_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get details about a public IP. + """Get project details. - Get details about a public IP inside a project. + Get details about a STACKIT project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param public_ip_id: The identifier (ID) of a Public IP. (required) - :type public_ip_id: str :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 @@ -9520,9 +10069,8 @@ def get_public_ip_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_public_ip_serialize( + _param = self._get_project_details_serialize( project_id=project_id, - public_ip_id=public_ip_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9530,7 +10078,7 @@ def get_public_ip_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicIp", + "200": "Project", "400": "Error", "401": "Error", "403": "Error", @@ -9540,10 +10088,9 @@ def get_public_ip_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_public_ip_serialize( + def _get_project_details_serialize( self, project_id, - public_ip_id, _request_auth, _content_type, _headers, @@ -9564,8 +10111,6 @@ def _get_public_ip_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if public_ip_id is not None: - _path_params["publicIpId"] = public_ip_id # process the query parameters # process the header parameters # process the form parameters @@ -9580,7 +10125,7 @@ def _get_public_ip_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/projects/{projectId}/public-ips/{publicIpId}", + resource_path="/v1alpha1/projects/{projectId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -9594,20 +10139,15 @@ def _get_public_ip_serialize( ) @validate_call - def get_security_group( + def get_project_request( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - security_group_id: Annotated[ + request_id: Annotated[ str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), ], _request_timeout: Union[ None, @@ -9618,15 +10158,15 @@ def get_security_group( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SecurityGroup: - """Get security group details. + ) -> Request: + """Lookup a project request ID. - Get details about a security group of a project. + Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str + :param request_id: The identifier (ID) of a STACKIT Request. (required) + :type request_id: str :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 @@ -9649,9 +10189,9 @@ def get_security_group( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_security_group_serialize( + _param = self._get_project_request_serialize( project_id=project_id, - security_group_id=security_group_id, + request_id=request_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9659,7 +10199,7 @@ def get_security_group( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroup", + "200": "Request", "400": "Error", "401": "Error", "403": "Error", @@ -9674,20 +10214,15 @@ def get_security_group( ).data @validate_call - def get_security_group_with_http_info( + def get_project_request_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - security_group_id: Annotated[ + request_id: Annotated[ str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), ], _request_timeout: Union[ None, @@ -9698,15 +10233,15 @@ def get_security_group_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[SecurityGroup]: - """Get security group details. + ) -> ApiResponse[Request]: + """Lookup a project request ID. - Get details about a security group of a project. + Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str + :param request_id: The identifier (ID) of a STACKIT Request. (required) + :type request_id: str :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 @@ -9729,9 +10264,9 @@ def get_security_group_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_security_group_serialize( + _param = self._get_project_request_serialize( project_id=project_id, - security_group_id=security_group_id, + request_id=request_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9739,7 +10274,7 @@ def get_security_group_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroup", + "200": "Request", "400": "Error", "401": "Error", "403": "Error", @@ -9754,20 +10289,15 @@ def get_security_group_with_http_info( ) @validate_call - def get_security_group_without_preload_content( + def get_project_request_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - security_group_id: Annotated[ + request_id: Annotated[ str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), ], _request_timeout: Union[ None, @@ -9779,14 +10309,14 @@ def get_security_group_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get security group details. + """Lookup a project request ID. - Get details about a security group of a project. + Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str + :param request_id: The identifier (ID) of a STACKIT Request. (required) + :type request_id: str :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 @@ -9809,9 +10339,9 @@ def get_security_group_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_security_group_serialize( + _param = self._get_project_request_serialize( project_id=project_id, - security_group_id=security_group_id, + request_id=request_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9819,7 +10349,7 @@ def get_security_group_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroup", + "200": "Request", "400": "Error", "401": "Error", "403": "Error", @@ -9829,10 +10359,10 @@ def get_security_group_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_security_group_serialize( + def _get_project_request_serialize( self, project_id, - security_group_id, + request_id, _request_auth, _content_type, _headers, @@ -9853,8 +10383,8 @@ def _get_security_group_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if security_group_id is not None: - _path_params["securityGroupId"] = security_group_id + if request_id is not None: + _path_params["requestId"] = request_id # process the query parameters # process the header parameters # process the form parameters @@ -9869,7 +10399,7 @@ def _get_security_group_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}", + resource_path="/v1alpha1/projects/{projectId}/requests/{requestId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -9883,29 +10413,14 @@ def _get_security_group_serialize( ) @validate_call - def get_security_group_rule( + def get_public_ip( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - security_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), - ], - security_group_rule_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group Rule.", - ), + public_ip_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") ], _request_timeout: Union[ None, @@ -9916,17 +10431,15 @@ def get_security_group_rule( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SecurityGroupRule: - """Get security group rule details. + ) -> PublicIp: + """Get details about a public IP. - Get details about a security group rule of a project. + Get details about a public IP inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str - :param security_group_rule_id: The identifier (ID) of a STACKIT Security Group Rule. (required) - :type security_group_rule_id: str + :param public_ip_id: The identifier (ID) of a Public IP. (required) + :type public_ip_id: str :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 @@ -9949,10 +10462,9 @@ def get_security_group_rule( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_security_group_rule_serialize( + _param = self._get_public_ip_serialize( project_id=project_id, - security_group_id=security_group_id, - security_group_rule_id=security_group_rule_id, + public_ip_id=public_ip_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9960,7 +10472,7 @@ def get_security_group_rule( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupRule", + "200": "PublicIp", "400": "Error", "401": "Error", "403": "Error", @@ -9975,29 +10487,14 @@ def get_security_group_rule( ).data @validate_call - def get_security_group_rule_with_http_info( + def get_public_ip_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - security_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), - ], - security_group_rule_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group Rule.", - ), + public_ip_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") ], _request_timeout: Union[ None, @@ -10008,17 +10505,15 @@ def get_security_group_rule_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[SecurityGroupRule]: - """Get security group rule details. + ) -> ApiResponse[PublicIp]: + """Get details about a public IP. - Get details about a security group rule of a project. + Get details about a public IP inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str - :param security_group_rule_id: The identifier (ID) of a STACKIT Security Group Rule. (required) - :type security_group_rule_id: str + :param public_ip_id: The identifier (ID) of a Public IP. (required) + :type public_ip_id: str :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 @@ -10041,10 +10536,9 @@ def get_security_group_rule_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_security_group_rule_serialize( + _param = self._get_public_ip_serialize( project_id=project_id, - security_group_id=security_group_id, - security_group_rule_id=security_group_rule_id, + public_ip_id=public_ip_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10052,7 +10546,7 @@ def get_security_group_rule_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupRule", + "200": "PublicIp", "400": "Error", "401": "Error", "403": "Error", @@ -10067,29 +10561,1196 @@ def get_security_group_rule_with_http_info( ) @validate_call - def get_security_group_rule_without_preload_content( + def get_public_ip_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - security_group_id: Annotated[ - str, - Field( - min_length=36, + public_ip_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") + ], + _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: + """Get details about a public IP. + + Get details about a public IP inside a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param public_ip_id: The identifier (ID) of a Public IP. (required) + :type public_ip_id: str + :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._get_public_ip_serialize( + project_id=project_id, + public_ip_id=public_ip_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PublicIp", + "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 _get_public_ip_serialize( + self, + project_id, + public_ip_id, + _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 + if project_id is not None: + _path_params["projectId"] = project_id + if public_ip_id is not None: + _path_params["publicIpId"] = public_ip_id + # 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="/v1alpha1/projects/{projectId}/public-ips/{publicIpId}", + 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 get_security_group( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + security_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group.", + ), + ], + _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, + ) -> SecurityGroup: + """Get security group details. + + Get details about a security group of a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) + :type security_group_id: str + :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._get_security_group_serialize( + project_id=project_id, + security_group_id=security_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SecurityGroup", + "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 get_security_group_with_http_info( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + security_group_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Security Group.", ), ], - security_group_rule_id: Annotated[ + _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[SecurityGroup]: + """Get security group details. + + Get details about a security group of a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) + :type security_group_id: str + :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._get_security_group_serialize( + project_id=project_id, + security_group_id=security_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SecurityGroup", + "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 get_security_group_without_preload_content( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + security_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group.", + ), + ], + _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: + """Get security group details. + + Get details about a security group of a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) + :type security_group_id: str + :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._get_security_group_serialize( + project_id=project_id, + security_group_id=security_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SecurityGroup", + "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 _get_security_group_serialize( + self, + project_id, + security_group_id, + _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 + if project_id is not None: + _path_params["projectId"] = project_id + if security_group_id is not None: + _path_params["securityGroupId"] = security_group_id + # 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="/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}", + 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 get_security_group_rule( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + security_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group.", + ), + ], + security_group_rule_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group Rule.", + ), + ], + _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, + ) -> SecurityGroupRule: + """Get security group rule details. + + Get details about a security group rule of a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) + :type security_group_id: str + :param security_group_rule_id: The identifier (ID) of a STACKIT Security Group Rule. (required) + :type security_group_rule_id: str + :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._get_security_group_rule_serialize( + project_id=project_id, + security_group_id=security_group_id, + security_group_rule_id=security_group_rule_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SecurityGroupRule", + "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 get_security_group_rule_with_http_info( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + security_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group.", + ), + ], + security_group_rule_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group Rule.", + ), + ], + _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[SecurityGroupRule]: + """Get security group rule details. + + Get details about a security group rule of a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) + :type security_group_id: str + :param security_group_rule_id: The identifier (ID) of a STACKIT Security Group Rule. (required) + :type security_group_rule_id: str + :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._get_security_group_rule_serialize( + project_id=project_id, + security_group_id=security_group_id, + security_group_rule_id=security_group_rule_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SecurityGroupRule", + "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 get_security_group_rule_without_preload_content( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + security_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group.", + ), + ], + security_group_rule_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group Rule.", + ), + ], + _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: + """Get security group rule details. + + Get details about a security group rule of a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) + :type security_group_id: str + :param security_group_rule_id: The identifier (ID) of a STACKIT Security Group Rule. (required) + :type security_group_rule_id: str + :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._get_security_group_rule_serialize( + project_id=project_id, + security_group_id=security_group_id, + security_group_rule_id=security_group_rule_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SecurityGroupRule", + "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 _get_security_group_rule_serialize( + self, + project_id, + security_group_id, + security_group_rule_id, + _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 + if project_id is not None: + _path_params["projectId"] = project_id + if security_group_id is not None: + _path_params["securityGroupId"] = security_group_id + if security_group_rule_id is not None: + _path_params["securityGroupRuleId"] = security_group_rule_id + # 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="/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}", + 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 get_server( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + ], + details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, + _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, + ) -> Server: + """Get server details. + + Get details about a server by its ID. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str + :param details: Show detailed information about server. + :type details: bool + :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._get_server_serialize( + project_id=project_id, + server_id=server_id, + details=details, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Server", + "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 get_server_with_http_info( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + ], + details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, + _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[Server]: + """Get server details. + + Get details about a server by its ID. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str + :param details: Show detailed information about server. + :type details: bool + :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._get_server_serialize( + project_id=project_id, + server_id=server_id, + details=details, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Server", + "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 get_server_without_preload_content( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + ], + details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, + _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: + """Get server details. + + Get details about a server by its ID. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str + :param details: Show detailed information about server. + :type details: bool + :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._get_server_serialize( + project_id=project_id, + server_id=server_id, + details=details, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Server", + "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 _get_server_serialize( + self, + project_id, + server_id, + details, + _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 + if project_id is not None: + _path_params["projectId"] = project_id + if server_id is not None: + _path_params["serverId"] = server_id + # process the query parameters + if details is not None: + + _query_params.append(("details", details)) + + # 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="/v1alpha1/projects/{projectId}/servers/{serverId}", + 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 get_server_console( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + ], + _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, + ) -> ServerConsoleUrl: + """Get server console. + + Get a URL for server remote console. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str + :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._get_server_console_serialize( + project_id=project_id, + server_id=server_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ServerConsoleUrl", + "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 get_server_console_with_http_info( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + ], + _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[ServerConsoleUrl]: + """Get server console. + + Get a URL for server remote console. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str + :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._get_server_console_serialize( + project_id=project_id, + server_id=server_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ServerConsoleUrl", + "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 get_server_console_without_preload_content( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + server_id: Annotated[ str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group Rule.", - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], _request_timeout: Union[ None, @@ -10101,16 +11762,14 @@ def get_security_group_rule_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get security group rule details. + """Get server console. - Get details about a security group rule of a project. + Get a URL for server remote console. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str - :param security_group_rule_id: The identifier (ID) of a STACKIT Security Group Rule. (required) - :type security_group_rule_id: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str :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 @@ -10133,10 +11792,9 @@ def get_security_group_rule_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_security_group_rule_serialize( + _param = self._get_server_console_serialize( project_id=project_id, - security_group_id=security_group_id, - security_group_rule_id=security_group_rule_id, + server_id=server_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10144,7 +11802,7 @@ def get_security_group_rule_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupRule", + "200": "ServerConsoleUrl", "400": "Error", "401": "Error", "403": "Error", @@ -10154,11 +11812,10 @@ def get_security_group_rule_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_security_group_rule_serialize( + def _get_server_console_serialize( self, project_id, - security_group_id, - security_group_rule_id, + server_id, _request_auth, _content_type, _headers, @@ -10179,10 +11836,8 @@ def _get_security_group_rule_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if security_group_id is not None: - _path_params["securityGroupId"] = security_group_id - if security_group_rule_id is not None: - _path_params["securityGroupRuleId"] = security_group_rule_id + if server_id is not None: + _path_params["serverId"] = server_id # process the query parameters # process the header parameters # process the form parameters @@ -10197,7 +11852,7 @@ def _get_security_group_rule_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}", + resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/console", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -10211,7 +11866,7 @@ def _get_security_group_rule_serialize( ) @validate_call - def get_server( + def get_server_log( self, project_id: Annotated[ str, @@ -10221,7 +11876,10 @@ def get_server( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], - details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, + get_server_log_request: Annotated[ + Optional[GetServerLogRequest], + Field(description="Request the server log. By default the length is limited to 2000 lines."), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -10231,17 +11889,17 @@ def get_server( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Server: - """Get server details. + ) -> GetServerLog200Response: + """Get server log. - Get details about a server by its ID. + Get server console log. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str :param server_id: The identifier (ID) of a STACKIT Server. (required) :type server_id: str - :param details: Show detailed information about server. - :type details: bool + :param get_server_log_request: Request the server log. By default the length is limited to 2000 lines. + :type get_server_log_request: GetServerLogRequest :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 @@ -10264,10 +11922,10 @@ def get_server( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_server_serialize( + _param = self._get_server_log_serialize( project_id=project_id, server_id=server_id, - details=details, + get_server_log_request=get_server_log_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10275,7 +11933,7 @@ def get_server( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Server", + "200": "GetServerLog200Response", "400": "Error", "401": "Error", "403": "Error", @@ -10290,7 +11948,7 @@ def get_server( ).data @validate_call - def get_server_with_http_info( + def get_server_log_with_http_info( self, project_id: Annotated[ str, @@ -10300,7 +11958,10 @@ def get_server_with_http_info( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], - details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, + get_server_log_request: Annotated[ + Optional[GetServerLogRequest], + Field(description="Request the server log. By default the length is limited to 2000 lines."), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -10310,17 +11971,17 @@ def get_server_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Server]: - """Get server details. + ) -> ApiResponse[GetServerLog200Response]: + """Get server log. - Get details about a server by its ID. + Get server console log. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str :param server_id: The identifier (ID) of a STACKIT Server. (required) :type server_id: str - :param details: Show detailed information about server. - :type details: bool + :param get_server_log_request: Request the server log. By default the length is limited to 2000 lines. + :type get_server_log_request: GetServerLogRequest :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 @@ -10343,10 +12004,10 @@ def get_server_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_server_serialize( + _param = self._get_server_log_serialize( project_id=project_id, server_id=server_id, - details=details, + get_server_log_request=get_server_log_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10354,7 +12015,7 @@ def get_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Server", + "200": "GetServerLog200Response", "400": "Error", "401": "Error", "403": "Error", @@ -10369,7 +12030,7 @@ def get_server_with_http_info( ) @validate_call - def get_server_without_preload_content( + def get_server_log_without_preload_content( self, project_id: Annotated[ str, @@ -10379,7 +12040,10 @@ def get_server_without_preload_content( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], - details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, + get_server_log_request: Annotated[ + Optional[GetServerLogRequest], + Field(description="Request the server log. By default the length is limited to 2000 lines."), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -10390,16 +12054,16 @@ def get_server_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get server details. + """Get server log. - Get details about a server by its ID. + Get server console log. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str :param server_id: The identifier (ID) of a STACKIT Server. (required) :type server_id: str - :param details: Show detailed information about server. - :type details: bool + :param get_server_log_request: Request the server log. By default the length is limited to 2000 lines. + :type get_server_log_request: GetServerLogRequest :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 @@ -10422,10 +12086,10 @@ def get_server_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_server_serialize( + _param = self._get_server_log_serialize( project_id=project_id, server_id=server_id, - details=details, + get_server_log_request=get_server_log_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10433,7 +12097,7 @@ def get_server_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Server", + "200": "GetServerLog200Response", "400": "Error", "401": "Error", "403": "Error", @@ -10443,11 +12107,11 @@ def get_server_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_server_serialize( + def _get_server_log_serialize( self, project_id, server_id, - details, + get_server_log_request, _request_auth, _content_type, _headers, @@ -10471,24 +12135,30 @@ def _get_server_serialize( if server_id is not None: _path_params["serverId"] = server_id # process the query parameters - if details is not None: - - _query_params.append(("details", details)) - # process the header parameters # process the form parameters # process the body parameter + if get_server_log_request is not None: + _body_params = get_server_log_request # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}", + resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/log", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -10502,15 +12172,18 @@ def _get_server_serialize( ) @validate_call - def get_server_console( + def get_virtual_ip( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - server_id: Annotated[ + network_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + virtual_ip_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") ], _request_timeout: Union[ None, @@ -10521,15 +12194,17 @@ def get_server_console( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ServerConsoleUrl: - """Get server console. + ) -> VirtualIp: + """Get details about a virtual IP. - Get a URL for server remote console. + Get details about a virtual IP inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str + :param network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param virtual_ip_id: The identifier (ID) of a Virtual IP. (required) + :type virtual_ip_id: str :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 @@ -10552,9 +12227,10 @@ def get_server_console( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_server_console_serialize( + _param = self._get_virtual_ip_serialize( project_id=project_id, - server_id=server_id, + network_id=network_id, + virtual_ip_id=virtual_ip_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10562,7 +12238,7 @@ def get_server_console( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServerConsoleUrl", + "200": "VirtualIp", "400": "Error", "401": "Error", "403": "Error", @@ -10577,15 +12253,18 @@ def get_server_console( ).data @validate_call - def get_server_console_with_http_info( + def get_virtual_ip_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - server_id: Annotated[ + network_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + virtual_ip_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") ], _request_timeout: Union[ None, @@ -10596,15 +12275,17 @@ def get_server_console_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ServerConsoleUrl]: - """Get server console. + ) -> ApiResponse[VirtualIp]: + """Get details about a virtual IP. - Get a URL for server remote console. + Get details about a virtual IP inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str + :param network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param virtual_ip_id: The identifier (ID) of a Virtual IP. (required) + :type virtual_ip_id: str :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 @@ -10627,9 +12308,10 @@ def get_server_console_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_server_console_serialize( + _param = self._get_virtual_ip_serialize( project_id=project_id, - server_id=server_id, + network_id=network_id, + virtual_ip_id=virtual_ip_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10637,7 +12319,7 @@ def get_server_console_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServerConsoleUrl", + "200": "VirtualIp", "400": "Error", "401": "Error", "403": "Error", @@ -10652,15 +12334,18 @@ def get_server_console_with_http_info( ) @validate_call - def get_server_console_without_preload_content( + def get_virtual_ip_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - server_id: Annotated[ + network_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + virtual_ip_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") ], _request_timeout: Union[ None, @@ -10672,14 +12357,16 @@ def get_server_console_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get server console. + """Get details about a virtual IP. - Get a URL for server remote console. + Get details about a virtual IP inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str + :param network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param virtual_ip_id: The identifier (ID) of a Virtual IP. (required) + :type virtual_ip_id: str :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 @@ -10702,9 +12389,10 @@ def get_server_console_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_server_console_serialize( + _param = self._get_virtual_ip_serialize( project_id=project_id, - server_id=server_id, + network_id=network_id, + virtual_ip_id=virtual_ip_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10712,7 +12400,7 @@ def get_server_console_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServerConsoleUrl", + "200": "VirtualIp", "400": "Error", "401": "Error", "403": "Error", @@ -10722,10 +12410,11 @@ def get_server_console_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_server_console_serialize( + def _get_virtual_ip_serialize( self, project_id, - server_id, + network_id, + virtual_ip_id, _request_auth, _content_type, _headers, @@ -10746,8 +12435,10 @@ def _get_server_console_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if server_id is not None: - _path_params["serverId"] = server_id + if network_id is not None: + _path_params["networkId"] = network_id + if virtual_ip_id is not None: + _path_params["virtualIpId"] = virtual_ip_id # process the query parameters # process the header parameters # process the form parameters @@ -10762,7 +12453,7 @@ def _get_server_console_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/console", + resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -10776,20 +12467,16 @@ def _get_server_console_serialize( ) @validate_call - def get_server_log( + def get_volume( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - server_id: Annotated[ + volume_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), ], - get_server_log_request: Annotated[ - Optional[GetServerLogRequest], - Field(description="Request the server log. By default the length is limited to 2000 lines."), - ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -10799,17 +12486,15 @@ def get_server_log( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetServerLog200Response: - """Get server log. + ) -> Volume: + """Get details about a volume. - Get server console log. + Get details about a block device volume. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param get_server_log_request: Request the server log. By default the length is limited to 2000 lines. - :type get_server_log_request: GetServerLogRequest + :param volume_id: The identifier (ID) of a STACKIT Volume. (required) + :type volume_id: str :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 @@ -10832,10 +12517,9 @@ def get_server_log( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_server_log_serialize( + _param = self._get_volume_serialize( project_id=project_id, - server_id=server_id, - get_server_log_request=get_server_log_request, + volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10843,7 +12527,7 @@ def get_server_log( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetServerLog200Response", + "200": "Volume", "400": "Error", "401": "Error", "403": "Error", @@ -10858,20 +12542,16 @@ def get_server_log( ).data @validate_call - def get_server_log_with_http_info( + def get_volume_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - server_id: Annotated[ + volume_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), ], - get_server_log_request: Annotated[ - Optional[GetServerLogRequest], - Field(description="Request the server log. By default the length is limited to 2000 lines."), - ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -10881,17 +12561,15 @@ def get_server_log_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetServerLog200Response]: - """Get server log. + ) -> ApiResponse[Volume]: + """Get details about a volume. - Get server console log. + Get details about a block device volume. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param get_server_log_request: Request the server log. By default the length is limited to 2000 lines. - :type get_server_log_request: GetServerLogRequest + :param volume_id: The identifier (ID) of a STACKIT Volume. (required) + :type volume_id: str :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 @@ -10914,10 +12592,9 @@ def get_server_log_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_server_log_serialize( + _param = self._get_volume_serialize( project_id=project_id, - server_id=server_id, - get_server_log_request=get_server_log_request, + volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10925,7 +12602,7 @@ def get_server_log_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetServerLog200Response", + "200": "Volume", "400": "Error", "401": "Error", "403": "Error", @@ -10940,20 +12617,16 @@ def get_server_log_with_http_info( ) @validate_call - def get_server_log_without_preload_content( + def get_volume_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - server_id: Annotated[ + volume_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), ], - get_server_log_request: Annotated[ - Optional[GetServerLogRequest], - Field(description="Request the server log. By default the length is limited to 2000 lines."), - ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -10964,16 +12637,14 @@ def get_server_log_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get server log. + """Get details about a volume. - Get server console log. + Get details about a block device volume. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param get_server_log_request: Request the server log. By default the length is limited to 2000 lines. - :type get_server_log_request: GetServerLogRequest + :param volume_id: The identifier (ID) of a STACKIT Volume. (required) + :type volume_id: str :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 @@ -10996,10 +12667,9 @@ def get_server_log_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_server_log_serialize( + _param = self._get_volume_serialize( project_id=project_id, - server_id=server_id, - get_server_log_request=get_server_log_request, + volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11007,7 +12677,7 @@ def get_server_log_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetServerLog200Response", + "200": "Volume", "400": "Error", "401": "Error", "403": "Error", @@ -11017,11 +12687,10 @@ def get_server_log_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_server_log_serialize( + def _get_volume_serialize( self, project_id, - server_id, - get_server_log_request, + volume_id, _request_auth, _content_type, _headers, @@ -11042,33 +12711,23 @@ def _get_server_log_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if server_id is not None: - _path_params["serverId"] = server_id + if volume_id is not None: + _path_params["volumeId"] = volume_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if get_server_log_request is not None: - _body_params = get_server_log_request # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type(["application/json"]) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type - # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/log", + resource_path="/v1alpha1/projects/{projectId}/volumes/{volumeId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -11082,18 +12741,14 @@ def _get_server_log_serialize( ) @validate_call - def get_virtual_ip( + def get_volume_performance_class( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - virtual_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") + volume_performance_class: Annotated[ + str, Field(strict=True, max_length=63, description="The name of a STACKIT Volume performance class.") ], _request_timeout: Union[ None, @@ -11104,17 +12759,15 @@ def get_virtual_ip( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> VirtualIp: - """Get details about a virtual IP. + ) -> VolumePerformanceClass: + """Get details about a volume performance class. - Get details about a virtual IP inside a project. + Get details about a specific volume performance class. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param virtual_ip_id: The identifier (ID) of a Virtual IP. (required) - :type virtual_ip_id: str + :param volume_performance_class: The name of a STACKIT Volume performance class. (required) + :type volume_performance_class: str :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 @@ -11137,10 +12790,9 @@ def get_virtual_ip( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_virtual_ip_serialize( + _param = self._get_volume_performance_class_serialize( project_id=project_id, - network_id=network_id, - virtual_ip_id=virtual_ip_id, + volume_performance_class=volume_performance_class, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11148,7 +12800,7 @@ def get_virtual_ip( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VirtualIp", + "200": "VolumePerformanceClass", "400": "Error", "401": "Error", "403": "Error", @@ -11163,18 +12815,14 @@ def get_virtual_ip( ).data @validate_call - def get_virtual_ip_with_http_info( + def get_volume_performance_class_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - virtual_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") + volume_performance_class: Annotated[ + str, Field(strict=True, max_length=63, description="The name of a STACKIT Volume performance class.") ], _request_timeout: Union[ None, @@ -11185,17 +12833,15 @@ def get_virtual_ip_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[VirtualIp]: - """Get details about a virtual IP. + ) -> ApiResponse[VolumePerformanceClass]: + """Get details about a volume performance class. - Get details about a virtual IP inside a project. + Get details about a specific volume performance class. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param virtual_ip_id: The identifier (ID) of a Virtual IP. (required) - :type virtual_ip_id: str + :param volume_performance_class: The name of a STACKIT Volume performance class. (required) + :type volume_performance_class: str :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 @@ -11218,10 +12864,9 @@ def get_virtual_ip_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_virtual_ip_serialize( + _param = self._get_volume_performance_class_serialize( project_id=project_id, - network_id=network_id, - virtual_ip_id=virtual_ip_id, + volume_performance_class=volume_performance_class, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11229,7 +12874,7 @@ def get_virtual_ip_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VirtualIp", + "200": "VolumePerformanceClass", "400": "Error", "401": "Error", "403": "Error", @@ -11244,18 +12889,14 @@ def get_virtual_ip_with_http_info( ) @validate_call - def get_virtual_ip_without_preload_content( + def get_volume_performance_class_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - virtual_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") + volume_performance_class: Annotated[ + str, Field(strict=True, max_length=63, description="The name of a STACKIT Volume performance class.") ], _request_timeout: Union[ None, @@ -11267,16 +12908,14 @@ def get_virtual_ip_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get details about a virtual IP. + """Get details about a volume performance class. - Get details about a virtual IP inside a project. + Get details about a specific volume performance class. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param virtual_ip_id: The identifier (ID) of a Virtual IP. (required) - :type virtual_ip_id: str + :param volume_performance_class: The name of a STACKIT Volume performance class. (required) + :type volume_performance_class: str :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 @@ -11299,10 +12938,9 @@ def get_virtual_ip_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_virtual_ip_serialize( + _param = self._get_volume_performance_class_serialize( project_id=project_id, - network_id=network_id, - virtual_ip_id=virtual_ip_id, + volume_performance_class=volume_performance_class, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11310,7 +12948,7 @@ def get_virtual_ip_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VirtualIp", + "200": "VolumePerformanceClass", "400": "Error", "401": "Error", "403": "Error", @@ -11320,11 +12958,10 @@ def get_virtual_ip_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_virtual_ip_serialize( + def _get_volume_performance_class_serialize( self, project_id, - network_id, - virtual_ip_id, + volume_performance_class, _request_auth, _content_type, _headers, @@ -11345,10 +12982,8 @@ def _get_virtual_ip_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if network_id is not None: - _path_params["networkId"] = network_id - if virtual_ip_id is not None: - _path_params["virtualIpId"] = virtual_ip_id + if volume_performance_class is not None: + _path_params["volumePerformanceClass"] = volume_performance_class # process the query parameters # process the header parameters # process the form parameters @@ -11363,7 +12998,7 @@ def _get_virtual_ip_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}", + resource_path="/v1alpha1/projects/{projectId}/volume-performance-classes/{volumePerformanceClass}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -11377,15 +13012,15 @@ def _get_virtual_ip_serialize( ) @validate_call - def get_volume( + def list_attached_volumes( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - volume_id: Annotated[ + server_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], _request_timeout: Union[ None, @@ -11396,15 +13031,15 @@ def get_volume( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Volume: - """Get details about a volume. + ) -> VolumeAttachmentListResponse: + """List all volume attachments of a server. - Get details about a block device volume. + Get a list of all volume attachments of a server. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param volume_id: The identifier (ID) of a STACKIT Volume. (required) - :type volume_id: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str :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 @@ -11427,9 +13062,9 @@ def get_volume( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_volume_serialize( + _param = self._list_attached_volumes_serialize( project_id=project_id, - volume_id=volume_id, + server_id=server_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11437,7 +13072,7 @@ def get_volume( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Volume", + "200": "VolumeAttachmentListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -11452,15 +13087,15 @@ def get_volume( ).data @validate_call - def get_volume_with_http_info( + def list_attached_volumes_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - volume_id: Annotated[ + server_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], _request_timeout: Union[ None, @@ -11471,15 +13106,15 @@ def get_volume_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Volume]: - """Get details about a volume. + ) -> ApiResponse[VolumeAttachmentListResponse]: + """List all volume attachments of a server. - Get details about a block device volume. + Get a list of all volume attachments of a server. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param volume_id: The identifier (ID) of a STACKIT Volume. (required) - :type volume_id: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str :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 @@ -11502,9 +13137,9 @@ def get_volume_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_volume_serialize( + _param = self._list_attached_volumes_serialize( project_id=project_id, - volume_id=volume_id, + server_id=server_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11512,7 +13147,7 @@ def get_volume_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Volume", + "200": "VolumeAttachmentListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -11527,15 +13162,15 @@ def get_volume_with_http_info( ) @validate_call - def get_volume_without_preload_content( + def list_attached_volumes_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - volume_id: Annotated[ + server_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], _request_timeout: Union[ None, @@ -11547,14 +13182,14 @@ def get_volume_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get details about a volume. + """List all volume attachments of a server. - Get details about a block device volume. + Get a list of all volume attachments of a server. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param volume_id: The identifier (ID) of a STACKIT Volume. (required) - :type volume_id: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str :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 @@ -11577,9 +13212,9 @@ def get_volume_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_volume_serialize( + _param = self._list_attached_volumes_serialize( project_id=project_id, - volume_id=volume_id, + server_id=server_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11587,7 +13222,7 @@ def get_volume_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Volume", + "200": "VolumeAttachmentListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -11597,10 +13232,10 @@ def get_volume_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_volume_serialize( + def _list_attached_volumes_serialize( self, project_id, - volume_id, + server_id, _request_auth, _content_type, _headers, @@ -11621,8 +13256,8 @@ def _get_volume_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if volume_id is not None: - _path_params["volumeId"] = volume_id + if server_id is not None: + _path_params["serverId"] = server_id # process the query parameters # process the header parameters # process the form parameters @@ -11637,7 +13272,7 @@ def _get_volume_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/projects/{projectId}/volumes/{volumeId}", + resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -11651,15 +13286,13 @@ def _get_volume_serialize( ) @validate_call - def get_volume_performance_class( + def list_images( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - volume_performance_class: Annotated[ - str, Field(strict=True, max_length=63, description="The name of a STACKIT Volume performance class.") - ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11669,15 +13302,15 @@ def get_volume_performance_class( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> VolumePerformanceClass: - """Get details about a volume performance class. + ) -> ImageListResponse: + """List all Images inside a project. - Get details about a specific volume performance class. + Get a list of all images inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param volume_performance_class: The name of a STACKIT Volume performance class. (required) - :type volume_performance_class: str + :param label_selector: Filter resources by labels. + :type label_selector: str :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 @@ -11700,9 +13333,9 @@ def get_volume_performance_class( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_volume_performance_class_serialize( + _param = self._list_images_serialize( project_id=project_id, - volume_performance_class=volume_performance_class, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11710,7 +13343,7 @@ def get_volume_performance_class( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumePerformanceClass", + "200": "ImageListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -11725,15 +13358,13 @@ def get_volume_performance_class( ).data @validate_call - def get_volume_performance_class_with_http_info( + def list_images_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - volume_performance_class: Annotated[ - str, Field(strict=True, max_length=63, description="The name of a STACKIT Volume performance class.") - ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11743,15 +13374,15 @@ def get_volume_performance_class_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[VolumePerformanceClass]: - """Get details about a volume performance class. + ) -> ApiResponse[ImageListResponse]: + """List all Images inside a project. - Get details about a specific volume performance class. + Get a list of all images inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param volume_performance_class: The name of a STACKIT Volume performance class. (required) - :type volume_performance_class: str + :param label_selector: Filter resources by labels. + :type label_selector: str :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 @@ -11774,9 +13405,9 @@ def get_volume_performance_class_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_volume_performance_class_serialize( + _param = self._list_images_serialize( project_id=project_id, - volume_performance_class=volume_performance_class, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11784,7 +13415,7 @@ def get_volume_performance_class_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumePerformanceClass", + "200": "ImageListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -11799,15 +13430,13 @@ def get_volume_performance_class_with_http_info( ) @validate_call - def get_volume_performance_class_without_preload_content( + def list_images_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - volume_performance_class: Annotated[ - str, Field(strict=True, max_length=63, description="The name of a STACKIT Volume performance class.") - ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11818,14 +13447,14 @@ def get_volume_performance_class_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get details about a volume performance class. + """List all Images inside a project. - Get details about a specific volume performance class. + Get a list of all images inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param volume_performance_class: The name of a STACKIT Volume performance class. (required) - :type volume_performance_class: str + :param label_selector: Filter resources by labels. + :type label_selector: str :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 @@ -11848,9 +13477,9 @@ def get_volume_performance_class_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_volume_performance_class_serialize( + _param = self._list_images_serialize( project_id=project_id, - volume_performance_class=volume_performance_class, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11858,7 +13487,7 @@ def get_volume_performance_class_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumePerformanceClass", + "200": "ImageListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -11868,10 +13497,10 @@ def get_volume_performance_class_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_volume_performance_class_serialize( + def _list_images_serialize( self, project_id, - volume_performance_class, + label_selector, _request_auth, _content_type, _headers, @@ -11892,9 +13521,11 @@ def _get_volume_performance_class_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if volume_performance_class is not None: - _path_params["volumePerformanceClass"] = volume_performance_class # process the query parameters + if label_selector is not None: + + _query_params.append(("label_selector", label_selector)) + # process the header parameters # process the form parameters # process the body parameter @@ -11908,7 +13539,7 @@ def _get_volume_performance_class_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/projects/{projectId}/volume-performance-classes/{volumePerformanceClass}", + resource_path="/v1alpha1/projects/{projectId}/images", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -11922,16 +13553,9 @@ def _get_volume_performance_class_serialize( ) @validate_call - def list_attached_volumes( + def list_key_pairs( self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11941,15 +13565,13 @@ def list_attached_volumes( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> VolumeAttachmentListResponse: - """List all volume attachments of a server. + ) -> KeyPairListResponse: + """List all SSH keypairs for the requesting user. - Get a list of all volume attachments of a server. + Get a list of all SSH keypairs assigned to the requesting user. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str + :param label_selector: Filter resources by labels. + :type label_selector: str :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 @@ -11972,9 +13594,8 @@ def list_attached_volumes( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_attached_volumes_serialize( - project_id=project_id, - server_id=server_id, + _param = self._list_key_pairs_serialize( + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11982,7 +13603,7 @@ def list_attached_volumes( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachmentListResponse", + "200": "KeyPairListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -11997,16 +13618,9 @@ def list_attached_volumes( ).data @validate_call - def list_attached_volumes_with_http_info( + def list_key_pairs_with_http_info( self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12016,15 +13630,13 @@ def list_attached_volumes_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[VolumeAttachmentListResponse]: - """List all volume attachments of a server. + ) -> ApiResponse[KeyPairListResponse]: + """List all SSH keypairs for the requesting user. - Get a list of all volume attachments of a server. + Get a list of all SSH keypairs assigned to the requesting user. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str + :param label_selector: Filter resources by labels. + :type label_selector: str :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 @@ -12047,9 +13659,8 @@ def list_attached_volumes_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_attached_volumes_serialize( - project_id=project_id, - server_id=server_id, + _param = self._list_key_pairs_serialize( + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12057,7 +13668,7 @@ def list_attached_volumes_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachmentListResponse", + "200": "KeyPairListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -12072,16 +13683,9 @@ def list_attached_volumes_with_http_info( ) @validate_call - def list_attached_volumes_without_preload_content( + def list_key_pairs_without_preload_content( self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12092,14 +13696,12 @@ def list_attached_volumes_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all volume attachments of a server. + """List all SSH keypairs for the requesting user. - Get a list of all volume attachments of a server. + Get a list of all SSH keypairs assigned to the requesting user. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str + :param label_selector: Filter resources by labels. + :type label_selector: str :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 @@ -12122,9 +13724,8 @@ def list_attached_volumes_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_attached_volumes_serialize( - project_id=project_id, - server_id=server_id, + _param = self._list_key_pairs_serialize( + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12132,7 +13733,7 @@ def list_attached_volumes_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachmentListResponse", + "200": "KeyPairListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -12142,10 +13743,9 @@ def list_attached_volumes_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_attached_volumes_serialize( + def _list_key_pairs_serialize( self, - project_id, - server_id, + label_selector, _request_auth, _content_type, _headers, @@ -12164,11 +13764,11 @@ def _list_attached_volumes_serialize( _body_params: Optional[bytes] = None # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if server_id is not None: - _path_params["serverId"] = server_id # process the query parameters + if label_selector is not None: + + _query_params.append(("label_selector", label_selector)) + # process the header parameters # process the form parameters # process the body parameter @@ -12182,7 +13782,7 @@ def _list_attached_volumes_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments", + resource_path="/v1alpha1/keypairs", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -12196,9 +13796,12 @@ def _list_attached_volumes_serialize( ) @validate_call - def list_key_pairs( + def list_machine_types( self, - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12208,13 +13811,13 @@ def list_key_pairs( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> KeyPairListResponse: - """List all SSH keypairs for the requesting user. + ) -> MachineTypeListResponse: + """List all machine types available for a project. - Get a list of all SSH keypairs assigned to the requesting user. + Get a list of all machine type available in a project. - :param label_selector: Filter resources by labels. - :type label_selector: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str :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 @@ -12237,8 +13840,8 @@ def list_key_pairs( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_key_pairs_serialize( - label_selector=label_selector, + _param = self._list_machine_types_serialize( + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12246,7 +13849,7 @@ def list_key_pairs( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "KeyPairListResponse", + "200": "MachineTypeListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -12261,9 +13864,12 @@ def list_key_pairs( ).data @validate_call - def list_key_pairs_with_http_info( + def list_machine_types_with_http_info( self, - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12273,13 +13879,13 @@ def list_key_pairs_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[KeyPairListResponse]: - """List all SSH keypairs for the requesting user. + ) -> ApiResponse[MachineTypeListResponse]: + """List all machine types available for a project. - Get a list of all SSH keypairs assigned to the requesting user. + Get a list of all machine type available in a project. - :param label_selector: Filter resources by labels. - :type label_selector: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str :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 @@ -12302,8 +13908,8 @@ def list_key_pairs_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_key_pairs_serialize( - label_selector=label_selector, + _param = self._list_machine_types_serialize( + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12311,7 +13917,7 @@ def list_key_pairs_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "KeyPairListResponse", + "200": "MachineTypeListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -12326,9 +13932,12 @@ def list_key_pairs_with_http_info( ) @validate_call - def list_key_pairs_without_preload_content( + def list_machine_types_without_preload_content( self, - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12339,12 +13948,12 @@ def list_key_pairs_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all SSH keypairs for the requesting user. + """List all machine types available for a project. - Get a list of all SSH keypairs assigned to the requesting user. + Get a list of all machine type available in a project. - :param label_selector: Filter resources by labels. - :type label_selector: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str :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 @@ -12367,8 +13976,8 @@ def list_key_pairs_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_key_pairs_serialize( - label_selector=label_selector, + _param = self._list_machine_types_serialize( + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12376,7 +13985,7 @@ def list_key_pairs_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "KeyPairListResponse", + "200": "MachineTypeListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -12386,9 +13995,9 @@ def list_key_pairs_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_key_pairs_serialize( + def _list_machine_types_serialize( self, - label_selector, + project_id, _request_auth, _content_type, _headers, @@ -12407,11 +14016,9 @@ def _list_key_pairs_serialize( _body_params: Optional[bytes] = None # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id # process the query parameters - if label_selector is not None: - - _query_params.append(("label_selector", label_selector)) - # process the header parameters # process the form parameters # process the body parameter @@ -12425,7 +14032,7 @@ def _list_key_pairs_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/keypairs", + resource_path="/v1alpha1/projects/{projectId}/machine-types", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -20743,6 +22350,300 @@ def _update_attached_volume_serialize( _request_auth=_request_auth, ) + @validate_call + def update_image( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + image_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") + ], + update_image_payload: Annotated[UpdateImagePayload, Field(description="Request an update of an Image.")], + _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, + ) -> Image: + """Update Image Parameters. + + Update the properties of an existing Image inside a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param image_id: The identifier (ID) of a STACKIT Image. (required) + :type image_id: str + :param update_image_payload: Request an update of an Image. (required) + :type update_image_payload: UpdateImagePayload + :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._update_image_serialize( + project_id=project_id, + image_id=image_id, + update_image_payload=update_image_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Image", + "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 update_image_with_http_info( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + image_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") + ], + update_image_payload: Annotated[UpdateImagePayload, Field(description="Request an update of an Image.")], + _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[Image]: + """Update Image Parameters. + + Update the properties of an existing Image inside a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param image_id: The identifier (ID) of a STACKIT Image. (required) + :type image_id: str + :param update_image_payload: Request an update of an Image. (required) + :type update_image_payload: UpdateImagePayload + :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._update_image_serialize( + project_id=project_id, + image_id=image_id, + update_image_payload=update_image_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Image", + "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 update_image_without_preload_content( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + image_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") + ], + update_image_payload: Annotated[UpdateImagePayload, Field(description="Request an update of an Image.")], + _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: + """Update Image Parameters. + + Update the properties of an existing Image inside a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param image_id: The identifier (ID) of a STACKIT Image. (required) + :type image_id: str + :param update_image_payload: Request an update of an Image. (required) + :type update_image_payload: UpdateImagePayload + :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._update_image_serialize( + project_id=project_id, + image_id=image_id, + update_image_payload=update_image_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Image", + "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 _update_image_serialize( + self, + project_id, + image_id, + update_image_payload, + _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 + if project_id is not None: + _path_params["projectId"] = project_id + if image_id is not None: + _path_params["imageId"] = image_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if update_image_payload is not None: + _body_params = update_image_payload + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="PATCH", + resource_path="/v1alpha1/projects/{projectId}/images/{imageId}", + 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 update_key_pair( self, @@ -21028,7 +22929,7 @@ def update_nic( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), ], - update_nic_payload: Annotated[UpdateNICPayload, Field(description="Request an update of a network interface.")], + update_nic_payload: Annotated[UpdateNicPayload, Field(description="Request an update of a network interface.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -21050,7 +22951,7 @@ def update_nic( :param nic_id: The identifier (ID) of a network interface. (required) :type nic_id: str :param update_nic_payload: Request an update of a network interface. (required) - :type update_nic_payload: UpdateNICPayload + :type update_nic_payload: UpdateNicPayload :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 @@ -21115,7 +23016,7 @@ def update_nic_with_http_info( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), ], - update_nic_payload: Annotated[UpdateNICPayload, Field(description="Request an update of a network interface.")], + update_nic_payload: Annotated[UpdateNicPayload, Field(description="Request an update of a network interface.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -21137,7 +23038,7 @@ def update_nic_with_http_info( :param nic_id: The identifier (ID) of a network interface. (required) :type nic_id: str :param update_nic_payload: Request an update of a network interface. (required) - :type update_nic_payload: UpdateNICPayload + :type update_nic_payload: UpdateNicPayload :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 @@ -21202,7 +23103,7 @@ def update_nic_without_preload_content( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), ], - update_nic_payload: Annotated[UpdateNICPayload, Field(description="Request an update of a network interface.")], + update_nic_payload: Annotated[UpdateNicPayload, Field(description="Request an update of a network interface.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -21224,7 +23125,7 @@ def update_nic_without_preload_content( :param nic_id: The identifier (ID) of a network interface. (required) :type nic_id: str :param update_nic_payload: Request an update of a network interface. (required) - :type update_nic_payload: UpdateNICPayload + :type update_nic_payload: UpdateNicPayload :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 diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/__init__.py b/services/iaasalpha/src/stackit/iaasalpha/models/__init__.py index 3fb3dfc..a951c6e 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/__init__.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/__init__.py @@ -31,8 +31,9 @@ from stackit.iaasalpha.models.boot_volume_source import BootVolumeSource from stackit.iaasalpha.models.create_area_address_family import CreateAreaAddressFamily from stackit.iaasalpha.models.create_area_ipv4 import CreateAreaIPv4 +from stackit.iaasalpha.models.create_image_payload import CreateImagePayload from stackit.iaasalpha.models.create_key_pair_payload import CreateKeyPairPayload -from stackit.iaasalpha.models.create_nic_payload import CreateNICPayload +from stackit.iaasalpha.models.create_nic_payload import CreateNicPayload from stackit.iaasalpha.models.create_protocol import CreateProtocol from stackit.iaasalpha.models.create_public_ip_payload import CreatePublicIPPayload from stackit.iaasalpha.models.create_security_group_payload import ( @@ -58,8 +59,14 @@ from stackit.iaasalpha.models.get_server_log200_response import GetServerLog200Response from stackit.iaasalpha.models.get_server_log_request import GetServerLogRequest from stackit.iaasalpha.models.icmp_parameters import ICMPParameters +from stackit.iaasalpha.models.image import Image +from stackit.iaasalpha.models.image_config import ImageConfig +from stackit.iaasalpha.models.image_create_response import ImageCreateResponse +from stackit.iaasalpha.models.image_list_response import ImageListResponse from stackit.iaasalpha.models.key_pair_list_response import KeyPairListResponse from stackit.iaasalpha.models.keypair import Keypair +from stackit.iaasalpha.models.machine_type import MachineType +from stackit.iaasalpha.models.machine_type_list_response import MachineTypeListResponse from stackit.iaasalpha.models.network import Network from stackit.iaasalpha.models.network_area import NetworkArea from stackit.iaasalpha.models.network_area_ipv4 import NetworkAreaIPv4 @@ -112,8 +119,9 @@ from stackit.iaasalpha.models.update_attached_volume_payload import ( UpdateAttachedVolumePayload, ) +from stackit.iaasalpha.models.update_image_payload import UpdateImagePayload from stackit.iaasalpha.models.update_key_pair_payload import UpdateKeyPairPayload -from stackit.iaasalpha.models.update_nic_payload import UpdateNICPayload +from stackit.iaasalpha.models.update_nic_payload import UpdateNicPayload from stackit.iaasalpha.models.update_public_ip_payload import UpdatePublicIPPayload from stackit.iaasalpha.models.update_security_group_payload import ( UpdateSecurityGroupPayload, diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/area_prefix_config_ipv4.py b/services/iaasalpha/src/stackit/iaasalpha/models/area_prefix_config_ipv4.py index d334a7d..d177ca8 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/area_prefix_config_ipv4.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/area_prefix_config_ipv4.py @@ -35,7 +35,7 @@ class AreaPrefixConfigIPv4(BaseModel): max_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=24)]] = Field( default=None, description="The maximal prefix length for networks in the network area.", alias="maxPrefixLen" ) - min_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=22)]] = Field( + min_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=8)]] = Field( default=None, description="The minimal prefix length for networks in the network area.", alias="minPrefixLen" ) __properties: ClassVar[List[str]] = ["defaultPrefixLen", "maxPrefixLen", "minPrefixLen"] diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/create_area_ipv4.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_area_ipv4.py index 0b64d33..83f59ed 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_area_ipv4.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/create_area_ipv4.py @@ -49,7 +49,7 @@ class CreateAreaIPv4(BaseModel): max_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=24)]] = Field( default=None, description="The maximal prefix length for networks in the network area.", alias="maxPrefixLen" ) - min_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=22)]] = Field( + min_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=8)]] = Field( default=None, description="The minimal prefix length for networks in the network area.", alias="minPrefixLen" ) __properties: ClassVar[List[str]] = [ diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/create_image_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_image_payload.py new file mode 100644 index 0000000..3d9be2e --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/models/create_image_payload.py @@ -0,0 +1,173 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1alpha1 + 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 datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictInt, + StrictStr, + field_validator, +) +from typing_extensions import Annotated, Self + +from stackit.iaasalpha.models.image_config import ImageConfig + + +class CreateImagePayload(BaseModel): + """ + Object that represents an Image and its parameters. Used for Creating and returning (get/list). + """ + + config: Optional[ImageConfig] = None + 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") + 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." + ) + 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") + name: Annotated[str, Field(strict=True, max_length=63)] = Field( + description="The name for a General Object. Matches Names and also UUIDs." + ) + protected: Optional[StrictBool] = None + status: Optional[StrictStr] = Field(default=None, description="The status of an image object.") + updated_at: Optional[datetime] = Field( + default=None, description="Date-time when resource was last updated.", alias="updatedAt" + ) + __properties: ClassVar[List[str]] = [ + "config", + "createdAt", + "diskFormat", + "id", + "labels", + "minDiskSize", + "minRam", + "name", + "protected", + "status", + "updatedAt", + ] + + @field_validator("id") + def id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", value): + raise ValueError( + r"must validate the regular expression /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/" + ) + return value + + @field_validator("name") + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + 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]+)*$/") + 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 CreateImagePayload 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. + * 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( + [ + "created_at", + "id", + "status", + "updated_at", + ] + ) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of config + if self.config: + _dict["config"] = self.config.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateImagePayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "config": ImageConfig.from_dict(obj["config"]) if obj.get("config") is not None else None, + "createdAt": obj.get("createdAt"), + "diskFormat": obj.get("diskFormat"), + "id": obj.get("id"), + "labels": obj.get("labels"), + "minDiskSize": obj.get("minDiskSize"), + "minRam": obj.get("minRam"), + "name": obj.get("name"), + "protected": obj.get("protected"), + "status": obj.get("status"), + "updatedAt": obj.get("updatedAt"), + } + ) + return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/create_nic_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_nic_payload.py index 48b27c1..67baa98 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_nic_payload.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/create_nic_payload.py @@ -32,7 +32,7 @@ from stackit.iaasalpha.models.allowed_addresses_inner import AllowedAddressesInner -class CreateNICPayload(BaseModel): +class CreateNicPayload(BaseModel): """ Object that represents a network interface. """ @@ -193,7 +193,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CreateNICPayload from a JSON string""" + """Create an instance of CreateNicPayload from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -239,7 +239,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateNICPayload from a dict""" + """Create an instance of CreateNicPayload from a dict""" if obj is None: return None diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/create_volume_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_volume_payload.py index 03d872f..bd617cd 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_volume_payload.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/create_volume_payload.py @@ -20,7 +20,15 @@ from datetime import datetime from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictInt, + StrictStr, + field_validator, +) from typing_extensions import Annotated, Self from stackit.iaasalpha.models.volume_source import VolumeSource @@ -34,6 +42,7 @@ class CreateVolumePayload(BaseModel): availability_zone: StrictStr = Field( description="Object that represents an availability zone.", alias="availabilityZone" ) + bootable: Optional[StrictBool] = Field(default=None, description="Indicates if a volume is bootable.") created_at: Optional[datetime] = Field( default=None, description="Date-time when resource was created.", alias="createdAt" ) @@ -65,6 +74,7 @@ class CreateVolumePayload(BaseModel): ) __properties: ClassVar[List[str]] = [ "availabilityZone", + "bootable", "createdAt", "description", "id", @@ -189,6 +199,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "availabilityZone": obj.get("availabilityZone"), + "bootable": obj.get("bootable"), "createdAt": obj.get("createdAt"), "description": obj.get("description"), "id": obj.get("id"), diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/image.py b/services/iaasalpha/src/stackit/iaasalpha/models/image.py new file mode 100644 index 0000000..3ed04e0 --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/models/image.py @@ -0,0 +1,173 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1alpha1 + 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 datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictInt, + StrictStr, + field_validator, +) +from typing_extensions import Annotated, Self + +from stackit.iaasalpha.models.image_config import ImageConfig + + +class Image(BaseModel): + """ + Object that represents an Image and its parameters. Used for Creating and returning (get/list). + """ + + config: Optional[ImageConfig] = None + 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") + 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." + ) + 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") + name: Annotated[str, Field(strict=True, max_length=63)] = Field( + description="The name for a General Object. Matches Names and also UUIDs." + ) + protected: Optional[StrictBool] = None + status: Optional[StrictStr] = Field(default=None, description="The status of an image object.") + updated_at: Optional[datetime] = Field( + default=None, description="Date-time when resource was last updated.", alias="updatedAt" + ) + __properties: ClassVar[List[str]] = [ + "config", + "createdAt", + "diskFormat", + "id", + "labels", + "minDiskSize", + "minRam", + "name", + "protected", + "status", + "updatedAt", + ] + + @field_validator("id") + def id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", value): + raise ValueError( + r"must validate the regular expression /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/" + ) + return value + + @field_validator("name") + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + 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]+)*$/") + 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 Image 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. + * 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( + [ + "created_at", + "id", + "status", + "updated_at", + ] + ) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of config + if self.config: + _dict["config"] = self.config.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Image from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "config": ImageConfig.from_dict(obj["config"]) if obj.get("config") is not None else None, + "createdAt": obj.get("createdAt"), + "diskFormat": obj.get("diskFormat"), + "id": obj.get("id"), + "labels": obj.get("labels"), + "minDiskSize": obj.get("minDiskSize"), + "minRam": obj.get("minRam"), + "name": obj.get("name"), + "protected": obj.get("protected"), + "status": obj.get("status"), + "updatedAt": obj.get("updatedAt"), + } + ) + return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/image_config.py b/services/iaasalpha/src/stackit/iaasalpha/models/image_config.py new file mode 100644 index 0000000..13d0122 --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/models/image_config.py @@ -0,0 +1,180 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1alpha1 + 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, StrictBool, StrictStr +from typing_extensions import Self + + +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") + cdrom_bus: Optional[StrictStr] = Field( + default=None, description="Sets CDROM bus controller type.", alias="cdromBus" + ) + disk_bus: Optional[StrictStr] = Field(default=None, description="Sets Disk bus controller type.", alias="diskBus") + nic_model: Optional[StrictStr] = Field(default=None, description="Sets virtual nic model.", alias="nicModel") + operating_system: Optional[StrictStr] = Field( + default=None, description="Enables OS specific optimizations.", alias="operatingSystem" + ) + operating_system_distro: Optional[StrictStr] = Field( + default=None, description="Operating System Distribution.", alias="operatingSystemDistro" + ) + operating_system_version: Optional[StrictStr] = Field( + default=None, description="Version of the OS.", alias="operatingSystemVersion" + ) + rescue_bus: Optional[StrictStr] = Field( + default=None, description="Sets the device bus when the image is used as a rescue image.", alias="rescueBus" + ) + 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.") + 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.", + alias="virtioScsi", + ) + __properties: ClassVar[List[str]] = [ + "bootMenu", + "cdromBus", + "diskBus", + "nicModel", + "operatingSystem", + "operatingSystemDistro", + "operatingSystemVersion", + "rescueBus", + "rescueDevice", + "secureBoot", + "uefi", + "videoModel", + "virtioScsi", + ] + + 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 ImageConfig 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, + ) + # set to None if cdrom_bus (nullable) is None + # and model_fields_set contains the field + if self.cdrom_bus is None and "cdrom_bus" in self.model_fields_set: + _dict["cdromBus"] = None + + # set to None if disk_bus (nullable) is None + # and model_fields_set contains the field + if self.disk_bus is None and "disk_bus" in self.model_fields_set: + _dict["diskBus"] = None + + # set to None if nic_model (nullable) is None + # and model_fields_set contains the field + if self.nic_model is None and "nic_model" in self.model_fields_set: + _dict["nicModel"] = None + + # set to None if operating_system_distro (nullable) is None + # and model_fields_set contains the field + if self.operating_system_distro is None and "operating_system_distro" in self.model_fields_set: + _dict["operatingSystemDistro"] = None + + # set to None if operating_system_version (nullable) is None + # and model_fields_set contains the field + if self.operating_system_version is None and "operating_system_version" in self.model_fields_set: + _dict["operatingSystemVersion"] = None + + # set to None if rescue_bus (nullable) is None + # and model_fields_set contains the field + if self.rescue_bus is None and "rescue_bus" in self.model_fields_set: + _dict["rescueBus"] = None + + # set to None if rescue_device (nullable) is None + # and model_fields_set contains the field + if self.rescue_device is None and "rescue_device" in self.model_fields_set: + _dict["rescueDevice"] = None + + # set to None if video_model (nullable) is None + # and model_fields_set contains the field + if self.video_model is None and "video_model" in self.model_fields_set: + _dict["videoModel"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ImageConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "bootMenu": obj.get("bootMenu") if obj.get("bootMenu") is not None else False, + "cdromBus": obj.get("cdromBus"), + "diskBus": obj.get("diskBus"), + "nicModel": obj.get("nicModel"), + "operatingSystem": obj.get("operatingSystem"), + "operatingSystemDistro": obj.get("operatingSystemDistro"), + "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, + "videoModel": obj.get("videoModel"), + "virtioScsi": obj.get("virtioScsi") if obj.get("virtioScsi") is not None else False, + } + ) + return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/image_create_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/image_create_response.py new file mode 100644 index 0000000..171a804 --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/models/image_create_response.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: 1alpha1 + 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, StrictStr, field_validator +from typing_extensions import Annotated, Self + + +class ImageCreateResponse(BaseModel): + """ + Image creation response. + """ + + id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( + description="Universally Unique Identifier (UUID)." + ) + upload_url: StrictStr = Field(alias="uploadUrl") + __properties: ClassVar[List[str]] = ["id", "uploadUrl"] + + @field_validator("id") + def id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", value): + raise ValueError( + r"must validate the regular expression /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/" + ) + 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 ImageCreateResponse 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 ImageCreateResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"id": obj.get("id"), "uploadUrl": obj.get("uploadUrl")}) + return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/image_list_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/image_list_response.py new file mode 100644 index 0000000..7ac4ab9 --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/models/image_list_response.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1alpha1 + 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.iaasalpha.models.image import Image + + +class ImageListResponse(BaseModel): + """ + Image list response. + """ + + items: List[Image] = Field(description="A list containing image objects.") + __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 ImageListResponse 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 ImageListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"items": [Image.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None} + ) + return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/machine_type.py b/services/iaasalpha/src/stackit/iaasalpha/models/machine_type.py new file mode 100644 index 0000000..9f0cf3a --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/models/machine_type.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1alpha1 + 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, StrictInt, field_validator +from typing_extensions import Annotated, Self + + +class MachineType(BaseModel): + """ + Machine Type. + """ + + description: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( + default=None, description="Description Object. Allows string up to 127 Characters." + ) + disk: StrictInt = Field(description="Size in Gigabyte.") + extra_specs: Optional[Dict[str, Any]] = Field( + default=None, + description="Properties to control certain aspects or scheduling behavior for an object.", + alias="extraSpecs", + ) + name: Annotated[str, Field(strict=True, max_length=63)] = Field( + description="The name for a General Object. Matches Names and also UUIDs." + ) + ram: StrictInt = Field(description="Size in Megabyte.") + vcpus: Annotated[int, Field(strict=True, ge=1)] = Field(description="The number of virtual CPUs of a server.") + __properties: ClassVar[List[str]] = ["description", "disk", "extraSpecs", "name", "ram", "vcpus"] + + @field_validator("name") + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + 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]+)*$/") + 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 MachineType 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 MachineType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "description": obj.get("description"), + "disk": obj.get("disk"), + "extraSpecs": obj.get("extraSpecs"), + "name": obj.get("name"), + "ram": obj.get("ram"), + "vcpus": obj.get("vcpus"), + } + ) + return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/machine_type_list_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/machine_type_list_response.py new file mode 100644 index 0000000..a7ba17f --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/models/machine_type_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: 1alpha1 + 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.iaasalpha.models.machine_type import MachineType + + +class MachineTypeListResponse(BaseModel): + """ + Machine type list response. + """ + + items: List[MachineType] = Field(description="Machine type list.") + __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 MachineTypeListResponse 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 MachineTypeListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "items": ( + [MachineType.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + ) + } + ) + return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/network_area_ipv4.py b/services/iaasalpha/src/stackit/iaasalpha/models/network_area_ipv4.py index 7e835e2..b6b4628 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/network_area_ipv4.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/network_area_ipv4.py @@ -49,7 +49,7 @@ class NetworkAreaIPv4(BaseModel): max_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=24)]] = Field( default=None, description="The maximal prefix length for networks in the network area.", alias="maxPrefixLen" ) - min_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=22)]] = Field( + min_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=8)]] = Field( default=None, description="The minimal prefix length for networks in the network area.", alias="minPrefixLen" ) __properties: ClassVar[List[str]] = [ diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/update_area_ipv4.py b/services/iaasalpha/src/stackit/iaasalpha/models/update_area_ipv4.py index f0ee221..5bb7e9d 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/update_area_ipv4.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/update_area_ipv4.py @@ -38,7 +38,7 @@ class UpdateAreaIPv4(BaseModel): max_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=24)]] = Field( default=None, description="The maximal prefix length for networks in the network area.", alias="maxPrefixLen" ) - min_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=22)]] = Field( + min_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=8)]] = Field( default=None, description="The minimal prefix length for networks in the network area.", alias="minPrefixLen" ) __properties: ClassVar[List[str]] = ["defaultNameservers", "defaultPrefixLen", "maxPrefixLen", "minPrefixLen"] diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/update_image_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/update_image_payload.py new file mode 100644 index 0000000..4cb11ee --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/models/update_image_payload.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1alpha1 + 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, + StrictBool, + StrictInt, + StrictStr, + field_validator, +) +from typing_extensions import Annotated, Self + +from stackit.iaasalpha.models.image_config import ImageConfig + + +class UpdateImagePayload(BaseModel): + """ + Object that represents an update request body of an Image. + """ + + config: Optional[ImageConfig] = None + disk_format: Optional[StrictStr] = Field( + default=None, description="Object that represents a disk format.", alias="diskFormat" + ) + labels: Optional[Dict[str, Any]] = Field( + default=None, description="Object that represents the labels of an object." + ) + 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") + 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." + ) + protected: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["config", "diskFormat", "labels", "minDiskSize", "minRam", "name", "protected"] + + @field_validator("name") + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + 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]+)*$/") + 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 UpdateImagePayload 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 config + if self.config: + _dict["config"] = self.config.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateImagePayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "config": ImageConfig.from_dict(obj["config"]) if obj.get("config") is not None else None, + "diskFormat": obj.get("diskFormat"), + "labels": obj.get("labels"), + "minDiskSize": obj.get("minDiskSize"), + "minRam": obj.get("minRam"), + "name": obj.get("name"), + "protected": obj.get("protected"), + } + ) + return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/update_nic_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/update_nic_payload.py index 43ca25a..2ded997 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/update_nic_payload.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/update_nic_payload.py @@ -25,7 +25,7 @@ from stackit.iaasalpha.models.allowed_addresses_inner import AllowedAddressesInner -class UpdateNICPayload(BaseModel): +class UpdateNicPayload(BaseModel): """ Object that represents a network interface update. """ @@ -76,7 +76,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UpdateNICPayload from a JSON string""" + """Create an instance of UpdateNicPayload from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -107,7 +107,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UpdateNICPayload from a dict""" + """Create an instance of UpdateNicPayload from a dict""" if obj is None: return None diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/update_volume_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/update_volume_payload.py index 600b92d..c4f405d 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/update_volume_payload.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/update_volume_payload.py @@ -19,7 +19,7 @@ import re from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator from typing_extensions import Annotated, Self @@ -28,6 +28,7 @@ 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.") description: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, description="Description Object. Allows string up to 127 Characters." ) @@ -37,7 +38,7 @@ class UpdateVolumePayload(BaseModel): 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." ) - __properties: ClassVar[List[str]] = ["description", "labels", "name"] + __properties: ClassVar[List[str]] = ["bootable", "description", "labels", "name"] @field_validator("name") def name_validate_regular_expression(cls, value): @@ -98,6 +99,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate( - {"description": obj.get("description"), "labels": obj.get("labels"), "name": obj.get("name")} + { + "bootable": obj.get("bootable") if obj.get("bootable") is not None else False, + "description": obj.get("description"), + "labels": obj.get("labels"), + "name": obj.get("name"), + } ) return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/volume.py b/services/iaasalpha/src/stackit/iaasalpha/models/volume.py index 29ca103..91cf9c7 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/volume.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/volume.py @@ -20,7 +20,15 @@ from datetime import datetime from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictInt, + StrictStr, + field_validator, +) from typing_extensions import Annotated, Self from stackit.iaasalpha.models.volume_source import VolumeSource @@ -34,6 +42,7 @@ class Volume(BaseModel): availability_zone: StrictStr = Field( description="Object that represents an availability zone.", alias="availabilityZone" ) + bootable: Optional[StrictBool] = Field(default=None, description="Indicates if a volume is bootable.") created_at: Optional[datetime] = Field( default=None, description="Date-time when resource was created.", alias="createdAt" ) @@ -65,6 +74,7 @@ class Volume(BaseModel): ) __properties: ClassVar[List[str]] = [ "availabilityZone", + "bootable", "createdAt", "description", "id", @@ -189,6 +199,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "availabilityZone": obj.get("availabilityZone"), + "bootable": obj.get("bootable"), "createdAt": obj.get("createdAt"), "description": obj.get("description"), "id": obj.get("id"), diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/volume_performance_class.py b/services/iaasalpha/src/stackit/iaasalpha/models/volume_performance_class.py index f9020c0..df46d6b 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/volume_performance_class.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/volume_performance_class.py @@ -19,7 +19,7 @@ import re from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictInt, field_validator from typing_extensions import Annotated, Self @@ -31,13 +31,15 @@ class VolumePerformanceClass(BaseModel): description: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, description="Description Object. Allows string up to 127 Characters." ) + 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." ) name: Annotated[str, Field(strict=True, max_length=63)] = Field( description="The name for a General Object. Matches Names and also UUIDs." ) - __properties: ClassVar[List[str]] = ["description", "labels", "name"] + throughput: Optional[StrictInt] = Field(default=None, description="Throughput in Megabyte per second.") + __properties: ClassVar[List[str]] = ["description", "iops", "labels", "name", "throughput"] @field_validator("name") def name_validate_regular_expression(cls, value): @@ -95,6 +97,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate( - {"description": obj.get("description"), "labels": obj.get("labels"), "name": obj.get("name")} + { + "description": obj.get("description"), + "iops": obj.get("iops"), + "labels": obj.get("labels"), + "name": obj.get("name"), + "throughput": obj.get("throughput"), + } ) return _obj