diff --git a/services/iaas/src/stackit/iaas/__init__.py b/services/iaas/src/stackit/iaas/__init__.py index 17456b09..107c366b 100644 --- a/services/iaas/src/stackit/iaas/__init__.py +++ b/services/iaas/src/stackit/iaas/__init__.py @@ -80,7 +80,6 @@ "ImageChecksum", "ImageConfig", "ImageCreateResponse", - "ImageFromVolumePayload", "ImageListResponse", "ImageShare", "ImageShareConsumer", @@ -314,9 +313,6 @@ from stackit.iaas.models.image_create_response import ( ImageCreateResponse as ImageCreateResponse, ) -from stackit.iaas.models.image_from_volume_payload import ( - ImageFromVolumePayload as ImageFromVolumePayload, -) from stackit.iaas.models.image_list_response import ( ImageListResponse as ImageListResponse, ) diff --git a/services/iaas/src/stackit/iaas/api/default_api.py b/services/iaas/src/stackit/iaas/api/default_api.py index 2dce65f9..4abba6e7 100644 --- a/services/iaas/src/stackit/iaas/api/default_api.py +++ b/services/iaas/src/stackit/iaas/api/default_api.py @@ -68,7 +68,6 @@ from stackit.iaas.models.get_server_log200_response import GetServerLog200Response from stackit.iaas.models.image import Image from stackit.iaas.models.image_create_response import ImageCreateResponse -from stackit.iaas.models.image_from_volume_payload import ImageFromVolumePayload from stackit.iaas.models.image_list_response import ImageListResponse from stackit.iaas.models.image_share import ImageShare from stackit.iaas.models.image_share_consumer import ImageShareConsumer @@ -22655,327 +22654,6 @@ def _get_volume_performance_class_serialize( _request_auth=_request_auth, ) - @validate_call - def image_from_volume( - 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[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), - ], - region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], - image_from_volume_payload: Annotated[ - Optional[ImageFromVolumePayload], Field(description="Create an image from a volume.") - ] = 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, - ) -> None: - """Create an image out of a volume. - - Create an image out a a volume. - - :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 region: The STACKIT Region of the resources. (required) - :type region: str - :param image_from_volume_payload: Create an image from a volume. - :type image_from_volume_payload: ImageFromVolumePayload - :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 - - _param = self._image_from_volume_serialize( - project_id=project_id, - volume_id=volume_id, - region=region, - image_from_volume_payload=image_from_volume_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "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 image_from_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."), - ], - volume_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), - ], - region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], - image_from_volume_payload: Annotated[ - Optional[ImageFromVolumePayload], Field(description="Create an image from a volume.") - ] = 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[None]: - """Create an image out of a volume. - - Create an image out a a volume. - - :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 region: The STACKIT Region of the resources. (required) - :type region: str - :param image_from_volume_payload: Create an image from a volume. - :type image_from_volume_payload: ImageFromVolumePayload - :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 - - _param = self._image_from_volume_serialize( - project_id=project_id, - volume_id=volume_id, - region=region, - image_from_volume_payload=image_from_volume_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "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 image_from_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."), - ], - volume_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), - ], - region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], - image_from_volume_payload: Annotated[ - Optional[ImageFromVolumePayload], Field(description="Create an image from a volume.") - ] = 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: - """Create an image out of a volume. - - Create an image out a a volume. - - :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 region: The STACKIT Region of the resources. (required) - :type region: str - :param image_from_volume_payload: Create an image from a volume. - :type image_from_volume_payload: ImageFromVolumePayload - :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 - - _param = self._image_from_volume_serialize( - project_id=project_id, - volume_id=volume_id, - region=region, - image_from_volume_payload=image_from_volume_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _image_from_volume_serialize( - self, - project_id, - volume_id, - region, - image_from_volume_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, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} - _body_params: Optional[bytes] = None - - # 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 region is not None: - _path_params["region"] = region - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if image_from_volume_payload is not None: - _body_params = image_from_volume_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="/v2/projects/{projectId}/regions/{region}/volumes/{volumeId}/upload", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - @validate_call def list_affinity_groups( self, diff --git a/services/iaas/src/stackit/iaas/models/__init__.py b/services/iaas/src/stackit/iaas/models/__init__.py index 82fe6052..995c8124 100644 --- a/services/iaas/src/stackit/iaas/models/__init__.py +++ b/services/iaas/src/stackit/iaas/models/__init__.py @@ -94,7 +94,6 @@ from stackit.iaas.models.image_checksum import ImageChecksum from stackit.iaas.models.image_config import ImageConfig from stackit.iaas.models.image_create_response import ImageCreateResponse -from stackit.iaas.models.image_from_volume_payload import ImageFromVolumePayload from stackit.iaas.models.image_list_response import ImageListResponse from stackit.iaas.models.image_share import ImageShare from stackit.iaas.models.image_share_consumer import ImageShareConsumer diff --git a/services/iaas/src/stackit/iaas/models/add_routing_table_to_area_payload.py b/services/iaas/src/stackit/iaas/models/add_routing_table_to_area_payload.py index 921a06fa..960dc03d 100644 --- a/services/iaas/src/stackit/iaas/models/add_routing_table_to_area_payload.py +++ b/services/iaas/src/stackit/iaas/models/add_routing_table_to_area_payload.py @@ -54,11 +54,7 @@ class AddRoutingTableToAreaPayload(BaseModel): name: Annotated[str, Field(strict=True, max_length=127)] = Field( description="The name for a General Object. Matches Names and also UUIDs." ) - system_routes: Optional[StrictBool] = Field( - default=True, - description="A config setting for a routing table which allows installation of automatic system routes for connectivity between projects in the same SNA.", - alias="systemRoutes", - ) + system_routes: Optional[StrictBool] = Field(default=True, alias="systemRoutes") updated_at: Optional[datetime] = Field( default=None, description="Date-time when resource was last updated.", alias="updatedAt" ) diff --git a/services/iaas/src/stackit/iaas/models/image_from_volume_payload.py b/services/iaas/src/stackit/iaas/models/image_from_volume_payload.py deleted file mode 100644 index 4f5bb73b..00000000 --- a/services/iaas/src/stackit/iaas/models/image_from_volume_payload.py +++ /dev/null @@ -1,126 +0,0 @@ -# coding: utf-8 - -""" - IaaS-API - - This API allows you to create and modify IaaS resources. - - The version of the OpenAPI document: 2 - Contact: stackit-iaas@mail.schwarz - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -from __future__ import annotations - -import json -import pprint -import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import ( - BaseModel, - ConfigDict, - Field, - StrictBool, - StrictStr, - field_validator, -) -from typing_extensions import Annotated, Self - - -class ImageFromVolumePayload(BaseModel): - """ - Object that represents the upload request of an image to a volume. Used for creating an image from a volume. - """ # noqa: E501 - - container_format: Optional[StrictStr] = Field( - default="bare", - description="Object that represents a container format. Possible values: `bare`, `ofv`, `ova`.", - alias="containerFormat", - ) - disk_format: Optional[StrictStr] = Field( - default=None, - description="Object that represents a disk format. Possible values: `raw`, `qcow2`, `iso`.", - alias="diskFormat", - ) - force: Optional[StrictBool] = False - name: Annotated[str, Field(strict=True, max_length=127)] = Field( - description="The name for a General Object. Matches Names and also UUIDs." - ) - protected: Optional[StrictBool] = Field( - default=False, description="When true the created image is prevented from being deleted." - ) - visibility: Optional[StrictStr] = Field( - default="private", - description="Object that represents Visibility. Possible values: `public`, `private`, `community`, `shared`.", - ) - __properties: ClassVar[List[str]] = ["containerFormat", "diskFormat", "force", "name", "protected", "visibility"] - - @field_validator("name") - def name_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"^[A-Za-z0-9]+([ \/._-]*[A-Za-z0-9]+)*$", value): - raise ValueError(r"must validate the regular expression /^[A-Za-z0-9]+([ \/._-]*[A-Za-z0-9]+)*$/") - return value - - model_config = ConfigDict( - 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 ImageFromVolumePayload 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 ImageFromVolumePayload from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "containerFormat": obj.get("containerFormat") if obj.get("containerFormat") is not None else "bare", - "diskFormat": obj.get("diskFormat"), - "force": obj.get("force") if obj.get("force") is not None else False, - "name": obj.get("name"), - "protected": obj.get("protected") if obj.get("protected") is not None else False, - "visibility": obj.get("visibility") if obj.get("visibility") is not None else "private", - } - ) - return _obj diff --git a/services/iaas/src/stackit/iaas/models/routing_table.py b/services/iaas/src/stackit/iaas/models/routing_table.py index 05d49788..ceb50a72 100644 --- a/services/iaas/src/stackit/iaas/models/routing_table.py +++ b/services/iaas/src/stackit/iaas/models/routing_table.py @@ -54,11 +54,7 @@ class RoutingTable(BaseModel): name: Annotated[str, Field(strict=True, max_length=127)] = Field( description="The name for a General Object. Matches Names and also UUIDs." ) - system_routes: Optional[StrictBool] = Field( - default=True, - description="A config setting for a routing table which allows installation of automatic system routes for connectivity between projects in the same SNA.", - alias="systemRoutes", - ) + system_routes: Optional[StrictBool] = Field(default=True, alias="systemRoutes") updated_at: Optional[datetime] = Field( default=None, description="Date-time when resource was last updated.", alias="updatedAt" ) diff --git a/services/iaas/src/stackit/iaas/models/update_routing_table_of_area_payload.py b/services/iaas/src/stackit/iaas/models/update_routing_table_of_area_payload.py index 5b5a21fd..8f9efee0 100644 --- a/services/iaas/src/stackit/iaas/models/update_routing_table_of_area_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_routing_table_of_area_payload.py @@ -32,8 +32,8 @@ class UpdateRoutingTableOfAreaPayload(BaseModel): default=None, description="Description Object. Allows string up to 255 Characters." ) dynamic_routes: Optional[StrictBool] = Field( - default=None, - description="The update config setting for a routing table which allows propagation of dynamic routes to this routing table.", + default=True, + description="A config setting for a routing table which allows propagation of dynamic routes to this routing table.", alias="dynamicRoutes", ) labels: Optional[Dict[str, Any]] = Field( @@ -43,12 +43,7 @@ class UpdateRoutingTableOfAreaPayload(BaseModel): name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." ) - system_routes: Optional[StrictBool] = Field( - default=None, - description="The update config setting for a routing table which allows installation of automatic system routes for connectivity between projects in the same SNA.", - alias="systemRoutes", - ) - __properties: ClassVar[List[str]] = ["description", "dynamicRoutes", "labels", "name", "systemRoutes"] + __properties: ClassVar[List[str]] = ["description", "dynamicRoutes", "labels", "name"] @field_validator("name") def name_validate_regular_expression(cls, value): @@ -111,10 +106,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "description": obj.get("description"), - "dynamicRoutes": obj.get("dynamicRoutes"), + "dynamicRoutes": obj.get("dynamicRoutes") if obj.get("dynamicRoutes") is not None else True, "labels": obj.get("labels"), "name": obj.get("name"), - "systemRoutes": obj.get("systemRoutes"), } ) return _obj